UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1 lines 64.1 kB
(function(v,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("../button-edit/index.umd.js"),require("../common/index.umd.js"),require("../combo-list/index.umd.js"),require("../locale/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../button-edit/index.umd.js","../common/index.umd.js","../combo-list/index.umd.js","../locale/index.umd.js"],i):(v=typeof globalThis<"u"?globalThis:v||self,i(v["time-picker"]={},v.Vue,v.FButtonEdit,v.common,v.comboList,v.locale))})(this,function(v,i,$,L,ze,Je){"use strict";var lr=Object.defineProperty;var dr=(v,i,$)=>i in v?lr(v,i,{enumerable:!0,configurable:!0,writable:!0,value:$}):v[i]=$;var l=(v,i,$)=>dr(v,typeof i!="symbol"?i+"":i,$);const ve={modelValue:{type:String,default:""},hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1},popupClassName:{type:String,default:""},placeholder:{type:String,default:"请选择时间"},placement:{type:String,default:"auto"},defaultOpenValue:{type:Date,default:null},format:{type:String,default:"HH:mm:ss"},isOpen:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!1},use12Hours:{type:Boolean,default:!1},disabledHours:{type:Function,default:null},disabledMinutes:{type:Function,default:null},disabledSeconds:{type:Function,default:null},hideDisabledElements:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},expandable:{type:Boolean,default:!1},expandMode:{type:String,default:"text"},expandContent:{type:String,default:""},expandDisabled:{type:Boolean,default:!1},enableClear:{type:Boolean,default:!0}},ke={modelValue:{type:String,default:""},hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1},defaultOpenValue:{type:Date,default:null},disabledHours:{type:Function,default:null},disabledMinutes:{type:Function,default:null},disabledSeconds:{type:Function,default:null},format:{type:String,default:"HH:mm:ss"},isOpen:{type:Boolean,default:!1},use12Hours:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!1},hideDisabledElements:{type:Boolean,default:!1},inDatePicker:{type:Boolean,default:!1},headerLabels:{type:Object,default:null}};function F(t){const r=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&r==="[object Date]"?new t.constructor(+t):typeof t=="number"||r==="[object Number]"||typeof t=="string"||r==="[object String]"?new Date(t):new Date(NaN)}function C(t,r){return t instanceof Date?new t.constructor(r):new Date(r)}function Oe(t,r){const e=F(t);return isNaN(r)?C(t,NaN):(r&&e.setDate(e.getDate()+r),e)}const De=6048e5,Ke=864e5,et=6e4,tt=36e5,nt=1e3;let rt={};function U(){return rt}function A(t,r){var c,g,y,p;const e=U(),n=(r==null?void 0:r.weekStartsOn)??((g=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:g.weekStartsOn)??e.weekStartsOn??((p=(y=e.locale)==null?void 0:y.options)==null?void 0:p.weekStartsOn)??0,a=F(t),s=a.getDay(),u=(s<n?7:0)+s-n;return a.setDate(a.getDate()-u),a.setHours(0,0,0,0),a}function Z(t){return A(t,{weekStartsOn:1})}function Ve(t){const r=F(t),e=r.getFullYear(),n=C(t,0);n.setFullYear(e+1,0,4),n.setHours(0,0,0,0);const a=Z(n),s=C(t,0);s.setFullYear(e,0,4),s.setHours(0,0,0,0);const u=Z(s);return r.getTime()>=a.getTime()?e+1:r.getTime()>=u.getTime()?e:e-1}function Ne(t){const r=F(t);return r.setHours(0,0,0,0),r}function se(t){const r=F(t),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+t-+e}function at(t,r){const e=Ne(t),n=Ne(r),a=+e-se(e),s=+n-se(n);return Math.round((a-s)/Ke)}function st(t){const r=Ve(t),e=C(t,0);return e.setFullYear(r,0,4),e.setHours(0,0,0,0),Z(e)}function it(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Ce(t){if(!it(t)&&typeof t!="number")return!1;const r=F(t);return!isNaN(Number(r))}function ot(t){const r=F(t),e=C(t,0);return e.setFullYear(r.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ut={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ct=(t,r,e)=>{let n;const a=ut[t];return typeof a=="string"?n=a:r===1?n=a.one:n=a.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function he(t){return(r={})=>{const e=r.width?String(r.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const lt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ft={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ht={date:he({formats:lt,defaultWidth:"full"}),time:he({formats:dt,defaultWidth:"full"}),dateTime:he({formats:ft,defaultWidth:"full"})},mt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wt=(t,r,e,n)=>mt[t];function K(t){return(r,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let a;if(n==="formatting"&&t.formattingValues){const u=t.defaultFormattingWidth||t.defaultWidth,c=e!=null&&e.width?String(e.width):u;a=t.formattingValues[c]||t.formattingValues[u]}else{const u=t.defaultWidth,c=e!=null&&e.width?String(e.width):t.defaultWidth;a=t.values[c]||t.values[u]}const s=t.argumentCallback?t.argumentCallback(r):r;return a[s]}}const yt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bt={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"]},gt={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"]},xt={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"}},Tt={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"}},Mt={ordinalNumber:(t,r)=>{const e=Number(t),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:K({values:yt,defaultWidth:"wide"}),quarter:K({values:pt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:K({values:bt,defaultWidth:"wide"}),day:K({values:gt,defaultWidth:"wide"}),dayPeriod:K({values:xt,defaultWidth:"wide",formattingValues:Tt,defaultFormattingWidth:"wide"})};function ee(t){return(r,e={})=>{const n=e.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],s=r.match(a);if(!s)return null;const u=s[0],c=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],g=Array.isArray(c)?Pt(c,x=>x.test(u)):Ht(c,x=>x.test(u));let y;y=t.valueCallback?t.valueCallback(g):g,y=e.valueCallback?e.valueCallback(y):y;const p=r.slice(u.length);return{value:y,rest:p}}}function Ht(t,r){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&r(t[e]))return e}function Pt(t,r){for(let e=0;e<t.length;e++)if(r(t[e]))return e}function vt(t){return(r,e={})=>{const n=r.match(t.matchPattern);if(!n)return null;const a=n[0],s=r.match(t.parsePattern);if(!s)return null;let u=t.valueCallback?t.valueCallback(s[0]):s[0];u=e.valueCallback?e.valueCallback(u):u;const c=r.slice(a.length);return{value:u,rest:c}}}const kt=/^(\d+)(th|st|nd|rd)?/i,Ot=/\d+/i,Dt={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},Vt={any:[/^b/i,/^(a|c)/i]},Nt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ct={any:[/1/i,/2/i,/3/i,/4/i]},Yt={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},Et={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]},_t={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},Ft={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]},St={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},Wt={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}},qt={ordinalNumber:vt({matchPattern:kt,parsePattern:Ot,valueCallback:t=>parseInt(t,10)}),era:ee({matchPatterns:Dt,defaultMatchWidth:"wide",parsePatterns:Vt,defaultParseWidth:"any"}),quarter:ee({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ee({matchPatterns:Yt,defaultMatchWidth:"wide",parsePatterns:Et,defaultParseWidth:"any"}),day:ee({matchPatterns:_t,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any"}),dayPeriod:ee({matchPatterns:St,defaultMatchWidth:"any",parsePatterns:Wt,defaultParseWidth:"any"})},Ye={code:"en-US",formatDistance:ct,formatLong:ht,formatRelative:wt,localize:Mt,match:qt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lt(t){const r=F(t);return at(r,ot(r))+1}function Ee(t){const r=F(t),e=+Z(r)-+st(r);return Math.round(e/De)+1}function me(t,r){var p,x,o,w;const e=F(t),n=e.getFullYear(),a=U(),s=(r==null?void 0:r.firstWeekContainsDate)??((x=(p=r==null?void 0:r.locale)==null?void 0:p.options)==null?void 0:x.firstWeekContainsDate)??a.firstWeekContainsDate??((w=(o=a.locale)==null?void 0:o.options)==null?void 0:w.firstWeekContainsDate)??1,u=C(t,0);u.setFullYear(n+1,0,s),u.setHours(0,0,0,0);const c=A(u,r),g=C(t,0);g.setFullYear(n,0,s),g.setHours(0,0,0,0);const y=A(g,r);return e.getTime()>=c.getTime()?n+1:e.getTime()>=y.getTime()?n:n-1}function It(t,r){var c,g,y,p;const e=U(),n=(r==null?void 0:r.firstWeekContainsDate)??((g=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:g.firstWeekContainsDate)??e.firstWeekContainsDate??((p=(y=e.locale)==null?void 0:y.options)==null?void 0:p.firstWeekContainsDate)??1,a=me(t,r),s=C(t,0);return s.setFullYear(a,0,n),s.setHours(0,0,0,0),A(s,r)}function _e(t,r){const e=F(t),n=+A(e,r)-+It(e,r);return Math.round(n/De)+1}function k(t,r){const e=t<0?"-":"",n=Math.abs(t).toString().padStart(r,"0");return e+n}const j={y(t,r){const e=t.getFullYear(),n=e>0?e:1-e;return k(r==="yy"?n%100:n,r.length)},M(t,r){const e=t.getMonth();return r==="M"?String(e+1):k(e+1,2)},d(t,r){return k(t.getDate(),r.length)},a(t,r){const e=t.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(t,r){return k(t.getHours()%12||12,r.length)},H(t,r){return k(t.getHours(),r.length)},m(t,r){return k(t.getMinutes(),r.length)},s(t,r){return k(t.getSeconds(),r.length)},S(t,r){const e=r.length,n=t.getMilliseconds(),a=Math.trunc(n*Math.pow(10,e-3));return k(a,r.length)}},z={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fe={G:function(t,r,e){const n=t.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(t,r,e){if(r==="yo"){const n=t.getFullYear(),a=n>0?n:1-n;return e.ordinalNumber(a,{unit:"year"})}return j.y(t,r)},Y:function(t,r,e,n){const a=me(t,n),s=a>0?a:1-a;if(r==="YY"){const u=s%100;return k(u,2)}return r==="Yo"?e.ordinalNumber(s,{unit:"year"}):k(s,r.length)},R:function(t,r){const e=Ve(t);return k(e,r.length)},u:function(t,r){const e=t.getFullYear();return k(e,r.length)},Q:function(t,r,e){const n=Math.ceil((t.getMonth()+1)/3);switch(r){case"Q":return String(n);case"QQ":return k(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,r,e){const n=Math.ceil((t.getMonth()+1)/3);switch(r){case"q":return String(n);case"qq":return k(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,r,e){const n=t.getMonth();switch(r){case"M":case"MM":return j.M(t,r);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(t,r,e){const n=t.getMonth();switch(r){case"L":return String(n+1);case"LL":return k(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(t,r,e,n){const a=_e(t,n);return r==="wo"?e.ordinalNumber(a,{unit:"week"}):k(a,r.length)},I:function(t,r,e){const n=Ee(t);return r==="Io"?e.ordinalNumber(n,{unit:"week"}):k(n,r.length)},d:function(t,r,e){return r==="do"?e.ordinalNumber(t.getDate(),{unit:"date"}):j.d(t,r)},D:function(t,r,e){const n=Lt(t);return r==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):k(n,r.length)},E:function(t,r,e){const n=t.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(t,r,e,n){const a=t.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return k(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(t,r,e,n){const a=t.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return k(s,r.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(t,r,e){const n=t.getDay(),a=n===0?7:n;switch(r){case"i":return String(a);case"ii":return k(a,r.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(t,r,e){const a=t.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,r,e){const n=t.getHours();let a;switch(n===12?a=z.noon:n===0?a=z.midnight:a=n/12>=1?"pm":"am",r){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,r,e){const n=t.getHours();let a;switch(n>=17?a=z.evening:n>=12?a=z.afternoon:n>=4?a=z.morning:a=z.night,r){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,r,e){if(r==="ho"){let n=t.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return j.h(t,r)},H:function(t,r,e){return r==="Ho"?e.ordinalNumber(t.getHours(),{unit:"hour"}):j.H(t,r)},K:function(t,r,e){const n=t.getHours()%12;return r==="Ko"?e.ordinalNumber(n,{unit:"hour"}):k(n,r.length)},k:function(t,r,e){let n=t.getHours();return n===0&&(n=24),r==="ko"?e.ordinalNumber(n,{unit:"hour"}):k(n,r.length)},m:function(t,r,e){return r==="mo"?e.ordinalNumber(t.getMinutes(),{unit:"minute"}):j.m(t,r)},s:function(t,r,e){return r==="so"?e.ordinalNumber(t.getSeconds(),{unit:"second"}):j.s(t,r)},S:function(t,r){return j.S(t,r)},X:function(t,r,e){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(r){case"X":return We(n);case"XXXX":case"XX":return X(n);case"XXXXX":case"XXX":default:return X(n,":")}},x:function(t,r,e){const n=t.getTimezoneOffset();switch(r){case"x":return We(n);case"xxxx":case"xx":return X(n);case"xxxxx":case"xxx":default:return X(n,":")}},O:function(t,r,e){const n=t.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+Se(n,":");case"OOOO":default:return"GMT"+X(n,":")}},z:function(t,r,e){const n=t.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+Se(n,":");case"zzzz":default:return"GMT"+X(n,":")}},t:function(t,r,e){const n=Math.trunc(t.getTime()/1e3);return k(n,r.length)},T:function(t,r,e){const n=t.getTime();return k(n,r.length)}};function Se(t,r=""){const e=t>0?"-":"+",n=Math.abs(t),a=Math.trunc(n/60),s=n%60;return s===0?e+String(a):e+String(a)+r+k(s,2)}function We(t,r){return t%60===0?(t>0?"-":"+")+k(Math.abs(t)/60,2):X(t,r)}function X(t,r=""){const e=t>0?"-":"+",n=Math.abs(t),a=k(Math.trunc(n/60),2),s=k(n%60,2);return e+a+r+s}const qe=(t,r)=>{switch(t){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Le=(t,r)=>{switch(t){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},we={p:Le,P:(t,r)=>{const e=t.match(/(P+)(p+)?/)||[],n=e[1],a=e[2];if(!a)return qe(t,r);let s;switch(n){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",qe(n,r)).replace("{{time}}",Le(a,r))}},Bt=/^D+$/,Rt=/^Y+$/,Qt=["D","DD","YY","YYYY"];function Ie(t){return Bt.test(t)}function Be(t){return Rt.test(t)}function ye(t,r,e){const n=At(t,r,e);if(console.warn(n),Qt.includes(t))throw new RangeError(n)}function At(t,r,e){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${r}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const jt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gt=/^'([^]*?)'?$/,$t=/''/g,Ut=/[a-zA-Z]/;function Re(t,r,e){var p,x,o,w;const n=U(),a=n.locale??Ye,s=n.firstWeekContainsDate??((x=(p=n.locale)==null?void 0:p.options)==null?void 0:x.firstWeekContainsDate)??1,u=n.weekStartsOn??((w=(o=n.locale)==null?void 0:o.options)==null?void 0:w.weekStartsOn)??0,c=F(t);if(!Ce(c))throw new RangeError("Invalid time value");let g=r.match(Xt).map(m=>{const M=m[0];if(M==="p"||M==="P"){const W=we[M];return W(m,a.formatLong)}return m}).join("").match(jt).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const M=m[0];if(M==="'")return{isToken:!1,value:Zt(m)};if(Fe[M])return{isToken:!0,value:m};if(M.match(Ut))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(g=a.localize.preprocessor(c,g));const y={firstWeekContainsDate:s,weekStartsOn:u,locale:a};return g.map(m=>{if(!m.isToken)return m.value;const M=m.value;(Be(M)||Ie(M))&&ye(M,r,String(t));const W=Fe[M[0]];return W(c,M,a.localize,y)}).join("")}function Zt(t){const r=t.match(Gt);return r?r[1].replace($t,"'"):t}function zt(){return Object.assign({},U())}function Jt(t){let e=F(t).getDay();return e===0&&(e=7),e}function Kt(t,r){const e=r instanceof Date?C(r,0):new r(0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),e}const en=10;class Qe{constructor(){l(this,"subPriority",0)}validate(r,e){return!0}}class tn extends Qe{constructor(r,e,n,a,s){super(),this.value=r,this.validateValue=e,this.setValue=n,this.priority=a,s&&(this.subPriority=s)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,n){return this.setValue(r,e,this.value,n)}}class nn extends Qe{constructor(){super(...arguments);l(this,"priority",en);l(this,"subPriority",-1)}set(e,n){return n.timestampIsSet?e:C(e,Kt(e,Date))}}class P{run(r,e,n,a){const s=this.parse(r,e,n,a);return s?{setter:new tn(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(r,e,n){return!0}}class rn extends P{constructor(){super(...arguments);l(this,"priority",140);l(this,"incompatibleTokens",["R","u","t","T"])}parse(e,n,a){switch(n){case"G":case"GG":case"GGG":return a.era(e,{width:"abbreviated"})||a.era(e,{width:"narrow"});case"GGGGG":return a.era(e,{width:"narrow"});case"GGGG":default:return a.era(e,{width:"wide"})||a.era(e,{width:"abbreviated"})||a.era(e,{width:"narrow"})}}set(e,n,a){return n.era=a,e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}const E={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}/},I={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 _(t,r){return t&&{value:r(t.value),rest:t.rest}}function N(t,r){const e=r.match(t);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function B(t,r){const e=r.match(t);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const n=e[1]==="+"?1:-1,a=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,u=e[5]?parseInt(e[5],10):0;return{value:n*(a*tt+s*et+u*nt),rest:r.slice(e[0].length)}}function Ae(t){return N(E.anyDigitsSigned,t)}function Y(t,r){switch(t){case 1:return N(E.singleDigit,r);case 2:return N(E.twoDigits,r);case 3:return N(E.threeDigits,r);case 4:return N(E.fourDigits,r);default:return N(new RegExp("^\\d{1,"+t+"}"),r)}}function ie(t,r){switch(t){case 1:return N(E.singleDigitSigned,r);case 2:return N(E.twoDigitsSigned,r);case 3:return N(E.threeDigitsSigned,r);case 4:return N(E.fourDigitsSigned,r);default:return N(new RegExp("^-?\\d{1,"+t+"}"),r)}}function pe(t){switch(t){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 je(t,r){const e=r>0,n=e?r:1-r;let a;if(n<=50)a=t||100;else{const s=n+50,u=Math.trunc(s/100)*100,c=t>=s%100;a=t+u-(c?100:0)}return e?a:1-a}function Xe(t){return t%400===0||t%4===0&&t%100!==0}class an extends P{constructor(){super(...arguments);l(this,"priority",130);l(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,n,a){const s=u=>({year:u,isTwoDigitYear:n==="yy"});switch(n){case"y":return _(Y(4,e),s);case"yo":return _(a.ordinalNumber(e,{unit:"year"}),s);default:return _(Y(n.length,e),s)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,a){const s=e.getFullYear();if(a.isTwoDigitYear){const c=je(a.year,s);return e.setFullYear(c,0,1),e.setHours(0,0,0,0),e}const u=!("era"in n)||n.era===1?a.year:1-a.year;return e.setFullYear(u,0,1),e.setHours(0,0,0,0),e}}class sn extends P{constructor(){super(...arguments);l(this,"priority",130);l(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,n,a){const s=u=>({year:u,isTwoDigitYear:n==="YY"});switch(n){case"Y":return _(Y(4,e),s);case"Yo":return _(a.ordinalNumber(e,{unit:"year"}),s);default:return _(Y(n.length,e),s)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,a,s){const u=me(e,s);if(a.isTwoDigitYear){const g=je(a.year,u);return e.setFullYear(g,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),A(e,s)}const c=!("era"in n)||n.era===1?a.year:1-a.year;return e.setFullYear(c,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),A(e,s)}}class on extends P{constructor(){super(...arguments);l(this,"priority",130);l(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,n){return ie(n==="R"?4:n.length,e)}set(e,n,a){const s=C(e,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),Z(s)}}class un extends P{constructor(){super(...arguments);l(this,"priority",130);l(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,n){return ie(n==="u"?4:n.length,e)}set(e,n,a){return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class cn extends P{constructor(){super(...arguments);l(this,"priority",120);l(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"Q":case"QQ":return Y(n.length,e);case"Qo":return a.ordinalNumber(e,{unit:"quarter"});case"QQQ":return a.quarter(e,{width:"abbreviated",context:"formatting"})||a.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(e,{width:"wide",context:"formatting"})||a.quarter(e,{width:"abbreviated",context:"formatting"})||a.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=1&&n<=4}set(e,n,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class ln extends P{constructor(){super(...arguments);l(this,"priority",120);l(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"q":case"qq":return Y(n.length,e);case"qo":return a.ordinalNumber(e,{unit:"quarter"});case"qqq":return a.quarter(e,{width:"abbreviated",context:"standalone"})||a.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(e,{width:"wide",context:"standalone"})||a.quarter(e,{width:"abbreviated",context:"standalone"})||a.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=1&&n<=4}set(e,n,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class dn extends P{constructor(){super(...arguments);l(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);l(this,"priority",110)}parse(e,n,a){const s=u=>u-1;switch(n){case"M":return _(N(E.month,e),s);case"MM":return _(Y(2,e),s);case"Mo":return _(a.ordinalNumber(e,{unit:"month"}),s);case"MMM":return a.month(e,{width:"abbreviated",context:"formatting"})||a.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(e,{width:"wide",context:"formatting"})||a.month(e,{width:"abbreviated",context:"formatting"})||a.month(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=11}set(e,n,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}class fn extends P{constructor(){super(...arguments);l(this,"priority",110);l(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,n,a){const s=u=>u-1;switch(n){case"L":return _(N(E.month,e),s);case"LL":return _(Y(2,e),s);case"Lo":return _(a.ordinalNumber(e,{unit:"month"}),s);case"LLL":return a.month(e,{width:"abbreviated",context:"standalone"})||a.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(e,{width:"wide",context:"standalone"})||a.month(e,{width:"abbreviated",context:"standalone"})||a.month(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=11}set(e,n,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}function hn(t,r,e){const n=F(t),a=_e(n,e)-r;return n.setDate(n.getDate()-a*7),n}class mn extends P{constructor(){super(...arguments);l(this,"priority",100);l(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,n,a){switch(n){case"w":return N(E.week,e);case"wo":return a.ordinalNumber(e,{unit:"week"});default:return Y(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,a,s){return A(hn(e,a,s),s)}}function wn(t,r){const e=F(t),n=Ee(e)-r;return e.setDate(e.getDate()-n*7),e}class yn extends P{constructor(){super(...arguments);l(this,"priority",100);l(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,n,a){switch(n){case"I":return N(E.week,e);case"Io":return a.ordinalNumber(e,{unit:"week"});default:return Y(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,a){return Z(wn(e,a))}}const pn=[31,28,31,30,31,30,31,31,30,31,30,31],bn=[31,29,31,30,31,30,31,31,30,31,30,31];class gn extends P{constructor(){super(...arguments);l(this,"priority",90);l(this,"subPriority",1);l(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"d":return N(E.date,e);case"do":return a.ordinalNumber(e,{unit:"date"});default:return Y(n.length,e)}}validate(e,n){const a=e.getFullYear(),s=Xe(a),u=e.getMonth();return s?n>=1&&n<=bn[u]:n>=1&&n<=pn[u]}set(e,n,a){return e.setDate(a),e.setHours(0,0,0,0),e}}class xn extends P{constructor(){super(...arguments);l(this,"priority",90);l(this,"subpriority",1);l(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,n,a){switch(n){case"D":case"DD":return N(E.dayOfYear,e);case"Do":return a.ordinalNumber(e,{unit:"date"});default:return Y(n.length,e)}}validate(e,n){const a=e.getFullYear();return Xe(a)?n>=1&&n<=366:n>=1&&n<=365}set(e,n,a){return e.setMonth(0,a),e.setHours(0,0,0,0),e}}function be(t,r,e){var x,o,w,m;const n=U(),a=(e==null?void 0:e.weekStartsOn)??((o=(x=e==null?void 0:e.locale)==null?void 0:x.options)==null?void 0:o.weekStartsOn)??n.weekStartsOn??((m=(w=n.locale)==null?void 0:w.options)==null?void 0:m.weekStartsOn)??0,s=F(t),u=s.getDay(),g=(r%7+7)%7,y=7-a,p=r<0||r>6?r-(u+y)%7:(g+y)%7-(u+y)%7;return Oe(s,p)}class Tn extends P{constructor(){super(...arguments);l(this,"priority",90);l(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"E":case"EE":case"EEE":return a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(e,{width:"wide",context:"formatting"})||a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,a,s){return e=be(e,a,s),e.setHours(0,0,0,0),e}}class Mn extends P{constructor(){super(...arguments);l(this,"priority",90);l(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,n,a,s){const u=c=>{const g=Math.floor((c-1)/7)*7;return(c+s.weekStartsOn+6)%7+g};switch(n){case"e":case"ee":return _(Y(n.length,e),u);case"eo":return _(a.ordinalNumber(e,{unit:"day"}),u);case"eee":return a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"eeeee":return a.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(e,{width:"wide",context:"formatting"})||a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,a,s){return e=be(e,a,s),e.setHours(0,0,0,0),e}}class Hn extends P{constructor(){super(...arguments);l(this,"priority",90);l(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,n,a,s){const u=c=>{const g=Math.floor((c-1)/7)*7;return(c+s.weekStartsOn+6)%7+g};switch(n){case"c":case"cc":return _(Y(n.length,e),u);case"co":return _(a.ordinalNumber(e,{unit:"day"}),u);case"ccc":return a.day(e,{width:"abbreviated",context:"standalone"})||a.day(e,{width:"short",context:"standalone"})||a.day(e,{width:"narrow",context:"standalone"});case"ccccc":return a.day(e,{width:"narrow",context:"standalone"});case"cccccc":return a.day(e,{width:"short",context:"standalone"})||a.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(e,{width:"wide",context:"standalone"})||a.day(e,{width:"abbreviated",context:"standalone"})||a.day(e,{width:"short",context:"standalone"})||a.day(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=6}set(e,n,a,s){return e=be(e,a,s),e.setHours(0,0,0,0),e}}function Pn(t,r){const e=F(t),n=Jt(e),a=r-n;return Oe(e,a)}class vn extends P{constructor(){super(...arguments);l(this,"priority",90);l(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,n,a){const s=u=>u===0?7:u;switch(n){case"i":case"ii":return Y(n.length,e);case"io":return a.ordinalNumber(e,{unit:"day"});case"iii":return _(a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),s);case"iiiii":return _(a.day(e,{width:"narrow",context:"formatting"}),s);case"iiiiii":return _(a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),s);case"iiii":default:return _(a.day(e,{width:"wide",context:"formatting"})||a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),s)}}validate(e,n){return n>=1&&n<=7}set(e,n,a){return e=Pn(e,a),e.setHours(0,0,0,0),e}}class kn extends P{constructor(){super(...arguments);l(this,"priority",80);l(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,n,a){switch(n){case"a":case"aa":case"aaa":return a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(e,{width:"wide",context:"formatting"})||a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,a){return e.setHours(pe(a),0,0,0),e}}class On extends P{constructor(){super(...arguments);l(this,"priority",80);l(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,n,a){switch(n){case"b":case"bb":case"bbb":return a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(e,{width:"wide",context:"formatting"})||a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,a){return e.setHours(pe(a),0,0,0),e}}class Dn extends P{constructor(){super(...arguments);l(this,"priority",80);l(this,"incompatibleTokens",["a","b","t","T"])}parse(e,n,a){switch(n){case"B":case"BB":case"BBB":return a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(e,{width:"wide",context:"formatting"})||a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,a){return e.setHours(pe(a),0,0,0),e}}class Vn extends P{constructor(){super(...arguments);l(this,"priority",70);l(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,n,a){switch(n){case"h":return N(E.hour12h,e);case"ho":return a.ordinalNumber(e,{unit:"hour"});default:return Y(n.length,e)}}validate(e,n){return n>=1&&n<=12}set(e,n,a){const s=e.getHours()>=12;return s&&a<12?e.setHours(a+12,0,0,0):!s&&a===12?e.setHours(0,0,0,0):e.setHours(a,0,0,0),e}}class Nn extends P{constructor(){super(...arguments);l(this,"priority",70);l(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,n,a){switch(n){case"H":return N(E.hour23h,e);case"Ho":return a.ordinalNumber(e,{unit:"hour"});default:return Y(n.length,e)}}validate(e,n){return n>=0&&n<=23}set(e,n,a){return e.setHours(a,0,0,0),e}}class Cn extends P{constructor(){super(...arguments);l(this,"priority",70);l(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,n,a){switch(n){case"K":return N(E.hour11h,e);case"Ko":return a.ordinalNumber(e,{unit:"hour"});default:return Y(n.length,e)}}validate(e,n){return n>=0&&n<=11}set(e,n,a){return e.getHours()>=12&&a<12?e.setHours(a+12,0,0,0):e.setHours(a,0,0,0),e}}class Yn extends P{constructor(){super(...arguments);l(this,"priority",70);l(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,n,a){switch(n){case"k":return N(E.hour24h,e);case"ko":return a.ordinalNumber(e,{unit:"hour"});default:return Y(n.length,e)}}validate(e,n){return n>=1&&n<=24}set(e,n,a){const s=a<=24?a%24:a;return e.setHours(s,0,0,0),e}}class En extends P{constructor(){super(...arguments);l(this,"priority",60);l(this,"incompatibleTokens",["t","T"])}parse(e,n,a){switch(n){case"m":return N(E.minute,e);case"mo":return a.ordinalNumber(e,{unit:"minute"});default:return Y(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,a){return e.setMinutes(a,0,0),e}}class _n extends P{constructor(){super(...arguments);l(this,"priority",50);l(this,"incompatibleTokens",["t","T"])}parse(e,n,a){switch(n){case"s":return N(E.second,e);case"so":return a.ordinalNumber(e,{unit:"second"});default:return Y(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,a){return e.setSeconds(a,0),e}}class Fn extends P{constructor(){super(...arguments);l(this,"priority",30);l(this,"incompatibleTokens",["t","T"])}parse(e,n){const a=s=>Math.trunc(s*Math.pow(10,-n.length+3));return _(Y(n.length,e),a)}set(e,n,a){return e.setMilliseconds(a),e}}class Sn extends P{constructor(){super(...arguments);l(this,"priority",10);l(this,"incompatibleTokens",["t","T","x"])}parse(e,n){switch(n){case"X":return B(I.basicOptionalMinutes,e);case"XX":return B(I.basic,e);case"XXXX":return B(I.basicOptionalSeconds,e);case"XXXXX":return B(I.extendedOptionalSeconds,e);case"XXX":default:return B(I.extended,e)}}set(e,n,a){return n.timestampIsSet?e:C(e,e.getTime()-se(e)-a)}}class Wn extends P{constructor(){super(...arguments);l(this,"priority",10);l(this,"incompatibleTokens",["t","T","X"])}parse(e,n){switch(n){case"x":return B(I.basicOptionalMinutes,e);case"xx":return B(I.basic,e);case"xxxx":return B(I.basicOptionalSeconds,e);case"xxxxx":return B(I.extendedOptionalSeconds,e);case"xxx":default:return B(I.extended,e)}}set(e,n,a){return n.timestampIsSet?e:C(e,e.getTime()-se(e)-a)}}class qn extends P{constructor(){super(...arguments);l(this,"priority",40);l(this,"incompatibleTokens","*")}parse(e){return Ae(e)}set(e,n,a){return[C(e,a*1e3),{timestampIsSet:!0}]}}class Ln extends P{constructor(){super(...arguments);l(this,"priority",20);l(this,"incompatibleTokens","*")}parse(e){return Ae(e)}set(e,n,a){return[C(e,a),{timestampIsSet:!0}]}}const In={G:new rn,y:new an,Y:new sn,R:new on,u:new un,Q:new cn,q:new ln,M:new dn,L:new fn,w:new mn,I:new yn,d:new gn,D:new xn,E:new Tn,e:new Mn,c:new Hn,i:new vn,a:new kn,b:new On,B:new Dn,h:new Vn,H:new Nn,K:new Cn,k:new Yn,m:new En,s:new _n,S:new Fn,X:new Sn,x:new Wn,t:new qn,T:new Ln},Bn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qn=/^'([^]*?)'?$/,An=/''/g,jn=/\S/,Xn=/[a-zA-Z]/;function Ge(t,r,e,n){var M,W,H,O;const a=zt(),s=a.locale??Ye,u=a.firstWeekContainsDate??((W=(M=a.locale)==null?void 0:M.options)==null?void 0:W.firstWeekContainsDate)??1,c=a.weekStartsOn??((O=(H=a.locale)==null?void 0:H.options)==null?void 0:O.weekStartsOn)??0;if(r==="")return t===""?F(e):C(e,NaN);const g={firstWeekContainsDate:u,weekStartsOn:c,locale:s},y=[new nn],p=r.match(Rn).map(f=>{const h=f[0];if(h in we){const T=we[h];return T(f,s.formatLong)}return f}).join("").match(Bn),x=[];for(let f of p){Be(f)&&ye(f,r,t),Ie(f)&&ye(f,r,t);const h=f[0],T=In[h];if(T){const{incompatibleTokens:V}=T;if(Array.isArray(V)){const ce=x.find(J=>V.includes(J.token)||J.token===h);if(ce)throw new RangeError(`The format string mustn't contain \`${ce.fullToken}\` and \`${f}\` at the same time`)}else if(T.incompatibleTokens==="*"&&x.length>0)throw new RangeError(`The format string mustn't contain \`${f}\` and any other token at the same time`);x.push({token:h,fullToken:f});const q=T.run(t,f,s.match,g);if(!q)return C(e,NaN);y.push(q.setter),t=q.rest}else{if(h.match(Xn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");if(f==="''"?f="'":h==="'"&&(f=Gn(f)),t.indexOf(f)===0)t=t.slice(f.length);else return C(e,NaN)}}if(t.length>0&&jn.test(t))return C(e,NaN);const o=y.map(f=>f.priority).sort((f,h)=>h-f).filter((f,h,T)=>T.indexOf(f)===h).map(f=>y.filter(h=>h.priority===f).sort((h,T)=>T.subPriority-h.subPriority)).map(f=>f[0]);let w=F(e);if(isNaN(w.getTime()))return C(e,NaN);const m={};for(const f of o){if(!f.validate(w,g))return C(e,NaN);const h=f.set(w,m,g);Array.isArray(h)?(w=h[0],Object.assign(m,h[1])):w=h}return C(e,w)}function Gn(t){return t.match(Qn)[1].replace(An,"'")}function D(t){return typeof t<"u"&&t!==null}function $n(t){return!!t}function ge(t,r="hh:mm:ss"){if(!(!t||!r))return r.indexOf("ss")===-1&&t.split(":").length===3&&(r=r+":ss"),r.indexOf("A")>-1?(r=r.replace(/A/g,"a"),Ge(t.toLowerCase(),r,new Date)):Ge(t,r,new Date)}function xe(t,r="hh:mm:ss",e="AM"){return!t||isNaN(t.getTime())?"":r.indexOf("A")>-1?(r=r.replace(/A/g,"a"),Re(t,r).toUpperCase()):Re(t,r)}function Un(t){return t=String(t),t.length===1?"0"+t:t}function oe(t,r){let e=t||"hh:mm:ss";return r?(e=e?e.replace(/H/g,"h"):"hh:mm:ss a",e.indexOf("a")===-1&&e.indexOf("A")===-1&&(e=e+" a")):e=e?e.replace(/h/g,"H"):"HH:mm:ss",e}class Zn{constructor(){l(this,"hourStep",1);l(this,"minuteStep",1);l(this,"secondStep",1);l(this,"use12Hours",!1);l(this,"changedValue",i.ref({text:"",value:void 0}));l(this,"format","HH:mm:ss");l(this,"temporaryHours");l(this,"temporaryMinutes");l(this,"temporarySeconds");l(this,"temporaryText","");l(this,"temporaryValue");l(this,"temporarySelected12Hours");l(this,"temporaryDefaultOpenValue",new Date)}get hours(){return this.temporaryHours}set hours(r){r!==this.temporaryHours&&(this.use12Hours?this.selected12Hours==="PM"&&r!==12?this.temporaryHours=r+12:this.selected12Hours==="AM"&&r===12?this.temporaryHours=0:this.temporaryHours=r:this.temporaryHours=r,this.update())}get realHours(){return this.temporaryHours}get viewHours(){return this.use12Hours&&D(this.temporaryHours)?this.calculateViewHour(this.temporaryHours):this.temporaryHours}get minutes(){return this.temporaryMinutes}set minutes(r){r!==this.temporaryMinutes&&(this.temporaryMinutes=r,this.update())}get seconds(){return this.temporarySeconds}set seconds(r){r!==this.temporarySeconds&&(this.temporarySeconds=r,this.update())}get defaultHours(){return this.defaultOpenValue.getHours()}get defaultViewHours(){const r=this.defaultOpenValue.getHours();return this.use12Hours&&D(r)?this.calculateViewHour(r):r}get defaultRealHours(){return this.defaultOpenValue.getHours()}get defaultMinutes(){return this.defaultOpenValue.getMinutes()}get defaultSeconds(){return this.defaultOpenValue.getSeconds()}get default12Hours(){return this.defaultOpenValue.getHours()>=12?"PM":"AM"}get text(){return this.temporaryText}set text(r){r!==this.temporaryText&&(this.temporaryText=r)}get value(){return this.temporaryValue}set value(r){r!==this.temporaryValue&&(this.temporaryValue=r,D(this.temporaryValue)&&Ce(this.temporaryValue)?(this.temporaryHours=this.temporaryValue.getHours(),this.temporaryMinutes=this.temporaryValue.getMinutes(),this.temporarySeconds=this.temporaryValue.getSeconds(),this.use12Hours&&D(this.temporaryHours)&&(this.temporarySelected12Hours=this.temporaryHours>=12?"PM":"AM")):this.clearTimeValue())}get selected12Hours(){return this.temporarySelected12Hours}set selected12Hours(r){r.toUpperCase()!==this.temporarySelected12Hours&&(this.temporarySelected12Hours=r.toUpperCase(),this.update())}get defaultOpenValue(){return this.temporaryDefaultOpenValue.setHours(this.setValueByStep(this.temporaryDefaultOpenValue.getHours(),this.hourStep)),this.temporaryDefaultOpenValue.setMinutes(this.setValueByStep(this.temporaryDefaultOpenValue.getMinutes(),this.minuteStep)),this.temporaryDefaultOpenValue.setSeconds(this.setValueByStep(this.temporaryDefaultOpenValue.getSeconds(),this.secondStep)),this.temporaryDefaultOpenValue}set defaultOpenValue(r){this.temporaryDefaultOpenValue!==r&&(this.temporaryDefaultOpenValue=r,this.update())}get isEmpty(){return!(D(this.temporaryHours)||D(this.temporaryMinutes)||D(this.temporarySeconds))}setFormat(r){this.format=r}setHours(r,e){return e?this:(this.setDefaultValueIfNil(),this.hours=r,this)}setUse12Hours(r){return this.use12Hours=r,this}setMinutes(r,e){return e?this:(this.setDefaultValueIfNil(),this.minutes=r,this)}setSeconds(r,e){return e?this:(this.setDefaultValueIfNil(),this.seconds=r,this)}setValue(r,e){return D(e)&&(this.use12Hours=e),this.value=r,this}setValueByStep(r,e){let n=Math.floor(r/e);const a=r%e,s=e/2;return n=a>s?n+1:n,e*n}setDefaultOpenValue(r){return this.defaultOpenValue=r,this}setDefaultValueIfNil(){D(this.temporaryValue)||(this.temporaryValue=new Date(this.defaultOpenValue))}update(){this.isEmpty?this.temporaryValue=void 0:(D(this.temporaryHours)?this.temporaryValue.setHours(this.hours):this.temporaryHours=this.defaultHours,D(this.temporaryMinutes)?this.temporaryValue.setMinutes(this.minutes):this.temporaryMinutes=this.defaultMinutes,D(this.temporarySeconds)?this.temporaryValue.setSeconds(this.seconds):this.temporarySeconds=this.defaultSeconds,this.use12Hours&&(D(this.temporarySelected12Hours)||(this.temporarySelected12Hours=this.default12Hours),this.selected12Hours==="PM"&&this.temporaryHours<12&&(this.temporaryHours+=12,this.temporaryValue.setHours(this.temporaryHours)),this.selected12Hours==="AM"&&this.temporaryHours>=12&&(this.temporaryHours-=12,this.temporaryValue.setHours(this.temporaryHours))),this.temporaryValue=new Date(this.temporaryValue),this.text=xe(this.temporaryValue,this.format,this.selected12Hours),this.changedValue.value={text:this.text,value:this.temporaryValue})}clearTimeValue(){this.temporaryHours=void 0,this.temporaryMinutes=void 0,this.temporarySeconds=void 0,this.temporarySelected12Hours=void 0,this.temporaryValue=void 0}clear(){this.clearTimeValue(),this.update()}calculateViewHour(r){const e=this.temporarySelected12Hours||this.default12Hours;return e==="PM"&&r>12?r-12:e==="AM"&&r===0?12:r}}function zn(t,r,e,n,a,s){function u