diff --git a/dist/@fleetbase/storefront.min.js b/dist/@fleetbase/storefront.min.js index 8de08ce..fc1e12e 100644 --- a/dist/@fleetbase/storefront.min.js +++ b/dist/@fleetbase/storefront.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@fleetbase/sdk")):"function"==typeof define&&define.amd?define(["exports","@fleetbase/sdk"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@fleetbase/storefront"]={},t.sdk)}(this,(function(t,e){"use strict";function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;e=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},e}function a(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function s(t,e,r,n,o,a,i){try{var s=t[a](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){s(a,n,o,i,u,"next",t)}function u(t){s(a,n,o,i,u,"throw",t)}i(void 0)}))}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),M=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"review",o)}return l(r,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),r}(x);function D(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var S=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=i(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var o=t.length;if("number"==typeof o)return!o}return!1},P=function(t){f(n,t);var r=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,n),r.call(this,t,e,"product",o)}return l(n,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?S(r)||S(n)?null:D(r/100,n):S(e)||S(n)?null:D(e/100,n)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}}]),n}(x),E=function(t){f(n,t);var r=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,n),r.call(this,t,e,"category",o)}return l(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new P(e,t.adapter)})))}))}}]),n}(x),O=new e.StoreActions({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",n({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",n({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",n({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),A=function(t){f(h,t);var r,a,i,s,d=v(h);function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,h),d.call(this,t,e,"customer",n({actions:O},r))}return l(h,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Re(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(s=u(o().mark((function t(e){var r=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=u(o().mark((function t(e){var r,n,a,i,s=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2&&void 0!==s[2]?s[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[n.toLowerCase()](e,r);case 6:return i=t.sent,t.abrupt("return",i);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(a=u(o().mark((function t(){var r,n=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return r=t.sent,t.abrupt("return",new e.Collection(r.map((function(t){return new e.Place(t,n.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return a.apply(this,arguments)})},{key:"getOrderHistory",value:(r=u(o().mark((function t(){var r,n,a=this,i=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",r);case 4:return n=t.sent,t.abrupt("return",new e.Collection(n.map((function(t){return new e.Order(t,a.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return r.apply(this,arguments)})}]),h}(x),q=Array.isArray,H=new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},o),{},{quantity:r}),a).then(this.afterFetch.bind(this))},update:function(t,e,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},o),{},{quantity:r}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),N=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,o,"cart",n({actions:H},a))}return l(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof P&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!q(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}(x),Y=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"payment-gateway",o)}return l(r,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),r}(x);function C(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function L(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function j(t,e){const r=C(t);return isNaN(e)?L(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const F=6048e5,R=864e5;let W={};function Q(){return W}function I(t,e){const r=Q(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=C(t),a=o.getDay(),i=(a=o.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function B(t){const e=C(t);return e.setHours(0,0,0,0),e}function z(t){const 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 X(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=C(t);return!isNaN(Number(r))}const $={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"}};function K(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const U={date:K({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:K({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:K({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},J={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function V(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):e;n=t.formattingValues[o]||t.formattingValues[e]}else{const e=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;n=t.values[o]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function Z(t){return(e,r={})=>{const n=r.width,o=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(o);if(!a)return null;const i=a[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var tt;const et={code:"en-US",formatDistance:(t,e,r)=>{let n;const o=$[t];return n="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:U,formatRelative:(t,e,r,n)=>J[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:V({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:V({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:V({values:{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"]},defaultWidth:"wide"}),day:V({values:{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"]},defaultWidth:"wide"}),dayPeriod:V({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(tt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(tt.matchPattern);if(!r)return null;const n=r[0],o=t.match(tt.parsePattern);if(!o)return null;let a=tt.valueCallback?tt.valueCallback(o[0]):o[0];return a=e.valueCallback?e.valueCallback(a):a,{value:a,rest:t.slice(n.length)}}),era:Z({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Z({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:Z({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:Z({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:Z({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function rt(t){const e=C(t),r=function(t,e){const r=B(t),n=B(e),o=r.getTime()-z(r),a=n.getTime()-z(n);return Math.round((o-a)/R)}(e,function(t){const e=C(t),r=L(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function nt(t){const e=C(t),r=G(e).getTime()-function(t){const e=_(t),r=L(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),G(r)}(e).getTime();return Math.round(r/F)+1}function ot(t,e){const r=C(t),n=r.getFullYear(),o=Q(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=L(t,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=I(i,e),u=L(t,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const c=I(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function at(t,e){const r=C(t),n=I(r,e).getTime()-function(t,e){const r=Q(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=ot(t,e),a=L(t,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),I(a,e)}(r,e).getTime();return Math.round(n/F)+1}function it(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const st={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return it("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):it(r+1,2)},d:(t,e)=>it(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>it(t.getHours()%12||12,e.length),H:(t,e)=>it(t.getHours(),e.length),m:(t,e)=>it(t.getMinutes(),e.length),s:(t,e)=>it(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return it(Math.floor(n*Math.pow(10,r-3)),e.length)}},ut="midnight",ct="noon",dt="morning",lt="afternoon",ht="evening",ft="night",pt={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return st.y(t,e)},Y:function(t,e,r,n){const o=ot(t,n),a=o>0?o:1-o;if("YY"===e){return it(a%100,2)}return"Yo"===e?r.ordinalNumber(a,{unit:"year"}):it(a,e.length)},R:function(t,e){return it(_(t),e.length)},u:function(t,e){return it(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return it(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return it(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return st.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return it(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const o=at(t,n);return"wo"===e?r.ordinalNumber(o,{unit:"week"}):it(o,e.length)},I:function(t,e,r){const n=nt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):it(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):st.d(t,e)},D:function(t,e,r){const n=rt(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):it(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return it(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return it(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),o=0===n?7:n;switch(e){case"i":return String(o);case"ii":return it(o,e.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let o;switch(o=12===n?ct:0===n?ut:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let o;switch(o=n>=17?ht:n>=12?lt:n>=4?dt:ft,e){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return st.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):st.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):st.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):st.s(t,e)},S:function(t,e){return st.S(t,e)},X:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return mt(o);case"XXXX":case"XX":return wt(o);default:return wt(o,":")}},x:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return mt(o);case"xxxx":case"xx":return wt(o);default:return wt(o,":")}},O:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+gt(o,":");default:return"GMT"+wt(o,":")}},z:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+gt(o,":");default:return"GMT"+wt(o,":")}},t:function(t,e,r,n){const o=n._originalDate||t;return it(Math.floor(o.getTime()/1e3),e.length)},T:function(t,e,r,n){return it((n._originalDate||t).getTime(),e.length)}};function gt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),o=Math.floor(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+e+it(a,2)}function mt(t,e){if(t%60==0){return(t>0?"-":"+")+it(Math.abs(t)/60,2)}return wt(t,e)}function wt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+it(Math.floor(n/60),2)+e+it(n%60,2)}const yt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},vt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},bt={p:vt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return yt(t,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"})}return a.replace("{{date}}",yt(n,e)).replace("{{time}}",vt(o,e))}},kt=["D","DD"],xt=["YY","YYYY"];function Tt(t){return-1!==kt.indexOf(t)}function Mt(t){return-1!==xt.indexOf(t)}function Dt(t,e,r){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const St=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Et=/^'([^]*?)'?$/,Ot=/''/g,At=/[a-zA-Z]/;function qt(t,e,r){const n=Q(),o=r?.locale??n.locale??et,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=C(t);if(!X(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o,_originalDate:s};return e.match(Pt).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,bt[e])(t,o.formatLong)}return t})).join("").match(St).map((function(n){if("''"===n)return"'";const a=n[0];if("'"===a)return function(t){const e=t.match(Et);if(!e)return t;return e[1].replace(Ot,"'")}(n);const i=pt[a];if(i)return!r?.useAdditionalWeekYearTokens&&Mt(n)&&Dt(n,e,String(t)),!r?.useAdditionalDayOfYearTokens&&Tt(n)&&Dt(n,e,String(t)),i(s,n,o.localize,u);if(a.match(At))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("")}class Ht{subPriority=0;validate(t,e){return!0}}class Nt extends Ht{constructor(t,e,r,n,o){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class Yt extends Ht{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:L(t,function(t,e){const r=e instanceof Date?L(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Ct{run(t,e,r,n){const o=this.parse(t,e,r,n);return o?{setter:new Nt(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,r){return!0}}const Lt=/^(1[0-2]|0?\d)/,jt=/^(3[0-1]|[0-2]?\d)/,Ft=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Rt=/^(5[0-3]|[0-4]?\d)/,Wt=/^(2[0-3]|[0-1]?\d)/,Qt=/^(2[0-4]|[0-1]?\d)/,It=/^(1[0-1]|0?\d)/,Gt=/^(1[0-2]|0?\d)/,_t=/^[0-5]?\d/,Bt=/^[0-5]?\d/,zt=/^\d/,Xt=/^\d{1,2}/,$t=/^\d{1,3}/,Kt=/^\d{1,4}/,Ut=/^-?\d+/,Jt=/^-?\d/,Vt=/^-?\d{1,2}/,Zt=/^-?\d{1,3}/,te=/^-?\d{1,4}/,ee=/^([+-])(\d{2})(\d{2})?|Z/,re=/^([+-])(\d{2})(\d{2})|Z/,ne=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,oe=/^([+-])(\d{2}):(\d{2})|Z/,ae=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ie(t,e){return t?{value:e(t.value),rest:t.rest}:t}function se(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function ue(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function ce(t){return se(Ut,t)}function de(t,e){switch(t){case 1:return se(zt,e);case 2:return se(Xt,e);case 3:return se($t,e);case 4:return se(Kt,e);default:return se(new RegExp("^\\d{1,"+t+"}"),e)}}function le(t,e){switch(t){case 1:return se(Jt,e);case 2:return se(Vt,e);case 3:return se(Zt,e);case 4:return se(te,e);default:return se(new RegExp("^-?\\d{1,"+t+"}"),e)}}function he(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function fe(t,e){const r=e>0,n=r?e:1-e;let o;if(n<=50)o=t||100;else{const e=n+50;o=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return r?o:1-o}function pe(t){return t%400==0||t%4==0&&t%100!=0}const ge=[31,28,31,30,31,30,31,31,30,31,30,31],me=[31,29,31,30,31,30,31,31,30,31,30,31];function we(t,e,r){const n=Q(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=C(t),i=a.getDay(),s=7-o;return j(a,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function ye(t,e){const r=C(t),n=function(t){let e=C(t).getDay();return 0===e&&(e=7),e}(r);return j(r,e-n)}const ve={G:new class extends Ct{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Ct{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return ie(de(4,t),n);case"yo":return ie(r.ordinalNumber(t,{unit:"year"}),n);default:return ie(de(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=fe(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Ct{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return ie(de(4,t),n);case"Yo":return ie(r.ordinalNumber(t,{unit:"year"}),n);default:return ie(de(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const o=ot(t,n);if(r.isTwoDigitYear){const e=fe(r.year,o);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Ct{priority=130;parse(t,e){return le("R"===e?4:e.length,t)}set(t,e,r){const n=L(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),G(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Ct{priority=130;parse(t,e){return le("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Ct{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return de(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Ct{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return de(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Ct{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return ie(se(Lt,t),n);case"MM":return ie(de(2,t),n);case"Mo":return ie(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Ct{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return ie(se(Lt,t),n);case"LL":return ie(de(2,t),n);case"Lo":return ie(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Ct{priority=100;parse(t,e,r){switch(e){case"w":return se(Rt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return I(function(t,e,r){const n=C(t),o=at(n,r)-e;return n.setDate(n.getDate()-7*o),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Ct{priority=100;parse(t,e,r){switch(e){case"I":return se(Rt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return G(function(t,e){const r=C(t),n=nt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Ct{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return se(jt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return de(e.length,t)}}validate(t,e){const r=pe(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=me[n]:e>=1&&e<=ge[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Ct{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return se(Ft,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return de(e.length,t)}}validate(t,e){return pe(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Ct{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Ct{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return ie(de(e.length,t),o);case"eo":return ie(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Ct{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return ie(de(e.length,t),o);case"co":return ie(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Ct{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return de(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return ie(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return ie(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return ie(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return ie(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=ye(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(he(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(he(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(he(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"h":return se(Gt,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"H":return se(Wt,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"K":return se(It,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"k":return se(Qt,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Ct{priority=60;parse(t,e,r){switch(e){case"m":return se(_t,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Ct{priority=50;parse(t,e,r){switch(e){case"s":return se(Bt,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Ct{priority=30;parse(t,e){return ie(de(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Ct{priority=10;parse(t,e){switch(e){case"X":return ue(ee,t);case"XX":return ue(re,t);case"XXXX":return ue(ne,t);case"XXXXX":return ue(ae,t);default:return ue(oe,t)}}set(t,e,r){return e.timestampIsSet?t:L(t,t.getTime()-z(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Ct{priority=10;parse(t,e){switch(e){case"x":return ue(ee,t);case"xx":return ue(re,t);case"xxxx":return ue(ne,t);case"xxxxx":return ue(ae,t);default:return ue(oe,t)}}set(t,e,r){return e.timestampIsSet?t:L(t,t.getTime()-z(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Ct{priority=40;parse(t){return ce(t)}set(t,e,r){return[L(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Ct{priority=20;parse(t){return ce(t)}set(t,e,r){return[L(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},be=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ke=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xe=/^'([^]*?)'?$/,Te=/''/g,Me=/\S/,De=/[a-zA-Z]/;function Se(t,e,r,n){const o=Object.assign({},Q()),a=n?.locale??o.locale??et,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===e)return""===t?C(r):L(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a},c=[new Yt],d=e.match(ke).map((t=>{const e=t[0];if(e in bt){return(0,bt[e])(t,a.formatLong)}return t})).join("").match(be),l=[];for(let o of d){!n?.useAdditionalWeekYearTokens&&Mt(o)&&Dt(o,e,t),!n?.useAdditionalDayOfYearTokens&&Tt(o)&&Dt(o,e,t);const i=o[0],s=ve[i];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=l.find((t=>e.includes(t.token)||t.token===i));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${o}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${o}\` and any other token at the same time`);l.push({token:i,fullToken:o});const n=s.run(t,o,a.match,u);if(!n)return L(r,NaN);c.push(n.setter),t=n.rest}else{if(i.match(De))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===o?o="'":"'"===i&&(o=o.match(xe)[1].replace(Te,"'")),0!==t.indexOf(o))return L(r,NaN);t=t.slice(o.length)}}if(t.length>0&&Me.test(t))return L(r,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=C(r);if(isNaN(f.getTime()))return L(r,NaN);const p={};for(const t of h){if(!t.validate(f,u))return L(r,NaN);const e=t.set(f,p,u);Array.isArray(e)?(f=e[0],Object.assign(p,e[1])):f=e}return L(r,f)}var Pe=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"store-hour",o)}return l(r,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Se(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Se(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return X(this.startDateInstance)&&X(this.endDateInstance)?"".concat(qt(this.startDateInstance,"p")," - ").concat(qt(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),r}(x),Ee=function(t){f(n,t);var r=v(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,n),r.call(this,t,e,"store-location",o)}return l(n,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new e.Collection(this.getAttribute("hours").map((function(t){return new Pe(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=qt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,o),r.call(this,t,e,"store",n)}return l(o,[{key:"getReviews",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",n({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",n({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(r){return r.place&&(r.place=new e.Place(r.place)),new Ee(r,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Ee(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",r).then((function(r){return new e.Collection(r.map((function(e){return new Y(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new Y(t,e.adapter)}))}}]),o}(x),Ae=function(t){f(d,t);var r,n,a,i,s=v(d);function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,d),s.call(this,t,e,"network",r)}return l(d,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(i=u(o().mark((function t(r,n){var a,i,s=this,u=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},t.prev=1,t.next=4,this.adapter.get(r,a);case 4:return i=t.sent,t.abrupt("return",new e.Collection(i.map((function(t){return new n(t,s.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),console.error("Error fetching ".concat(r,":"),t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t,e){return i.apply(this,arguments)})},{key:"getStores",value:(a=u(o().mark((function t(){var e,r=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Oe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getStoreLocations",value:(n=u(o().mark((function t(){var e,r=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Ee,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getPaymentGateways",value:(r=u(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",Y));case 1:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})}]),d}(x),qe=Array.isArray,He=function(t){f(i,t);var r,n,a=v(i);function i(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,i),r instanceof e.Adapter?y(t,t=a.call(this,{},r,"service-quote",o)):a.call(this,r,n,"service-quote",o)}return l(i,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Re(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return S(e)||S(r)?null:D(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(n=u(o().mark((function t(r,n,a){var s,u,c,d,l,h,f=this,p=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d=p.length>3&&void 0!==p[3]?p[3]:"storefront",l=p.length>4&&void 0!==p[4]&&p[4],null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),null!==(u=n)&&void 0!==u&&u.id&&(n=n.id),null!==(c=a)&&void 0!==c&&c.id&&(a=a.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:r,destination:n,cart:a,config:d,all:l});case 8:if(h=t.sent,!qe(h)){t.next=11;break}return t.abrupt("return",new e.Collection(h.map((function(t){return new i(t,f.adapter)}))));case 11:return t.abrupt("return",new i(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,r){return n.apply(this,arguments)})}],[{key:"getFromCart",value:(r=u(o().mark((function t(e,r,n,a){var s,u,c,d=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=d.length>4&&void 0!==d[4]?d[4]:"storefront",u=d.length>5&&void 0!==d[5]&&d[5],c=new i(e),t.abrupt("return",c.fetchServiceQuotesFromCart(r,n,a,s,u));case 4:case"end":return t.stop()}}),t)}))),function(t,e,n,o){return r.apply(this,arguments)})}]),i}(e.ServiceQuote),Ne=new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,r,o,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return e.isResource(t)&&(t=t.id),e.isResource(r)&&(r=r.id),e.isResource(o)&&(o=o.id),e.isResource(a)&&(a=a.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),n(n({},i),{},{customer:t,cart:r,serviceQuote:o,gateway:a}),s)},captureOrder:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:t,transactionDetails:r},n).then((function(t){return new e.Order(t)}))}}),Ye=function(t){f(r,t);var e=v(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c(this,r),e.call(this,t,n,"checkout",o)}return l(r,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),r}(x),Ce={Product:P,Category:E,Customer:A,Cart:N,DeliveryServiceQuote:He,Store:Oe,StoreLocation:Ee,StoreHour:Pe,Checkout:Ye,Review:M},Le={BrowserAdapter:e.BrowserAdapter,NodeAdapter:e.NodeAdapter},je=function(){function t(){return c(this,t),this.resources=Ce,this.adapters=Le,this.lookup.apply(this,arguments)}return l(t,[{key:"lookup",value:function(t,r){var n=e.pluralize(t),o=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][r])throw new Error("No ".concat(e.singularize(t)," named ").concat(r," to resolve"));return w(this[n][r],b(o))}}]),t}(),Fe=function(){return w(je,Array.prototype.slice.call(arguments))},Re=function(t){f(n,t);var r=v(n);function n(){return c(this,n),r.apply(this,arguments)}return l(n,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.extendStoreActions(this,t)}},{key:"serialize",value:function(t){return Fe("resource",e.classify(this.resource),t,this.adapter)}}]),n}(e.Store),We=function(){function t(r){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(c(this,t),this.version=o.version||"v1",this.options={version:this.version,host:o.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||o.namespace,publicKey:r,debug:a},!("string"==typeof(n=r)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=o.adapter||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.isNodeEnvironment()?Fe("adapter","NodeAdapter",t):Fe("adapter","BrowserAdapter",t)}(this.options),this.products=new Re("product",this.adapter),this.categories=new Re("category",this.adapter),this.reviews=new Re("review",this.adapter).extendActions(T),this.customers=new Re("customer",this.adapter).extendActions(O),this.cart=new Re("cart",this.adapter).extendActions(H),this.checkout=new Re("checkout",this.adapter).extendActions(Ne)}return l(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",n({query:t},r)).then((function(t){return new e.Collection(t.map((function(t){return new P(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return w(t,Array.prototype.slice.call(arguments))}}]),t}();t.Cart=N,t.Category=E,t.Checkout=Ye,t.Customer=A,t.DeliveryServiceQuote=He,t.Network=Ae,t.PaymentGateway=Y,t.Product=P,t.Review=M,t.Store=Oe,t.StoreHour=Pe,t.StoreLocation=Ee,t.default=We})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@fleetbase/sdk")):"function"==typeof define&&define.amd?define(["exports","@fleetbase/sdk"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@fleetbase/storefront"]={},t.sdk)}(this,(function(t,e){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function v(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}var x=function(t){function e(){return i(this,e),a(this,e,arguments)}return l(e,t),c(e,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new We(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}}])}(e.Resource),T=new e.StoreActions({count:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),M=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"review",n])}return l(e,t),c(e,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}])}(x);function S(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var P=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=k(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var o=t.length;if("number"==typeof o)return!o}return!1},E=function(t){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"product",n])}return l(r,t),c(r,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?P(r)||P(n)?null:S(r/100,n):P(e)||P(n)?null:S(e/100,n)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}}])}(x),D=function(t){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"category",n])}return l(r,t),c(r,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new E(e,t.adapter)})))}))}}])}(x),O=new e.StoreActions({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",g({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",g({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",g({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),A=function(t){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"customer",g({actions:O},n)])}return l(r,t),c(r,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new We(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(d=o(w().mark((function t(e){var r=this;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(u=o(w().mark((function t(e){var r,n,o,a,i=arguments;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},n=i.length>2&&void 0!==i[2]?i[2]:"GET",t.prev=2,o={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(o)[n.toLowerCase()](e,r);case 6:return a=t.sent,t.abrupt("return",a);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return u.apply(this,arguments)})},{key:"getSavedPlaces",value:(s=o(w().mark((function t(){var r,n=this;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return r=t.sent,t.abrupt("return",new e.Collection(r.map((function(t){return new e.Place(t,n.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return s.apply(this,arguments)})},{key:"getOrderHistory",value:(n=o(w().mark((function t(){var r,n,o=this,a=arguments;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",r);case 4:return n=t.sent,t.abrupt("return",new e.Collection(n.map((function(t){return new e.Order(t,o.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return n.apply(this,arguments)})},{key:"getStripeEphemeralKey",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-ephemeral-key",t)}},{key:"getStripeSetupIntent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-setup-intent",t)}}]);var n,s,u,d}(x),q=Array.isArray,H=new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),g(g({},n),{},{quantity:r}),o).then(this.afterFetch.bind(this))},update:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),g(g({},n),{},{quantity:r}),o).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),N=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"cart",g({actions:H},n)])}return l(e,t),c(e,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof E&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!q(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}])}(x),C=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"payment-gateway",n])}return l(e,t),c(e,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}])}(x);function L(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function j(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Y(t,e){const r=L(t);return isNaN(e)?j(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const F=6048e5;let R={};function W(){return R}function I(t,e){const r=W(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=L(t),a=o.getDay(),i=(a=o.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function z(t){const e=L(t);return e.setHours(0,0,0,0),e}function B(t){const e=L(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function _(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=L(t);return!isNaN(Number(r))}const X={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"}};function $(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const K={date:$({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:$({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Z={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function J(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):e;n=t.formattingValues[o]||t.formattingValues[e]}else{const e=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;n=t.values[o]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function U(t){return(e,r={})=>{const n=r.width,o=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(o);if(!a)return null;const i=a[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var V;const tt={code:"en-US",formatDistance:(t,e,r)=>{let n;const o=X[t];return n="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:K,formatRelative:(t,e,r,n)=>Z[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:J({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:J({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:J({values:{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"]},defaultWidth:"wide"}),day:J({values:{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"]},defaultWidth:"wide"}),dayPeriod:J({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(V={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(V.matchPattern);if(!r)return null;const n=r[0],o=t.match(V.parsePattern);if(!o)return null;let a=V.valueCallback?V.valueCallback(o[0]):o[0];return a=e.valueCallback?e.valueCallback(a):a,{value:a,rest:t.slice(n.length)}}),era:U({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:U({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:U({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:U({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:U({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function et(t){const e=L(t),r=function(t,e){const r=z(t),n=z(e),o=+r-B(r),a=+n-B(n);return Math.round((o-a)/864e5)}(e,function(t){const e=L(t),r=j(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function rt(t){const e=L(t),r=+Q(e)-+function(t){const e=G(t),r=j(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),Q(r)}(e);return Math.round(r/F)+1}function nt(t,e){const r=L(t),n=r.getFullYear(),o=W(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=j(t,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=I(i,e),u=j(t,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const c=I(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function ot(t,e){const r=L(t),n=+I(r,e)-+function(t,e){const r=W(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=nt(t,e),a=j(t,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),I(a,e)}(r,e);return Math.round(n/F)+1}function at(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const it={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return at("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):at(r+1,2)},d:(t,e)=>at(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>at(t.getHours()%12||12,e.length),H:(t,e)=>at(t.getHours(),e.length),m:(t,e)=>at(t.getMinutes(),e.length),s:(t,e)=>at(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return at(Math.trunc(n*Math.pow(10,r-3)),e.length)}},st="midnight",ut="noon",ct="morning",dt="afternoon",ht="evening",lt="night",ft={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return it.y(t,e)},Y:function(t,e,r,n){const o=nt(t,n),a=o>0?o:1-o;if("YY"===e){return at(a%100,2)}return"Yo"===e?r.ordinalNumber(a,{unit:"year"}):at(a,e.length)},R:function(t,e){return at(G(t),e.length)},u:function(t,e){return at(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return at(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return at(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return it.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return at(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const o=ot(t,n);return"wo"===e?r.ordinalNumber(o,{unit:"week"}):at(o,e.length)},I:function(t,e,r){const n=rt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):at(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):it.d(t,e)},D:function(t,e,r){const n=et(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):at(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return at(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return at(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),o=0===n?7:n;switch(e){case"i":return String(o);case"ii":return at(o,e.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let o;switch(o=12===n?ut:0===n?st:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let o;switch(o=n>=17?ht:n>=12?dt:n>=4?ct:lt,e){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return it.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):it.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):it.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):it.s(t,e)},S:function(t,e){return it.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(0===n)return"Z";switch(e){case"X":return gt(n);case"XXXX":case"XX":return mt(n);default:return mt(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return gt(n);case"xxxx":case"xx":return mt(n);default:return mt(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+pt(n,":");default:return"GMT"+mt(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+pt(n,":");default:return"GMT"+mt(n,":")}},t:function(t,e,r){return at(Math.trunc(t.getTime()/1e3),e.length)},T:function(t,e,r){return at(t.getTime(),e.length)}};function pt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),o=Math.trunc(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+e+at(a,2)}function gt(t,e){if(t%60==0){return(t>0?"-":"+")+at(Math.abs(t)/60,2)}return mt(t,e)}function mt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+at(Math.trunc(n/60),2)+e+at(n%60,2)}const wt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},yt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},vt={p:yt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return wt(t,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"})}return a.replace("{{date}}",wt(n,e)).replace("{{time}}",yt(o,e))}},bt=/^D+$/,kt=/^Y+$/,xt=["D","DD","YY","YYYY"];function Tt(t){return bt.test(t)}function Mt(t){return kt.test(t)}function St(t,e,r){const n=function(t,e,r){const n="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,r);if(console.warn(n),xt.includes(t))throw new RangeError(n)}const Pt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Et=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dt=/^'([^]*?)'?$/,Ot=/''/g,At=/[a-zA-Z]/;function qt(t,e,r){const n=W(),o=n.locale??tt,a=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=L(t);if(!_(s))throw new RangeError("Invalid time value");let u=e.match(Et).map((t=>{const e=t[0];if("p"===e||"P"===e){return(0,vt[e])(t,o.formatLong)}return t})).join("").match(Pt).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:Ht(t)};if(ft[e])return{isToken:!0,value:t};if(e.match(At))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));o.localize.preprocessor&&(u=o.localize.preprocessor(s,u));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return u.map((r=>{if(!r.isToken)return r.value;const n=r.value;(Mt(n)||Tt(n))&&St(n,e,String(t));return(0,ft[n[0]])(s,n,o.localize,c)})).join("")}function Ht(t){const e=t.match(Dt);return e?e[1].replace(Ot,"'"):t}class Nt{subPriority=0;validate(t,e){return!0}}class Ct extends Nt{constructor(t,e,r,n,o){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class Lt extends Nt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:j(t,function(t,e){const r=e instanceof Date?j(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class jt{run(t,e,r,n){const o=this.parse(t,e,r,n);return o?{setter:new Ct(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,r){return!0}}const Yt=/^(1[0-2]|0?\d)/,Ft=/^(3[0-1]|[0-2]?\d)/,Rt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Wt=/^(5[0-3]|[0-4]?\d)/,It=/^(2[0-3]|[0-1]?\d)/,Qt=/^(2[0-4]|[0-1]?\d)/,Gt=/^(1[0-1]|0?\d)/,zt=/^(1[0-2]|0?\d)/,Bt=/^[0-5]?\d/,_t=/^[0-5]?\d/,Xt=/^\d/,$t=/^\d{1,2}/,Kt=/^\d{1,3}/,Zt=/^\d{1,4}/,Jt=/^-?\d+/,Ut=/^-?\d/,Vt=/^-?\d{1,2}/,te=/^-?\d{1,3}/,ee=/^-?\d{1,4}/,re=/^([+-])(\d{2})(\d{2})?|Z/,ne=/^([+-])(\d{2})(\d{2})|Z/,oe=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ae=/^([+-])(\d{2}):(\d{2})|Z/,ie=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function se(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ue(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function ce(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function de(t){return ue(Jt,t)}function he(t,e){switch(t){case 1:return ue(Xt,e);case 2:return ue($t,e);case 3:return ue(Kt,e);case 4:return ue(Zt,e);default:return ue(new RegExp("^\\d{1,"+t+"}"),e)}}function le(t,e){switch(t){case 1:return ue(Ut,e);case 2:return ue(Vt,e);case 3:return ue(te,e);case 4:return ue(ee,e);default:return ue(new RegExp("^-?\\d{1,"+t+"}"),e)}}function fe(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function pe(t,e){const r=e>0,n=r?e:1-e;let o;if(n<=50)o=t||100;else{const e=n+50;o=t+100*Math.trunc(e/100)-(t>=e%100?100:0)}return r?o:1-o}function ge(t){return t%400==0||t%4==0&&t%100!=0}const me=[31,28,31,30,31,30,31,31,30,31,30,31],we=[31,29,31,30,31,30,31,31,30,31,30,31];function ye(t,e,r){const n=W(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=L(t),i=a.getDay(),s=7-o;return Y(a,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function ve(t,e){const r=L(t),n=function(t){let e=L(t).getDay();return 0===e&&(e=7),e}(r);return Y(r,e-n)}const be={G:new class extends jt{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends jt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return se(he(4,t),n);case"yo":return se(r.ordinalNumber(t,{unit:"year"}),n);default:return se(he(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=pe(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}},Y:new class extends jt{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return se(he(4,t),n);case"Yo":return se(r.ordinalNumber(t,{unit:"year"}),n);default:return se(he(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const o=nt(t,n);if(r.isTwoDigitYear){const e=pe(r.year,o);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends jt{priority=130;parse(t,e){return le("R"===e?4:e.length,t)}set(t,e,r){const n=j(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Q(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends jt{priority=130;parse(t,e){return le("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends jt{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return he(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends jt{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return he(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends jt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return se(ue(Yt,t),n);case"MM":return se(he(2,t),n);case"Mo":return se(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends jt{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return se(ue(Yt,t),n);case"LL":return se(he(2,t),n);case"Lo":return se(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends jt{priority=100;parse(t,e,r){switch(e){case"w":return ue(Wt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return he(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return I(function(t,e,r){const n=L(t),o=ot(n,r)-e;return n.setDate(n.getDate()-7*o),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends jt{priority=100;parse(t,e,r){switch(e){case"I":return ue(Wt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return he(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return Q(function(t,e){const r=L(t),n=rt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends jt{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return ue(Ft,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return he(e.length,t)}}validate(t,e){const r=ge(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=we[n]:e>=1&&e<=me[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends jt{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return ue(Rt,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return he(e.length,t)}}validate(t,e){return ge(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends jt{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=ye(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends jt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return se(he(e.length,t),o);case"eo":return se(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=ye(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends jt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return se(he(e.length,t),o);case"co":return se(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=ye(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends jt{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return he(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return se(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return se(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return se(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return se(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=ve(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends jt{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(fe(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends jt{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(fe(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends jt{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(fe(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends jt{priority=70;parse(t,e,r){switch(e){case"h":return ue(zt,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return he(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends jt{priority=70;parse(t,e,r){switch(e){case"H":return ue(It,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return he(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends jt{priority=70;parse(t,e,r){switch(e){case"K":return ue(Gt,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return he(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends jt{priority=70;parse(t,e,r){switch(e){case"k":return ue(Qt,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return he(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends jt{priority=60;parse(t,e,r){switch(e){case"m":return ue(Bt,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return he(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends jt{priority=50;parse(t,e,r){switch(e){case"s":return ue(_t,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return he(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends jt{priority=30;parse(t,e){return se(he(e.length,t),(t=>Math.trunc(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends jt{priority=10;parse(t,e){switch(e){case"X":return ce(re,t);case"XX":return ce(ne,t);case"XXXX":return ce(oe,t);case"XXXXX":return ce(ie,t);default:return ce(ae,t)}}set(t,e,r){return e.timestampIsSet?t:j(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends jt{priority=10;parse(t,e){switch(e){case"x":return ce(re,t);case"xx":return ce(ne,t);case"xxxx":return ce(oe,t);case"xxxxx":return ce(ie,t);default:return ce(ae,t)}}set(t,e,r){return e.timestampIsSet?t:j(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends jt{priority=40;parse(t){return de(t)}set(t,e,r){return[j(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends jt{priority=20;parse(t){return de(t)}set(t,e,r){return[j(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},ke=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Te=/^'([^]*?)'?$/,Me=/''/g,Se=/\S/,Pe=/[a-zA-Z]/;function Ee(t,e,r,n){const o=Object.assign({},W()),a=o.locale??tt,i=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===e)return""===t?L(r):j(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a},c=[new Lt],d=e.match(xe).map((t=>{const e=t[0];if(e in vt){return(0,vt[e])(t,a.formatLong)}return t})).join("").match(ke),h=[];for(let n of d){Mt(n)&&St(n,e,t),Tt(n)&&St(n,e,t);const o=n[0],i=be[o];if(i){const{incompatibleTokens:e}=i;if(Array.isArray(e)){const t=h.find((t=>e.includes(t.token)||t.token===o));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${n}\` at the same time`)}else if("*"===i.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);h.push({token:o,fullToken:n});const s=i.run(t,n,a.match,u);if(!s)return j(r,NaN);c.push(s.setter),t=s.rest}else{if(o.match(Pe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");if("''"===n?n="'":"'"===o&&(n=n.match(Te)[1].replace(Me,"'")),0!==t.indexOf(n))return j(r,NaN);t=t.slice(n.length)}}if(t.length>0&&Se.test(t))return j(r,NaN);const l=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=L(r);if(isNaN(f.getTime()))return j(r,NaN);const p={};for(const t of l){if(!t.validate(f,u))return j(r,NaN);const e=t.set(f,p,u);Array.isArray(e)?(f=e[0],Object.assign(p,e[1])):f=e}return j(r,f)}var De=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"store-hour",n])}return l(e,t),c(e,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Ee(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Ee(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return _(this.startDateInstance)&&_(this.endDateInstance)?"".concat(qt(this.startDateInstance,"p")," - ").concat(qt(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}])}(x),Oe=function(t){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"store-location",n])}return l(r,t),c(r,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new e.Collection(this.getAttribute("hours").map((function(t){return new De(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=qt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"store",n])}return l(r,t),c(r,[{key:"getReviews",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",g({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",g({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(r){return r.place&&(r.place=new e.Place(r.place)),new Oe(r,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Oe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",r).then((function(r){return new e.Collection(r.map((function(e){return new C(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new C(t,e.adapter)}))}}])}(x),qe=function(t){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"network",n])}return l(r,t),c(r,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(d=o(w().mark((function t(r,n){var o,a,i=this,s=arguments;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=s.length>2&&void 0!==s[2]?s[2]:{},t.prev=1,t.next=4,this.adapter.get(r,o);case 4:return a=t.sent,t.abrupt("return",new e.Collection(a.map((function(t){return new n(t,i.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),console.error("Error fetching ".concat(r,":"),t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t,e){return d.apply(this,arguments)})},{key:"getStores",value:(u=o(w().mark((function t(){var e,r=arguments;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Ae,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return u.apply(this,arguments)})},{key:"getStoreLocations",value:(s=o(w().mark((function t(){var e,r=arguments;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Oe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"getPaymentGateways",value:(n=o(w().mark((function t(){return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",C));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]);var n,s,u,d}(x),He=Array.isArray,Ne=function(t){function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),n instanceof e.Adapter?m(t,t=a(this,r,[{},n,"service-quote",s])):a(this,r,[n,o,"service-quote",s])}return l(r,t),c(r,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new We(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return P(e)||P(r)?null:S(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(s=o(w().mark((function t(n,o,a){var i,s,u,c,d,h,l=this,f=arguments;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=f.length>3&&void 0!==f[3]?f[3]:"storefront",d=f.length>4&&void 0!==f[4]&&f[4],null!==(i=n)&&void 0!==i&&i.id&&(n=n.id),null!==(s=o)&&void 0!==s&&s.id&&(o=o.id),null!==(u=a)&&void 0!==u&&u.id&&(a=a.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:n,destination:o,cart:a,config:c,all:d});case 8:if(h=t.sent,!He(h)){t.next=11;break}return t.abrupt("return",new e.Collection(h.map((function(t){return new r(t,l.adapter)}))));case 11:return t.abrupt("return",new r(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,r){return s.apply(this,arguments)})}],[{key:"getFromCart",value:(n=o(w().mark((function t(e,n,o,a){var i,s,u,c=arguments;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=c.length>4&&void 0!==c[4]?c[4]:"storefront",s=c.length>5&&void 0!==c[5]&&c[5],u=new r(e),t.abrupt("return",u.fetchServiceQuotesFromCart(n,o,a,i,s));case 4:case"end":return t.stop()}}),t)}))),function(t,e,r,o){return n.apply(this,arguments)})}]);var n,s}(e.ServiceQuote),Ce=new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,r,n,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return e.isResource(t)&&(t=t.id),e.isResource(r)&&(r=r.id),e.isResource(n)&&(n=n.id),e.isResource(o)&&(o=o.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),g(g({},a),{},{customer:t,cart:r,serviceQuote:n,gateway:o}),i)},captureOrder:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:t,transactionDetails:r},n).then((function(t){return new e.Order(t)}))},createStripeSetupIntent:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.isResource(t)&&(t=t.id),this.adapter.post("".concat(this.namespace,"/stripe-setup-intent"),{customer:t},r)},updateStripePaymentIntent:function(t,r,n,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return e.isResource(r)&&(r=r.id),e.isResource(n)&&(n=n.id),e.isResource(o)&&(o=o.id),this.adapter.put("".concat(this.namespace,"/stripe-update-payment-intent"),g({paymentIntent:t,customer:r,cart:n,serviceQuote:o},a),i)}}),Le=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"checkout",n])}return l(e,t),c(e,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}])}(x),je={Product:E,Category:D,Customer:A,Cart:N,DeliveryServiceQuote:Ne,Store:Ae,StoreLocation:Oe,StoreHour:De,Checkout:Le,Review:M},Ye={BrowserAdapter:e.BrowserAdapter,NodeAdapter:e.NodeAdapter};var Fe=function(){return c((function t(){return i(this,t),this.resources=je,this.adapters=Ye,this.lookup.apply(this,arguments)}),[{key:"lookup",value:function(t,r){var n=e.pluralize(t),o=r.split(/[^a-zA-Z0-9]/).filter(Boolean).map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(""),a=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][o])throw new Error("No ".concat(e.singularize(t)," named ").concat(r," (").concat(o,") to resolve"));return s(this[n][o],v(a))}}])}(),Re=function(){return s(Fe,Array.prototype.slice.call(arguments))},We=function(t){function r(){return i(this,r),a(this,r,arguments)}return l(r,t),c(r,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.extendStoreActions(this,t)}},{key:"serialize",value:function(t){return Re("resource",e.classify(this.resource),t,this.adapter)}}])}(e.Store),Ie=function(){function t(r){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(i(this,t),this.version=o.version||"v1",this.options={version:this.version,host:o.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||o.namespace,publicKey:r,debug:a},!("string"==typeof(n=r)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=o.adapter||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.isNodeEnvironment()?Re("adapter","NodeAdapter",t):Re("adapter","BrowserAdapter",t)}(this.options),this.products=new We("product",this.adapter),this.categories=new We("category",this.adapter),this.reviews=new We("review",this.adapter).extendActions(T),this.customers=new We("customer",this.adapter).extendActions(O),this.cart=new We("cart",this.adapter).extendActions(H),this.checkout=new We("checkout",this.adapter).extendActions(Ce)}return c(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"lookup",value:function(t){return this.adapter.get("lookup/".concat(t))}},{key:"search",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",g({query:t},r)).then((function(t){return new e.Collection(t.map((function(t){return new E(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return s(t,Array.prototype.slice.call(arguments))}}])}();t.Cart=N,t.Category=D,t.Checkout=Le,t.Customer=A,t.DeliveryServiceQuote=Ne,t.Network=qe,t.PaymentGateway=C,t.Product=E,t.Review=M,t.Store=Ae,t.StoreHour=De,t.StoreLocation=Oe,t.default=Ie,t.lookup=Re})); //# sourceMappingURL=storefront.min.js.map diff --git a/dist/@fleetbase/storefront.min.js.map b/dist/@fleetbase/storefront.min.js.map index 93575d2..229680a 100644 --- a/dist/@fleetbase/storefront.min.js.map +++ b/dist/@fleetbase/storefront.min.js.map @@ -1 +1 @@ -{"version":3,"file":"storefront.min.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n startOfDayRight.getTime() -\n getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff =\n startOfISOWeek(_date).getTime() - startOfISOWeekYear(_date).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff =\n startOfWeek(_date, options).getTime() -\n startOfWeekYear(_date, options).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.floor(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const protectedDayOfYearTokens = [\"D\", \"DD\"];\nconst protectedWeekYearTokens = [\"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nexport function throwProtectedError(token, format, input) {\n if (token === \"YYYY\") {\n throw new RangeError(\n `Use \\`yyyy\\` instead of \\`YYYY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"YY\") {\n throw new RangeError(\n `Use \\`yy\\` instead of \\`YY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"D\") {\n throw new RangeError(\n `Use \\`d\\` instead of \\`D\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"DD\") {\n throw new RangeError(\n `Use \\`dd\\` instead of \\`DD\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n }\n}\n","import { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate,\n };\n\n const result = formatStr\n .match(longFormattingTokensRegExp)\n .map(function (substring) {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = formatters[firstCharacter];\n if (formatter) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n return formatter(\n originalDate,\n substring,\n locale.localize,\n formatterOptions,\n );\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.floor(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { enUS as defaultLocale } from \"./locale/en-US.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nconst resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][className]) {\n throw new Error(`No ${singularize(type)} named ${className} to resolve`);\n }\n\n return new this[key][className](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_inherits","_super","_createSuper","_classCallCheck","apply","this","arguments","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","Resource","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","call","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_getOrderHistory","_getSavedPlaces","_performAuthorizedRequest","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","millisecondsInDay","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","floor","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","matched","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","includes","fullToken","push","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getPaymentGateways","_getStoreLocations","_getStores","_getResourceCollection","ResourceClass","resources","_args","getResourceCollection","_args3","DeliveryServiceQuote","_ServiceQuote","_getFromCart","_fetchServiceQuotesFromCart","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","ServiceQuote","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","startsWith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AA,cAAAC,MAVD,WACI,OAAAikB,EAAWM,EAAUld,MAAA4B,UAAA4G,MAAArO,KAAI3B,WAC7B,KAAC0kB,CAAA,CA/C0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file +{"version":3,"file":"storefront.min.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n\n getStripeEphemeralKey(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-ephemeral-key', params);\n }\n\n getStripeSetupIntent(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-setup-intent', params);\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { toDate } from \"../toDate.mjs\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(date.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n const timestamp = date.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.trunc(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { longFormatters, parsers };\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst objectToParams = (obj = {}, prefix = null) => {\n if (obj === null || obj === undefined) {\n return {};\n }\n\n const parsed = {};\n const keys = Object.keys(obj);\n\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n const value = obj[key];\n\n if (key && value) {\n if (prefix && typeof prefix === 'string') {\n parsed[`${prefix}[${key}]`] = value;\n continue;\n }\n\n parsed[key] = value;\n }\n }\n\n return parsed;\n};\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n\n createStripeSetupIntent: function (customer, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n return this.adapter.post(`${this.namespace}/stripe-setup-intent`, { customer }, options);\n },\n\n updateStripePaymentIntent: function (paymentIntent, customer, cart, serviceQuote, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n return this.adapter.put(`${this.namespace}/stripe-update-payment-intent`, { paymentIntent, customer, cart, serviceQuote, ...orderOptions }, options);\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nexport const resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nfunction toStudlyCase(str) {\n return str\n .split(/[^a-zA-Z0-9]/) // Split by non-alphanumeric characters\n .filter(Boolean) // Remove empty elements\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize the first letter of each word\n .join(''); // Join the words together without spaces\n}\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const classKey = toStudlyCase(className);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][classKey]) {\n throw new Error(`No ${singularize(type)} named ${className} (${classKey}) to resolve`);\n }\n\n return new this[key][classKey](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n\nexport default Resolver;\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { lookup } from './resolver';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** lookup a specific store or network provided the ID */\n lookup(id) {\n return this.adapter.get(`lookup/${id}`);\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network, lookup };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_classCallCheck","_callSuper","this","arguments","_inherits","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","Resource","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","apply","_performAuthorizedRequest","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_getSavedPlaces","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_getOrderHistory","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","call","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","trunc","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","dayOfYearTokenRE","weekYearTokenRE","throwTokens","isProtectedDayOfYearToken","isProtectedWeekYearToken","warnOrThrowProtectedError","input","_message","subject","message","warn","includes","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","originalDate","parts","substring","firstCharacter","longFormatter","join","isToken","cleanEscapedString","preprocessor","formatterOptions","part","formatter","matched","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","floor","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","fullToken","push","indexOf","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getResourceCollection","ResourceClass","resources","_args","_getStores","getResourceCollection","_getStoreLocations","_args3","_getPaymentGateways","DeliveryServiceQuote","_ServiceQuote","Adapter","_possibleConstructorReturn","_fetchServiceQuotesFromCart","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","_getFromCart","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","ServiceQuote","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","createStripeSetupIntent","updateStripePaymentIntent","paymentIntent","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","classKey","Boolean","word","charAt","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","startsWith","isNodeEnvironment","detectAdapter","categories","extendActions","customers","checkout","product"],"mappings":"w8UACsC,IAEjBA,WAAkBC,GAAA,SAAAD,IAAA,OAAAE,OAAAF,GAAAG,EAAAC,KAAAJ,EAAAK,UAAA,CAAA,OAAAC,EAAAN,EAAAC,GAAAM,EAAAP,EAAA,CAAA,CAAAQ,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAP,KAAKM,QAAUA,EACfN,KAAKQ,MAAQ,IAAIC,GAAgBT,KAAKU,SAAUJ,EAAS,CACrDK,aAAcX,KAAKY,eAAeC,KAAKb,MACvCc,QAAqBP,QAAdA,EAAEP,KAAKe,eAALR,IAAYA,OAAZA,EAAAA,EAAcO,UAGpBd,IACX,IAAC,EAf2CgB,YCA1CC,EAAgB,IAAIC,EAAAA,aAAa,CACnCC,MAAO,SAAUC,GAAuB,IAAdL,EAAOd,UAAAoB,OAAA,QAAAC,IAAArB,UAAA,GAAAA,UAAA,GAAG,CAAE,EAC5BsB,EAAS,CAAE,EAMjB,OAJIH,IACAG,EAAOf,MAAQY,GAGZpB,KAAKM,QAAQkB,IAAGC,GAAAA,OAAIzB,KAAK0B,UAAS,UAAUH,EAAQR,EAC/D,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0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file diff --git a/dist/@fleetbase/storefront/resolver.min.js b/dist/@fleetbase/storefront/resolver.min.js new file mode 100644 index 0000000..9ad0453 --- /dev/null +++ b/dist/@fleetbase/storefront/resolver.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@fleetbase/sdk")):"function"==typeof define&&define.amd?define(["exports","@fleetbase/sdk"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@fleetbase/storefront/resolver"]={},t.sdk)}(this,(function(t,e){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),q(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;q(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}function v(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}var x=function(t){function r(){return i(this,r),a(this,r,arguments)}return l(r,t),c(r,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.extendStoreActions(this,t)}},{key:"serialize",value:function(t){return Ye("resource",e.classify(this.resource),t,this.adapter)}}])}(e.Store),T=function(t){function e(){return i(this,e),a(this,e,arguments)}return l(e,t),c(e,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new x(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}}])}(e.Resource);new e.StoreActions({count:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}});var M=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"review",n])}return l(e,t),c(e,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}])}(T);function P(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var S=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=k(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var o=t.length;if("number"==typeof o)return!o}return!1},E=function(t){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"product",n])}return l(r,t),c(r,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?S(r)||S(n)?null:P(r/100,n):S(e)||S(n)?null:P(e/100,n)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}}])}(T),D=function(t){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"category",n])}return l(r,t),c(r,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(r){return new e.Collection(r.map((function(e){return new E(e,t.adapter)})))}))}}])}(T),O=new e.StoreActions({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",p({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",p({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",p({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),q=function(t){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"customer",p({actions:O},n)])}return l(r,t),c(r,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new x(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(d=o(y().mark((function t(e){var r=this;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(u=o(y().mark((function t(e){var r,n,o,a,i=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},n=i.length>2&&void 0!==i[2]?i[2]:"GET",t.prev=2,o={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(o)[n.toLowerCase()](e,r);case 6:return a=t.sent,t.abrupt("return",a);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return u.apply(this,arguments)})},{key:"getSavedPlaces",value:(s=o(y().mark((function t(){var r,n=this;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return r=t.sent,t.abrupt("return",new e.Collection(r.map((function(t){return new e.Place(t,n.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return s.apply(this,arguments)})},{key:"getOrderHistory",value:(n=o(y().mark((function t(){var r,n,o=this,a=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",r);case 4:return n=t.sent,t.abrupt("return",new e.Collection(n.map((function(t){return new e.Order(t,o.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return n.apply(this,arguments)})},{key:"getStripeEphemeralKey",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-ephemeral-key",t)}},{key:"getStripeSetupIntent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-setup-intent",t)}}]);var n,s,u,d}(T),A=Array.isArray,H=new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),p(p({},n),{},{quantity:r}),o).then(this.afterFetch.bind(this))},update:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),p(p({},n),{},{quantity:r}),o).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),N=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"cart",p({actions:H},n)])}return l(e,t),c(e,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof E&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!A(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}])}(T),L=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"payment-gateway",n])}return l(e,t),c(e,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}])}(T);function j(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function C(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Y(t,e){const r=j(t);return isNaN(e)?C(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const F=6048e5;let R={};function W(){return R}function I(t,e){const r=W(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=j(t),a=o.getDay(),i=(a=o.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function z(t){const e=j(t);return e.setHours(0,0,0,0),e}function B(t){const e=j(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function _(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=j(t);return!isNaN(Number(r))}const X={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"}};function $(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const K={date:$({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:$({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Z={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function J(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):e;n=t.formattingValues[o]||t.formattingValues[e]}else{const e=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;n=t.values[o]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function U(t){return(e,r={})=>{const n=r.width,o=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(o);if(!a)return null;const i=a[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var V;const tt={code:"en-US",formatDistance:(t,e,r)=>{let n;const o=X[t];return n="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:K,formatRelative:(t,e,r,n)=>Z[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:J({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:J({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:J({values:{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"]},defaultWidth:"wide"}),day:J({values:{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"]},defaultWidth:"wide"}),dayPeriod:J({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(V={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(V.matchPattern);if(!r)return null;const n=r[0],o=t.match(V.parsePattern);if(!o)return null;let a=V.valueCallback?V.valueCallback(o[0]):o[0];return a=e.valueCallback?e.valueCallback(a):a,{value:a,rest:t.slice(n.length)}}),era:U({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:U({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:U({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:U({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:U({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function et(t){const e=j(t),r=function(t,e){const r=z(t),n=z(e),o=+r-B(r),a=+n-B(n);return Math.round((o-a)/864e5)}(e,function(t){const e=j(t),r=C(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function rt(t){const e=j(t),r=+Q(e)-+function(t){const e=G(t),r=C(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),Q(r)}(e);return Math.round(r/F)+1}function nt(t,e){const r=j(t),n=r.getFullYear(),o=W(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=C(t,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=I(i,e),u=C(t,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const c=I(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function ot(t,e){const r=j(t),n=+I(r,e)-+function(t,e){const r=W(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=nt(t,e),a=C(t,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),I(a,e)}(r,e);return Math.round(n/F)+1}function at(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const it={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return at("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):at(r+1,2)},d:(t,e)=>at(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>at(t.getHours()%12||12,e.length),H:(t,e)=>at(t.getHours(),e.length),m:(t,e)=>at(t.getMinutes(),e.length),s:(t,e)=>at(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return at(Math.trunc(n*Math.pow(10,r-3)),e.length)}},st="midnight",ut="noon",ct="morning",dt="afternoon",ht="evening",lt="night",ft={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return it.y(t,e)},Y:function(t,e,r,n){const o=nt(t,n),a=o>0?o:1-o;if("YY"===e){return at(a%100,2)}return"Yo"===e?r.ordinalNumber(a,{unit:"year"}):at(a,e.length)},R:function(t,e){return at(G(t),e.length)},u:function(t,e){return at(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return at(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return at(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return it.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return at(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const o=ot(t,n);return"wo"===e?r.ordinalNumber(o,{unit:"week"}):at(o,e.length)},I:function(t,e,r){const n=rt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):at(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):it.d(t,e)},D:function(t,e,r){const n=et(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):at(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return at(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return at(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),o=0===n?7:n;switch(e){case"i":return String(o);case"ii":return at(o,e.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let o;switch(o=12===n?ut:0===n?st:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let o;switch(o=n>=17?ht:n>=12?dt:n>=4?ct:lt,e){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return it.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):it.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):it.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):it.s(t,e)},S:function(t,e){return it.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(0===n)return"Z";switch(e){case"X":return pt(n);case"XXXX":case"XX":return gt(n);default:return gt(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return pt(n);case"xxxx":case"xx":return gt(n);default:return gt(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+mt(n,":");default:return"GMT"+gt(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+mt(n,":");default:return"GMT"+gt(n,":")}},t:function(t,e,r){return at(Math.trunc(t.getTime()/1e3),e.length)},T:function(t,e,r){return at(t.getTime(),e.length)}};function mt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),o=Math.trunc(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+e+at(a,2)}function pt(t,e){if(t%60==0){return(t>0?"-":"+")+at(Math.abs(t)/60,2)}return gt(t,e)}function gt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+at(Math.trunc(n/60),2)+e+at(n%60,2)}const yt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},wt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},vt={p:wt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return yt(t,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"})}return a.replace("{{date}}",yt(n,e)).replace("{{time}}",wt(o,e))}},bt=/^D+$/,kt=/^Y+$/,xt=["D","DD","YY","YYYY"];function Tt(t){return bt.test(t)}function Mt(t){return kt.test(t)}function Pt(t,e,r){const n=function(t,e,r){const n="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,r);if(console.warn(n),xt.includes(t))throw new RangeError(n)}const St=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Et=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dt=/^'([^]*?)'?$/,Ot=/''/g,qt=/[a-zA-Z]/;function At(t,e,r){const n=W(),o=n.locale??tt,a=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=j(t);if(!_(s))throw new RangeError("Invalid time value");let u=e.match(Et).map((t=>{const e=t[0];if("p"===e||"P"===e){return(0,vt[e])(t,o.formatLong)}return t})).join("").match(St).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:Ht(t)};if(ft[e])return{isToken:!0,value:t};if(e.match(qt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));o.localize.preprocessor&&(u=o.localize.preprocessor(s,u));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return u.map((r=>{if(!r.isToken)return r.value;const n=r.value;(Mt(n)||Tt(n))&&Pt(n,e,String(t));return(0,ft[n[0]])(s,n,o.localize,c)})).join("")}function Ht(t){const e=t.match(Dt);return e?e[1].replace(Ot,"'"):t}class Nt{subPriority=0;validate(t,e){return!0}}class Lt extends Nt{constructor(t,e,r,n,o){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class jt extends Nt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:C(t,function(t,e){const r=e instanceof Date?C(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Ct{run(t,e,r,n){const o=this.parse(t,e,r,n);return o?{setter:new Lt(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,r){return!0}}const Yt=/^(1[0-2]|0?\d)/,Ft=/^(3[0-1]|[0-2]?\d)/,Rt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Wt=/^(5[0-3]|[0-4]?\d)/,It=/^(2[0-3]|[0-1]?\d)/,Qt=/^(2[0-4]|[0-1]?\d)/,Gt=/^(1[0-1]|0?\d)/,zt=/^(1[0-2]|0?\d)/,Bt=/^[0-5]?\d/,_t=/^[0-5]?\d/,Xt=/^\d/,$t=/^\d{1,2}/,Kt=/^\d{1,3}/,Zt=/^\d{1,4}/,Jt=/^-?\d+/,Ut=/^-?\d/,Vt=/^-?\d{1,2}/,te=/^-?\d{1,3}/,ee=/^-?\d{1,4}/,re=/^([+-])(\d{2})(\d{2})?|Z/,ne=/^([+-])(\d{2})(\d{2})|Z/,oe=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ae=/^([+-])(\d{2}):(\d{2})|Z/,ie=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function se(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ue(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function ce(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function de(t){return ue(Jt,t)}function he(t,e){switch(t){case 1:return ue(Xt,e);case 2:return ue($t,e);case 3:return ue(Kt,e);case 4:return ue(Zt,e);default:return ue(new RegExp("^\\d{1,"+t+"}"),e)}}function le(t,e){switch(t){case 1:return ue(Ut,e);case 2:return ue(Vt,e);case 3:return ue(te,e);case 4:return ue(ee,e);default:return ue(new RegExp("^-?\\d{1,"+t+"}"),e)}}function fe(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function me(t,e){const r=e>0,n=r?e:1-e;let o;if(n<=50)o=t||100;else{const e=n+50;o=t+100*Math.trunc(e/100)-(t>=e%100?100:0)}return r?o:1-o}function pe(t){return t%400==0||t%4==0&&t%100!=0}const ge=[31,28,31,30,31,30,31,31,30,31,30,31],ye=[31,29,31,30,31,30,31,31,30,31,30,31];function we(t,e,r){const n=W(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=j(t),i=a.getDay(),s=7-o;return Y(a,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function ve(t,e){const r=j(t),n=function(t){let e=j(t).getDay();return 0===e&&(e=7),e}(r);return Y(r,e-n)}const be={G:new class extends Ct{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Ct{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return se(he(4,t),n);case"yo":return se(r.ordinalNumber(t,{unit:"year"}),n);default:return se(he(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=me(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Ct{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return se(he(4,t),n);case"Yo":return se(r.ordinalNumber(t,{unit:"year"}),n);default:return se(he(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const o=nt(t,n);if(r.isTwoDigitYear){const e=me(r.year,o);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),I(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Ct{priority=130;parse(t,e){return le("R"===e?4:e.length,t)}set(t,e,r){const n=C(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Q(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Ct{priority=130;parse(t,e){return le("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Ct{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return he(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Ct{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return he(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Ct{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return se(ue(Yt,t),n);case"MM":return se(he(2,t),n);case"Mo":return se(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Ct{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return se(ue(Yt,t),n);case"LL":return se(he(2,t),n);case"Lo":return se(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Ct{priority=100;parse(t,e,r){switch(e){case"w":return ue(Wt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return he(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return I(function(t,e,r){const n=j(t),o=ot(n,r)-e;return n.setDate(n.getDate()-7*o),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Ct{priority=100;parse(t,e,r){switch(e){case"I":return ue(Wt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return he(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return Q(function(t,e){const r=j(t),n=rt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Ct{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return ue(Ft,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return he(e.length,t)}}validate(t,e){const r=pe(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=ye[n]:e>=1&&e<=ge[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Ct{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return ue(Rt,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return he(e.length,t)}}validate(t,e){return pe(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Ct{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Ct{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return se(he(e.length,t),o);case"eo":return se(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Ct{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return se(he(e.length,t),o);case"co":return se(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Ct{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return he(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return se(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return se(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return se(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return se(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=ve(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(fe(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(fe(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Ct{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(fe(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"h":return ue(zt,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return he(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"H":return ue(It,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return he(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"K":return ue(Gt,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return he(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Ct{priority=70;parse(t,e,r){switch(e){case"k":return ue(Qt,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return he(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Ct{priority=60;parse(t,e,r){switch(e){case"m":return ue(Bt,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return he(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Ct{priority=50;parse(t,e,r){switch(e){case"s":return ue(_t,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return he(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Ct{priority=30;parse(t,e){return se(he(e.length,t),(t=>Math.trunc(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Ct{priority=10;parse(t,e){switch(e){case"X":return ce(re,t);case"XX":return ce(ne,t);case"XXXX":return ce(oe,t);case"XXXXX":return ce(ie,t);default:return ce(ae,t)}}set(t,e,r){return e.timestampIsSet?t:C(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Ct{priority=10;parse(t,e){switch(e){case"x":return ce(re,t);case"xx":return ce(ne,t);case"xxxx":return ce(oe,t);case"xxxxx":return ce(ie,t);default:return ce(ae,t)}}set(t,e,r){return e.timestampIsSet?t:C(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Ct{priority=40;parse(t){return de(t)}set(t,e,r){return[C(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Ct{priority=20;parse(t){return de(t)}set(t,e,r){return[C(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},ke=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Te=/^'([^]*?)'?$/,Me=/''/g,Pe=/\S/,Se=/[a-zA-Z]/;function Ee(t,e,r,n){const o=Object.assign({},W()),a=o.locale??tt,i=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===e)return""===t?j(r):C(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a},c=[new jt],d=e.match(xe).map((t=>{const e=t[0];if(e in vt){return(0,vt[e])(t,a.formatLong)}return t})).join("").match(ke),h=[];for(let n of d){Mt(n)&&Pt(n,e,t),Tt(n)&&Pt(n,e,t);const o=n[0],i=be[o];if(i){const{incompatibleTokens:e}=i;if(Array.isArray(e)){const t=h.find((t=>e.includes(t.token)||t.token===o));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${n}\` at the same time`)}else if("*"===i.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);h.push({token:o,fullToken:n});const s=i.run(t,n,a.match,u);if(!s)return C(r,NaN);c.push(s.setter),t=s.rest}else{if(o.match(Se))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");if("''"===n?n="'":"'"===o&&(n=n.match(Te)[1].replace(Me,"'")),0!==t.indexOf(n))return C(r,NaN);t=t.slice(n.length)}}if(t.length>0&&Pe.test(t))return C(r,NaN);const l=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=j(r);if(isNaN(f.getTime()))return C(r,NaN);const m={};for(const t of l){if(!t.validate(f,u))return C(r,NaN);const e=t.set(f,m,u);Array.isArray(e)?(f=e[0],Object.assign(m,e[1])):f=e}return C(r,f)}var De=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"store-hour",n])}return l(e,t),c(e,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Ee(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Ee(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return _(this.startDateInstance)&&_(this.endDateInstance)?"".concat(At(this.startDateInstance,"p")," - ").concat(At(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}])}(T),Oe=function(t){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"store-location",n])}return l(r,t),c(r,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new e.Collection(this.getAttribute("hours").map((function(t){return new De(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=At(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),a(this,r,[t,e,"store",n])}return l(r,t),c(r,[{key:"getReviews",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",p({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(e){return new M(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",p({store:this.id},r)).then((function(r){return new e.Collection(r.map((function(r){return r.place&&(r.place=new e.Place(r.place)),new Oe(r,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Oe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",r).then((function(r){return new e.Collection(r.map((function(e){return new L(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new L(t,e.adapter)}))}}])}(T),Ae=Array.isArray,He=function(t){function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,r),n instanceof e.Adapter?g(t,t=a(this,r,[{},n,"service-quote",s])):a(this,r,[n,o,"service-quote",s])}return l(r,t),c(r,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new x(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return S(e)||S(r)?null:P(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(s=o(y().mark((function t(n,o,a){var i,s,u,c,d,h,l=this,f=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=f.length>3&&void 0!==f[3]?f[3]:"storefront",d=f.length>4&&void 0!==f[4]&&f[4],null!==(i=n)&&void 0!==i&&i.id&&(n=n.id),null!==(s=o)&&void 0!==s&&s.id&&(o=o.id),null!==(u=a)&&void 0!==u&&u.id&&(a=a.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:n,destination:o,cart:a,config:c,all:d});case 8:if(h=t.sent,!Ae(h)){t.next=11;break}return t.abrupt("return",new e.Collection(h.map((function(t){return new r(t,l.adapter)}))));case 11:return t.abrupt("return",new r(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,r){return s.apply(this,arguments)})}],[{key:"getFromCart",value:(n=o(y().mark((function t(e,n,o,a){var i,s,u,c=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=c.length>4&&void 0!==c[4]?c[4]:"storefront",s=c.length>5&&void 0!==c[5]&&c[5],u=new r(e),t.abrupt("return",u.fetchServiceQuotesFromCart(n,o,a,i,s));case 4:case"end":return t.stop()}}),t)}))),function(t,e,r,o){return n.apply(this,arguments)})}]);var n,s}(e.ServiceQuote);new e.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,r,n,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return e.isResource(t)&&(t=t.id),e.isResource(r)&&(r=r.id),e.isResource(n)&&(n=n.id),e.isResource(o)&&(o=o.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),p(p({},a),{},{customer:t,cart:r,serviceQuote:n,gateway:o}),i)},captureOrder:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:t,transactionDetails:r},n).then((function(t){return new e.Order(t)}))},createStripeSetupIntent:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.isResource(t)&&(t=t.id),this.adapter.post("".concat(this.namespace,"/stripe-setup-intent"),{customer:t},r)},updateStripePaymentIntent:function(t,r,n,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return e.isResource(r)&&(r=r.id),e.isResource(n)&&(n=n.id),e.isResource(o)&&(o=o.id),this.adapter.put("".concat(this.namespace,"/stripe-update-payment-intent"),p({paymentIntent:t,customer:r,cart:n,serviceQuote:o},a),i)}});var Ne=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(this,e),a(this,e,[t,r,"checkout",n])}return l(e,t),c(e,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}])}(T),Le={Product:E,Category:D,Customer:q,Cart:N,DeliveryServiceQuote:He,Store:qe,StoreLocation:Oe,StoreHour:De,Checkout:Ne,Review:M},je={BrowserAdapter:e.BrowserAdapter,NodeAdapter:e.NodeAdapter};var Ce=function(){return c((function t(){return i(this,t),this.resources=Le,this.adapters=je,this.lookup.apply(this,arguments)}),[{key:"lookup",value:function(t,r){var n=e.pluralize(t),o=r.split(/[^a-zA-Z0-9]/).filter(Boolean).map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(""),a=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][o])throw new Error("No ".concat(e.singularize(t)," named ").concat(r," (").concat(o,") to resolve"));return s(this[n][o],v(a))}}])}(),Ye=function(){return s(Ce,Array.prototype.slice.call(arguments))};t.Resolver=Ce,t.default=Ce,t.lookup=Ye,t.resources=Le})); +//# sourceMappingURL=resolver.min.js.map diff --git a/dist/@fleetbase/storefront/resolver.min.js.map b/dist/@fleetbase/storefront/resolver.min.js.map new file mode 100644 index 0000000..1bb9cc2 --- /dev/null +++ b/dist/@fleetbase/storefront/resolver.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolver.min.js","sources":["../../../src/store.js","../../../src/resource.js","../../../src/resources/review.js","../../../src/utils/format-currency.js","../../../src/utils/is-empty.js","../../../src/resources/product.js","../../../src/resources/category.js","../../../src/resources/customer.js","../../../src/utils/is-phone.js","../../../src/resources/cart.js","../../../src/resources/payment-gateway.js","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/toDate.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructFrom.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/addDays.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constants.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/defaultOptions.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeek.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeek.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeekYear.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfDay.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isValid.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isDate.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDayOfYear.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInCalendarDays.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfYear.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeek.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeekYear.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeekYear.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeek.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeekYear.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/formatters.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/longFormatters.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/protectedTokens.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/format.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/Setter.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/transpose.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/Parser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/constants.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/utils.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setDay.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setISODay.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISODay.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setWeek.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setISOWeek.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDefaultOptions.mjs","../../../src/resources/store-hour.js","../../../src/resources/store-location.js","../../../src/resources/store.js","../../../src/resources/delivery-service-quote.js","../../../src/resources/checkout.js","../../../src/resolver.js"],"sourcesContent":["import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n\n getStripeEphemeralKey(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-ephemeral-key', params);\n }\n\n getStripeSetupIntent(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-setup-intent', params);\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { toDate } from \"../toDate.mjs\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(date.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n const timestamp = date.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.trunc(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { longFormatters, parsers };\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst objectToParams = (obj = {}, prefix = null) => {\n if (obj === null || obj === undefined) {\n return {};\n }\n\n const parsed = {};\n const keys = Object.keys(obj);\n\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n const value = obj[key];\n\n if (key && value) {\n if (prefix && typeof prefix === 'string') {\n parsed[`${prefix}[${key}]`] = value;\n continue;\n }\n\n parsed[key] = value;\n }\n }\n\n return parsed;\n};\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n\n createStripeSetupIntent: function (customer, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n return this.adapter.post(`${this.namespace}/stripe-setup-intent`, { customer }, options);\n },\n\n updateStripePaymentIntent: function (paymentIntent, customer, cart, serviceQuote, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n return this.adapter.put(`${this.namespace}/stripe-update-payment-intent`, { paymentIntent, customer, cart, serviceQuote, ...orderOptions }, options);\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nexport const resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nfunction toStudlyCase(str) {\n return str\n .split(/[^a-zA-Z0-9]/) // Split by non-alphanumeric characters\n .filter(Boolean) // Remove empty elements\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize the first letter of each word\n .join(''); // Join the words together without spaces\n}\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const classKey = toStudlyCase(className);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][classKey]) {\n throw new Error(`No ${singularize(type)} named ${className} (${classKey}) to resolve`);\n }\n\n return new this[key][classKey](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n\nexport default Resolver;\n"],"names":["StorefrontStore","_Store","_classCallCheck","_callSuper","this","arguments","_inherits","_createClass","key","value","actions","length","undefined","extendStoreActions","json","lookup","classify","resource","adapter","Store","StorefrontResource","_Resource","_this$options","store","onAfterFetch","syncAttributes","bind","options","Resource","StoreActions","count","storeId","params","get","concat","namespace","Review","attributes","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","apply","_performAuthorizedRequest","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_getSavedPlaces","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_getOrderHistory","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","call","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","trunc","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","dayOfYearTokenRE","weekYearTokenRE","throwTokens","isProtectedDayOfYearToken","isProtectedWeekYearToken","warnOrThrowProtectedError","input","_message","subject","message","warn","includes","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","originalDate","parts","substring","firstCharacter","longFormatter","join","isToken","cleanEscapedString","preprocessor","formatterOptions","part","formatter","matched","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","floor","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","fullToken","push","indexOf","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","storeLocations","place","_this4","gateways","_this5","DeliveryServiceQuote","_ServiceQuote","Adapter","_possibleConstructorReturn","_fetchServiceQuotesFromCart","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","_args","serviceQuote","_x3","_getFromCart","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","ServiceQuote","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","createStripeSetupIntent","updateStripePaymentIntent","paymentIntent","Checkout","_this$store","_this$store2","resources","adapters","BrowserAdapter","NodeAdapter","Resolver","className","pluralize","classKey","Boolean","word","charAt","singularize","_construct","_toConsumableArray"],"mappings":"i9UACoC,IAEfA,WAAeC,GAChC,SAAAD,IAAc,OAAAE,OAAAF,GAAAG,EAAAC,KAAAJ,EACDK,UACb,CAAC,OAAAC,EAAAN,EAAAC,GAAAM,EAAAP,EAAA,CAAA,CAAAQ,IAAA,gBAAAC,MAED,WAA4B,IAAdC,EAAOL,UAAAM,OAAA,QAAAC,IAAAP,UAAA,GAAAA,UAAA,GAAG,GACpB,OAAOQ,EAAkBA,mBAACT,KAAMM,EACpC,GAAC,CAAAF,IAAA,YAAAC,MAED,SAAUK,GACN,OAAOC,GAAO,WAAYC,WAASZ,KAAKa,UAAWH,EAAMV,KAAKc,QAClE,IAAC,EAXwCC,SCAxBC,WAAkBC,GAAA,SAAAD,IAAA,OAAAlB,OAAAkB,GAAAjB,EAAAC,KAAAgB,EAAAf,UAAA,CAAA,OAAAC,EAAAc,EAAAC,GAAAd,EAAAa,EAAA,CAAA,CAAAZ,IAAA,aAAAC,MAOnC,SAAWS,GAAS,IAAAI,EAOhB,OANAl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c,MAAA4B,UAAA4G,MAAA1G,KAAI5J,WAC3B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file diff --git a/dist/cjs/resolver.js b/dist/cjs/resolver.js new file mode 100644 index 0000000..5acc196 --- /dev/null +++ b/dist/cjs/resolver.js @@ -0,0 +1,2 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./store-C9rG6_hX.js");require("@fleetbase/sdk"),exports.Resolver=e.Resolver,exports.default=e.Resolver,exports.lookup=e.lookup,exports.resources=e.resources; +//# sourceMappingURL=resolver.js.map diff --git a/dist/cjs/resolver.js.map b/dist/cjs/resolver.js.map new file mode 100644 index 0000000..0a3a873 --- /dev/null +++ b/dist/cjs/resolver.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolver.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/cjs/store-1208b91a.js b/dist/cjs/store-1208b91a.js new file mode 100644 index 0000000..4a080fa --- /dev/null +++ b/dist/cjs/store-1208b91a.js @@ -0,0 +1,2 @@ +"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e=t(require("axios"));function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function r(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(L(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat(N(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var a=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return G(t,a,n)},V=function(t,e,n){return z(t,e,0,[n]),n},tt=function(t){R(n,j(Array));var e=$(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return Q(this,0)}},{key:"last",get:function(){return Q(this,this.length-1)}},{key:"replace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return z(this,t,e,n),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return Q(e,t)}))}},{key:"objectAt",value:function(t){return Q(this,t)}},{key:"indexOf",value:function(t,e){return Z(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(Q(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==Z(this,t,e,!0)}},{key:"findBy",value:function(){return X(this,B.apply(void 0,arguments))}},{key:"findIndexBy",value:function(){return G(this,B.apply(void 0,arguments))}},{key:"isEvery",value:function(){return J(this,B.apply(void 0,arguments))}},{key:"isAny",value:function(){return K(this,B.apply(void 0,arguments))}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:W,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return V(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return z(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=Q(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=Q(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return V(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;)Q(this,e)===t&&this.removeAt(e);return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),et=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=x(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1},nt=function(t){return et(t)||"string"==typeof t&&!1===/\S/.test(t)};function rt(t){return t instanceof dt}var it=function(){var t,e,n,r,i;return!("undefined"==typeof process||"object"!==x(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(r=window)||void 0===r||null===(i=r.navigator)||void 0===i?void 0:i.product))},at=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return it()?Rt("adapter","NodeAdapter",t):Rt("adapter","BrowserAdapter",t)},ot=Array.isArray;!function(){function t(e){A(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}D(t,[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=k(k({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}])}();var ut=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;A(this,t),this.type="Point",this.coordinates=[n,e]}return D(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=H(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}();"undefined"==typeof arguments||arguments;var st=function(t,e){var n=t();return Array.isArray(n)||"object"===x(n)?ct(n,e):null},ct=function t(e,n){var r,i=e,a=x(e),o="object"===a,u="function"===a,s=Array.isArray(e),c="string"===x(n)&&n.includes(".")?n.split("."):[n];if(s||o){for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;A(this,t),this.actions=e,this.bind=n}return D(t,[{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&"object"===x(this.actions))for(var n in this.actions){var r=this.actions[n];ht(e,n,"function"==typeof r?r.bind(e):r)}return this}}]),t}(),dt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};A(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}return D(t,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Pt(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return et(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===x(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return ht(this.attributes,t,n),ht(this.dirtyAttributes,t,r),L(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=ct(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(L(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return L(t)?this.hasAttribute(t)&&t.every((function(t){return!et(e.getAttribute(t))})):this.hasAttribute(t)&&!et(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!L(t))throw new Error("No attribute properties provided!");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=k(k({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),ft=new lt({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),{},e)}}),vt=function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"order",k({actions:ft},i))}return D(n,[{key:"getDistanceAndTime",value:function(){return this.store.getDistanceAndTime(this.id)}}]),n}(),gt=function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"payload",i)}return D(n,[{key:"attach",value:function(t){}},{key:"entities",get:function(){}},{key:"dropoff",get:function(){}},{key:"pickup",get:function(){}},{key:"waypoints",get:function(){return new tt(this.waypoints)}}]),n}();!function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"entity",i)}}();var pt=function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"place",i)}return D(n,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new ut))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new ut))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return rt(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute("coordinates"),a=H(i,2),o=a[0],u=a[1],s={name:null,address:t.getAttribute("address"),location:new ut(o,u),street1:t.getAttribute("streetName"),street2:null,city:t.getAttribute("city"),province:t.getAttribute("stateLong"),postal_code:t.getAttribute("postalCode"),neighborhood:t.get("neighborhood"),district:t.getAttribute("county"),building:t.get("building"),country:t.getAttribute("countryShort"),phone:null,security_access_code:null};return new n(s,e,r)}}]),n}();!function(t){R(n,pt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"waypoint",i)}}(),function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"tracking-status",i)}}(),function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"vehicle",i)}}(),function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"driver",i)}}(),function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"vendor",i)}}(),function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"contact",i)}}(),function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"zone",i)}}(),function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"service-area",i)}}(),function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"service-rate",i)}}();var yt=function(t){R(n,dt);var e=$(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,n),e.call(this,t,r,"service-quote",i)}return D(n,[{key:"fromPreliminary",value:function(){}},{key:"fromPayload",value:function(){}}]),n}(),mt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};A(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},wt=function(t){R(n,mt);var e=$(n);function n(t){var r;return A(this,n),(r=e.call(this,t)).setHeaders({Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),r}return D(n,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=k(k({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(a,o){return fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),k({method:n,mode:i.mode||"cors",headers:new Headers(k(k({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){return t.ok?a(t.json):o(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){o(t)}))}))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=nt(e)?"":new URLSearchParams(e).toString();return this.request("".concat(t).concat(r?"?".concat(r):""),"GET",{},n)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}]),n}(),bt=function(t){R(r,mt);var n=$(r);function r(t){var i;return A(this,r),(i=n.call(this,t)).axios=e.default.create({baseURL:"".concat(i.host,"/").concat(i.namespace),headers:{Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),i}return D(r,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=k(k({},e),t),this}},{key:"transform",value:function(t){return t.data}},{key:"handleError",value:function(t){if(t.response){var e=t.response.data;if(L(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=nt(e)?"":new URLSearchParams(e).toString();return this.axios.get("".concat(t).concat(r?"?".concat(r):""),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),r}(),kt=function(t){R(n,mt);var e=$(n);function n(){return A(this,n),e.apply(this,arguments)}return n}(),xt=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];A(this,t),S(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),S(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),S(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),S(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),S(this,"idSuffix",new RegExp("(_ids|_id)$","g")),S(this,"underbar",new RegExp("_","g")),S(this,"spaceOrUnderbar",new RegExp("[ _]","g")),S(this,"uppercase",new RegExp("([A-Z])","g")),S(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return D(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=L(e)?e:[e],!L(e))return e instanceof lt&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};A(this,t),this.resource=e,this.adapter=n||at(),this.namespace=Tt(e),this.storage=new tt,this.options=r,this.extendActions(r.actions)}return D(t,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ot(this,t)}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return Rt("resource",At(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),L(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=C(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"update",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=C(regeneratorRuntime.mark((function i(a,o){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put("".concat(e.namespace,"/").concat(t),n,r).then(e.afterFetch.bind(e)).catch(o);case 2:u=i.sent,a(u);case 4:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:"findRecord",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=C(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get("".concat(e.namespace,"/").concat(t),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"findAll",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=C(regeneratorRuntime.mark((function n(r,i){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get("".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:a=n.sent,r(a);case 4:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:"query",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=C(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"queryRecord",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=C(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"destroy",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=rt(t)?t.getAttribute("id"):t;return new Promise(function(){var t=C(regeneratorRuntime.mark((function t(i,a){var o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete("".concat(e.namespace,"/").concat(r),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=t.sent,i(o);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}();!function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(A(this,t),this.version=n.version||"v1",this.options={version:this.version,host:n.host||"https://api.fleetbase.io",namespace:this.version||n.namespace,debug:r,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!it()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=n.adapter||at(this.options),this.orders=new Pt("order",this.adapter).extendActions(ft),this.entities=new Pt("entity",this.adapter),this.places=new Pt("place",this.adapter),this.drivers=new Pt("driver",this.adapter),this.vehicles=new Pt("vehicle",this.adapter),this.vendors=new Pt("vendor",this.adapter),this.contacts=new Pt("contact",this.adapter)}D(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return M(t,Array.prototype.slice.call(arguments))}}])}();var Ut=function(t){l(n,dt);var e=y(n);function n(){return u(this,n),e.apply(this,arguments)}return c(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new tr(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}}]),n}(),Mt=new lt({count:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),jt=function(t){l(n,Ut);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"review",i)}return c(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}(),qt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t)};function $t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var Ht=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=i(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var a=t.length;if("number"==typeof a)return!a}return!1},Nt=function(t){l(n,Ut);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"product",i)}return c(n,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,n=t.sale_price,r=t.currency;return this.isOnSale?Ht(n)||Ht(r)?null:$t(n/100,r):Ht(e)||Ht(r)?null:$t(e/100,r)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new tt(e.map((function(e){return new jt(e,t.adapter)})))}))}}]),n}(),Yt=function(t){l(n,Ut);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"category",i)}return c(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new tt(e.map((function(e){return new Nt(e,t.adapter)})))}))}}]),n}(),Ft=new lt({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(qt(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",r({identity:t,password:e},n)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",r({identity:t,code:e},n)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",r({identity:t,code:e},n)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),Lt=function(t){l(h,Ut);var e,n,i,a,s=y(h);function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,h),s.call(this,t,e,"customer",r({actions:Ft},n))}return c(h,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new tr(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(a=o(regeneratorRuntime.mark((function t(e){var n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return n})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=o(regeneratorRuntime.mark((function t(e){var n,r,i,a,o=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:"GET",t.prev=2,i={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(i)[r.toLowerCase()](e,n);case 6:return a=t.sent,t.abrupt("return",a);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(r," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(n=o(regeneratorRuntime.mark((function t(){var e,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return e=t.sent,t.abrupt("return",new tt(e.map((function(t){return new pt(t,n.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return n.apply(this,arguments)})},{key:"getOrderHistory",value:(e=o(regeneratorRuntime.mark((function t(){var e,n,r=this,i=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",e);case 4:return n=t.sent,t.abrupt("return",new tt(n.map((function(t){return new vt(t,r.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return e.apply(this,arguments)})},{key:"getStripeEphemeralKey",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-ephemeral-key",t)}},{key:"getStripeSetupIntent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-setup-intent",t)}}]),h}(),_t=Array.isArray,zt=new lt({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},i),{},{quantity:n}),a).then(this.afterFetch.bind(this))},update:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},i),{},{quantity:n}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),Wt=function(t){l(n,Ut);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,i,"cart",r({actions:zt},a))}return c(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof Nt&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!_t(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),n}(),It=function(t){l(n,Ut);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"payment-gateway",i)}return c(n,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),n}();function Qt(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Bt(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function Gt(t){Bt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(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 Xt(t,e){Bt(2,arguments);var n=Gt(t).getTime(),r=Qt(e);return new Date(n+r)}function Kt(t){var 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 Jt(t){return Bt(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function Zt(t){if(Bt(1,arguments),!Jt(t)&&"number"!=typeof t)return!1;var e=Gt(t);return!isNaN(Number(e))}var Vt={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"}},te=function(t,e,n){var r,i=Vt[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ee(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var ne={date:ee({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ee({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ee({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},re={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ie(t){return function(e,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=i.width?String(i.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var u=t.defaultWidth,s=i.width?String(i.width):t.defaultWidth;r=t.values[s]||t.values[u]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function ae(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],a=e.match(i);if(!a)return null;var o,u=a[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?ue(s,(function(t){return t.test(u)})):oe(s,(function(t){return t.test(u)}));o=t.valueCallback?t.valueCallback(c):c,o=n.valueCallback?n.valueCallback(o):o;var h=e.slice(u.length);return{value:o,rest:h}}}function oe(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function ue(t,e){for(var n=0;n20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ie({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ie({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ie({values:{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"]},defaultWidth:"wide"}),day:ie({values:{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"]},defaultWidth:"wide"}),dayPeriod:ie({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(se={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(se.matchPattern);if(!n)return null;var r=n[0],i=t.match(se.parsePattern);if(!i)return null;var a=se.valueCallback?se.valueCallback(i[0]):i[0];a=e.valueCallback?e.valueCallback(a):a;var o=t.slice(r.length);return{value:a,rest:o}}),era:ae({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ae({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ae({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:ae({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:ae({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function he(t,e){Bt(2,arguments);var n=Qt(e);return Xt(t,-n)}function le(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?n:1-n;return le("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):le(n+1,2)},d:function(t,e){return le(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return le(t.getUTCHours()%12||12,e.length)},H:function(t,e){return le(t.getUTCHours(),e.length)},m:function(t,e){return le(t.getUTCMinutes(),e.length)},s:function(t,e){return le(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return le(Math.floor(r*Math.pow(10,n-3)),e.length)}};function fe(t){Bt(1,arguments);var e=1,n=Gt(t),r=n.getUTCDay(),i=(r=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function ge(t){Bt(1,arguments);var e=ve(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=fe(n);return r}function pe(t){Bt(1,arguments);var e=Gt(t),n=fe(e).getTime()-ge(e).getTime();return Math.round(n/6048e5)+1}function ye(t,e){Bt(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,a=null==i?0:Qt(i),o=null==n.weekStartsOn?a:Qt(n.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Gt(t),s=u.getUTCDay(),c=(s=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(r+1,0,s),c.setUTCHours(0,0,0,0);var h=ye(c,e),l=new Date(0);l.setUTCFullYear(r,0,s),l.setUTCHours(0,0,0,0);var d=ye(l,e);return n.getTime()>=h.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function we(t,e){Bt(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,a=null==i?1:Qt(i),o=null==n.firstWeekContainsDate?a:Qt(n.firstWeekContainsDate),u=me(t,e),s=new Date(0);s.setUTCFullYear(u,0,o),s.setUTCHours(0,0,0,0);var c=ye(s,e);return c}function be(t,e){Bt(1,arguments);var n=Gt(t),r=ye(n,e).getTime()-we(n,e).getTime();return Math.round(r/6048e5)+1}var ke="midnight",xe="noon",Te="morning",Ce="afternoon",Ae="evening",Ee="night",De={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return de.y(t,e)},Y:function(t,e,n,r){var i=me(t,r),a=i>0?i:1-i;return"YY"===e?le(a%100,2):"Yo"===e?n.ordinalNumber(a,{unit:"year"}):le(a,e.length)},R:function(t,e){return le(ve(t),e.length)},u:function(t,e){return le(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return le(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return le(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return de.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return le(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=be(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):le(i,e.length)},I:function(t,e,n){var r=pe(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):le(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):de.d(t,e)},D:function(t,e,n){var r=function(t){Bt(1,arguments);var e=Gt(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):le(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":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"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return le(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return le(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return le(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){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"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?xe:0===i?ke:i/12>=1?"pm":"am",e){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"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?Ae:i>=12?Ce:i>=4?Te:Ee,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return de.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):de.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):le(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):le(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):de.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):de.s(t,e)},S:function(t,e){return de.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return Re(i);case"XXXX":case"XX":return Oe(i);default:return Oe(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return Re(i);case"xxxx":case"xx":return Oe(i);default:return Oe(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Se(i,":");default:return"GMT"+Oe(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Se(i,":");default:return"GMT"+Oe(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return le(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return le((r._originalDate||t).getTime(),e.length)}};function Se(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),a=r%60;if(0===a)return n+String(i);var o=e||"";return n+String(i)+o+le(a,2)}function Re(t,e){return t%60==0?(t>0?"-":"+")+le(Math.abs(t)/60,2):Oe(t,e)}function Oe(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+le(Math.floor(i/60),2)+n+le(i%60,2)}var Pe=De;function Ue(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}}function Me(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}}var je={p:Me,P:function(t,e){var n,r=t.match(/(P+)(p+)?/),i=r[1],a=r[2];if(!a)return Ue(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",Ue(i,e)).replace("{{time}}",Me(a,e))}},qe=je,$e=["D","DD"],He=["YY","YYYY"];function Ne(t){return-1!==$e.indexOf(t)}function Ye(t){return-1!==He.indexOf(t)}function Fe(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Le=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ze=/^'([^]*?)'?$/,We=/''/g,Ie=/[a-zA-Z]/;function Qe(t,e,n){Bt(2,arguments);var r=String(e),i=n||{},a=i.locale||ce,o=a.options&&a.options.firstWeekContainsDate,u=null==o?1:Qt(o),s=null==i.firstWeekContainsDate?u:Qt(i.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,h=null==c?0:Qt(c),l=null==i.weekStartsOn?h:Qt(i.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=Gt(t);if(!Zt(d))throw new RangeError("Invalid time value");var f=Kt(d),v=he(d,f),g={firstWeekContainsDate:s,weekStartsOn:l,locale:a,_originalDate:d},p=r.match(_e).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,qe[e])(t,a.formatLong,g):t})).join("").match(Le).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return Be(n);var o=Pe[r];if(o)return!i.useAdditionalWeekYearTokens&&Ye(n)&&Fe(n,e,t),!i.useAdditionalDayOfYearTokens&&Ne(n)&&Fe(n,e,t),o(v,n,a.localize,g);if(r.match(Ie))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return p}function Be(t){return t.match(ze)[1].replace(We,"'")}function Ge(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Xe(t,e,n){Bt(2,arguments);var r=n||{},i=r.locale,a=i&&i.options&&i.options.weekStartsOn,o=null==a?0:Qt(a),u=null==r.weekStartsOn?o:Qt(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Gt(t),c=Qt(e),h=s.getUTCDay(),l=c%7,d=(l+7)%7,f=(d0,i=r?e:1-e;if(i<=50)n=t||100;else{var a=i+50;n=t+100*Math.floor(a/100)-(t>=a%100?100:0)}return r?n:1-n}var Sn=[31,28,31,30,31,30,31,31,30,31,30,31],Rn=[31,29,31,30,31,30,31,31,30,31,30,31];function On(t){return t%400==0||t%4==0&&t%100!=0}var Pn={G:{priority:140,parse:function(t,e,n,r){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}},set:function(t,e,n,r){return e.era=n,t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return Cn(4,t,i);case"yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Cn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=t.getUTCFullYear();if(n.isTwoDigitYear){var a=Dn(n.year,i);return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return Cn(4,t,i);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Cn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=me(t,r);if(n.isTwoDigitYear){var a=Dn(n.year,i);return t.setUTCFullYear(a,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),ye(t,r)}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),ye(t,r)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,n,r){return An("R"===e?4:e.length,t)},set:function(t,e,n,r){var i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),fe(i)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,n,r){return An("u"===e?4:e.length,t)},set:function(t,e,n,r){return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,n,r){switch(e){case"Q":case"QQ":return Cn(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,n,r){switch(e){case"q":case"qq":return Cn(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"M":return kn(Ke,t,i);case"MM":return Cn(2,t,i);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"L":return kn(Ke,t,i);case"LL":return Cn(2,t,i);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,n,r){switch(e){case"w":return kn(Ve,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return Cn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return ye(function(t,e,n){Bt(2,arguments);var r=Gt(t),i=Qt(e),a=be(r,n)-i;return r.setUTCDate(r.getUTCDate()-7*a),r}(t,n,r),r)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,n,r){switch(e){case"I":return kn(Ve,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return Cn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return fe(function(t,e){Bt(2,arguments);var n=Gt(t),r=Qt(e),i=pe(n)-r;return n.setUTCDate(n.getUTCDate()-7*i),n}(t,n,r),r)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"d":return kn(Je,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return Cn(e.length,t)}},validate:function(t,e,n){var r=On(t.getUTCFullYear()),i=t.getUTCMonth();return r?e>=1&&e<=Rn[i]:e>=1&&e<=Sn[i]},set:function(t,e,n,r){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"D":case"DD":return kn(Ze,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return Cn(e.length,t)}},validate:function(t,e,n){return On(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n,r){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,n,r){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Xe(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return Cn(e.length,t,i);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Xe(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return Cn(e.length,t,i);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Xe(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,n,r){var i=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return Cn(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});default:return n.day(t,{width:"wide",context:"formatting",valueCallback:i})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n,r){return t=function(t,e){Bt(2,arguments);var n=Qt(e);n%7==0&&(n-=7);var r=1,i=Gt(t),a=i.getUTCDay(),o=((n%7+7)%7=1&&e<=12},set:function(t,e,n,r){var i=t.getUTCHours()>=12;return i&&n<12?t.setUTCHours(n+12,0,0,0):i||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,n,r){switch(e){case"H":return kn(tn,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return Cn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n,r){return t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,n,r){switch(e){case"K":return kn(nn,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return Cn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,n,r){switch(e){case"k":return kn(en,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return Cn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n,r){var i=n<=24?n%24:n;return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,n,r){switch(e){case"m":return kn(an,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return Cn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCMinutes(n,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,n,r){switch(e){case"s":return kn(on,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return Cn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCSeconds(n,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,n,r){return Cn(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,n,r){return t.setUTCMilliseconds(n),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,n,r){switch(e){case"X":return xn(pn,t);case"XX":return xn(yn,t);case"XXXX":return xn(mn,t);case"XXXXX":return xn(bn,t);default:return xn(wn,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,n,r){switch(e){case"x":return xn(pn,t);case"xx":return xn(yn,t);case"xxxx":return xn(mn,t);case"xxxxx":return xn(bn,t);default:return xn(wn,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,n,r){return Tn(t)},set:function(t,e,n,r){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,n,r){return Tn(t)},set:function(t,e,n,r){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}},Un=Pn,Mn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qn=/^'([^]*?)'?$/,$n=/''/g,Hn=/\S/,Nn=/[a-zA-Z]/;function Yn(t,e,n,r){Bt(3,arguments);var i=String(t),a=String(e),o=r||{},u=o.locale||ce;if(!u.match)throw new RangeError("locale must contain match property");var s=u.options&&u.options.firstWeekContainsDate,c=null==s?1:Qt(s),h=null==o.firstWeekContainsDate?c:Qt(o.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=u.options&&u.options.weekStartsOn,d=null==l?0:Qt(l),f=null==o.weekStartsOn?d:Qt(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===a)return""===i?Gt(n):new Date(NaN);var v,g={firstWeekContainsDate:h,weekStartsOn:f,locale:u},p=[{priority:10,subPriority:-1,set:Fn,index:0}],y=a.match(jn).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,qe[e])(t,u.formatLong,g):t})).join("").match(Mn),m=[];for(v=0;v0&&Hn.test(i))return new Date(NaN);var D=p.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return p.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),S=Gt(n);if(isNaN(S))return new Date(NaN);var R=he(S,Kt(S)),O={};for(v=0;v0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"store-hour",i)}return c(n,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,n=Math.abs(t-e);return Math.floor(n/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Yn(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Yn(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return Zt(this.startDateInstance)&&Zt(this.endDateInstance)?"".concat(Qe(this.startDateInstance,"p")," - ").concat(Qe(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),n}(),zn=function(t){l(n,Ut);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"store-location",i)}return c(n,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new tt(this.getAttribute("hours").map((function(t){return new _n(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Qe(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"store",i)}return c(n,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",r({store:this.id},e)).then((function(e){return new tt(e.map((function(e){return new jt(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",r({store:this.id},e)).then((function(e){return new tt(e.map((function(e){return e.place&&(e.place=new pt(e.place)),new zn(e,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new zn(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",e).then((function(e){return new tt(e.map((function(e){return new It(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new It(t,e.adapter)}))}}]),n}(),In=Array.isArray,Qn=function(t){l(i,yt);var e,n,r=y(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,i),e instanceof mt?p(t,t=r.call(this,{},e,"service-quote",a)):r.call(this,e,n,"service-quote",a)}return c(i,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new tr(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,n=t.currency;return Ht(e)||Ht(n)?null:$t(e/100,n)}},{key:"fetchServiceQuotesFromCart",value:(n=o(regeneratorRuntime.mark((function t(e,n,r){var a,o,u,s,c,h,l=this,d=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=d.length>3&&void 0!==d[3]?d[3]:"storefront",c=d.length>4&&void 0!==d[4]&&d[4],null!==(a=e)&&void 0!==a&&a.id&&(e=e.id),null!==(o=n)&&void 0!==o&&o.id&&(n=n.id),null!==(u=r)&&void 0!==u&&u.id&&(r=r.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:e,destination:n,cart:r,config:s,all:c});case 8:if(h=t.sent,!In(h)){t.next=11;break}return t.abrupt("return",new tt(h.map((function(t){return new i(t,l.adapter)}))));case 11:return t.abrupt("return",new i(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,r){return n.apply(this,arguments)})}],[{key:"getFromCart",value:(e=o(regeneratorRuntime.mark((function t(e,n,r,a){var o,u,s,c=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=c.length>4&&void 0!==c[4]?c[4]:"storefront",u=c.length>5&&void 0!==c[5]&&c[5],s=new i(e),t.abrupt("return",s.fetchServiceQuotesFromCart(n,r,a,o,u));case 4:case"end":return t.stop()}}),t)}))),function(t,n,r,i){return e.apply(this,arguments)})}]),i}(),Bn=new lt({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,e,n,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return rt(t)&&(t=t.id),rt(e)&&(e=e.id),rt(n)&&(n=n.id),rt(i)&&(i=i.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),r(r({},a),{},{customer:t,cart:e,serviceQuote:n,gateway:i}),o)},captureOrder:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:t,transactionDetails:e},n).then((function(t){return new vt(t)}))},createStripeSetupIntent:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rt(t)&&(t=t.id),this.adapter.post("".concat(this.namespace,"/stripe-setup-intent"),{customer:t},e)},updateStripePaymentIntent:function(t,e,n,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return rt(e)&&(e=e.id),rt(n)&&(n=n.id),rt(i)&&(i=i.id),this.adapter.put("".concat(this.namespace,"/stripe-update-payment-intent"),r({paymentIntent:t,customer:e,cart:n,serviceQuote:i},a),o)}}),Gn=function(t){l(n,Ut);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,r,"checkout",i)}return c(n,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),n}(),Xn={Product:Nt,Category:Yt,Customer:Lt,Cart:Wt,DeliveryServiceQuote:Qn,Store:Wn,StoreLocation:zn,StoreHour:_n,Checkout:Gn,Review:jt},Kn={BrowserAdapter:wt,NodeAdapter:bt};function Jn(t){return t.split(/[^a-zA-Z0-9]/).filter(Boolean).map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join("")}var Zn=function(){function t(){return u(this,t),this.resources=Xn,this.adapters=Kn,this.lookup.apply(this,arguments)}return c(t,[{key:"lookup",value:function(t,e){var n=Tt(t),r=Jn(e),i=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][r])throw new Error("No ".concat(Ct(t)," named ").concat(e," (").concat(r,") to resolve"));return g(this[n][r],m(i))}}]),t}(),Vn=function(){return g(Zn,Array.prototype.slice.call(arguments))},tr=function(t){l(n,Pt);var e=y(n);function n(){return u(this,n),e.apply(this,arguments)}return c(n,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ot(this,t)}},{key:"serialize",value:function(t){return Vn("resource",At(this.resource),t,this.adapter)}}]),n}();exports.Cart=Wt,exports.Category=Yt,exports.Checkout=Gn,exports.Customer=Lt,exports.D=tt,exports.DeliveryServiceQuote=Qn,exports.PaymentGateway=It,exports.Product=Nt,exports.Resolver=Zn,exports.Review=jt,exports.Store=Wn,exports.StoreHour=_n,exports.StoreLocation=zn,exports.StorefrontResource=Ut,exports.StorefrontStore=tr,exports.U=it,exports._asyncToGenerator=o,exports._classCallCheck=u,exports._construct=g,exports._createClass=c,exports._createSuper=y,exports._inherits=l,exports._objectSpread2=r,exports.cartActions=zt,exports.checkoutActions=Bn,exports.customerActions=Ft,exports.lookup=Vn,exports.resources=Xn,exports.reviewActions=Mt; +//# sourceMappingURL=store-1208b91a.js.map diff --git a/dist/cjs/store-1208b91a.js.map b/dist/cjs/store-1208b91a.js.map new file mode 100644 index 0000000..9386016 --- /dev/null +++ b/dist/cjs/store-1208b91a.js.map @@ -0,0 +1 @@ +{"version":3,"file":"store-1208b91a.js","sources":["../../node_modules/@fleetbase/sdk/dist/esm/fleetbase.js","../../src/resource.js","../../src/resources/review.js","../../src/utils/is-phone.js","../../src/utils/format-currency.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/date-fns/esm/_lib/toInteger/index.js","../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../node_modules/date-fns/esm/toDate/index.js","../../node_modules/date-fns/esm/addMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","../../node_modules/date-fns/esm/isDate/index.js","../../node_modules/date-fns/esm/isValid/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","../../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","../../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","../../node_modules/date-fns/esm/locale/en-US/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","../../node_modules/date-fns/esm/subMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/format/formatters/index.js","../../node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","../../node_modules/date-fns/esm/_lib/format/longFormatters/index.js","../../node_modules/date-fns/esm/_lib/protectedTokens/index.js","../../node_modules/date-fns/esm/format/index.js","../../node_modules/date-fns/esm/_lib/assign/index.js","../../node_modules/date-fns/esm/_lib/setUTCDay/index.js","../../node_modules/date-fns/esm/parse/_lib/parsers/index.js","../../node_modules/date-fns/esm/_lib/setUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/setUTCISODay/index.js","../../node_modules/date-fns/esm/parse/index.js","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js"],"sourcesContent":["import t from\"axios\";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(A(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat(m(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var o=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return S(t,o,n)},F=function(t,e,n){return $(t,e,0,[n]),n},D=function(t){h(n,g(Array));var e=y(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:\"empty\",get:function(){return 0===this.length}},{key:\"first\",get:function(){return j(this,0)}},{key:\"last\",get:function(){return j(this,this.length-1)}},{key:\"replace\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return $(this,t,e,n),this}},{key:\"objectsAt\",value:function(t){var e=this;return t.map((function(t){return j(e,t)}))}},{key:\"objectAt\",value:function(t){return j(this,t)}},{key:\"indexOf\",value:function(t,e){return L(this,t,e,!1)}},{key:\"lastIndexOf\",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(j(this,r)===t)return r;return-1}},{key:\"includes\",value:function(t,e){return-1!==L(this,t,e,!0)}},{key:\"findBy\",value:function(){return _(this,O.apply(void 0,arguments))}},{key:\"findIndexBy\",value:function(){return S(this,O.apply(void 0,arguments))}},{key:\"isEvery\",value:function(){return z(this,O.apply(void 0,arguments))}},{key:\"isAny\",value:function(){return P(this,O.apply(void 0,arguments))}},{key:\"invoke\",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:R,n=[],r=new Set,i=\"function\"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:\"without\",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:\"clear\",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:\"insertAt\",value:function(t,e){return F(this,t,e),this}},{key:\"replaceAt\",value:function(t,e){return this.replace(t,1,[e])}},{key:\"removeAt\",value:function(t,e){return function(t,e){return $(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:\"pushObject\",value:function(t){return this.insertAt(this.length,t)}},{key:\"pushObjects\",value:function(t){return this.replace(this.length,0,t),this}},{key:\"popObject\",value:function(){var t=this.length;if(0===t)return null;var e=j(this,t-1);return this.removeAt(t-1,1),e}},{key:\"shiftObject\",value:function(){if(0===this.length)return null;var t=j(this,0);return this.removeAt(0),t}},{key:\"unshiftObject\",value:function(t){return F(this,0,t)}},{key:\"unshiftObjects\",value:function(t){return this.replace(0,0,t),this}},{key:\"reverseObjects\",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:\"setObjects\",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:\"removeObject\",value:function(t){for(var e=this.length||0;--e>=0;){j(this,e)===t&&this.removeAt(e)}return this}},{key:\"removeObjects\",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:\"addObject\",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:\"addObjects\",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),C=function(t){var e=null==t;if(e)return e;if(\"number\"==typeof t.size)return!t.size;var n=r(t);if(\"object\"===n){var i=t.size;if(\"number\"==typeof i)return!i}if(\"number\"==typeof t.length&&\"function\"!==n)return!t.length;if(\"object\"===n){var o=t.length;if(\"number\"==typeof o)return!o}return!1},T=function(t){return C(t)||\"string\"==typeof t&&!1===/\\S/.test(t)};function N(t){return isFinite(t)&&Math.abs(t)<=90}function q(t){return isFinite(t)&&Math.abs(t)<=180&&Math.abs(t)>=90}function B(t){return t instanceof Y}var U=function(){var t,e,n,i,o;return!(\"undefined\"==typeof process||\"object\"!==r(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||\"undefined\"!=typeof window&&\"ReactNative\"!==(null===(i=window)||void 0===i||null===(o=i.navigator)||void 0===o?void 0:o.product))},I=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U()?Rt(\"adapter\",\"NodeAdapter\",t):Rt(\"adapter\",\"BrowserAdapter\",t)},J=Array.isArray,K=function(){function t(e){s(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}return a(t,[{key:\"parse\",value:function(){this.parseComponents(),this.parseProperties()}},{key:\"parseComponents\",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:\"parseProperties\",value:function(){var t,e={streetNumber:this.get(\"street_number\"),streetName:this.get(\"route\"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or([\"locality\",\"sublocality\",\"sublocality_level_1\",\"neighborhood\",\"administrative_area_level_3\",\"administrative_area_level_2\"]),county:this.get(\"administrative_area_level_2\"),stateShort:this.get(\"administrative_area_level_1\",!0),stateLong:this.get(\"administrative_area_level_1\"),countryShort:this.get(\"country\",!0),country:this.get(\"country\",!0),countryLong:this.get(\"country\"),postalCode:this.get(\"postal_code\")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(\" \"),e}},{key:\"all\",value:function(){return this.attributes}},{key:\"or\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=n(n({},this.attributes),t),this}},{key:\"setAttribute\",value:function(t,e){return this.attributes[t]=e,this}},{key:\"getAttribute\",value:function(t){return this.attributes[t]||null}}]),t}(),M=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,t),this.type=\"Point\",this.coordinates=[n,e]}return a(t,[{key:\"latitude\",get:function(){return this.coordinates[1]}},{key:\"longitude\",get:function(){return this.coordinates[0]}},{key:\"lat\",value:function(){return this.latitude}},{key:\"lng\",value:function(){return this.longitude}},{key:\"serialize\",value:function(){return{type:\"Point\",coorindates:[this.lat(),this.lng()]}}},{key:\"toJson\",value:function(){return this.serialize()}},{key:\"toString\",value:function(){return\"(\".concat(this.latitude,\", \").concat(this.longitude,\")\")}}],[{key:\"fromGeoJson\",value:function(e){var n=b(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}();\"undefined\"==typeof arguments||arguments;var W=function(t,e){var n=t();return Array.isArray(n)||\"object\"===r(n)?H(n,e):null},H=function t(e,n){var i,o=e,s=r(e),u=\"object\"===s,a=\"function\"===s,c=Array.isArray(e),h=\"string\"===r(n)&&n.includes(\".\")?n.split(\".\"):[n];if(c||u){for(var l=0;l0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(this,t),this.actions=e,this.bind=n}return a(t,[{key:\"extend\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&\"object\"===r(this.actions))for(var n in this.actions){var i=this.actions[n];\"function\"==typeof i?G(e,n,i.bind(e)):G(e,n,i)}return this}}]),t}(),Y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};s(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||\"v1\",this.setAdapter(n)}return a(t,[{key:\"setAdapter\",value:function(t){var e;return this.adapter=t,this.store=new jt(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:\"id\",get:function(){return this.getAttribute(\"id\")}},{key:\"create\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.create(n).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"update\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"destroy\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isDestroying\"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags([\"isLoading\",\"isDestroying\"],!1),e}))}},{key:\"reload\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isReloading\"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:\"setFlags\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[\"isLoading\",\"isSaving\",\"isReloading\",\"isDestroying\"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return C(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:\"saveDirty\",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:\"mutate\",value:function(t,e){this.attributes[t]=e}},{key:\"setAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&\"object\"===r(t))return this.setAttributes(t);var i=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return G(this.attributes,t,n),G(this.dirtyAttributes,t,i),A(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:i,value:n,changedAt:new Date}),this}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:\"getAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=H(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:\"hasAttribute\",value:function(t){if(A(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:\"hasAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:\"isAttributeFilled\",value:function(t){var e=this;return A(t)?this.hasAttribute(t)&&t.every((function(t){return!C(e.getAttribute(t))})):this.hasAttribute(t)&&!C(this.getAttribute(t))}},{key:\"getAttributes\",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if(\"string\"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!A(t))throw new Error(\"No attribute properties provided!\");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=n(n({},r),e),this.attributes}},{key:\"syncAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),Z=new V({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get(\"\".concat(this.namespace,\"/\").concat(t,\"/distance-and-time\"),{},e)}}),Q=function(t){h(r,Y);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,r),e.call(this,t,i,\"order\",n({actions:Z},o))}return a(r,[{key:\"getDistanceAndTime\",value:function(){return this.store.getDistanceAndTime(this.id)}}]),r}(),X=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"payload\",i)}return a(n,[{key:\"attach\",value:function(t){}},{key:\"entities\",get:function(){}},{key:\"dropoff\",get:function(){}},{key:\"pickup\",get:function(){}},{key:\"waypoints\",get:function(){return new D(this.waypoints)}}]),n}(),tt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"entity\",i)}return n}(),et=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"place\",i)}return a(n,[{key:\"latitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[1]}},{key:\"longitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[0]}},{key:\"coordinates\",get:function(){return[this.latitude,this.longitude]}},{key:\"setOwner\",value:function(t){return B(t)&&this.setAttribute(\"owner\",t.id),\"string\"==typeof t&&this.setAttribute(\"owner\",t),this}}],[{key:\"fromGoogleAddress\",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute(\"coordinates\"),o=b(i,2),s=o[0],u=o[1],a={name:null,address:t.getAttribute(\"address\"),location:new M(s,u),street1:t.getAttribute(\"streetName\"),street2:null,city:t.getAttribute(\"city\"),province:t.getAttribute(\"stateLong\"),postal_code:t.getAttribute(\"postalCode\"),neighborhood:t.get(\"neighborhood\"),district:t.getAttribute(\"county\"),building:t.get(\"building\"),country:t.getAttribute(\"countryShort\"),phone:null,security_access_code:null};return new n(a,e,r)}}]),n}(),nt=function(t){h(n,et);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"waypoint\",i)}return n}(),rt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"tracking-status\",i)}return n}(),it=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vehicle\",i)}return n}(),ot=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"driver\",i)}return n}(),st=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vendor\",i)}return n}(),ut=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"contact\",i)}return n}(),at=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"zone\",i)}return n}(),ct=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-area\",i)}return n}(),ht=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-rate\",i)}return n}(),lt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-quote\",i)}return a(n,[{key:\"fromPreliminary\",value:function(){}},{key:\"fromPayload\",value:function(){}}]),n}(),vt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t),this.version=e.version||\"v1\",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},ft=function(t){h(r,vt);var e=y(r);function r(t){var n;return s(this,r),(n=e.call(this,t)).setHeaders({Authorization:\"Bearer \".concat(t.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;browser\"}),n}return a(r,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=n(n({},this.headers),t),this}},{key:\"parseJSON\",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error(\"Oops! Something went wrong when handling your request.\"))}))}))}},{key:\"request\",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"GET\",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(s,u){return fetch(o.url||\"\".concat(e.host,\"/\").concat(e.namespace,\"/\").concat(t),n({method:r,mode:o.mode||\"cors\",headers:new Headers(n(n({},e.headers||{}),o.headers||{}))},i)).then(e.parseJSON).then((function(t){return t.ok?s(t.json):u(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){u(t)}))}))}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.request(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),\"GET\",{},n)}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"POST\",{body:JSON.stringify(e)},n)}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PUT\",{body:JSON.stringify(e)},n)}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,\"DELETE\",{},e)}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PATCH\",{body:JSON.stringify(e)},n)}}]),r}(),dt=function(e){h(i,vt);var r=y(i);function i(e){var n;return s(this,i),(n=r.call(this,e)).axios=t.create({baseURL:\"\".concat(n.host,\"/\").concat(n.namespace),headers:{Authorization:\"Bearer \".concat(e.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;node\"}}),n}return a(i,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=n(n({},e),t),this}},{key:\"transform\",value:function(t){return t.data}},{key:\"handleError\",value:function(t){if(t.response){var e=t.response.data;if(A(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.axios.get(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),i}(),gt=function(t){h(n,vt);var e=y(n);function n(){return s(this,n),e.apply(this,arguments)}return n}(),pt=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s(this,t),c(this,\"uncountableWords\",[\"equipment\",\"information\",\"rice\",\"money\",\"species\",\"series\",\"fish\",\"sheep\",\"moose\",\"deer\",\"news\"]),c(this,\"pluralRules\",[[new RegExp(\"(m)an$\",\"gi\"),\"$1en\"],[new RegExp(\"(pe)rson$\",\"gi\"),\"$1ople\"],[new RegExp(\"(child)$\",\"gi\"),\"$1ren\"],[new RegExp(\"^(ox)$\",\"gi\"),\"$1en\"],[new RegExp(\"(ax|test)is$\",\"gi\"),\"$1es\"],[new RegExp(\"(octop|vir)us$\",\"gi\"),\"$1i\"],[new RegExp(\"(alias|status)$\",\"gi\"),\"$1es\"],[new RegExp(\"(bu)s$\",\"gi\"),\"$1ses\"],[new RegExp(\"(buffal|tomat|potat)o$\",\"gi\"),\"$1oes\"],[new RegExp(\"([ti])um$\",\"gi\"),\"$1a\"],[new RegExp(\"sis$\",\"gi\"),\"ses\"],[new RegExp(\"(?:([^f])fe|([lr])f)$\",\"gi\"),\"$1$2ves\"],[new RegExp(\"(hive)$\",\"gi\"),\"$1s\"],[new RegExp(\"([^aeiouy]|qu)y$\",\"gi\"),\"$1ies\"],[new RegExp(\"(x|ch|ss|sh)$\",\"gi\"),\"$1es\"],[new RegExp(\"(matr|vert|ind)ix|ex$\",\"gi\"),\"$1ices\"],[new RegExp(\"([m|l])ouse$\",\"gi\"),\"$1ice\"],[new RegExp(\"(quiz)$\",\"gi\"),\"$1zes\"],[new RegExp(\"s$\",\"gi\"),\"s\"],[new RegExp(\"$\",\"gi\"),\"s\"]]),c(this,\"singularRules\",[[new RegExp(\"(m)en$\",\"gi\"),\"$1an\"],[new RegExp(\"(pe)ople$\",\"gi\"),\"$1rson\"],[new RegExp(\"(child)ren$\",\"gi\"),\"$1\"],[new RegExp(\"([ti])a$\",\"gi\"),\"$1um\"],[new RegExp(\"((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$\",\"gi\"),\"$1$2sis\"],[new RegExp(\"(hive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(tive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(curve)s$\",\"gi\"),\"$1\"],[new RegExp(\"([lr])ves$\",\"gi\"),\"$1f\"],[new RegExp(\"([^fo])ves$\",\"gi\"),\"$1fe\"],[new RegExp(\"([^aeiouy]|qu)ies$\",\"gi\"),\"$1y\"],[new RegExp(\"(s)eries$\",\"gi\"),\"$1eries\"],[new RegExp(\"(m)ovies$\",\"gi\"),\"$1ovie\"],[new RegExp(\"(x|ch|ss|sh)es$\",\"gi\"),\"$1\"],[new RegExp(\"([m|l])ice$\",\"gi\"),\"$1ouse\"],[new RegExp(\"(bus)es$\",\"gi\"),\"$1\"],[new RegExp(\"(o)es$\",\"gi\"),\"$1\"],[new RegExp(\"(shoe)s$\",\"gi\"),\"$1\"],[new RegExp(\"(cris|ax|test)es$\",\"gi\"),\"$1is\"],[new RegExp(\"(octop|vir)i$\",\"gi\"),\"$1us\"],[new RegExp(\"(alias|status)es$\",\"gi\"),\"$1\"],[new RegExp(\"^(ox)en\",\"gi\"),\"$1\"],[new RegExp(\"(vert|ind)ices$\",\"gi\"),\"$1ex\"],[new RegExp(\"(matr)ices$\",\"gi\"),\"$1ix\"],[new RegExp(\"(quiz)zes$\",\"gi\"),\"$1\"],[new RegExp(\"s$\",\"gi\"),\"\"]]),c(this,\"nonTitlecasedWords\",[\"and\",\"or\",\"nor\",\"a\",\"an\",\"the\",\"so\",\"but\",\"to\",\"of\",\"at\",\"by\",\"from\",\"into\",\"on\",\"onto\",\"off\",\"out\",\"in\",\"over\",\"with\",\"for\"]),c(this,\"idSuffix\",new RegExp(\"(_ids|_id)$\",\"g\")),c(this,\"underbar\",new RegExp(\"_\",\"g\")),c(this,\"spaceOrUnderbar\",new RegExp(\"[ _]\",\"g\")),c(this,\"uppercase\",new RegExp(\"([A-Z])\",\"g\")),c(this,\"underbarPrefix\",new RegExp(\"^_\")),this.str=e,this.chain=n}return a(t,[{key:\"get\",value:function(){return this.str}},{key:\"applyRules\",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:\"singularize\",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:\"camelize\",value:function(t,e){for(var n=(t=t||this.str).split(\"/\"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?\"\":\"_\")+\"id\",this.str=t,!0===this.chain?this:t}},{key:\"ordinalize\",value:function(t){for(var e=(t=t||this.str).split(\" \"),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=A(e)?e:[e],!A(e))return e instanceof V&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};s(this,t),this.resource=e,this.adapter=n||I(),this.namespace=yt(e),this.storage=new D,this.options=r,this.extendActions(r.actions)}return a(t,[{key:\"extendActions\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Et(this,t)}},{key:\"deposit\",value:function(t){return t}},{key:\"serialize\",value:function(t){return Rt(\"resource\",wt(this.resource),t,this.adapter)}},{key:\"afterFetch\",value:function(t){return function(t,e){if(\"function\"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),A(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"update\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=o(regeneratorRuntime.mark((function i(o,s){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put(\"\".concat(e.namespace,\"/\").concat(t),n,r).then(e.afterFetch.bind(e)).catch(s);case 2:u=i.sent,o(u);case 4:case\"end\":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:\"findRecord\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get(\"\".concat(e.namespace,\"/\").concat(t),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"findAll\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=o(regeneratorRuntime.mark((function n(r,i){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get(\"\".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:o=n.sent,r(o);case 4:case\"end\":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:\"query\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"queryRecord\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"destroy\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=B(t)?t.getAttribute(\"id\"):t;return new Promise(function(){var t=o(regeneratorRuntime.mark((function t(i,o){var s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete(\"\".concat(e.namespace,\"/\").concat(r),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=t.sent,i(s);case 4:case\"end\":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}(),Ot=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(s(this,t),this.version=n.version||\"v1\",this.options={version:this.version,host:n.host||\"https://api.fleetbase.io\",namespace:this.version||n.namespace,debug:r,publicKey:e},\"string\"!=typeof e||0===e.length)throw new Error(\"⚠️ Invalid public key given to Fleetbase SDK\");if(!U()&&e.toLowerCase().startsWith(\"$\"))throw new Error(\"Secret key provided. You must use a public key with Fleetbase Javascript SDK!\");this.adapter=n.adapter||I(this.options),this.orders=new jt(\"order\",this.adapter).extendActions(Z),this.entities=new jt(\"entity\",this.adapter),this.places=new jt(\"place\",this.adapter),this.drivers=new jt(\"driver\",this.adapter),this.vehicles=new jt(\"vehicle\",this.adapter),this.vendors=new jt(\"vendor\",this.adapter),this.contacts=new jt(\"contact\",this.adapter)}return a(t,[{key:\"setAdapter\",value:function(t){this.adapter=t}},{key:\"getAdapter\",value:function(){return this.adapter}}],[{key:\"newInstance\",value:function(){return d(t,Array.prototype.slice.call(arguments))}}]),t}();export default Ot;export{vt as Adapter,ft as BrowserAdapter,D as Collection,ut as Contact,ot as Driver,gt as EmberJsAdapter,tt as Entity,K as GoogleAddress,dt as NodeAdapter,Q as Order,X as Payload,et as Place,M as Point,Y as Resource,ct as ServiceArea,lt as ServiceQuote,ht as ServiceRate,jt as Store,V as StoreActions,rt as TrackingStatus,it as Vehicle,st as Vendor,nt as Waypoint,at as Zone,mt as camelize,wt as classify,kt as dasherize,Et as extendStoreActions,N as isLatitude,q as isLongitude,U as isNodeEnvironment,B as isResource,yt as pluralize,bt as singularize};\n//# sourceMappingURL=fleetbase.js.map\n","import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n\n getStripeEphemeralKey(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-ephemeral-key', params);\n }\n\n getStripeSetupIntent(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-setup-intent', params);\n }\n}\n\nexport { customerActions };\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n 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\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\n\nexport default function isDate(value) {\n requiredArgs(1, arguments);\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import isDate from \"../isDate/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now `isValid` doesn't throw an exception\n * if the first argument is not an instance of Date.\n * Instead, argument is converted beforehand using `toDate`.\n *\n * Examples:\n *\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\n * |---------------------------|---------------|---------------|\n * | `new Date()` | `true` | `true` |\n * | `new Date('2016-01-01')` | `true` | `true` |\n * | `new Date('')` | `false` | `false` |\n * | `new Date(1488370835081)` | `true` | `true` |\n * | `new Date(NaN)` | `false` | `false` |\n * | `'2016-01-01'` | `TypeError` | `false` |\n * | `''` | `TypeError` | `false` |\n * | `1488370835081` | `TypeError` | `true` |\n * | `NaN` | `TypeError` | `false` |\n *\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\n * that try to coerce arguments to the expected type\n * (which is also the case with other *date-fns* functions).\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\n\nexport default function isValid(dirtyDate) {\n requiredArgs(1, arguments);\n\n if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(Number(date));\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function (token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\n if (typeof tokenValue === 'string') {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace('{{count}}', count.toString());\n }\n\n if (options !== null && options !== void 0 && options.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return 'in ' + result;\n } else {\n return result + ' ago';\n }\n }\n\n return result;\n};\n\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar timeFormats = {\n full: 'h:mm:ss a zzzz',\n long: 'h:mm:ss a z',\n medium: 'h:mm:ss a',\n short: 'h:mm a'\n};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: 'P'\n};\n\nvar formatRelative = function (token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, dirtyOptions) {\n var options = dirtyOptions || {};\n var context = options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challange you to try to remove it!\n\n return valuesArray[index];\n };\n}","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n 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],\n 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]\n};\nvar matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i\n }\n};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function (index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\n}; // Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar dayValues = {\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar dayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n }\n};\nvar formattingDayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n }\n};\n\nvar ordinalNumber = function (dirtyNumber, _options) {\n var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function (quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nvar formatters = {\n // Year\n y: function (date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate, dirtyOptions);\n var year = date.getUTCFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import toInteger from \"../toInteger/index.js\";\nimport getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import lightFormatters from \"../lightFormatters/index.js\";\nimport getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nvar dayPeriodEnum = {\n am: 'am',\n pm: 'pm',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n};\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\n },\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case 'e':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n }\n\n switch (token) {\n case 'b':\n case 'bb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return 'Z';\n }\n\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n}\n\nfunction timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n}\n\nfunction dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/);\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n}\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'D') {\n throw new RangeError(\"Use `d` instead of `D` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'DD') {\n throw new RangeError(\"Use `dd` instead of `DD` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n }\n}","import isValid from \"../isValid/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport setUTCDay from \"../../../_lib/setUTCDay/index.js\";\nimport setUTCISODay from \"../../../_lib/setUTCISODay/index.js\";\nimport setUTCISOWeek from \"../../../_lib/setUTCISOWeek/index.js\";\nimport setUTCWeek from \"../../../_lib/setUTCWeek/index.js\";\nimport startOfUTCISOWeek from \"../../../_lib/startOfUTCISOWeek/index.js\";\nimport startOfUTCWeek from \"../../../_lib/startOfUTCWeek/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/\n};\n\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'e':\n case 'ee':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'c':\n case 'cc':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCWeek from \"../getUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCISOWeek from \"../getUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport parsers from \"./_lib/parsers/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 0001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward (toDate no longer accepts a string)\n * toDate(1392098430000) // Unix to timestamp\n * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} referenceDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {\n requiredArgs(3, arguments);\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyReferenceDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale\n }; // If timezone isn't specified, it will be set to the system timezone\n\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n subPriority: -1,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n subPriority: parser.subPriority || 0,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).sort(function (a, b) {\n return b.subPriority - a.subPriority;\n });\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyReferenceDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst objectToParams = (obj = {}, prefix = null) => {\n if (obj === null || obj === undefined) {\n return {};\n }\n\n const parsed = {};\n const keys = Object.keys(obj);\n\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n const value = obj[key];\n\n if (key && value) {\n if (prefix && typeof prefix === 'string') {\n parsed[`${prefix}[${key}]`] = value;\n continue;\n }\n\n parsed[key] = value;\n }\n }\n\n return parsed;\n};\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n\n createStripeSetupIntent: function (customer, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n return this.adapter.post(`${this.namespace}/stripe-setup-intent`, { customer }, options);\n },\n\n updateStripePaymentIntent: function (paymentIntent, customer, cart, serviceQuote, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n return this.adapter.put(`${this.namespace}/stripe-update-payment-intent`, { paymentIntent, customer, cart, serviceQuote, ...orderOptions }, options);\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nexport const resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nfunction toStudlyCase(str) {\n return str\n .split(/[^a-zA-Z0-9]/) // Split by non-alphanumeric characters\n .filter(Boolean) // Remove empty elements\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize the first letter of each word\n .join(''); // Join the words together without spaces\n}\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const classKey = toStudlyCase(className);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][classKey]) {\n throw new Error(`No ${singularize(type)} named ${className} (${classKey}) to resolve`);\n }\n\n return new this[key][classKey](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n\nexport default Resolver;\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n"],"names":["isArray","Array","StorefrontResource","Resource","adapter","store","StorefrontStore","this","resource","onAfterFetch","syncAttributes","bind","actions","options","_this$options","reviewActions","StoreActions","count","storeId","params","get","namespace","Review","attributes","isPhone","phone","test","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","length","Product","getAttribute","getAttributes","price","sale_price","isOnSale","id","then","reviews","Collection","map","_this","Category","category","products","customerActions","login","identity","password","post","Error","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","token","setHeaders","endpoint","method","headers","toLowerCase","response","console","error","performAuthorizedRequest","places","Place","_this2","orders","Order","_this3","cartActions","undefined","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toInteger","dirtyNumber","NaN","number","Number","isNaN","Math","ceil","floor","requiredArgs","required","args","TypeError","toDate","argument","arguments","argStr","Object","prototype","toString","call","Date","getTime","warn","stack","addMilliseconds","dirtyDate","dirtyAmount","timestamp","getTimezoneOffsetInMilliseconds","date","utcDate","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isDate","value","isValid","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","result","tokenValue","replace","addSuffix","comparison","buildFormatLongFn","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","dirtyIndex","dirtyOptions","valuesArray","context","formattingValues","defaultFormattingWidth","_defaultWidth","_width","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","key","pattern","findKey","valueCallback","rest","slice","object","predicate","hasOwnProperty","array","formatDistance","formatRelative","_date","_baseDate","_options","localize","ordinalNumber","rem100","era","narrow","abbreviated","wide","quarter","month","day","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","weekStartsOn","firstWeekContainsDate","subMilliseconds","addLeadingZeros","targetLength","sign","output","abs","y","signedYear","getUTCFullYear","year","M","getUTCMonth","d","getUTCDate","a","dayPeriodEnumValue","getUTCHours","toUpperCase","h","H","m","getUTCMinutes","s","getUTCSeconds","S","numberOfDigits","milliseconds","getUTCMilliseconds","pow","startOfUTCISOWeek","getUTCDay","diff","setUTCDate","setUTCHours","getUTCISOWeekYear","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","startOfUTCISOWeekYear","fourthOfJanuary","getUTCISOWeek","round","startOfUTCWeek","locale","localeWeekStartsOn","defaultWeekStartsOn","RangeError","getUTCWeekYear","localeFirstWeekContainsDate","defaultFirstWeekContainsDate","firstWeekOfNextYear","firstWeekOfThisYear","startOfUTCWeekYear","firstWeek","getUTCWeek","dayPeriodEnum","formatters","G","unit","lightFormatters","Y","signedWeekYear","weekYear","R","u","Q","q","L","w","week","I","isoWeek","D","dayOfYear","setUTCMonth","startOfYearTimestamp","difference","getUTCDayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","dirtyDelimiter","absOffset","minutes","delimiter","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeFormat","datePattern","timePattern","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","concat","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","dirtyFormatStr","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","assign","target","dirtyObject","property","setUTCDay","dirtyDay","currentDay","remainder","dayIndex","numericPatterns","timezonePatterns","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","enumValue","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","isLeapYearIndex","parsers","priority","parse","set","flags","incompatibleTokens","isTwoDigitYear","validate","normalizedTwoDigitYear","_match","_flags","firstWeekOfYear","dirtyWeek","setUTCWeek","dirtyISOWeek","setUTCISOWeek","subPriority","isLeapYear","wholeWeekDays","setUTCISODay","isPM","setUTCMinutes","setUTCSeconds","setUTCMilliseconds","timestampIsSet","_token","notWhitespaceRegExp","dirtyDateString","dirtyFormatString","dirtyReferenceDate","dateString","formatString","subFnOptions","setters","dateToSystemTimezone","tokens","usedTokens","parser","incompatibleToken","_i","usedToken","fullToken","push","uniquePrioritySetters","setter","sort","filter","setterArray","convertedDate","setFullYear","setHours","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","gateways","_this4","_this5","DeliveryServiceQuote","ServiceQuote","Adapter","origin","destination","cart","config","all","_origin","_destination","_cart","serviceQuotes","serviceQuote","quote","fetchServiceQuotesFromCart","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","createStripeSetupIntent","updateStripePaymentIntent","paymentIntent","Checkout","resources","adapters","BrowserAdapter","NodeAdapter","toStudlyCase","str","Boolean","word","charAt","Resolver","lookup","className","pluralize","classKey","singularize","extendStoreActions","json","classify"],"mappings":"ovQAAQA,EAAYC,MAAZD,QAAAA,EAAAA,oBAAAA,eAAAA,EAAAA,m0rCCGaE,mBAA2BC,kHAOjCC,qBACFA,QAAUA,OACVC,MAAQ,IAAIC,GAAgBC,KAAKC,SAAUJ,EAAS,CACrDK,aAAcF,KAAKG,eAAeC,KAAKJ,MACvCK,kBAASL,KAAKM,4BAALC,EAAcF,UAGpBL,cCdTQ,GAAgB,IAAIC,GAAa,CACnCC,MAAO,SAAUC,OAASL,yDAAU,GAC1BM,EAAS,UAEXD,IACAC,EAAOd,MAAQa,GAGZX,KAAKH,QAAQgB,cAAOb,KAAKc,oBAAmBF,EAAQN,MAI9CS,mBAAenB,gCACpBoB,yDAAa,GAAInB,yCAASS,yDAAU,gCACtCU,EAAYnB,EAAS,SAAUS,qCAGzC,qCAIA,qCAIA,qBC5BEW,GAAU,eAACC,yDAAQ,SACd,iDAAiDC,KAAKD,ICDlD,SAASE,SAAeC,yDAAS,EAAGC,yDAAW,MAAOC,yDAAkB,gBAC5E,IAAIC,KAAKC,aAAa,QAAS,CAClCC,MAAO,WACPJ,SAAAA,EACAC,gBAAAA,IACDI,OAAON,GCLd,IAAMO,GAAU,SAACC,OACPC,EAAOD,MAAAA,KACTC,SACOA,KAGa,iBAAbD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AAU,UACbwhB,GAAmB7hB,KAAMK,4BAGpC,SAAUyhB,UACCN,GAAO,WAAYO,GAAS/hB,KAAKC,UAAW6hB,EAAM9hB,KAAKH"} \ No newline at end of file diff --git a/dist/cjs/store-C9rG6_hX.js b/dist/cjs/store-C9rG6_hX.js new file mode 100644 index 0000000..1331948 --- /dev/null +++ b/dist/cjs/store-C9rG6_hX.js @@ -0,0 +1,2 @@ +"use strict";var t=require("@fleetbase/sdk");function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:q(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},e}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}function y(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}var x=function(){function e(){return a(this,e),o(this,e,arguments)}return h(e,t.Resource),u(e,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Fe(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}}])}(),k=new t.StoreActions({count:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),T=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,t),o(this,t,[e,r,"review",n])}return h(t,x),u(t,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}])}();function M(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var S=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=b(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var o=t.length;if("number"==typeof o)return!o}return!1},P=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,e),o(this,e,[t,r,"product",n])}return h(e,x),u(e,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?S(r)||S(n)?null:M(r/100,n):S(e)||S(n)?null:M(e/100,n)}},{key:"getReviews",value:function(){var e=this;return this.adapter.get("reviews",{store:this.id}).then((function(r){return new t.Collection(r.map((function(t){return new T(t,e.adapter)})))}))}}])}(),E=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,e),o(this,e,[t,r,"category",n])}return h(e,x),u(e,[{key:"getProducts",value:function(){var e=this;return this.adapter.get("products",{category:this.id}).then((function(r){return new t.Collection(r.map((function(t){return new P(t,e.adapter)})))}))}}])}(),D=new t.StoreActions({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",p({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",p({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",p({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,e),o(this,e,[t,r,"customer",p({actions:D},n)])}return h(e,x),u(e,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Fe(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(c=n(g().mark((function t(e){var r=this;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(s=n(g().mark((function t(e){var r,n,o,a,i=arguments;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},n=i.length>2&&void 0!==i[2]?i[2]:"GET",t.prev=2,o={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(o)[n.toLowerCase()](e,r);case 6:return a=t.sent,t.abrupt("return",a);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return s.apply(this,arguments)})},{key:"getSavedPlaces",value:(i=n(g().mark((function e(){var r,n=this;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.performAuthorizedRequest("customers/places");case 3:return r=e.sent,e.abrupt("return",new t.Collection(r.map((function(e){return new t.Place(e,n.adapter)}))));case 7:throw e.prev=7,e.t0=e.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return i.apply(this,arguments)})},{key:"getOrderHistory",value:(r=n(g().mark((function e(){var r,n,o=this,a=arguments;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},e.prev=1,e.next=4,this.performAuthorizedRequest("customers/orders",r);case 4:return n=e.sent,e.abrupt("return",new t.Collection(n.map((function(e){return new t.Order(e,o.adapter)}))));case 8:throw e.prev=8,e.t0=e.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return r.apply(this,arguments)})},{key:"getStripeEphemeralKey",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-ephemeral-key",t)}},{key:"getStripeSetupIntent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-setup-intent",t)}}]);var r,i,s,c}(),A=Array.isArray,H=new t.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),p(p({},n),{},{quantity:r}),o).then(this.afterFetch.bind(this))},update:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),p(p({},n),{},{quantity:r}),o).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),q=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,t),o(this,t,[e,r,"cart",p({actions:H},n)])}return h(t,x),u(t,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof P&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!A(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}])}(),N=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,t),o(this,t,[e,r,"payment-gateway",n])}return h(t,x),u(t,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}])}();function C(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function L(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function j(t,e){const r=C(t);return isNaN(e)?L(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const Y=6048e5;let F={};function R(){return F}function W(t,e){const r=R(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=C(t),a=o.getDay(),i=(a=o.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function G(t){const e=C(t);return e.setHours(0,0,0,0),e}function _(t){const e=C(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function z(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=C(t);return!isNaN(Number(r))}const B={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"}};function X(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const $={date:X({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:X({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:X({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},K={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Z(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):e;n=t.formattingValues[o]||t.formattingValues[e]}else{const e=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;n=t.values[o]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function J(t){return(e,r={})=>{const n=r.width,o=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(o);if(!a)return null;const i=a[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var U;const V={code:"en-US",formatDistance:(t,e,r)=>{let n;const o=B[t];return n="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:$,formatRelative:(t,e,r,n)=>K[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Z({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Z({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:Z({values:{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"]},defaultWidth:"wide"}),day:Z({values:{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"]},defaultWidth:"wide"}),dayPeriod:Z({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(U={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(U.matchPattern);if(!r)return null;const n=r[0],o=t.match(U.parsePattern);if(!o)return null;let a=U.valueCallback?U.valueCallback(o[0]):o[0];return a=e.valueCallback?e.valueCallback(a):a,{value:a,rest:t.slice(n.length)}}),era:J({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:J({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:J({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:J({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function tt(t){const e=C(t),r=function(t,e){const r=G(t),n=G(e),o=+r-_(r),a=+n-_(n);return Math.round((o-a)/864e5)}(e,function(t){const e=C(t),r=L(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function et(t){const e=C(t),r=+Q(e)-+function(t){const e=I(t),r=L(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),Q(r)}(e);return Math.round(r/Y)+1}function rt(t,e){const r=C(t),n=r.getFullYear(),o=R(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=L(t,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=W(i,e),u=L(t,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const c=W(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function nt(t,e){const r=C(t),n=+W(r,e)-+function(t,e){const r=R(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=rt(t,e),a=L(t,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),W(a,e)}(r,e);return Math.round(n/Y)+1}function ot(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const at={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return ot("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):ot(r+1,2)},d:(t,e)=>ot(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>ot(t.getHours()%12||12,e.length),H:(t,e)=>ot(t.getHours(),e.length),m:(t,e)=>ot(t.getMinutes(),e.length),s:(t,e)=>ot(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return ot(Math.trunc(n*Math.pow(10,r-3)),e.length)}},it="midnight",st="noon",ut="morning",ct="afternoon",dt="evening",ht="night",lt={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return at.y(t,e)},Y:function(t,e,r,n){const o=rt(t,n),a=o>0?o:1-o;if("YY"===e){return ot(a%100,2)}return"Yo"===e?r.ordinalNumber(a,{unit:"year"}):ot(a,e.length)},R:function(t,e){return ot(I(t),e.length)},u:function(t,e){return ot(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return ot(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return ot(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return at.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return ot(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const o=nt(t,n);return"wo"===e?r.ordinalNumber(o,{unit:"week"}):ot(o,e.length)},I:function(t,e,r){const n=et(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):ot(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):at.d(t,e)},D:function(t,e,r){const n=tt(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):ot(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return ot(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return ot(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),o=0===n?7:n;switch(e){case"i":return String(o);case"ii":return ot(o,e.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let o;switch(o=12===n?st:0===n?it:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let o;switch(o=n>=17?dt:n>=12?ct:n>=4?ut:ht,e){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return at.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):at.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):ot(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):ot(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):at.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):at.s(t,e)},S:function(t,e){return at.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(0===n)return"Z";switch(e){case"X":return pt(n);case"XXXX":case"XX":return mt(n);default:return mt(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return pt(n);case"xxxx":case"xx":return mt(n);default:return mt(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ft(n,":");default:return"GMT"+mt(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ft(n,":");default:return"GMT"+mt(n,":")}},t:function(t,e,r){return ot(Math.trunc(t.getTime()/1e3),e.length)},T:function(t,e,r){return ot(t.getTime(),e.length)}};function ft(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),o=Math.trunc(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+e+ot(a,2)}function pt(t,e){if(t%60==0){return(t>0?"-":"+")+ot(Math.abs(t)/60,2)}return mt(t,e)}function mt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+ot(Math.trunc(n/60),2)+e+ot(n%60,2)}const gt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},wt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},yt={p:wt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return gt(t,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"})}return a.replace("{{date}}",gt(n,e)).replace("{{time}}",wt(o,e))}},vt=/^D+$/,bt=/^Y+$/,xt=["D","DD","YY","YYYY"];function kt(t){return vt.test(t)}function Tt(t){return bt.test(t)}function Mt(t,e,r){const n=function(t,e,r){const n="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,r);if(console.warn(n),xt.includes(t))throw new RangeError(n)}const St=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Et=/^'([^]*?)'?$/,Dt=/''/g,Ot=/[a-zA-Z]/;function At(t,e,r){const n=R(),o=n.locale??V,a=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=C(t);if(!z(s))throw new RangeError("Invalid time value");let u=e.match(Pt).map((t=>{const e=t[0];if("p"===e||"P"===e){return(0,yt[e])(t,o.formatLong)}return t})).join("").match(St).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:Ht(t)};if(lt[e])return{isToken:!0,value:t};if(e.match(Ot))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));o.localize.preprocessor&&(u=o.localize.preprocessor(s,u));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return u.map((r=>{if(!r.isToken)return r.value;const n=r.value;(Tt(n)||kt(n))&&Mt(n,e,String(t));return(0,lt[n[0]])(s,n,o.localize,c)})).join("")}function Ht(t){const e=t.match(Et);return e?e[1].replace(Dt,"'"):t}class qt{subPriority=0;validate(t,e){return!0}}class Nt extends qt{constructor(t,e,r,n,o){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class Ct extends qt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:L(t,function(t,e){const r=e instanceof Date?L(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Lt{run(t,e,r,n){const o=this.parse(t,e,r,n);return o?{setter:new Nt(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,r){return!0}}const jt=/^(1[0-2]|0?\d)/,Yt=/^(3[0-1]|[0-2]?\d)/,Ft=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Rt=/^(5[0-3]|[0-4]?\d)/,Wt=/^(2[0-3]|[0-1]?\d)/,Qt=/^(2[0-4]|[0-1]?\d)/,It=/^(1[0-1]|0?\d)/,Gt=/^(1[0-2]|0?\d)/,_t=/^[0-5]?\d/,zt=/^[0-5]?\d/,Bt=/^\d/,Xt=/^\d{1,2}/,$t=/^\d{1,3}/,Kt=/^\d{1,4}/,Zt=/^-?\d+/,Jt=/^-?\d/,Ut=/^-?\d{1,2}/,Vt=/^-?\d{1,3}/,te=/^-?\d{1,4}/,ee=/^([+-])(\d{2})(\d{2})?|Z/,re=/^([+-])(\d{2})(\d{2})|Z/,ne=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,oe=/^([+-])(\d{2}):(\d{2})|Z/,ae=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ie(t,e){return t?{value:e(t.value),rest:t.rest}:t}function se(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function ue(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function ce(t){return se(Zt,t)}function de(t,e){switch(t){case 1:return se(Bt,e);case 2:return se(Xt,e);case 3:return se($t,e);case 4:return se(Kt,e);default:return se(new RegExp("^\\d{1,"+t+"}"),e)}}function he(t,e){switch(t){case 1:return se(Jt,e);case 2:return se(Ut,e);case 3:return se(Vt,e);case 4:return se(te,e);default:return se(new RegExp("^-?\\d{1,"+t+"}"),e)}}function le(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function fe(t,e){const r=e>0,n=r?e:1-e;let o;if(n<=50)o=t||100;else{const e=n+50;o=t+100*Math.trunc(e/100)-(t>=e%100?100:0)}return r?o:1-o}function pe(t){return t%400==0||t%4==0&&t%100!=0}const me=[31,28,31,30,31,30,31,31,30,31,30,31],ge=[31,29,31,30,31,30,31,31,30,31,30,31];function we(t,e,r){const n=R(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=C(t),i=a.getDay(),s=7-o;return j(a,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function ye(t,e){const r=C(t),n=function(t){let e=C(t).getDay();return 0===e&&(e=7),e}(r);return j(r,e-n)}const ve={G:new class extends Lt{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Lt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return ie(de(4,t),n);case"yo":return ie(r.ordinalNumber(t,{unit:"year"}),n);default:return ie(de(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=fe(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Lt{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return ie(de(4,t),n);case"Yo":return ie(r.ordinalNumber(t,{unit:"year"}),n);default:return ie(de(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const o=rt(t,n);if(r.isTwoDigitYear){const e=fe(r.year,o);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),W(t,n)}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),W(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Lt{priority=130;parse(t,e){return he("R"===e?4:e.length,t)}set(t,e,r){const n=L(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Q(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Lt{priority=130;parse(t,e){return he("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Lt{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return de(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Lt{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return de(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Lt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return ie(se(jt,t),n);case"MM":return ie(de(2,t),n);case"Mo":return ie(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Lt{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return ie(se(jt,t),n);case"LL":return ie(de(2,t),n);case"Lo":return ie(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Lt{priority=100;parse(t,e,r){switch(e){case"w":return se(Rt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return W(function(t,e,r){const n=C(t),o=nt(n,r)-e;return n.setDate(n.getDate()-7*o),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Lt{priority=100;parse(t,e,r){switch(e){case"I":return se(Rt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return Q(function(t,e){const r=C(t),n=et(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Lt{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return se(Yt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return de(e.length,t)}}validate(t,e){const r=pe(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=ge[n]:e>=1&&e<=me[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Lt{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return se(Ft,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return de(e.length,t)}}validate(t,e){return pe(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Lt{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Lt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return ie(de(e.length,t),o);case"eo":return ie(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Lt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return ie(de(e.length,t),o);case"co":return ie(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=we(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Lt{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return de(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return ie(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return ie(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return ie(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return ie(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=ye(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Lt{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Lt{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Lt{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Lt{priority=70;parse(t,e,r){switch(e){case"h":return se(Gt,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Lt{priority=70;parse(t,e,r){switch(e){case"H":return se(Wt,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Lt{priority=70;parse(t,e,r){switch(e){case"K":return se(It,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Lt{priority=70;parse(t,e,r){switch(e){case"k":return se(Qt,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return de(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Lt{priority=60;parse(t,e,r){switch(e){case"m":return se(_t,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Lt{priority=50;parse(t,e,r){switch(e){case"s":return se(zt,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return de(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Lt{priority=30;parse(t,e){return ie(de(e.length,t),(t=>Math.trunc(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Lt{priority=10;parse(t,e){switch(e){case"X":return ue(ee,t);case"XX":return ue(re,t);case"XXXX":return ue(ne,t);case"XXXXX":return ue(ae,t);default:return ue(oe,t)}}set(t,e,r){return e.timestampIsSet?t:L(t,t.getTime()-_(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Lt{priority=10;parse(t,e){switch(e){case"x":return ue(ee,t);case"xx":return ue(re,t);case"xxxx":return ue(ne,t);case"xxxxx":return ue(ae,t);default:return ue(oe,t)}}set(t,e,r){return e.timestampIsSet?t:L(t,t.getTime()-_(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Lt{priority=40;parse(t){return ce(t)}set(t,e,r){return[L(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Lt{priority=20;parse(t){return ce(t)}set(t,e,r){return[L(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},be=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ke=/^'([^]*?)'?$/,Te=/''/g,Me=/\S/,Se=/[a-zA-Z]/;function Pe(t,e,r,n){const o=Object.assign({},R()),a=o.locale??V,i=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===e)return""===t?C(r):L(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a},c=[new Ct],d=e.match(xe).map((t=>{const e=t[0];if(e in yt){return(0,yt[e])(t,a.formatLong)}return t})).join("").match(be),h=[];for(let n of d){Tt(n)&&Mt(n,e,t),kt(n)&&Mt(n,e,t);const o=n[0],i=ve[o];if(i){const{incompatibleTokens:e}=i;if(Array.isArray(e)){const t=h.find((t=>e.includes(t.token)||t.token===o));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${n}\` at the same time`)}else if("*"===i.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);h.push({token:o,fullToken:n});const s=i.run(t,n,a.match,u);if(!s)return L(r,NaN);c.push(s.setter),t=s.rest}else{if(o.match(Se))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");if("''"===n?n="'":"'"===o&&(n=n.match(ke)[1].replace(Te,"'")),0!==t.indexOf(n))return L(r,NaN);t=t.slice(n.length)}}if(t.length>0&&Me.test(t))return L(r,NaN);const l=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=C(r);if(isNaN(f.getTime()))return L(r,NaN);const p={};for(const t of l){if(!t.validate(f,u))return L(r,NaN);const e=t.set(f,p,u);Array.isArray(e)?(f=e[0],Object.assign(p,e[1])):f=e}return L(r,f)}var Ee=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,t),o(this,t,[e,r,"store-hour",n])}return h(t,x),u(t,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Pe(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Pe(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return z(this.startDateInstance)&&z(this.endDateInstance)?"".concat(At(this.startDateInstance,"p")," - ").concat(At(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}])}(),De=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,e),o(this,e,[t,r,"store-location",n])}return h(e,x),u(e,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new t.Collection(this.getAttribute("hours").map((function(t){return new Ee(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=At(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var e={},r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,e),o(this,e,[t,r,"store",n])}return h(e,x),u(e,[{key:"getReviews",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",p({store:this.id},r)).then((function(r){return new t.Collection(r.map((function(t){return new T(t,e.adapter)})))}))}},{key:"getLocations",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",p({store:this.id},r)).then((function(r){return new t.Collection(r.map((function(r){return r.place&&(r.place=new t.Place(r.place)),new De(r,e.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new De(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",r).then((function(r){return new t.Collection(r.map((function(t){return new N(t,e.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new N(t,e.adapter)}))}}])}(),Ae=Array.isArray,He=function(){function e(){var r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,e),n instanceof t.Adapter?m(r,r=o(this,e,[{},n,"service-quote",s])):o(this,e,[n,i,"service-quote",s])}return h(e,t.ServiceQuote),u(e,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Fe(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return S(e)||S(r)?null:M(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(i=n(g().mark((function r(n,o,a){var i,s,u,c,d,h,l=this,f=arguments;return g().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=f.length>3&&void 0!==f[3]?f[3]:"storefront",d=f.length>4&&void 0!==f[4]&&f[4],null!==(i=n)&&void 0!==i&&i.id&&(n=n.id),null!==(s=o)&&void 0!==s&&s.id&&(o=o.id),null!==(u=a)&&void 0!==u&&u.id&&(a=a.id),r.prev=5,r.next=8,this.adapter.get("service-quotes/from-cart",{origin:n,destination:o,cart:a,config:c,all:d});case 8:if(h=r.sent,!Ae(h)){r.next=11;break}return r.abrupt("return",new t.Collection(h.map((function(t){return new e(t,l.adapter)}))));case 11:return r.abrupt("return",new e(h,this.adapter));case 14:throw r.prev=14,r.t0=r.catch(5),console.error("Error fetching service quotes:",r.t0),r.t0;case 18:case"end":return r.stop()}}),r,this,[[5,14]])}))),function(t,e,r){return i.apply(this,arguments)})}],[{key:"getFromCart",value:(r=n(g().mark((function t(r,n,o,a){var i,s,u,c=arguments;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=c.length>4&&void 0!==c[4]?c[4]:"storefront",s=c.length>5&&void 0!==c[5]&&c[5],u=new e(r),t.abrupt("return",u.fetchServiceQuotesFromCart(n,o,a,i,s));case 4:case"end":return t.stop()}}),t)}))),function(t,e,n,o){return r.apply(this,arguments)})}]);var r,i}(),qe=new t.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(e,r,n,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return t.isResource(e)&&(e=e.id),t.isResource(r)&&(r=r.id),t.isResource(n)&&(n=n.id),t.isResource(o)&&(o=o.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),p(p({},a),{},{customer:e,cart:r,serviceQuote:n,gateway:o}),i)},captureOrder:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:e,transactionDetails:r},n).then((function(e){return new t.Order(e)}))},createStripeSetupIntent:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.isResource(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/stripe-setup-intent"),{customer:e},r)},updateStripePaymentIntent:function(e,r,n,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return t.isResource(r)&&(r=r.id),t.isResource(n)&&(n=n.id),t.isResource(o)&&(o=o.id),this.adapter.put("".concat(this.namespace,"/stripe-update-payment-intent"),p({paymentIntent:e,customer:r,cart:n,serviceQuote:o},a),i)}}),Ne=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,t),o(this,t,[e,r,"checkout",n])}return h(t,x),u(t,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}])}(),Ce={Product:P,Category:E,Customer:O,Cart:q,DeliveryServiceQuote:He,Store:Oe,StoreLocation:De,StoreHour:Ee,Checkout:Ne,Review:T},Le={BrowserAdapter:t.BrowserAdapter,NodeAdapter:t.NodeAdapter};var je=function(){return u((function t(){return a(this,t),this.resources=Ce,this.adapters=Le,this.lookup.apply(this,arguments)}),[{key:"lookup",value:function(e,r){var n=t.pluralize(e),o=r.split(/[^a-zA-Z0-9]/).filter(Boolean).map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(""),a=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][o])throw new Error("No ".concat(t.singularize(e)," named ").concat(r," (").concat(o,") to resolve"));return i(this[n][o],y(a))}}])}(),Ye=function(){return i(je,Array.prototype.slice.call(arguments))},Fe=function(){function e(){return a(this,e),o(this,e,arguments)}return h(e,t.Store),u(e,[{key:"extendActions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.extendStoreActions(this,e)}},{key:"serialize",value:function(e){return Ye("resource",t.classify(this.resource),e,this.adapter)}}])}();exports.Cart=q,exports.Category=E,exports.Checkout=Ne,exports.Customer=O,exports.DeliveryServiceQuote=He,exports.PaymentGateway=N,exports.Product=P,exports.Resolver=je,exports.Review=T,exports.Store=Oe,exports.StoreHour=Ee,exports.StoreLocation=De,exports.StorefrontResource=x,exports.StorefrontStore=Fe,exports._asyncToGenerator=n,exports._callSuper=o,exports._classCallCheck=a,exports._construct=i,exports._createClass=u,exports._inherits=h,exports._objectSpread2=p,exports._regeneratorRuntime=g,exports.cartActions=H,exports.checkoutActions=qe,exports.customerActions=D,exports.lookup=Ye,exports.resources=Ce,exports.reviewActions=k; +//# sourceMappingURL=store-C9rG6_hX.js.map diff --git a/dist/cjs/store-C9rG6_hX.js.map b/dist/cjs/store-C9rG6_hX.js.map new file mode 100644 index 0000000..de45b32 --- /dev/null +++ b/dist/cjs/store-C9rG6_hX.js.map @@ -0,0 +1 @@ +{"version":3,"file":"store-C9rG6_hX.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n\n getStripeEphemeralKey(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-ephemeral-key', params);\n }\n\n getStripeSetupIntent(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-setup-intent', params);\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { toDate } from \"../toDate.mjs\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(date.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n const timestamp = date.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.trunc(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { longFormatters, parsers };\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst objectToParams = (obj = {}, prefix = null) => {\n if (obj === null || obj === undefined) {\n return {};\n }\n\n const parsed = {};\n const keys = Object.keys(obj);\n\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n const value = obj[key];\n\n if (key && value) {\n if (prefix && typeof prefix === 'string') {\n parsed[`${prefix}[${key}]`] = value;\n continue;\n }\n\n parsed[key] = value;\n }\n }\n\n return parsed;\n};\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n\n createStripeSetupIntent: function (customer, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n return this.adapter.post(`${this.namespace}/stripe-setup-intent`, { customer }, options);\n },\n\n updateStripePaymentIntent: function (paymentIntent, customer, cart, serviceQuote, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n return this.adapter.put(`${this.namespace}/stripe-update-payment-intent`, { paymentIntent, customer, cart, serviceQuote, ...orderOptions }, options);\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nexport const resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nfunction toStudlyCase(str) {\n return str\n .split(/[^a-zA-Z0-9]/) // Split by non-alphanumeric characters\n .filter(Boolean) // Remove empty elements\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize the first letter of each word\n .join(''); // Join the words together without spaces\n}\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const classKey = toStudlyCase(className);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][classKey]) {\n throw new Error(`No ${singularize(type)} named ${className} (${classKey}) to resolve`);\n }\n\n return new this[key][classKey](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n\nexport default Resolver;\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n"],"names":["StorefrontResource","_classCallCheck","_callSuper","this","arguments","_inherits","Resource","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","apply","_performAuthorizedRequest","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_getSavedPlaces","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_getOrderHistory","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","call","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","trunc","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","dayOfYearTokenRE","weekYearTokenRE","throwTokens","isProtectedDayOfYearToken","isProtectedWeekYearToken","warnOrThrowProtectedError","input","_message","subject","message","warn","includes","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","originalDate","parts","substring","firstCharacter","longFormatter","join","isToken","cleanEscapedString","preprocessor","formatterOptions","part","formatter","matched","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","floor","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","fullToken","push","indexOf","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","DeliveryServiceQuote","Adapter","_possibleConstructorReturn","ServiceQuote","_fetchServiceQuotesFromCart","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","_args","serviceQuote","_x3","_getFromCart","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","createStripeSetupIntent","updateStripePaymentIntent","paymentIntent","Checkout","_this$store","_this$store2","resources","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","classKey","Boolean","word","charAt","singularize","_construct","_toConsumableArray","extendStoreActions","json","classify"],"mappings":"ksUAGqBA,IAAAA,aAAkB,SAAAA,IAAA,OAAAC,OAAAD,GAAAE,EAAAC,KAAAH,EAAAI,UAAA,CAAA,OAAAC,EAAAL,EAASM,EAAQA,UAAjBC,EAAAP,EAAA,CAAA,CAAAQ,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAR,KAAKO,QAAUA,EACfP,KAAKS,MAAQ,IAAIC,GAAgBV,KAAKW,SAAUJ,EAAS,CACrDK,aAAcZ,KAAKa,eAAeC,KAAKd,MACvCe,QAAqBP,QAAdA,EAAER,KAAKgB,eAALR,IAAYA,OAAZA,EAAAA,EAAcO,UAGpBf,IACX,IAAC,ICfCiB,EAAgB,IAAIC,EAAAA,aAAa,CACnCC,MAAO,SAAUC,GAAuB,IAAdJ,EAAOf,UAAAoB,OAAA,QAAAC,IAAArB,UAAA,GAAAA,UAAA,GAAG,CAAE,EAC5BsB,EAAS,CAAE,EAMjB,OAJIH,IACAG,EAAOd,MAAQW,GAGZpB,KAAKO,QAAQiB,IAAGC,GAAAA,OAAIzB,KAAK0B,UA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57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89]} \ No newline at end of file diff --git a/dist/cjs/storefront.js b/dist/cjs/storefront.js index 40f08d6..53bfc29 100644 --- a/dist/cjs/storefront.js +++ b/dist/cjs/storefront.js @@ -1,2 +1,2 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@fleetbase/sdk");function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(t){for(var r=1;r=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},e}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,e,r,n,o,a,i){try{var s=t[a](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function s(t){i(a,n,o,s,u,"next",t)}function u(t){i(a,n,o,s,u,"throw",t)}s(void 0)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),T=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"review",o)}return d(r,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),r}();function M(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var D=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=a(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var o=t.length;if("number"==typeof o)return!o}return!1},S=function(e){h(n,k);var r=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r.call(this,t,e,"product",o)}return d(n,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?D(r)||D(n)?null:M(r/100,n):D(e)||D(n)?null:M(e/100,n)}},{key:"getReviews",value:function(){var e=this;return this.adapter.get("reviews",{store:this.id}).then((function(r){return new t.Collection(r.map((function(t){return new T(t,e.adapter)})))}))}}]),n}(),P=function(e){h(n,k);var r=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r.call(this,t,e,"category",o)}return d(n,[{key:"getProducts",value:function(){var e=this;return this.adapter.get("products",{category:this.id}).then((function(r){return new t.Collection(r.map((function(t){return new S(t,e.adapter)})))}))}}]),n}(),E=new t.StoreActions({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",r({identity:t,password:e},n)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",r({identity:t,code:e},n)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",r({identity:t,code:e},n)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),O=function(e){h(f,k);var o,a,i,c,l=y(f);function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,f),l.call(this,t,e,"customer",r({actions:E},n))}return d(f,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Fe(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(c=s(n().mark((function t(e){var r=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=s(n().mark((function t(e){var r,o,a,i,s=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},o=s.length>2&&void 0!==s[2]?s[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[o.toLowerCase()](e,r);case 6:return i=t.sent,t.abrupt("return",i);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(o," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(a=s(n().mark((function e(){var r,o=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.performAuthorizedRequest("customers/places");case 3:return r=e.sent,e.abrupt("return",new t.Collection(r.map((function(e){return new t.Place(e,o.adapter)}))));case 7:throw e.prev=7,e.t0=e.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return a.apply(this,arguments)})},{key:"getOrderHistory",value:(o=s(n().mark((function e(){var r,o,a=this,i=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},e.prev=1,e.next=4,this.performAuthorizedRequest("customers/orders",r);case 4:return o=e.sent,e.abrupt("return",new t.Collection(o.map((function(e){return new t.Order(e,a.adapter)}))));case 8:throw e.prev=8,e.t0=e.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return o.apply(this,arguments)})}]),f}(),A=Array.isArray,q=new t.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},o),{},{quantity:n}),a).then(this.afterFetch.bind(this))},update:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),r(r({},o),{},{quantity:n}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),H=function(t){h(n,k);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),e.call(this,t,o,"cart",r({actions:q},a))}return d(n,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof S&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!A(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),n}(),N=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"payment-gateway",o)}return d(r,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),r}();function Y(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function C(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function L(t,e){const r=Y(t);return isNaN(e)?C(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const j=6048e5,F=864e5;let R={};function W(){return R}function Q(t,e){const r=W(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=Y(t),a=o.getDay(),i=(a=o.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function _(t){const e=Y(t);return e.setHours(0,0,0,0),e}function B(t){const 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 z(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=Y(t);return!isNaN(Number(r))}const X={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"}};function $(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const K={date:$({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:$({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function J(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):e;n=t.formattingValues[o]||t.formattingValues[e]}else{const e=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;n=t.values[o]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function V(t){return(e,r={})=>{const n=r.width,o=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(o);if(!a)return null;const i=a[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var Z;const tt={code:"en-US",formatDistance:(t,e,r)=>{let n;const o=X[t];return n="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:K,formatRelative:(t,e,r,n)=>U[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:J({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:J({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:J({values:{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"]},defaultWidth:"wide"}),day:J({values:{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"]},defaultWidth:"wide"}),dayPeriod:J({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Z={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(Z.matchPattern);if(!r)return null;const n=r[0],o=t.match(Z.parsePattern);if(!o)return null;let a=Z.valueCallback?Z.valueCallback(o[0]):o[0];return a=e.valueCallback?e.valueCallback(a):a,{value:a,rest:t.slice(n.length)}}),era:V({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:V({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:V({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:V({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:V({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function et(t){const e=Y(t),r=function(t,e){const r=_(t),n=_(e),o=r.getTime()-B(r),a=n.getTime()-B(n);return Math.round((o-a)/F)}(e,function(t){const e=Y(t),r=C(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function rt(t){const e=Y(t),r=I(e).getTime()-function(t){const e=G(t),r=C(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),I(r)}(e).getTime();return Math.round(r/j)+1}function nt(t,e){const r=Y(t),n=r.getFullYear(),o=W(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=C(t,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=Q(i,e),u=C(t,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const c=Q(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function ot(t,e){const r=Y(t),n=Q(r,e).getTime()-function(t,e){const r=W(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=nt(t,e),a=C(t,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),Q(a,e)}(r,e).getTime();return Math.round(n/j)+1}function at(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const it={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return at("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):at(r+1,2)},d:(t,e)=>at(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>at(t.getHours()%12||12,e.length),H:(t,e)=>at(t.getHours(),e.length),m:(t,e)=>at(t.getMinutes(),e.length),s:(t,e)=>at(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return at(Math.floor(n*Math.pow(10,r-3)),e.length)}},st="midnight",ut="noon",ct="morning",dt="afternoon",lt="evening",ht="night",ft={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return it.y(t,e)},Y:function(t,e,r,n){const o=nt(t,n),a=o>0?o:1-o;if("YY"===e){return at(a%100,2)}return"Yo"===e?r.ordinalNumber(a,{unit:"year"}):at(a,e.length)},R:function(t,e){return at(G(t),e.length)},u:function(t,e){return at(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return at(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return at(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return it.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return at(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const o=ot(t,n);return"wo"===e?r.ordinalNumber(o,{unit:"week"}):at(o,e.length)},I:function(t,e,r){const n=rt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):at(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):it.d(t,e)},D:function(t,e,r){const n=et(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):at(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return at(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const o=t.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return at(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),o=0===n?7:n;switch(e){case"i":return String(o);case"ii":return at(o,e.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let o;switch(o=12===n?ut:0===n?st:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let o;switch(o=n>=17?lt:n>=12?dt:n>=4?ct:ht,e){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return it.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):it.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):it.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):it.s(t,e)},S:function(t,e){return it.S(t,e)},X:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return gt(o);case"XXXX":case"XX":return mt(o);default:return mt(o,":")}},x:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return gt(o);case"xxxx":case"xx":return mt(o);default:return mt(o,":")}},O:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+pt(o,":");default:return"GMT"+mt(o,":")}},z:function(t,e,r,n){const o=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+pt(o,":");default:return"GMT"+mt(o,":")}},t:function(t,e,r,n){const o=n._originalDate||t;return at(Math.floor(o.getTime()/1e3),e.length)},T:function(t,e,r,n){return at((n._originalDate||t).getTime(),e.length)}};function pt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),o=Math.floor(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+e+at(a,2)}function gt(t,e){if(t%60==0){return(t>0?"-":"+")+at(Math.abs(t)/60,2)}return mt(t,e)}function mt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+at(Math.floor(n/60),2)+e+at(n%60,2)}const wt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},yt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},vt={p:yt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return wt(t,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"})}return a.replace("{{date}}",wt(n,e)).replace("{{time}}",yt(o,e))}},bt=["D","DD"],kt=["YY","YYYY"];function xt(t){return-1!==bt.indexOf(t)}function Tt(t){return-1!==kt.indexOf(t)}function Mt(t,e,r){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const Dt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,St=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pt=/^'([^]*?)'?$/,Et=/''/g,Ot=/[a-zA-Z]/;function At(t,e,r){const n=W(),o=r?.locale??n.locale??tt,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Y(t);if(!z(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o,_originalDate:s};return e.match(St).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,vt[e])(t,o.formatLong)}return t})).join("").match(Dt).map((function(n){if("''"===n)return"'";const a=n[0];if("'"===a)return function(t){const e=t.match(Pt);if(!e)return t;return e[1].replace(Et,"'")}(n);const i=ft[a];if(i)return!r?.useAdditionalWeekYearTokens&&Tt(n)&&Mt(n,e,String(t)),!r?.useAdditionalDayOfYearTokens&&xt(n)&&Mt(n,e,String(t)),i(s,n,o.localize,u);if(a.match(Ot))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("")}class qt{subPriority=0;validate(t,e){return!0}}class Ht extends qt{constructor(t,e,r,n,o){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class Nt extends qt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:C(t,function(t,e){const r=e instanceof Date?C(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Yt{run(t,e,r,n){const o=this.parse(t,e,r,n);return o?{setter:new Ht(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,r){return!0}}const Ct=/^(1[0-2]|0?\d)/,Lt=/^(3[0-1]|[0-2]?\d)/,jt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Ft=/^(5[0-3]|[0-4]?\d)/,Rt=/^(2[0-3]|[0-1]?\d)/,Wt=/^(2[0-4]|[0-1]?\d)/,Qt=/^(1[0-1]|0?\d)/,It=/^(1[0-2]|0?\d)/,Gt=/^[0-5]?\d/,_t=/^[0-5]?\d/,Bt=/^\d/,zt=/^\d{1,2}/,Xt=/^\d{1,3}/,$t=/^\d{1,4}/,Kt=/^-?\d+/,Ut=/^-?\d/,Jt=/^-?\d{1,2}/,Vt=/^-?\d{1,3}/,Zt=/^-?\d{1,4}/,te=/^([+-])(\d{2})(\d{2})?|Z/,ee=/^([+-])(\d{2})(\d{2})|Z/,re=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ne=/^([+-])(\d{2}):(\d{2})|Z/,oe=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ae(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ie(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function se(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function ue(t){return ie(Kt,t)}function ce(t,e){switch(t){case 1:return ie(Bt,e);case 2:return ie(zt,e);case 3:return ie(Xt,e);case 4:return ie($t,e);default:return ie(new RegExp("^\\d{1,"+t+"}"),e)}}function de(t,e){switch(t){case 1:return ie(Ut,e);case 2:return ie(Jt,e);case 3:return ie(Vt,e);case 4:return ie(Zt,e);default:return ie(new RegExp("^-?\\d{1,"+t+"}"),e)}}function le(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function he(t,e){const r=e>0,n=r?e:1-e;let o;if(n<=50)o=t||100;else{const e=n+50;o=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return r?o:1-o}function fe(t){return t%400==0||t%4==0&&t%100!=0}const pe=[31,28,31,30,31,30,31,31,30,31,30,31],ge=[31,29,31,30,31,30,31,31,30,31,30,31];function me(t,e,r){const n=W(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Y(t),i=a.getDay(),s=7-o;return L(a,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function we(t,e){const r=Y(t),n=function(t){let e=Y(t).getDay();return 0===e&&(e=7),e}(r);return L(r,e-n)}const ye={G:new class extends Yt{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Yt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return ae(ce(4,t),n);case"yo":return ae(r.ordinalNumber(t,{unit:"year"}),n);default:return ae(ce(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=he(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Yt{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return ae(ce(4,t),n);case"Yo":return ae(r.ordinalNumber(t,{unit:"year"}),n);default:return ae(ce(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const o=nt(t,n);if(r.isTwoDigitYear){const e=he(r.year,o);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,n)}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Yt{priority=130;parse(t,e){return de("R"===e?4:e.length,t)}set(t,e,r){const n=C(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),I(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Yt{priority=130;parse(t,e){return de("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Yt{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return ce(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Yt{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return ce(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Yt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return ae(ie(Ct,t),n);case"MM":return ae(ce(2,t),n);case"Mo":return ae(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Yt{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return ae(ie(Ct,t),n);case"LL":return ae(ce(2,t),n);case"Lo":return ae(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Yt{priority=100;parse(t,e,r){switch(e){case"w":return ie(Ft,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return Q(function(t,e,r){const n=Y(t),o=ot(n,r)-e;return n.setDate(n.getDate()-7*o),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Yt{priority=100;parse(t,e,r){switch(e){case"I":return ie(Ft,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return I(function(t,e){const r=Y(t),n=rt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Yt{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return ie(Lt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return ce(e.length,t)}}validate(t,e){const r=fe(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=ge[n]:e>=1&&e<=pe[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Yt{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return ie(jt,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return ce(e.length,t)}}validate(t,e){return fe(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Yt{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=me(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Yt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return ae(ce(e.length,t),o);case"eo":return ae(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=me(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Yt{priority=90;parse(t,e,r,n){const o=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return ae(ce(e.length,t),o);case"co":return ae(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=me(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Yt{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return ce(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return ae(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return ae(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return ae(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return ae(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=we(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Yt{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Yt{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Yt{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(le(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"h":return ie(It,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"H":return ie(Rt,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"K":return ie(Qt,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Yt{priority=70;parse(t,e,r){switch(e){case"k":return ie(Wt,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return ce(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Yt{priority=60;parse(t,e,r){switch(e){case"m":return ie(Gt,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Yt{priority=50;parse(t,e,r){switch(e){case"s":return ie(_t,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return ce(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Yt{priority=30;parse(t,e){return ae(ce(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Yt{priority=10;parse(t,e){switch(e){case"X":return se(te,t);case"XX":return se(ee,t);case"XXXX":return se(re,t);case"XXXXX":return se(oe,t);default:return se(ne,t)}}set(t,e,r){return e.timestampIsSet?t:C(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Yt{priority=10;parse(t,e){switch(e){case"x":return se(te,t);case"xx":return se(ee,t);case"xxxx":return se(re,t);case"xxxxx":return se(oe,t);default:return se(ne,t)}}set(t,e,r){return e.timestampIsSet?t:C(t,t.getTime()-B(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Yt{priority=40;parse(t){return ue(t)}set(t,e,r){return[C(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Yt{priority=20;parse(t){return ue(t)}set(t,e,r){return[C(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},ve=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,be=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ke=/^'([^]*?)'?$/,xe=/''/g,Te=/\S/,Me=/[a-zA-Z]/;function De(t,e,r,n){const o=Object.assign({},W()),a=n?.locale??o.locale??tt,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===e)return""===t?Y(r):C(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a},c=[new Nt],d=e.match(be).map((t=>{const e=t[0];if(e in vt){return(0,vt[e])(t,a.formatLong)}return t})).join("").match(ve),l=[];for(let o of d){!n?.useAdditionalWeekYearTokens&&Tt(o)&&Mt(o,e,t),!n?.useAdditionalDayOfYearTokens&&xt(o)&&Mt(o,e,t);const i=o[0],s=ye[i];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=l.find((t=>e.includes(t.token)||t.token===i));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${o}\` at the same time`)}else if("*"===s.incompatibleTokens&&l.length>0)throw new RangeError(`The format string mustn't contain \`${o}\` and any other token at the same time`);l.push({token:i,fullToken:o});const n=s.run(t,o,a.match,u);if(!n)return C(r,NaN);c.push(n.setter),t=n.rest}else{if(i.match(Me))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===o?o="'":"'"===i&&(o=o.match(ke)[1].replace(xe,"'")),0!==t.indexOf(o))return C(r,NaN);t=t.slice(o.length)}}if(t.length>0&&Te.test(t))return C(r,NaN);const h=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=Y(r);if(isNaN(f.getTime()))return C(r,NaN);const p={};for(const t of h){if(!t.validate(f,u))return C(r,NaN);const e=t.set(f,p,u);Array.isArray(e)?(f=e[0],Object.assign(p,e[1])):f=e}return C(r,f)}var Se=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"store-hour",o)}return d(r,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return De(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return De(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return z(this.startDateInstance)&&z(this.endDateInstance)?"".concat(At(this.startDateInstance,"p")," - ").concat(At(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),r}(),Pe=function(e){h(n,k);var r=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,n),r.call(this,t,e,"store-location",o)}return d(n,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new t.Collection(this.getAttribute("hours").map((function(t){return new Se(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=At(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var e={},r=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,o),n.call(this,t,e,"store",r)}return d(o,[{key:"getReviews",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",r({store:this.id},n)).then((function(r){return new t.Collection(r.map((function(t){return new T(t,e.adapter)})))}))}},{key:"getLocations",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",r({store:this.id},n)).then((function(r){return new t.Collection(r.map((function(r){return r.place&&(r.place=new t.Place(r.place)),new Pe(r,e.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Pe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",r).then((function(r){return new t.Collection(r.map((function(t){return new N(t,e.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new N(t,e.adapter)}))}}]),o}(),Oe=function(e){h(l,k);var r,o,a,i,c=y(l);function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,l),c.call(this,t,e,"network",r)}return d(l,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(i=s(n().mark((function e(r,o){var a,i,s=this,u=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},e.prev=1,e.next=4,this.adapter.get(r,a);case 4:return i=e.sent,e.abrupt("return",new t.Collection(i.map((function(t){return new o(t,s.adapter)}))));case 8:throw e.prev=8,e.t0=e.catch(1),console.error("Error fetching ".concat(r,":"),e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(t,e){return i.apply(this,arguments)})},{key:"getStores",value:(a=s(n().mark((function t(){var e,r=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Ee,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getStoreLocations",value:(o=s(n().mark((function t(){var e,r=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Pe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"getPaymentGateways",value:(r=s(n().mark((function t(){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",N));case 1:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})}]),l}(),Ae=Array.isArray,qe=function(e){h(i,t.ServiceQuote);var r,o,a=y(i);function i(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,i),r instanceof t.Adapter?w(e,e=a.call(this,{},r,"service-quote",o)):a.call(this,r,n,"service-quote",o)}return d(i,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Fe(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return D(e)||D(r)?null:M(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(o=s(n().mark((function e(r,o,a){var s,u,c,d,l,h,f=this,p=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=p.length>3&&void 0!==p[3]?p[3]:"storefront",l=p.length>4&&void 0!==p[4]&&p[4],null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),null!==(u=o)&&void 0!==u&&u.id&&(o=o.id),null!==(c=a)&&void 0!==c&&c.id&&(a=a.id),e.prev=5,e.next=8,this.adapter.get("service-quotes/from-cart",{origin:r,destination:o,cart:a,config:d,all:l});case 8:if(h=e.sent,!Ae(h)){e.next=11;break}return e.abrupt("return",new t.Collection(h.map((function(t){return new i(t,f.adapter)}))));case 11:return e.abrupt("return",new i(h,this.adapter));case 14:throw e.prev=14,e.t0=e.catch(5),console.error("Error fetching service quotes:",e.t0),e.t0;case 18:case"end":return e.stop()}}),e,this,[[5,14]])}))),function(t,e,r){return o.apply(this,arguments)})}],[{key:"getFromCart",value:(r=s(n().mark((function t(e,r,o,a){var s,u,c,d=arguments;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=d.length>4&&void 0!==d[4]?d[4]:"storefront",u=d.length>5&&void 0!==d[5]&&d[5],c=new i(e),t.abrupt("return",c.fetchServiceQuotesFromCart(r,o,a,s,u));case 4:case"end":return t.stop()}}),t)}))),function(t,e,n,o){return r.apply(this,arguments)})}]),i}(),He=new t.StoreActions({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(e,n,o,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return t.isResource(e)&&(e=e.id),t.isResource(n)&&(n=n.id),t.isResource(o)&&(o=o.id),t.isResource(a)&&(a=a.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),r(r({},i),{},{customer:e,cart:n,serviceQuote:o,gateway:a}),s)},captureOrder:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:e,transactionDetails:r},n).then((function(e){return new t.Order(e)}))}}),Ne=function(t){h(r,k);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u(this,r),e.call(this,t,n,"checkout",o)}return d(r,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),r}(),Ye={Product:S,Category:P,Customer:O,Cart:H,DeliveryServiceQuote:qe,Store:Ee,StoreLocation:Pe,StoreHour:Se,Checkout:Ne,Review:T},Ce={BrowserAdapter:t.BrowserAdapter,NodeAdapter:t.NodeAdapter},Le=function(){function e(){return u(this,e),this.resources=Ye,this.adapters=Ce,this.lookup.apply(this,arguments)}return d(e,[{key:"lookup",value:function(e,r){var n=t.pluralize(e),o=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][r])throw new Error("No ".concat(t.singularize(e)," named ").concat(r," to resolve"));return m(this[n][r],v(o))}}]),e}(),je=function(){return m(Le,Array.prototype.slice.call(arguments))},Fe=function(e){h(n,t.Store);var r=y(n);function n(){return u(this,n),r.apply(this,arguments)}return d(n,[{key:"extendActions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.extendStoreActions(this,e)}},{key:"serialize",value:function(e){return je("resource",t.classify(this.resource),e,this.adapter)}}]),n}(),Re=function(){function e(r){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(u(this,e),this.version=o.version||"v1",this.options={version:this.version,host:o.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||o.namespace,publicKey:r,debug:a},!("string"==typeof(n=r)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=o.adapter||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.isNodeEnvironment()?je("adapter","NodeAdapter",e):je("adapter","BrowserAdapter",e)}(this.options),this.products=new Fe("product",this.adapter),this.categories=new Fe("category",this.adapter),this.reviews=new Fe("review",this.adapter).extendActions(x),this.customers=new Fe("customer",this.adapter).extendActions(E),this.cart=new Fe("cart",this.adapter).extendActions(q),this.checkout=new Fe("checkout",this.adapter).extendActions(He)}return d(e,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",r({query:e},n)).then((function(e){return new t.Collection(e.map((function(t){return new S(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return m(e,Array.prototype.slice.call(arguments))}}]),e}();exports.Cart=H,exports.Category=P,exports.Checkout=Ne,exports.Customer=O,exports.DeliveryServiceQuote=qe,exports.Network=Oe,exports.PaymentGateway=N,exports.Product=S,exports.Review=T,exports.Store=Ee,exports.StoreHour=Se,exports.StoreLocation=Pe,exports.default=Re; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./store-C9rG6_hX.js"),t=require("@fleetbase/sdk"),r=function(r){function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e._classCallCheck(this,o),e._callSuper(this,o,[t,r,"network",n])}return e._inherits(o,r),e._createClass(o,[{key:"getTags",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",e)}},{key:"getResourceCollection",value:(i=e._asyncToGenerator(e._regeneratorRuntime().mark((function r(o,n){var a,s,i=this,u=arguments;return e._regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},e.prev=1,e.next=4,this.adapter.get(o,a);case 4:return s=e.sent,e.abrupt("return",new t.Collection(s.map((function(e){return new n(e,i.adapter)}))));case 8:throw e.prev=8,e.t0=e.catch(1),console.error("Error fetching ".concat(o,":"),e.t0),e.t0;case 12:case"end":return e.stop()}}),r,this,[[1,8]])}))),function(e,t){return i.apply(this,arguments)})},{key:"getStores",value:(s=e._asyncToGenerator(e._regeneratorRuntime().mark((function t(){var r,o=arguments;return e._regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:{},t.abrupt("return",this.getResourceCollection("stores",e.Store,r));case 2:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"getStoreLocations",value:(a=e._asyncToGenerator(e._regeneratorRuntime().mark((function t(){var r,o=arguments;return e._regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",e.StoreLocation,r));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getPaymentGateways",value:(n=e._asyncToGenerator(e._regeneratorRuntime().mark((function t(){return e._regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",e.PaymentGateway));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]);var n,a,s,i}(e.StorefrontResource),o=function(){function r(o){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e._classCallCheck(this,r),this.version=a.version||"v1",this.options={version:this.version,host:a.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||a.namespace,publicKey:o,debug:s},!("string"==typeof(n=o)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=a.adapter||function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.isNodeEnvironment()?e.lookup("adapter","NodeAdapter",r):e.lookup("adapter","BrowserAdapter",r)}(this.options),this.products=new e.StorefrontStore("product",this.adapter),this.categories=new e.StorefrontStore("category",this.adapter),this.reviews=new e.StorefrontStore("review",this.adapter).extendActions(e.reviewActions),this.customers=new e.StorefrontStore("customer",this.adapter).extendActions(e.customerActions),this.cart=new e.StorefrontStore("cart",this.adapter).extendActions(e.cartActions),this.checkout=new e.StorefrontStore("checkout",this.adapter).extendActions(e.checkoutActions)}return e._createClass(r,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"lookup",value:function(e){return this.adapter.get("lookup/".concat(e))}},{key:"search",value:function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",e._objectSpread2({query:r},o)).then((function(r){return new t.Collection(r.map((function(t){return new e.Product(t)})))}))}},{key:"setAdapter",value:function(e){this.adapter=e}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return e._construct(r,Array.prototype.slice.call(arguments))}}])}();exports.Cart=e.Cart,exports.Category=e.Category,exports.Checkout=e.Checkout,exports.Customer=e.Customer,exports.DeliveryServiceQuote=e.DeliveryServiceQuote,exports.PaymentGateway=e.PaymentGateway,exports.Product=e.Product,exports.Review=e.Review,exports.Store=e.Store,exports.StoreHour=e.StoreHour,exports.StoreLocation=e.StoreLocation,exports.lookup=e.lookup,exports.Network=r,exports.default=o; //# sourceMappingURL=storefront.js.map diff --git a/dist/cjs/storefront.js.map b/dist/cjs/storefront.js.map index 1a6d2d9..8bf53ed 100644 --- a/dist/cjs/storefront.js.map +++ b/dist/cjs/storefront.js.map @@ -1 +1 @@ -{"version":3,"file":"storefront.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n startOfDayRight.getTime() -\n getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff =\n startOfISOWeek(_date).getTime() - startOfISOWeekYear(_date).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff =\n startOfWeek(_date, options).getTime() -\n startOfWeekYear(_date, options).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.floor(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const protectedDayOfYearTokens = [\"D\", \"DD\"];\nconst protectedWeekYearTokens = [\"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nexport function throwProtectedError(token, format, input) {\n if (token === \"YYYY\") {\n throw new RangeError(\n `Use \\`yyyy\\` instead of \\`YYYY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"YY\") {\n throw new RangeError(\n `Use \\`yy\\` instead of \\`YY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"D\") {\n throw new RangeError(\n `Use \\`d\\` instead of \\`D\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"DD\") {\n throw new RangeError(\n `Use \\`dd\\` instead of \\`DD\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n }\n}\n","import { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate,\n };\n\n const result = formatStr\n .match(longFormattingTokensRegExp)\n .map(function (substring) {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = formatters[firstCharacter];\n if (formatter) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n return formatter(\n originalDate,\n substring,\n locale.localize,\n formatterOptions,\n );\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.floor(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { enUS as defaultLocale } from \"./locale/en-US.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nconst resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][className]) {\n throw new Error(`No ${singularize(type)} named ${className} to resolve`);\n }\n\n return new this[key][className](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_inherits","Resource","_super","_createSuper","_classCallCheck","apply","this","arguments","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","call","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_getOrderHistory","_getSavedPlaces","_performAuthorizedRequest","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","millisecondsInDay","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","floor","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","matched","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","includes","fullToken","push","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getPaymentGateways","_getStoreLocations","_getStores","_getResourceCollection","ResourceClass","resources","_args","getResourceCollection","_args3","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","_getFromCart","_fetchServiceQuotesFromCart","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","startsWith","isNodeEnvironment","detectAdapter","categories","extendActions","customers","checkout","product"],"mappings":"4hVACsC,IAEjBA,WAAkBC,GAAAC,EAAAF,EAASG,YAAT,IAAAC,EAAAC,EAAAL,GAAA,SAAAA,IAAA,OAAAM,OAAAN,GAAAI,EAAAG,MAAAC,KAAAC,UAAA,CAelC,OAfkCC,EAAAV,EAAA,CAAA,CAAAW,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAN,KAAKK,QAAUA,EACfL,KAAKO,MAAQ,IAAIC,GAAgBR,KAAKS,SAAUJ,EAA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B,GACzEf,KAAKqlB,UAAY,IAAI7kB,GAAgB,WAAYR,KAAKK,SAAS+kB,cAAc1hB,GAC7E1D,KAAKiiB,KAAO,IAAIzhB,GAAgB,OAAQR,KAAKK,SAAS+kB,cAAc3d,GACpEzH,KAAKslB,SAAW,IAAI9kB,GAAgB,WAAYR,KAAKK,SAAS+kB,cAAcpC,GAChF,CAgBC,OAdD9iB,EAAAwkB,EAAA,CAAA,CAAAvkB,IAAA,QAAAC,MACA,WACI,OAAOJ,KAAKK,QAAQiB,IAAI,QAC5B,GAEA,CAAAnB,IAAA,SAAAC,MACA,SAAOuH,GAAqB,IAAd7G,EAAOb,UAAAkB,OAAA,QAAAC,IAAAnB,UAAA,GAAAA,UAAA,GAAG,CAAA,EACpB,OAAOD,KAAKK,QAAQiB,IAAI,SAAQ6C,EAAA,CAAIwD,MAAAA,GAAU7G,IAAWqC,MAAK,SAACM,GAC3D,OAAO,IAAIJ,EAAAA,WAAWI,EAASH,KAAI,SAACiiB,GAAO,OAAK,IAAI7iB,EAAQ6iB,EAAQ,IACxE,GACJ,GAAC,CAAAplB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAgkB,EAAWM,EAAUld,MAAA4B,UAAA4G,MAAArO,KAAI1B,WAC7B,KAACykB,CAAA,CA/C0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file +{"version":3,"file":"storefront.js","sources":["../../src/resources/network.js","../../src/storefront.js","../../src/utils/is-key-valid.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { lookup } from './resolver';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** lookup a specific store or network provided the ID */\n lookup(id) {\n return this.adapter.get(`lookup/${id}`);\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network, lookup };\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["Network","_Resource","attributes","arguments","length","undefined","adapter","options","_classCallCheck","_callSuper","_inherits","_createClass","key","value","params","this","get","_getResourceCollection","_asyncToGenerator","_regeneratorRuntime","mark","_callee","endpoint","ResourceClass","resources","_this","_args","wrap","_context","prev","next","sent","abrupt","Collection","map","t0","console","error","concat","stop","_x","_x2","apply","_getStores","_callee2","_args2","_context2","getResourceCollection","Store","_getStoreLocations","_callee3","_args3","_context3","StoreLocation","_getPaymentGateways","_callee4","_context4","PaymentGateway","Resource","StorefrontResource","Storefront","storeKey","config","debug","version","host","namespace","publicKey","startsWith","Error","isNodeEnvironment","lookup","detectAdapter","products","StorefrontStore","categories","reviews","extendActions","reviewActions","customers","customerActions","cart","cartActions","checkout","checkoutActions","id","query","_objectSpread","then","product","Product","_construct","Array","prototype","slice","call"],"mappings":"qIAMqBA,WAAOC,GACxB,SAAAD,IAAoD,IAAxCE,EAAUC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EAAEG,EAAOH,UAAAC,OAAAD,EAAAA,kBAAAE,EAAEE,EAAOJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EAAA,OAAAK,EAAAA,qBAAAR,GAAAS,EAAAA,WAAAT,KAAAA,EACxCE,CAAAA,EAAYI,EAAS,UAAWC,GAC1C,CAAC,OAAAG,EAAAA,UAAAV,EAAAC,GAAAU,EAAAA,aAAAX,EAAA,CAAA,CAAAY,IAAA,UAAAC,MAED,WAAqB,IAAbC,EAAMX,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EACf,OAAOY,KAAKT,QAAQU,IAAI,OAAQF,EACpC,GAAC,CAAAF,IAAA,wBAAAC,OAAAI,EAAAC,EAAAA,kBAAAC,wBAAAC,MAED,SAAAC,EAA4BC,EAAUC,GAAa,IAAAT,EAAAU,EAAAC,EAAAV,KAAAW,EAAAvB,UAAA,OAAAgB,EAAAA,sBAAAQ,MAAA,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAa,OAAXhB,EAAMY,EAAAtB,OAAAsB,QAAArB,IAAAqB,EAAArB,GAAAqB,EAAG,GAAA,CAAE,EAAAE,EAAAC,KAAA,EAAAD,EAAAE,KAAA,EAEhCf,KAAKT,QAAQU,IAAIM,EAAUR,GAAO,KAAA,EAA3C,OAATU,EAASI,EAAAG,KAAAH,EAAAI,OAAA,SACR,IAAIC,EAAUA,WAACT,EAAUU,KAAI,SAA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AAW/B,EAAUgC,MAAAC,UAAAC,MAAAC,KAAI5F,WAC7B,IAAC,CApD0B"} \ No newline at end of file diff --git a/dist/esm/resolver.js b/dist/esm/resolver.js new file mode 100644 index 0000000..8e46f37 --- /dev/null +++ b/dist/esm/resolver.js @@ -0,0 +1,2 @@ +export{v as Resolver,v as default,l as lookup,u as resources}from"./store-DTqxvCQ3.js";import"@fleetbase/sdk"; +//# sourceMappingURL=resolver.js.map diff --git a/dist/esm/resolver.js.map b/dist/esm/resolver.js.map new file mode 100644 index 0000000..0a3a873 --- /dev/null +++ b/dist/esm/resolver.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolver.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/esm/store-DTqxvCQ3.js b/dist/esm/store-DTqxvCQ3.js new file mode 100644 index 0000000..c3f7efc --- /dev/null +++ b/dist/esm/store-DTqxvCQ3.js @@ -0,0 +1,2 @@ +import{Resource as t,StoreActions as e,Collection as r,Place as n,Order as a,ServiceQuote as o,Adapter as i,isResource as s,pluralize as u,singularize as c,BrowserAdapter as d,NodeAdapter as h,extendStoreActions as l,classify as f,Store as m}from"@fleetbase/sdk";function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function H(t,e){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},H(t,e)}function N(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}var j=function(){function e(){return v(this,e),y(this,e,arguments)}return P(e,t),x(e,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ue(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}}])}(),Y=new e({count:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),C=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"review",n])}return P(t,j),x(t,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}])}();function F(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var W=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=L(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var a=t.length;if("number"==typeof a)return!a}return!1},I=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"product",n])}return P(t,j),x(t,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?W(r)||W(n)?null:F(r/100,n):W(e)||W(n)?null:F(e/100,n)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new r(e.map((function(e){return new C(e,t.adapter)})))}))}}])}(),Q=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"category",n])}return P(t,j),x(t,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new r(e.map((function(e){return new I(e,t.adapter)})))}))}}])}(),R=new e({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",D({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",D({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",D({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),G=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"customer",D({actions:R},n)])}return P(t,j),x(t,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ue(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(s=w(q().mark((function t(e){var r=this;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=w(q().mark((function t(e){var r,n,a,o,i=arguments;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},n=i.length>2&&void 0!==i[2]?i[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[n.toLowerCase()](e,r);case 6:return o=t.sent,t.abrupt("return",o);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(o=w(q().mark((function t(){var e,a=this;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return e=t.sent,t.abrupt("return",new r(e.map((function(t){return new n(t,a.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return o.apply(this,arguments)})},{key:"getOrderHistory",value:(e=w(q().mark((function t(){var e,n,o=this,i=arguments;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",e);case 4:return n=t.sent,t.abrupt("return",new r(n.map((function(t){return new a(t,o.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return e.apply(this,arguments)})},{key:"getStripeEphemeralKey",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-ephemeral-key",t)}},{key:"getStripeSetupIntent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-setup-intent",t)}}]);var e,o,i,s}(),z=Array.isArray,B=new e({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),D(D({},n),{},{quantity:r}),a).then(this.afterFetch.bind(this))},update:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),D(D({},n),{},{quantity:r}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),_=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"cart",D({actions:B},n)])}return P(t,j),x(t,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof I&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!z(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}])}(),X=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"payment-gateway",n])}return P(t,j),x(t,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}])}();function $(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function K(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Z(t,e){const r=$(t);return isNaN(e)?K(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const J=6048e5;let U={};function V(){return U}function tt(t,e){const r=V(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=$(t),o=a.getDay(),i=(o=a.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function nt(t){const e=$(t);return e.setHours(0,0,0,0),e}function at(t){const e=$(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function ot(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=$(t);return!isNaN(Number(r))}const it={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"}};function st(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const ut={date:st({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:st({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:st({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ct={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function dt(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=r?.width?String(r.width):e;n=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=r?.width?String(r.width):t.defaultWidth;n=t.values[a]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function ht(t){return(e,r={})=>{const n=r.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var lt;const ft={code:"en-US",formatDistance:(t,e,r)=>{let n;const a=it[t];return n="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:ut,formatRelative:(t,e,r,n)=>ct[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:dt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:dt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:dt({values:{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"]},defaultWidth:"wide"}),day:dt({values:{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"]},defaultWidth:"wide"}),dayPeriod:dt({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(lt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(lt.matchPattern);if(!r)return null;const n=r[0],a=t.match(lt.parsePattern);if(!a)return null;let o=lt.valueCallback?lt.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(n.length)}}),era:ht({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ht({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:ht({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:ht({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:ht({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function mt(t){const e=$(t),r=function(t,e){const r=nt(t),n=nt(e),a=+r-at(r),o=+n-at(n);return Math.round((a-o)/864e5)}(e,function(t){const e=$(t),r=K(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function pt(t){const e=$(t),r=+et(e)-+function(t){const e=rt(t),r=K(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),et(r)}(e);return Math.round(r/J)+1}function gt(t,e){const r=$(t),n=r.getFullYear(),a=V(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=K(t,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const s=tt(i,e),u=K(t,0);u.setFullYear(n,0,o),u.setHours(0,0,0,0);const c=tt(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function wt(t,e){const r=$(t),n=+tt(r,e)-+function(t,e){const r=V(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=gt(t,e),o=K(t,0);return o.setFullYear(a,0,n),o.setHours(0,0,0,0),tt(o,e)}(r,e);return Math.round(n/J)+1}function yt(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const vt={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return yt("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):yt(r+1,2)},d:(t,e)=>yt(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>yt(t.getHours()%12||12,e.length),H:(t,e)=>yt(t.getHours(),e.length),m:(t,e)=>yt(t.getMinutes(),e.length),s:(t,e)=>yt(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return yt(Math.trunc(n*Math.pow(10,r-3)),e.length)}},bt="midnight",kt="noon",xt="morning",Tt="afternoon",Mt="evening",Pt="night",St={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return vt.y(t,e)},Y:function(t,e,r,n){const a=gt(t,n),o=a>0?a:1-a;if("YY"===e){return yt(o%100,2)}return"Yo"===e?r.ordinalNumber(o,{unit:"year"}):yt(o,e.length)},R:function(t,e){return yt(rt(t),e.length)},u:function(t,e){return yt(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return yt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return yt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return vt.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return yt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const a=wt(t,n);return"wo"===e?r.ordinalNumber(a,{unit:"week"}):yt(a,e.length)},I:function(t,e,r){const n=pt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):yt(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):vt.d(t,e)},D:function(t,e,r){const n=mt(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):yt(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const a=t.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return yt(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const a=t.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return yt(o,e.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return yt(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let a;switch(a=12===n?kt:0===n?bt:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let a;switch(a=n>=17?Mt:n>=12?Tt:n>=4?xt:Pt,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return vt.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):vt.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):yt(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):yt(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):vt.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):vt.s(t,e)},S:function(t,e){return vt.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(0===n)return"Z";switch(e){case"X":return Dt(n);case"XXXX":case"XX":return Ot(n);default:return Ot(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return Dt(n);case"xxxx":case"xx":return Ot(n);default:return Ot(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Et(n,":");default:return"GMT"+Ot(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Et(n,":");default:return"GMT"+Ot(n,":")}},t:function(t,e,r){return yt(Math.trunc(t.getTime()/1e3),e.length)},T:function(t,e,r){return yt(t.getTime(),e.length)}};function Et(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=Math.trunc(n/60),o=n%60;return 0===o?r+String(a):r+String(a)+e+yt(o,2)}function Dt(t,e){if(t%60==0){return(t>0?"-":"+")+yt(Math.abs(t)/60,2)}return Ot(t,e)}function Ot(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+yt(Math.trunc(n/60),2)+e+yt(n%60,2)}const qt=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Ht=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Nt={p:Ht,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return qt(t,e);let o;switch(n){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",qt(n,e)).replace("{{time}}",Ht(a,e))}},At=/^D+$/,Lt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Yt(t){return At.test(t)}function Ct(t){return Lt.test(t)}function Ft(t,e,r){const n=function(t,e,r){const n="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,r);if(console.warn(n),jt.includes(t))throw new RangeError(n)}const Wt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,It=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qt=/^'([^]*?)'?$/,Rt=/''/g,Gt=/[a-zA-Z]/;function zt(t,e,r){const n=V(),a=n.locale??ft,o=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=$(t);if(!ot(s))throw new RangeError("Invalid time value");let u=e.match(It).map((t=>{const e=t[0];if("p"===e||"P"===e){return(0,Nt[e])(t,a.formatLong)}return t})).join("").match(Wt).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:Bt(t)};if(St[e])return{isToken:!0,value:t};if(e.match(Gt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const c={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return u.map((r=>{if(!r.isToken)return r.value;const n=r.value;(Ct(n)||Yt(n))&&Ft(n,e,String(t));return(0,St[n[0]])(s,n,a.localize,c)})).join("")}function Bt(t){const e=t.match(Qt);return e?e[1].replace(Rt,"'"):t}class _t{subPriority=0;validate(t,e){return!0}}class Xt extends _t{constructor(t,e,r,n,a){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class $t extends _t{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:K(t,function(t,e){const r=e instanceof Date?K(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Kt{run(t,e,r,n){const a=this.parse(t,e,r,n);return a?{setter:new Xt(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,r){return!0}}const Zt=/^(1[0-2]|0?\d)/,Jt=/^(3[0-1]|[0-2]?\d)/,Ut=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Vt=/^(5[0-3]|[0-4]?\d)/,te=/^(2[0-3]|[0-1]?\d)/,ee=/^(2[0-4]|[0-1]?\d)/,re=/^(1[0-1]|0?\d)/,ne=/^(1[0-2]|0?\d)/,ae=/^[0-5]?\d/,oe=/^[0-5]?\d/,ie=/^\d/,se=/^\d{1,2}/,ue=/^\d{1,3}/,ce=/^\d{1,4}/,de=/^-?\d+/,he=/^-?\d/,le=/^-?\d{1,2}/,fe=/^-?\d{1,3}/,me=/^-?\d{1,4}/,pe=/^([+-])(\d{2})(\d{2})?|Z/,ge=/^([+-])(\d{2})(\d{2})|Z/,we=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ye=/^([+-])(\d{2}):(\d{2})|Z/,ve=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function be(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ke(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function xe(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function Te(t){return ke(de,t)}function Me(t,e){switch(t){case 1:return ke(ie,e);case 2:return ke(se,e);case 3:return ke(ue,e);case 4:return ke(ce,e);default:return ke(new RegExp("^\\d{1,"+t+"}"),e)}}function Pe(t,e){switch(t){case 1:return ke(he,e);case 2:return ke(le,e);case 3:return ke(fe,e);case 4:return ke(me,e);default:return ke(new RegExp("^-?\\d{1,"+t+"}"),e)}}function Se(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Ee(t,e){const r=e>0,n=r?e:1-e;let a;if(n<=50)a=t||100;else{const e=n+50;a=t+100*Math.trunc(e/100)-(t>=e%100?100:0)}return r?a:1-a}function De(t){return t%400==0||t%4==0&&t%100!=0}const Oe=[31,28,31,30,31,30,31,31,30,31,30,31],qe=[31,29,31,30,31,30,31,31,30,31,30,31];function He(t,e,r){const n=V(),a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=$(t),i=o.getDay(),s=7-a;return Z(o,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function Ne(t,e){const r=$(t),n=function(t){let e=$(t).getDay();return 0===e&&(e=7),e}(r);return Z(r,e-n)}const Ae={G:new class extends Kt{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Kt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return be(Me(4,t),n);case"yo":return be(r.ordinalNumber(t,{unit:"year"}),n);default:return be(Me(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=Ee(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Kt{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return be(Me(4,t),n);case"Yo":return be(r.ordinalNumber(t,{unit:"year"}),n);default:return be(Me(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const a=gt(t,n);if(r.isTwoDigitYear){const e=Ee(r.year,a);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),tt(t,n)}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),tt(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Kt{priority=130;parse(t,e){return Pe("R"===e?4:e.length,t)}set(t,e,r){const n=K(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),et(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Kt{priority=130;parse(t,e){return Pe("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Kt{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return Me(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Kt{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return Me(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Kt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return be(ke(Zt,t),n);case"MM":return be(Me(2,t),n);case"Mo":return be(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Kt{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return be(ke(Zt,t),n);case"LL":return be(Me(2,t),n);case"Lo":return be(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Kt{priority=100;parse(t,e,r){switch(e){case"w":return ke(Vt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return tt(function(t,e,r){const n=$(t),a=wt(n,r)-e;return n.setDate(n.getDate()-7*a),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Kt{priority=100;parse(t,e,r){switch(e){case"I":return ke(Vt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return et(function(t,e){const r=$(t),n=pt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Kt{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return ke(Jt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return Me(e.length,t)}}validate(t,e){const r=De(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=qe[n]:e>=1&&e<=Oe[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Kt{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return ke(Ut,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return Me(e.length,t)}}validate(t,e){return De(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Kt{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=He(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Kt{priority=90;parse(t,e,r,n){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return be(Me(e.length,t),a);case"eo":return be(r.ordinalNumber(t,{unit:"day"}),a);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=He(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Kt{priority=90;parse(t,e,r,n){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return be(Me(e.length,t),a);case"co":return be(r.ordinalNumber(t,{unit:"day"}),a);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=He(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Kt{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return Me(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return be(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return be(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return be(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return be(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=Ne(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Se(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Se(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Se(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"h":return ke(ne,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"H":return ke(te,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"K":return ke(re,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"k":return ke(ee,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Kt{priority=60;parse(t,e,r){switch(e){case"m":return ke(ae,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Kt{priority=50;parse(t,e,r){switch(e){case"s":return ke(oe,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Kt{priority=30;parse(t,e){return be(Me(e.length,t),(t=>Math.trunc(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Kt{priority=10;parse(t,e){switch(e){case"X":return xe(pe,t);case"XX":return xe(ge,t);case"XXXX":return xe(we,t);case"XXXXX":return xe(ve,t);default:return xe(ye,t)}}set(t,e,r){return e.timestampIsSet?t:K(t,t.getTime()-at(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Kt{priority=10;parse(t,e){switch(e){case"x":return xe(pe,t);case"xx":return xe(ge,t);case"xxxx":return xe(we,t);case"xxxxx":return xe(ve,t);default:return xe(ye,t)}}set(t,e,r){return e.timestampIsSet?t:K(t,t.getTime()-at(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Kt{priority=40;parse(t){return Te(t)}set(t,e,r){return[K(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Kt{priority=20;parse(t){return Te(t)}set(t,e,r){return[K(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},Le=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,je=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ye=/^'([^]*?)'?$/,Ce=/''/g,Fe=/\S/,We=/[a-zA-Z]/;function Ie(t,e,r,n){const a=Object.assign({},V()),o=a.locale??ft,i=a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?$(r):K(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o},c=[new $t],d=e.match(je).map((t=>{const e=t[0];if(e in Nt){return(0,Nt[e])(t,o.formatLong)}return t})).join("").match(Le),h=[];for(let n of d){Ct(n)&&Ft(n,e,t),Yt(n)&&Ft(n,e,t);const a=n[0],i=Ae[a];if(i){const{incompatibleTokens:e}=i;if(Array.isArray(e)){const t=h.find((t=>e.includes(t.token)||t.token===a));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${n}\` at the same time`)}else if("*"===i.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);h.push({token:a,fullToken:n});const s=i.run(t,n,o.match,u);if(!s)return K(r,NaN);c.push(s.setter),t=s.rest}else{if(a.match(We))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if("''"===n?n="'":"'"===a&&(n=n.match(Ye)[1].replace(Ce,"'")),0!==t.indexOf(n))return K(r,NaN);t=t.slice(n.length)}}if(t.length>0&&Fe.test(t))return K(r,NaN);const l=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=$(r);if(isNaN(f.getTime()))return K(r,NaN);const m={};for(const t of l){if(!t.validate(f,u))return K(r,NaN);const e=t.set(f,m,u);Array.isArray(e)?(f=e[0],Object.assign(m,e[1])):f=e}return K(r,f)}var Qe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"store-hour",n])}return P(t,j),x(t,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Ie(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Ie(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return ot(this.startDateInstance)&&ot(this.endDateInstance)?"".concat(zt(this.startDateInstance,"p")," - ").concat(zt(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}])}(),Re=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"store-location",n])}return P(t,j),x(t,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new r(this.getAttribute("hours").map((function(t){return new Qe(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=zt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"store",n])}return P(t,j),x(t,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",D({store:this.id},e)).then((function(e){return new r(e.map((function(e){return new C(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",D({store:this.id},e)).then((function(e){return new r(e.map((function(e){return e.place&&(e.place=new n(e.place)),new Re(e,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Re(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",e).then((function(e){return new r(e.map((function(e){return new X(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new X(t,e.adapter)}))}}])}(),ze=Array.isArray,Be=function(){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),r instanceof i?O(e,e=y(this,t,[{},r,"service-quote",a])):y(this,t,[r,n,"service-quote",a])}return P(t,o),x(t,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ue(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return W(e)||W(r)?null:F(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(n=w(q().mark((function e(n,a,o){var i,s,u,c,d,h,l=this,f=arguments;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=f.length>3&&void 0!==f[3]?f[3]:"storefront",d=f.length>4&&void 0!==f[4]&&f[4],null!==(i=n)&&void 0!==i&&i.id&&(n=n.id),null!==(s=a)&&void 0!==s&&s.id&&(a=a.id),null!==(u=o)&&void 0!==u&&u.id&&(o=o.id),e.prev=5,e.next=8,this.adapter.get("service-quotes/from-cart",{origin:n,destination:a,cart:o,config:c,all:d});case 8:if(h=e.sent,!ze(h)){e.next=11;break}return e.abrupt("return",new r(h.map((function(e){return new t(e,l.adapter)}))));case 11:return e.abrupt("return",new t(h,this.adapter));case 14:throw e.prev=14,e.t0=e.catch(5),console.error("Error fetching service quotes:",e.t0),e.t0;case 18:case"end":return e.stop()}}),e,this,[[5,14]])}))),function(t,e,r){return n.apply(this,arguments)})}],[{key:"getFromCart",value:(e=w(q().mark((function e(r,n,a,o){var i,s,u,c=arguments;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=c.length>4&&void 0!==c[4]?c[4]:"storefront",s=c.length>5&&void 0!==c[5]&&c[5],u=new t(r),e.abrupt("return",u.fetchServiceQuotesFromCart(n,a,o,i,s));case 4:case"end":return e.stop()}}),e)}))),function(t,r,n,a){return e.apply(this,arguments)})}]);var e,n}(),_e=new e({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,e,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return s(t)&&(t=t.id),s(e)&&(e=e.id),s(r)&&(r=r.id),s(n)&&(n=n.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),D(D({},a),{},{customer:t,cart:e,serviceQuote:r,gateway:n}),o)},captureOrder:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:t,transactionDetails:e},r).then((function(t){return new a(t)}))},createStripeSetupIntent:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(t)&&(t=t.id),this.adapter.post("".concat(this.namespace,"/stripe-setup-intent"),{customer:t},e)},updateStripePaymentIntent:function(t,e,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return s(e)&&(e=e.id),s(r)&&(r=r.id),s(n)&&(n=n.id),this.adapter.put("".concat(this.namespace,"/stripe-update-payment-intent"),D({paymentIntent:t,customer:e,cart:r,serviceQuote:n},a),o)}}),Xe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v(this,t),y(this,t,[e,r,"checkout",n])}return P(t,j),x(t,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}])}(),$e={Product:I,Category:Q,Customer:G,Cart:_,DeliveryServiceQuote:Be,Store:Ge,StoreLocation:Re,StoreHour:Qe,Checkout:Xe,Review:C},Ke={BrowserAdapter:d,NodeAdapter:h};var Ze=function(){return x((function t(){return v(this,t),this.resources=$e,this.adapters=Ke,this.lookup.apply(this,arguments)}),[{key:"lookup",value:function(t,e){var r=u(t),n=e.split(/[^a-zA-Z0-9]/).filter(Boolean).map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(""),a=Array.prototype.slice.call(arguments).slice(2);if(!this[r])throw new Error("Attempted to resolve invalid type");if(!this[r][n])throw new Error("No ".concat(c(t)," named ").concat(e," (").concat(n,") to resolve"));return b(this[r][n],N(a))}}])}(),Je=function(){return b(Ze,Array.prototype.slice.call(arguments))},Ue=function(){function t(){return v(this,t),y(this,t,arguments)}return P(t,m),x(t,[{key:"extendActions",value:function(){return l(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"serialize",value:function(t){return Je("resource",f(this.resource),t,this.adapter)}}])}();export{Q as C,Be as D,X as P,C as R,j as S,P as _,x as a,v as b,y as c,w as d,q as e,Ge as f,Re as g,b as h,D as i,I as j,Ue as k,Je as l,R as m,B as n,_e as o,G as p,_ as q,Y as r,Qe as s,Xe as t,$e as u,Ze as v}; +//# sourceMappingURL=store-DTqxvCQ3.js.map diff --git a/dist/esm/store-DTqxvCQ3.js.map b/dist/esm/store-DTqxvCQ3.js.map new file mode 100644 index 0000000..1da8f30 --- /dev/null +++ b/dist/esm/store-DTqxvCQ3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"store-DTqxvCQ3.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n\n getStripeEphemeralKey(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-ephemeral-key', params);\n }\n\n getStripeSetupIntent(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-setup-intent', params);\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { toDate } from \"../toDate.mjs\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(date.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n const timestamp = date.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n // We want here floor instead of trunc, so we get -7 for value 0 instead of 0\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.trunc(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { longFormatters, parsers };\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst objectToParams = (obj = {}, prefix = null) => {\n if (obj === null || obj === undefined) {\n return {};\n }\n\n const parsed = {};\n const keys = Object.keys(obj);\n\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n const value = obj[key];\n\n if (key && value) {\n if (prefix && typeof prefix === 'string') {\n parsed[`${prefix}[${key}]`] = value;\n continue;\n }\n\n parsed[key] = value;\n }\n }\n\n return parsed;\n};\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n\n createStripeSetupIntent: function (customer, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n return this.adapter.post(`${this.namespace}/stripe-setup-intent`, { customer }, options);\n },\n\n updateStripePaymentIntent: function (paymentIntent, customer, cart, serviceQuote, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n return this.adapter.put(`${this.namespace}/stripe-update-payment-intent`, { paymentIntent, customer, cart, serviceQuote, ...orderOptions }, options);\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nexport const resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nfunction toStudlyCase(str) {\n return str\n .split(/[^a-zA-Z0-9]/) // Split by non-alphanumeric characters\n .filter(Boolean) // Remove empty elements\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize the first letter of each word\n .join(''); // Join the words together without spaces\n}\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const classKey = toStudlyCase(className);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][classKey]) {\n throw new Error(`No ${singularize(type)} named ${className} (${classKey}) to resolve`);\n }\n\n return new this[key][classKey](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n\nexport default Resolver;\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n"],"names":["StorefrontResource","_classCallCheck","_callSuper","this","arguments","_inherits","Resource","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","apply","_performAuthorizedRequest","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_getSavedPlaces","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_getOrderHistory","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","call","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","trunc","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","dayOfYearTokenRE","weekYearTokenRE","throwTokens","isProtectedDayOfYearToken","isProtectedWeekYearToken","warnOrThrowProtectedError","input","_message","subject","message","warn","includes","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","originalDate","parts","substring","firstCharacter","longFormatter","join","isToken","cleanEscapedString","preprocessor","formatterOptions","part","formatter","matched","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","floor","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","fullToken","push","indexOf","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","DeliveryServiceQuote","Adapter","_possibleConstructorReturn","ServiceQuote","_fetchServiceQuotesFromCart","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","_args","serviceQuote","_x3","_getFromCart","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","createStripeSetupIntent","updateStripePaymentIntent","paymentIntent","Checkout","_this$store","_this$store2","resources","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","classKey","Boolean","word","charAt","singularize","_construct","_toConsumableArray","extendStoreActions","json","classify"],"mappings":"45UAGqBA,IAAAA,aAAkB,SAAAA,IAAA,OAAAC,OAAAD,GAAAE,EAAAC,KAAAH,EAAAI,UAAA,CAAA,OAAAC,EAAAL,EAASM,GAATC,EAAAP,EAAA,CAAA,CAAAQ,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAR,KAAKO,QAAUA,EACfP,KAAKS,MAAQ,IAAIC,GAAgBV,KAAKW,SAAUJ,EAAS,CACrDK,aAAcZ,KAAKa,eAAeC,KAAKd,MACvCe,QAAqBP,QAAdA,EAAER,KAAKgB,eAALR,IAAYA,OAAZA,EAAAA,EAAcO,UAGpBf,IACX,IAAC,ICfCiB,EAAgB,IAAIC,EAAa,CACnCC,MAAO,SAAUC,GAAuB,IAAdJ,EAAOf,UAAAoB,OAAA,QAAAC,IA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,IAAA,SAAAC,MAED,SAAO2I,EAAMmb,GACT,IAAM/jB,EAAMgkB,EAAUpb,GAChBqb,EAAwBF,EAhB7B7D,MAAM,gBACNT,OAAOyE,SACPhhB,KAAI,SAACihB,GAAI,OAAKA,EAAKC,OAAO,GAAGlQ,cAAgBiQ,EAAKtU,MAAM,EAAE,IAC1DiK,KAAK,IAcA5Y,EAASmG,MAAA4B,UAAA4G,MAAA1G,KAAIvJ,WAAWiQ,MAAM,GAEpC,IAAKlQ,KAAKK,GACN,MAAM,IAAI8D,MAAM,qCAGpB,IAAKnE,KAAKK,GAAKikB,GACX,MAAM,IAAIngB,MAAK,MAAA1C,OAAOijB,EAAYzb,GAAKxH,WAAAA,OAAU2iB,EAAS,MAAA3iB,OAAK6iB,mBAGnE,OAAAK,EAAW3kB,KAAKK,GAAKikB,GAASM,EAAIrjB,GACtC,IAAC,CAtBS,GAyBR4iB,GAAS,WACX,OAAAQ,EAAWT,GAAQxc,MAAA4B,UAAA4G,MAAA1G,KAAIvJ,WAC3B,ECrDqBS,cACjB,SAAAA,IAAc,OAAAZ,OAAAY,GAAAX,EAAAC,KAAAU,EACDT,UACb,CAAC,OAAAC,EAAAQ,EAHwCugB,GAGxC7gB,EAAAM,EAAA,CAAA,CAAAL,IAAA,gBAAAC,MAED,WACI,OAAOukB,EAAmB7kB,KADTC,UAAAoB,OAAA,QAAAC,IAAArB,UAAA,GAAAA,UAAA,GAAG,GAExB,GAAC,CAAAI,IAAA,YAAAC,MAED,SAAUwkB,GACN,OAAOX,GAAO,WAAYY,EAAS/kB,KAAKW,UAAWmkB,EAAM9kB,KAAKO,QAClE,IAAC","x_google_ignoreList":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89]} \ No newline at end of file diff --git a/dist/esm/store-a1153df9.js b/dist/esm/store-a1153df9.js new file mode 100644 index 0000000..1dd6fc2 --- /dev/null +++ b/dist/esm/store-a1153df9.js @@ -0,0 +1,2 @@ +import t from"axios";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(F(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat(H(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var a=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return B(t,a,n)},Z=function(t,e,n){return _(t,e,0,[n]),n},V=function(t){R(n,M(Array));var e=q(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return I(this,0)}},{key:"last",get:function(){return I(this,this.length-1)}},{key:"replace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return _(this,t,e,n),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return I(e,t)}))}},{key:"objectAt",value:function(t){return I(this,t)}},{key:"indexOf",value:function(t,e){return J(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(I(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==J(this,t,e,!0)}},{key:"findBy",value:function(){return G(this,Q.apply(void 0,arguments))}},{key:"findIndexBy",value:function(){return B(this,Q.apply(void 0,arguments))}},{key:"isEvery",value:function(){return K(this,Q.apply(void 0,arguments))}},{key:"isAny",value:function(){return X(this,Q.apply(void 0,arguments))}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:z,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return Z(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return _(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=I(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=I(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return Z(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;)I(this,e)===t&&this.removeAt(e);return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),tt=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=k(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1},et=function(t){return tt(t)||"string"==typeof t&&!1===/\S/.test(t)};function nt(t){return t instanceof lt}var rt=function(){var t,e,n,r,i;return!("undefined"==typeof process||"object"!==k(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(r=window)||void 0===r||null===(i=r.navigator)||void 0===i?void 0:i.product))},it=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rt()?Rt("adapter","NodeAdapter",t):Rt("adapter","BrowserAdapter",t)},at=Array.isArray;!function(){function t(e){C(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}E(t,[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=b(b({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}])}();var ot=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;C(this,t),this.type="Point",this.coordinates=[n,e]}return E(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=$(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}();"undefined"==typeof arguments||arguments;var ut=function(t,e){var n=t();return Array.isArray(n)||"object"===k(n)?st(n,e):null},st=function t(e,n){var r,i=e,a=k(e),o="object"===a,u="function"===a,s=Array.isArray(e),c="string"===k(n)&&n.includes(".")?n.split("."):[n];if(s||o){for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;C(this,t),this.actions=e,this.bind=n}return E(t,[{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&"object"===k(this.actions))for(var n in this.actions){var r=this.actions[n];ct(e,n,"function"==typeof r?r.bind(e):r)}return this}}]),t}(),lt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};C(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}return E(t,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new St(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return tt(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===k(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return ct(this.attributes,t,n),ct(this.dirtyAttributes,t,r),F(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=st(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(F(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return F(t)?this.hasAttribute(t)&&t.every((function(t){return!tt(e.getAttribute(t))})):this.hasAttribute(t)&&!tt(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!F(t))throw new Error("No attribute properties provided!");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=b(b({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),dt=new ht({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),{},e)}}),ft=function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"order",b({actions:dt},i))}return E(n,[{key:"getDistanceAndTime",value:function(){return this.store.getDistanceAndTime(this.id)}}]),n}(),vt=function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"payload",i)}return E(n,[{key:"attach",value:function(t){}},{key:"entities",get:function(){}},{key:"dropoff",get:function(){}},{key:"pickup",get:function(){}},{key:"waypoints",get:function(){return new V(this.waypoints)}}]),n}();!function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"entity",i)}}();var gt=function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"place",i)}return E(n,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new ot))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new ot))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return nt(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute("coordinates"),a=$(i,2),o=a[0],u=a[1],s={name:null,address:t.getAttribute("address"),location:new ot(o,u),street1:t.getAttribute("streetName"),street2:null,city:t.getAttribute("city"),province:t.getAttribute("stateLong"),postal_code:t.getAttribute("postalCode"),neighborhood:t.get("neighborhood"),district:t.getAttribute("county"),building:t.get("building"),country:t.getAttribute("countryShort"),phone:null,security_access_code:null};return new n(s,e,r)}}]),n}();!function(t){R(n,gt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"waypoint",i)}}(),function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"tracking-status",i)}}(),function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"vehicle",i)}}(),function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"driver",i)}}(),function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"vendor",i)}}(),function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"contact",i)}}(),function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"zone",i)}}(),function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"service-area",i)}}(),function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"service-rate",i)}}();var pt=function(t){R(n,lt);var e=q(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C(this,n),e.call(this,t,r,"service-quote",i)}return E(n,[{key:"fromPreliminary",value:function(){}},{key:"fromPayload",value:function(){}}]),n}(),yt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};C(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},mt=function(t){R(n,yt);var e=q(n);function n(t){var r;return C(this,n),(r=e.call(this,t)).setHeaders({Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),r}return E(n,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=b(b({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(a,o){return fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),b({method:n,mode:i.mode||"cors",headers:new Headers(b(b({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){return t.ok?a(t.json):o(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){o(t)}))}))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=et(e)?"":new URLSearchParams(e).toString();return this.request("".concat(t).concat(r?"?".concat(r):""),"GET",{},n)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}]),n}(),wt=function(e){R(r,yt);var n=q(r);function r(e){var i;return C(this,r),(i=n.call(this,e)).axios=t.create({baseURL:"".concat(i.host,"/").concat(i.namespace),headers:{Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),i}return E(r,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=b(b({},e),t),this}},{key:"transform",value:function(t){return t.data}},{key:"handleError",value:function(t){if(t.response){var e=t.response.data;if(F(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=et(e)?"":new URLSearchParams(e).toString();return this.axios.get("".concat(t).concat(r?"?".concat(r):""),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),r}(),bt=function(t){R(n,yt);var e=q(n);function n(){return C(this,n),e.apply(this,arguments)}return n}(),kt=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];C(this,t),D(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),D(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),D(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),D(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),D(this,"idSuffix",new RegExp("(_ids|_id)$","g")),D(this,"underbar",new RegExp("_","g")),D(this,"spaceOrUnderbar",new RegExp("[ _]","g")),D(this,"uppercase",new RegExp("([A-Z])","g")),D(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return E(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=F(e)?e:[e],!F(e))return e instanceof ht&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};C(this,t),this.resource=e,this.adapter=n||it(),this.namespace=Tt(e),this.storage=new V,this.options=r,this.extendActions(r.actions)}return E(t,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ot(this,t)}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return Rt("resource",Ct(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),F(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=x(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"update",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=x(regeneratorRuntime.mark((function i(a,o){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put("".concat(e.namespace,"/").concat(t),n,r).then(e.afterFetch.bind(e)).catch(o);case 2:u=i.sent,a(u);case 4:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:"findRecord",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=x(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get("".concat(e.namespace,"/").concat(t),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"findAll",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=x(regeneratorRuntime.mark((function n(r,i){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get("".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:a=n.sent,r(a);case 4:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:"query",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=x(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"queryRecord",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=x(regeneratorRuntime.mark((function r(i,a){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get("".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(a);case 2:o=r.sent,i(o);case 4:case"end":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"destroy",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=nt(t)?t.getAttribute("id"):t;return new Promise(function(){var t=x(regeneratorRuntime.mark((function t(i,a){var o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete("".concat(e.namespace,"/").concat(r),{},n).then(e.afterFetch.bind(e)).catch(a);case 2:o=t.sent,i(o);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}();!function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(C(this,t),this.version=n.version||"v1",this.options={version:this.version,host:n.host||"https://api.fleetbase.io",namespace:this.version||n.namespace,debug:r,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!rt()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=n.adapter||it(this.options),this.orders=new St("order",this.adapter).extendActions(dt),this.entities=new St("entity",this.adapter),this.places=new St("place",this.adapter),this.drivers=new St("driver",this.adapter),this.vehicles=new St("vehicle",this.adapter),this.vendors=new St("vendor",this.adapter),this.contacts=new St("contact",this.adapter)}E(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return U(t,Array.prototype.slice.call(arguments))}}])}();var Pt=function(t){h(n,lt);var e=p(n);function n(){return o(this,n),e.apply(this,arguments)}return s(n,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Vn(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}}]),n}(),Ut=new ht({count:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};return t&&(n.store=t),this.adapter.get("".concat(this.namespace,"/count"),n,e)}}),Mt=function(t){h(n,Pt);var e=p(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"review",i)}return s(n,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),n}(),jt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(t)};function qt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:n}).format(t)}var $t=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=r(t);if("object"===n){var i=t.size;if("number"==typeof i)return!i}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var a=t.length;if("number"==typeof a)return!a}return!1},Ht=function(t){h(n,Pt);var e=p(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"product",i)}return s(n,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,n=t.sale_price,r=t.currency;return this.isOnSale?$t(n)||$t(r)?null:qt(n/100,r):$t(e)||$t(r)?null:qt(e/100,r)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new V(e.map((function(e){return new Mt(e,t.adapter)})))}))}}]),n}(),Nt=function(t){h(n,Pt);var e=p(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"category",i)}return s(n,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new V(e.map((function(e){return new Ht(e,t.adapter)})))}))}}]),n}(),Yt=new ht({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(jt(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",n({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",n({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",n({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),Ft=function(t){h(l,Pt);var e,r,i,u,c=p(l);function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,l),c.call(this,t,e,"customer",n({actions:Yt},r))}return s(l,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Vn(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(u=a(regeneratorRuntime.mark((function t(e){var n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return n})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=a(regeneratorRuntime.mark((function t(e){var n,r,i,a,o=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:"GET",t.prev=2,i={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(i)[r.toLowerCase()](e,n);case 6:return a=t.sent,t.abrupt("return",a);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(r," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(r=a(regeneratorRuntime.mark((function t(){var e,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return e=t.sent,t.abrupt("return",new V(e.map((function(t){return new gt(t,n.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return r.apply(this,arguments)})},{key:"getOrderHistory",value:(e=a(regeneratorRuntime.mark((function t(){var e,n,r=this,i=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",e);case 4:return n=t.sent,t.abrupt("return",new V(n.map((function(t){return new ft(t,r.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return e.apply(this,arguments)})},{key:"getStripeEphemeralKey",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-ephemeral-key",t)}},{key:"getStripeSetupIntent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/stripe-setup-intent",t)}}]),l}(),Lt=Array.isArray,_t=new ht({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},i),{},{quantity:r}),a).then(this.afterFetch.bind(this))},update:function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),n(n({},i),{},{quantity:r}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},n).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),zt=function(t){h(r,Pt);var e=p(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),e.call(this,t,i,"cart",n({actions:_t},a))}return s(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof Ht&&(t=t.id),this.store.add(this.id,t,e,n,r)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,n,r)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!Lt(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}(),Wt=function(t){h(n,Pt);var e=p(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"payment-gateway",i)}return s(n,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),n}();function It(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Qt(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function Bt(t){Qt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(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 Gt(t,e){Qt(2,arguments);var n=Bt(t).getTime(),r=It(e);return new Date(n+r)}function Xt(t){var 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 Kt(t){return Qt(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function Jt(t){if(Qt(1,arguments),!Kt(t)&&"number"!=typeof t)return!1;var e=Bt(t);return!isNaN(Number(e))}var Zt={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"}},Vt=function(t,e,n){var r,i=Zt[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function te(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var ee={date:te({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:te({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:te({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ne={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function re(t){return function(e,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=i.width?String(i.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var u=t.defaultWidth,s=i.width?String(i.width):t.defaultWidth;r=t.values[s]||t.values[u]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function ie(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],a=e.match(i);if(!a)return null;var o,u=a[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?oe(s,(function(t){return t.test(u)})):ae(s,(function(t){return t.test(u)}));o=t.valueCallback?t.valueCallback(c):c,o=n.valueCallback?n.valueCallback(o):o;var h=e.slice(u.length);return{value:o,rest:h}}}function ae(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function oe(t,e){for(var n=0;n20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:re({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:re({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:re({values:{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"]},defaultWidth:"wide"}),day:re({values:{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"]},defaultWidth:"wide"}),dayPeriod:re({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ue={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(ue.matchPattern);if(!n)return null;var r=n[0],i=t.match(ue.parsePattern);if(!i)return null;var a=ue.valueCallback?ue.valueCallback(i[0]):i[0];a=e.valueCallback?e.valueCallback(a):a;var o=t.slice(r.length);return{value:a,rest:o}}),era:ie({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ie({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ie({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:ie({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:ie({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ce(t,e){Qt(2,arguments);var n=It(e);return Gt(t,-n)}function he(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?n:1-n;return he("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):he(n+1,2)},d:function(t,e){return he(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return he(t.getUTCHours()%12||12,e.length)},H:function(t,e){return he(t.getUTCHours(),e.length)},m:function(t,e){return he(t.getUTCMinutes(),e.length)},s:function(t,e){return he(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return he(Math.floor(r*Math.pow(10,n-3)),e.length)}};function de(t){Qt(1,arguments);var e=1,n=Bt(t),r=n.getUTCDay(),i=(r=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function ve(t){Qt(1,arguments);var e=fe(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=de(n);return r}function ge(t){Qt(1,arguments);var e=Bt(t),n=de(e).getTime()-ve(e).getTime();return Math.round(n/6048e5)+1}function pe(t,e){Qt(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,a=null==i?0:It(i),o=null==n.weekStartsOn?a:It(n.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Bt(t),s=u.getUTCDay(),c=(s=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(r+1,0,s),c.setUTCHours(0,0,0,0);var h=pe(c,e),l=new Date(0);l.setUTCFullYear(r,0,s),l.setUTCHours(0,0,0,0);var d=pe(l,e);return n.getTime()>=h.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function me(t,e){Qt(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,a=null==i?1:It(i),o=null==n.firstWeekContainsDate?a:It(n.firstWeekContainsDate),u=ye(t,e),s=new Date(0);s.setUTCFullYear(u,0,o),s.setUTCHours(0,0,0,0);var c=pe(s,e);return c}function we(t,e){Qt(1,arguments);var n=Bt(t),r=pe(n,e).getTime()-me(n,e).getTime();return Math.round(r/6048e5)+1}var be="midnight",ke="noon",Te="morning",xe="afternoon",Ce="evening",Ae="night",Ee={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return le.y(t,e)},Y:function(t,e,n,r){var i=ye(t,r),a=i>0?i:1-i;return"YY"===e?he(a%100,2):"Yo"===e?n.ordinalNumber(a,{unit:"year"}):he(a,e.length)},R:function(t,e){return he(fe(t),e.length)},u:function(t,e){return he(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return he(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return he(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return le.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return he(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=we(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):he(i,e.length)},I:function(t,e,n){var r=ge(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):he(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):le.d(t,e)},D:function(t,e,n){var r=function(t){Qt(1,arguments);var e=Bt(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):he(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":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"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return he(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return he(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return he(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){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"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?ke:0===i?be:i/12>=1?"pm":"am",e){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"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?Ce:i>=12?xe:i>=4?Te:Ae,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return le.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):le.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):he(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):he(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):le.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):le.s(t,e)},S:function(t,e){return le.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return Re(i);case"XXXX":case"XX":return Oe(i);default:return Oe(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return Re(i);case"xxxx":case"xx":return Oe(i);default:return Oe(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+De(i,":");default:return"GMT"+Oe(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+De(i,":");default:return"GMT"+Oe(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return he(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return he((r._originalDate||t).getTime(),e.length)}};function De(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),a=r%60;if(0===a)return n+String(i);var o=e||"";return n+String(i)+o+he(a,2)}function Re(t,e){return t%60==0?(t>0?"-":"+")+he(Math.abs(t)/60,2):Oe(t,e)}function Oe(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+he(Math.floor(i/60),2)+n+he(i%60,2)}var Se=Ee;function Pe(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}}function Ue(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}}var Me={p:Ue,P:function(t,e){var n,r=t.match(/(P+)(p+)?/),i=r[1],a=r[2];if(!a)return Pe(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",Pe(i,e)).replace("{{time}}",Ue(a,e))}},je=Me,qe=["D","DD"],$e=["YY","YYYY"];function He(t){return-1!==qe.indexOf(t)}function Ne(t){return-1!==$e.indexOf(t)}function Ye(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Fe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Le=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_e=/^'([^]*?)'?$/,ze=/''/g,We=/[a-zA-Z]/;function Ie(t,e,n){Qt(2,arguments);var r=String(e),i=n||{},a=i.locale||se,o=a.options&&a.options.firstWeekContainsDate,u=null==o?1:It(o),s=null==i.firstWeekContainsDate?u:It(i.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,h=null==c?0:It(c),l=null==i.weekStartsOn?h:It(i.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=Bt(t);if(!Jt(d))throw new RangeError("Invalid time value");var f=Xt(d),v=ce(d,f),g={firstWeekContainsDate:s,weekStartsOn:l,locale:a,_originalDate:d},p=r.match(Le).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,je[e])(t,a.formatLong,g):t})).join("").match(Fe).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return Qe(n);var o=Se[r];if(o)return!i.useAdditionalWeekYearTokens&&Ne(n)&&Ye(n,e,t),!i.useAdditionalDayOfYearTokens&&He(n)&&Ye(n,e,t),o(v,n,a.localize,g);if(r.match(We))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return p}function Qe(t){return t.match(_e)[1].replace(ze,"'")}function Be(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Ge(t,e,n){Qt(2,arguments);var r=n||{},i=r.locale,a=i&&i.options&&i.options.weekStartsOn,o=null==a?0:It(a),u=null==r.weekStartsOn?o:It(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Bt(t),c=It(e),h=s.getUTCDay(),l=c%7,d=(l+7)%7,f=(d0,i=r?e:1-e;if(i<=50)n=t||100;else{var a=i+50;n=t+100*Math.floor(a/100)-(t>=a%100?100:0)}return r?n:1-n}var Dn=[31,28,31,30,31,30,31,31,30,31,30,31],Rn=[31,29,31,30,31,30,31,31,30,31,30,31];function On(t){return t%400==0||t%4==0&&t%100!=0}var Sn={G:{priority:140,parse:function(t,e,n,r){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}},set:function(t,e,n,r){return e.era=n,t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return xn(4,t,i);case"yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return xn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=t.getUTCFullYear();if(n.isTwoDigitYear){var a=En(n.year,i);return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return xn(4,t,i);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return xn(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=ye(t,r);if(n.isTwoDigitYear){var a=En(n.year,i);return t.setUTCFullYear(a,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),pe(t,r)}var o="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(o,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),pe(t,r)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,n,r){return Cn("R"===e?4:e.length,t)},set:function(t,e,n,r){var i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),de(i)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,n,r){return Cn("u"===e?4:e.length,t)},set:function(t,e,n,r){return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,n,r){switch(e){case"Q":case"QQ":return xn(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,n,r){switch(e){case"q":case"qq":return xn(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"M":return bn(Xe,t,i);case"MM":return xn(2,t,i);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"L":return bn(Xe,t,i);case"LL":return xn(2,t,i);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,n,r){switch(e){case"w":return bn(Ze,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return xn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return pe(function(t,e,n){Qt(2,arguments);var r=Bt(t),i=It(e),a=we(r,n)-i;return r.setUTCDate(r.getUTCDate()-7*a),r}(t,n,r),r)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,n,r){switch(e){case"I":return bn(Ze,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return xn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return de(function(t,e){Qt(2,arguments);var n=Bt(t),r=It(e),i=ge(n)-r;return n.setUTCDate(n.getUTCDate()-7*i),n}(t,n,r),r)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"d":return bn(Ke,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return xn(e.length,t)}},validate:function(t,e,n){var r=On(t.getUTCFullYear()),i=t.getUTCMonth();return r?e>=1&&e<=Rn[i]:e>=1&&e<=Dn[i]},set:function(t,e,n,r){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"D":case"DD":return bn(Je,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return xn(e.length,t)}},validate:function(t,e,n){return On(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n,r){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,n,r){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Ge(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return xn(e.length,t,i);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Ge(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return xn(e.length,t,i);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Ge(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,n,r){var i=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return xn(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});default:return n.day(t,{width:"wide",context:"formatting",valueCallback:i})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n,r){return t=function(t,e){Qt(2,arguments);var n=It(e);n%7==0&&(n-=7);var r=1,i=Bt(t),a=i.getUTCDay(),o=((n%7+7)%7=1&&e<=12},set:function(t,e,n,r){var i=t.getUTCHours()>=12;return i&&n<12?t.setUTCHours(n+12,0,0,0):i||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,n,r){switch(e){case"H":return bn(Ve,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return xn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n,r){return t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,n,r){switch(e){case"K":return bn(en,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return xn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,n,r){switch(e){case"k":return bn(tn,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return xn(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n,r){var i=n<=24?n%24:n;return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,n,r){switch(e){case"m":return bn(rn,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return xn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCMinutes(n,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,n,r){switch(e){case"s":return bn(an,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return xn(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCSeconds(n,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,n,r){return xn(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,n,r){return t.setUTCMilliseconds(n),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,n,r){switch(e){case"X":return kn(gn,t);case"XX":return kn(pn,t);case"XXXX":return kn(yn,t);case"XXXXX":return kn(wn,t);default:return kn(mn,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,n,r){switch(e){case"x":return kn(gn,t);case"xx":return kn(pn,t);case"xxxx":return kn(yn,t);case"xxxxx":return kn(wn,t);default:return kn(mn,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,n,r){return Tn(t)},set:function(t,e,n,r){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,n,r){return Tn(t)},set:function(t,e,n,r){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}},Pn=Sn,Un=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jn=/^'([^]*?)'?$/,qn=/''/g,$n=/\S/,Hn=/[a-zA-Z]/;function Nn(t,e,n,r){Qt(3,arguments);var i=String(t),a=String(e),o=r||{},u=o.locale||se;if(!u.match)throw new RangeError("locale must contain match property");var s=u.options&&u.options.firstWeekContainsDate,c=null==s?1:It(s),h=null==o.firstWeekContainsDate?c:It(o.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=u.options&&u.options.weekStartsOn,d=null==l?0:It(l),f=null==o.weekStartsOn?d:It(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===a)return""===i?Bt(n):new Date(NaN);var v,g={firstWeekContainsDate:h,weekStartsOn:f,locale:u},p=[{priority:10,subPriority:-1,set:Yn,index:0}],y=a.match(Mn).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,je[e])(t,u.formatLong,g):t})).join("").match(Un),m=[];for(v=0;v0&&$n.test(i))return new Date(NaN);var D=p.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return p.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),R=Bt(n);if(isNaN(R))return new Date(NaN);var O=ce(R,Xt(R)),S={};for(v=0;v0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"store-hour",i)}return s(n,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,n=Math.abs(t-e);return Math.floor(n/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Nn(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Nn(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return Jt(this.startDateInstance)&&Jt(this.endDateInstance)?"".concat(Ie(this.startDateInstance,"p")," - ").concat(Ie(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),n}(),_n=function(t){h(n,Pt);var e=p(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"store-location",i)}return s(n,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new V(this.getAttribute("hours").map((function(t){return new Ln(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Ie(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,r),e.call(this,t,n,"store",i)}return s(r,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",n({store:this.id},e)).then((function(e){return new V(e.map((function(e){return new Mt(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",n({store:this.id},e)).then((function(e){return new V(e.map((function(e){return e.place&&(e.place=new gt(e.place)),new _n(e,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new _n(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",e).then((function(e){return new V(e.map((function(e){return new Wt(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new Wt(t,e.adapter)}))}}]),r}(),Wn=Array.isArray,In=function(t){h(i,pt);var e,n,r=p(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,i),e instanceof yt?g(t,t=r.call(this,{},e,"service-quote",a)):r.call(this,e,n,"service-quote",a)}return s(i,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Vn(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,n=t.currency;return $t(e)||$t(n)?null:qt(e/100,n)}},{key:"fetchServiceQuotesFromCart",value:(n=a(regeneratorRuntime.mark((function t(e,n,r){var a,o,u,s,c,h,l=this,d=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=d.length>3&&void 0!==d[3]?d[3]:"storefront",c=d.length>4&&void 0!==d[4]&&d[4],null!==(a=e)&&void 0!==a&&a.id&&(e=e.id),null!==(o=n)&&void 0!==o&&o.id&&(n=n.id),null!==(u=r)&&void 0!==u&&u.id&&(r=r.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:e,destination:n,cart:r,config:s,all:c});case 8:if(h=t.sent,!Wn(h)){t.next=11;break}return t.abrupt("return",new V(h.map((function(t){return new i(t,l.adapter)}))));case 11:return t.abrupt("return",new i(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,r){return n.apply(this,arguments)})}],[{key:"getFromCart",value:(e=a(regeneratorRuntime.mark((function t(e,n,r,a){var o,u,s,c=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=c.length>4&&void 0!==c[4]?c[4]:"storefront",u=c.length>5&&void 0!==c[5]&&c[5],s=new i(e),t.abrupt("return",s.fetchServiceQuotesFromCart(n,r,a,o,u));case 4:case"end":return t.stop()}}),t)}))),function(t,n,r,i){return e.apply(this,arguments)})}]),i}(),Qn=new ht({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,e,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return nt(t)&&(t=t.id),nt(e)&&(e=e.id),nt(r)&&(r=r.id),nt(i)&&(i=i.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),n(n({},a),{},{customer:t,cart:e,serviceQuote:r,gateway:i}),o)},captureOrder:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:t,transactionDetails:e},n).then((function(t){return new ft(t)}))},createStripeSetupIntent:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nt(t)&&(t=t.id),this.adapter.post("".concat(this.namespace,"/stripe-setup-intent"),{customer:t},e)},updateStripePaymentIntent:function(t,e,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return nt(e)&&(e=e.id),nt(r)&&(r=r.id),nt(i)&&(i=i.id),this.adapter.put("".concat(this.namespace,"/stripe-update-payment-intent"),n({paymentIntent:t,customer:e,cart:r,serviceQuote:i},a),o)}}),Bn=function(t){h(n,Pt);var e=p(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,n),e.call(this,t,r,"checkout",i)}return s(n,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),n}(),Gn={Product:Ht,Category:Nt,Customer:Ft,Cart:zt,DeliveryServiceQuote:In,Store:zn,StoreLocation:_n,StoreHour:Ln,Checkout:Bn,Review:Mt},Xn={BrowserAdapter:mt,NodeAdapter:wt};function Kn(t){return t.split(/[^a-zA-Z0-9]/).filter(Boolean).map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join("")}var Jn=function(){function t(){return o(this,t),this.resources=Gn,this.adapters=Xn,this.lookup.apply(this,arguments)}return s(t,[{key:"lookup",value:function(t,e){var n=Tt(t),r=Kn(e),i=Array.prototype.slice.call(arguments).slice(2);if(!this[n])throw new Error("Attempted to resolve invalid type");if(!this[n][r])throw new Error("No ".concat(xt(t)," named ").concat(e," (").concat(r,") to resolve"));return v(this[n][r],y(i))}}]),t}(),Zn=function(){return v(Jn,Array.prototype.slice.call(arguments))},Vn=function(t){h(n,St);var e=p(n);function n(){return o(this,n),e.apply(this,arguments)}return s(n,[{key:"extendActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ot(this,t)}},{key:"serialize",value:function(t){return Zn("resource",Ct(this.resource),t,this.adapter)}}]),n}();export{Nt as C,V as D,Wt as P,Mt as R,Pt as S,rt as U,h as _,p as a,o as b,s as c,a as d,zn as e,_n as f,Vn as g,Yt as h,_t as i,Qn as j,v as k,Zn as l,n as m,Ht as n,Ft as o,zt as p,Ln as q,Ut as r,In as s,Bn as t,Gn as u,Jn as v}; +//# sourceMappingURL=store-a1153df9.js.map diff --git a/dist/esm/store-a1153df9.js.map b/dist/esm/store-a1153df9.js.map new file mode 100644 index 0000000..1c7cef0 --- /dev/null +++ b/dist/esm/store-a1153df9.js.map @@ -0,0 +1 @@ +{"version":3,"file":"store-a1153df9.js","sources":["../../node_modules/@fleetbase/sdk/dist/esm/fleetbase.js","../../src/resource.js","../../src/resources/review.js","../../src/utils/is-phone.js","../../src/utils/format-currency.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/date-fns/esm/_lib/toInteger/index.js","../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../node_modules/date-fns/esm/toDate/index.js","../../node_modules/date-fns/esm/addMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","../../node_modules/date-fns/esm/isDate/index.js","../../node_modules/date-fns/esm/isValid/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","../../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","../../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","../../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","../../node_modules/date-fns/esm/locale/en-US/index.js","../../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","../../node_modules/date-fns/esm/subMilliseconds/index.js","../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","../../node_modules/date-fns/esm/_lib/getUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/format/formatters/index.js","../../node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","../../node_modules/date-fns/esm/_lib/format/longFormatters/index.js","../../node_modules/date-fns/esm/_lib/protectedTokens/index.js","../../node_modules/date-fns/esm/format/index.js","../../node_modules/date-fns/esm/_lib/assign/index.js","../../node_modules/date-fns/esm/_lib/setUTCDay/index.js","../../node_modules/date-fns/esm/parse/_lib/parsers/index.js","../../node_modules/date-fns/esm/_lib/setUTCWeek/index.js","../../node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","../../node_modules/date-fns/esm/_lib/setUTCISODay/index.js","../../node_modules/date-fns/esm/parse/index.js","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js"],"sourcesContent":["import t from\"axios\";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];if(A(t))if(r.length<=6e4)t.splice.apply(t,[e,n].concat(m(r)));else{t.splice(e,n);for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;n<0&&(n+=i);var o=r&&e!=e?function(t){return t!=t}:function(t){return t===e};return S(t,o,n)},F=function(t,e,n){return $(t,e,0,[n]),n},D=function(t){h(n,g(Array));var e=y(n);function n(){for(var t=arguments.length,r=new Array(t),i=0;i0}},{key:\"empty\",get:function(){return 0===this.length}},{key:\"first\",get:function(){return j(this,0)}},{key:\"last\",get:function(){return j(this,this.length-1)}},{key:\"replace\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return $(this,t,e,n),this}},{key:\"objectsAt\",value:function(t){var e=this;return t.map((function(t){return j(e,t)}))}},{key:\"objectAt\",value:function(t){return j(this,t)}},{key:\"indexOf\",value:function(t,e){return L(this,t,e,!1)}},{key:\"lastIndexOf\",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(j(this,r)===t)return r;return-1}},{key:\"includes\",value:function(t,e){return-1!==L(this,t,e,!0)}},{key:\"findBy\",value:function(){return _(this,O.apply(void 0,arguments))}},{key:\"findIndexBy\",value:function(){return S(this,O.apply(void 0,arguments))}},{key:\"isEvery\",value:function(){return z(this,O.apply(void 0,arguments))}},{key:\"isAny\",value:function(){return P(this,O.apply(void 0,arguments))}},{key:\"invoke\",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:R,n=[],r=new Set,i=\"function\"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:\"without\",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:\"clear\",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:\"insertAt\",value:function(t,e){return F(this,t,e),this}},{key:\"replaceAt\",value:function(t,e){return this.replace(t,1,[e])}},{key:\"removeAt\",value:function(t,e){return function(t,e){return $(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:\"pushObject\",value:function(t){return this.insertAt(this.length,t)}},{key:\"pushObjects\",value:function(t){return this.replace(this.length,0,t),this}},{key:\"popObject\",value:function(){var t=this.length;if(0===t)return null;var e=j(this,t-1);return this.removeAt(t-1,1),e}},{key:\"shiftObject\",value:function(){if(0===this.length)return null;var t=j(this,0);return this.removeAt(0),t}},{key:\"unshiftObject\",value:function(t){return F(this,0,t)}},{key:\"unshiftObjects\",value:function(t){return this.replace(0,0,t),this}},{key:\"reverseObjects\",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:\"setObjects\",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:\"removeObject\",value:function(t){for(var e=this.length||0;--e>=0;){j(this,e)===t&&this.removeAt(e)}return this}},{key:\"removeObjects\",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:\"addObject\",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:\"addObjects\",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}]),n}(),C=function(t){var e=null==t;if(e)return e;if(\"number\"==typeof t.size)return!t.size;var n=r(t);if(\"object\"===n){var i=t.size;if(\"number\"==typeof i)return!i}if(\"number\"==typeof t.length&&\"function\"!==n)return!t.length;if(\"object\"===n){var o=t.length;if(\"number\"==typeof o)return!o}return!1},T=function(t){return C(t)||\"string\"==typeof t&&!1===/\\S/.test(t)};function N(t){return isFinite(t)&&Math.abs(t)<=90}function q(t){return isFinite(t)&&Math.abs(t)<=180&&Math.abs(t)>=90}function B(t){return t instanceof Y}var U=function(){var t,e,n,i,o;return!(\"undefined\"==typeof process||\"object\"!==r(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(n=e.name)||void 0===n?void 0:n.search(/node|io.js/))||\"undefined\"!=typeof window&&\"ReactNative\"!==(null===(i=window)||void 0===i||null===(o=i.navigator)||void 0===o?void 0:o.product))},I=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U()?Rt(\"adapter\",\"NodeAdapter\",t):Rt(\"adapter\",\"BrowserAdapter\",t)},J=Array.isArray,K=function(){function t(e){s(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}return a(t,[{key:\"parse\",value:function(){this.parseComponents(),this.parseProperties()}},{key:\"parseComponents\",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:\"parseProperties\",value:function(){var t,e={streetNumber:this.get(\"street_number\"),streetName:this.get(\"route\"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or([\"locality\",\"sublocality\",\"sublocality_level_1\",\"neighborhood\",\"administrative_area_level_3\",\"administrative_area_level_2\"]),county:this.get(\"administrative_area_level_2\"),stateShort:this.get(\"administrative_area_level_1\",!0),stateLong:this.get(\"administrative_area_level_1\"),countryShort:this.get(\"country\",!0),country:this.get(\"country\",!0),countryLong:this.get(\"country\"),postalCode:this.get(\"postal_code\")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(\" \"),e}},{key:\"all\",value:function(){return this.attributes}},{key:\"or\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;e1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=n(n({},this.attributes),t),this}},{key:\"setAttribute\",value:function(t,e){return this.attributes[t]=e,this}},{key:\"getAttribute\",value:function(t){return this.attributes[t]||null}}]),t}(),M=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,t),this.type=\"Point\",this.coordinates=[n,e]}return a(t,[{key:\"latitude\",get:function(){return this.coordinates[1]}},{key:\"longitude\",get:function(){return this.coordinates[0]}},{key:\"lat\",value:function(){return this.latitude}},{key:\"lng\",value:function(){return this.longitude}},{key:\"serialize\",value:function(){return{type:\"Point\",coorindates:[this.lat(),this.lng()]}}},{key:\"toJson\",value:function(){return this.serialize()}},{key:\"toString\",value:function(){return\"(\".concat(this.latitude,\", \").concat(this.longitude,\")\")}}],[{key:\"fromGeoJson\",value:function(e){var n=b(e.coordinates,2);return longitude=n[0],latitude=n[1],new t(latitude,longitude)}}]),t}();\"undefined\"==typeof arguments||arguments;var W=function(t,e){var n=t();return Array.isArray(n)||\"object\"===r(n)?H(n,e):null},H=function t(e,n){var i,o=e,s=r(e),u=\"object\"===s,a=\"function\"===s,c=Array.isArray(e),h=\"string\"===r(n)&&n.includes(\".\")?n.split(\".\"):[n];if(c||u){for(var l=0;l0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(this,t),this.actions=e,this.bind=n}return a(t,[{key:\"extend\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t||this.bind;if(!e)return this;if(null!=this&&this.actions&&\"object\"===r(this.actions))for(var n in this.actions){var i=this.actions[n];\"function\"==typeof i?G(e,n,i.bind(e)):G(e,n,i)}return this}}]),t}(),Y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};s(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||\"v1\",this.setAdapter(n)}return a(t,[{key:\"setAdapter\",value:function(t){var e;return this.adapter=t,this.store=new jt(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:\"id\",get:function(){return this.getAttribute(\"id\")}},{key:\"create\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.create(n).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"update\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags([\"isLoading\",\"isSaving\"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags([\"isLoading\",\"isSaving\"],!1),e}))}},{key:\"destroy\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isDestroying\"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags([\"isLoading\",\"isDestroying\"],!1),e}))}},{key:\"reload\",value:function(){var t=this;return this.setFlags([\"isLoading\",\"isReloading\"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:\"setFlags\",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[\"isLoading\",\"isSaving\",\"isReloading\",\"isDestroying\"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return C(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:\"saveDirty\",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n0}},{key:\"mutate\",value:function(t,e){this.attributes[t]=e}},{key:\"setAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&\"object\"===r(t))return this.setAttributes(t);var i=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return G(this.attributes,t,n),G(this.dirtyAttributes,t,i),A(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:i,value:n,changedAt:new Date}),this}},{key:\"setAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:\"getAttribute\",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=H(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:\"hasAttribute\",value:function(t){if(A(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:\"hasAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:\"isAttributeFilled\",value:function(t){var e=this;return A(t)?this.hasAttribute(t)&&t.every((function(t){return!C(e.getAttribute(t))})):this.hasAttribute(t)&&!C(this.getAttribute(t))}},{key:\"getAttributes\",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if(\"string\"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!A(t))throw new Error(\"No attribute properties provided!\");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=n(n({},r),e),this.attributes}},{key:\"syncAttributes\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]),t}(),Z=new V({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get(\"\".concat(this.namespace,\"/\").concat(t,\"/distance-and-time\"),{},e)}}),Q=function(t){h(r,Y);var e=y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,r),e.call(this,t,i,\"order\",n({actions:Z},o))}return a(r,[{key:\"getDistanceAndTime\",value:function(){return this.store.getDistanceAndTime(this.id)}}]),r}(),X=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"payload\",i)}return a(n,[{key:\"attach\",value:function(t){}},{key:\"entities\",get:function(){}},{key:\"dropoff\",get:function(){}},{key:\"pickup\",get:function(){}},{key:\"waypoints\",get:function(){return new D(this.waypoints)}}]),n}(),tt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"entity\",i)}return n}(),et=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"place\",i)}return a(n,[{key:\"latitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[1]}},{key:\"longitude\",get:function(){var t;return null===(t=this.getAttribute(\"location\",new M))||void 0===t?void 0:t.coordinates[0]}},{key:\"coordinates\",get:function(){return[this.latitude,this.longitude]}},{key:\"setOwner\",value:function(t){return B(t)&&this.setAttribute(\"owner\",t.id),\"string\"==typeof t&&this.setAttribute(\"owner\",t),this}}],[{key:\"fromGoogleAddress\",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getAttribute(\"coordinates\"),o=b(i,2),s=o[0],u=o[1],a={name:null,address:t.getAttribute(\"address\"),location:new M(s,u),street1:t.getAttribute(\"streetName\"),street2:null,city:t.getAttribute(\"city\"),province:t.getAttribute(\"stateLong\"),postal_code:t.getAttribute(\"postalCode\"),neighborhood:t.get(\"neighborhood\"),district:t.getAttribute(\"county\"),building:t.get(\"building\"),country:t.getAttribute(\"countryShort\"),phone:null,security_access_code:null};return new n(a,e,r)}}]),n}(),nt=function(t){h(n,et);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"waypoint\",i)}return n}(),rt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"tracking-status\",i)}return n}(),it=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vehicle\",i)}return n}(),ot=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"driver\",i)}return n}(),st=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"vendor\",i)}return n}(),ut=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"contact\",i)}return n}(),at=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"zone\",i)}return n}(),ct=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-area\",i)}return n}(),ht=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-rate\",i)}return n}(),lt=function(t){h(n,Y);var e=y(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),e.call(this,t,r,\"service-quote\",i)}return a(n,[{key:\"fromPreliminary\",value:function(){}},{key:\"fromPayload\",value:function(){}}]),n}(),vt=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t),this.version=e.version||\"v1\",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}},ft=function(t){h(r,vt);var e=y(r);function r(t){var n;return s(this,r),(n=e.call(this,t)).setHeaders({Authorization:\"Bearer \".concat(t.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;browser\"}),n}return a(r,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=n(n({},this.headers),t),this}},{key:\"parseJSON\",value:function(t){return new Promise((function(e,n){return t.json().then((function(n){return e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error(\"Oops! Something went wrong when handling your request.\"))}))}))}},{key:\"request\",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"GET\",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(s,u){return fetch(o.url||\"\".concat(e.host,\"/\").concat(e.namespace,\"/\").concat(t),n({method:r,mode:o.mode||\"cors\",headers:new Headers(n(n({},e.headers||{}),o.headers||{}))},i)).then(e.parseJSON).then((function(t){return t.ok?s(t.json):u(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){u(t)}))}))}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.request(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),\"GET\",{},n)}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"POST\",{body:JSON.stringify(e)},n)}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PUT\",{body:JSON.stringify(e)},n)}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,\"DELETE\",{},e)}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,\"PATCH\",{body:JSON.stringify(e)},n)}}]),r}(),dt=function(e){h(i,vt);var r=y(i);function i(e){var n;return s(this,i),(n=r.call(this,e)).axios=t.create({baseURL:\"\".concat(n.host,\"/\").concat(n.namespace),headers:{Authorization:\"Bearer \".concat(e.publicKey),\"Content-Type\":\"application/json\",\"User-Agent\":\"@fleetbase/sdk;node\"}}),n}return a(i,[{key:\"setHeaders\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.axios.defaults.headers.common;return this.axios.defaults.headers.common=n(n({},e),t),this}},{key:\"transform\",value:function(t){return t.data}},{key:\"handleError\",value:function(t){if(t.response){var e=t.response.data;if(A(e.errors))throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t}},{key:\"get\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=T(e)?\"\":new URLSearchParams(e).toString();return this.axios.get(\"\".concat(t).concat(r?\"?\".concat(r):\"\"),n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"post\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.post(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"put\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.put(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"delete\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.axios.delete(t,e).then(this.transform.bind(this)).catch(this.handleError.bind(this))}},{key:\"patch\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axios.patch(t,e,n).then(this.transform.bind(this)).catch(this.handleError.bind(this))}}]),i}(),gt=function(t){h(n,vt);var e=y(n);function n(){return s(this,n),e.apply(this,arguments)}return n}(),pt=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s(this,t),c(this,\"uncountableWords\",[\"equipment\",\"information\",\"rice\",\"money\",\"species\",\"series\",\"fish\",\"sheep\",\"moose\",\"deer\",\"news\"]),c(this,\"pluralRules\",[[new RegExp(\"(m)an$\",\"gi\"),\"$1en\"],[new RegExp(\"(pe)rson$\",\"gi\"),\"$1ople\"],[new RegExp(\"(child)$\",\"gi\"),\"$1ren\"],[new RegExp(\"^(ox)$\",\"gi\"),\"$1en\"],[new RegExp(\"(ax|test)is$\",\"gi\"),\"$1es\"],[new RegExp(\"(octop|vir)us$\",\"gi\"),\"$1i\"],[new RegExp(\"(alias|status)$\",\"gi\"),\"$1es\"],[new RegExp(\"(bu)s$\",\"gi\"),\"$1ses\"],[new RegExp(\"(buffal|tomat|potat)o$\",\"gi\"),\"$1oes\"],[new RegExp(\"([ti])um$\",\"gi\"),\"$1a\"],[new RegExp(\"sis$\",\"gi\"),\"ses\"],[new RegExp(\"(?:([^f])fe|([lr])f)$\",\"gi\"),\"$1$2ves\"],[new RegExp(\"(hive)$\",\"gi\"),\"$1s\"],[new RegExp(\"([^aeiouy]|qu)y$\",\"gi\"),\"$1ies\"],[new RegExp(\"(x|ch|ss|sh)$\",\"gi\"),\"$1es\"],[new RegExp(\"(matr|vert|ind)ix|ex$\",\"gi\"),\"$1ices\"],[new RegExp(\"([m|l])ouse$\",\"gi\"),\"$1ice\"],[new RegExp(\"(quiz)$\",\"gi\"),\"$1zes\"],[new RegExp(\"s$\",\"gi\"),\"s\"],[new RegExp(\"$\",\"gi\"),\"s\"]]),c(this,\"singularRules\",[[new RegExp(\"(m)en$\",\"gi\"),\"$1an\"],[new RegExp(\"(pe)ople$\",\"gi\"),\"$1rson\"],[new RegExp(\"(child)ren$\",\"gi\"),\"$1\"],[new RegExp(\"([ti])a$\",\"gi\"),\"$1um\"],[new RegExp(\"((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$\",\"gi\"),\"$1$2sis\"],[new RegExp(\"(hive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(tive)s$\",\"gi\"),\"$1\"],[new RegExp(\"(curve)s$\",\"gi\"),\"$1\"],[new RegExp(\"([lr])ves$\",\"gi\"),\"$1f\"],[new RegExp(\"([^fo])ves$\",\"gi\"),\"$1fe\"],[new RegExp(\"([^aeiouy]|qu)ies$\",\"gi\"),\"$1y\"],[new RegExp(\"(s)eries$\",\"gi\"),\"$1eries\"],[new RegExp(\"(m)ovies$\",\"gi\"),\"$1ovie\"],[new RegExp(\"(x|ch|ss|sh)es$\",\"gi\"),\"$1\"],[new RegExp(\"([m|l])ice$\",\"gi\"),\"$1ouse\"],[new RegExp(\"(bus)es$\",\"gi\"),\"$1\"],[new RegExp(\"(o)es$\",\"gi\"),\"$1\"],[new RegExp(\"(shoe)s$\",\"gi\"),\"$1\"],[new RegExp(\"(cris|ax|test)es$\",\"gi\"),\"$1is\"],[new RegExp(\"(octop|vir)i$\",\"gi\"),\"$1us\"],[new RegExp(\"(alias|status)es$\",\"gi\"),\"$1\"],[new RegExp(\"^(ox)en\",\"gi\"),\"$1\"],[new RegExp(\"(vert|ind)ices$\",\"gi\"),\"$1ex\"],[new RegExp(\"(matr)ices$\",\"gi\"),\"$1ix\"],[new RegExp(\"(quiz)zes$\",\"gi\"),\"$1\"],[new RegExp(\"s$\",\"gi\"),\"\"]]),c(this,\"nonTitlecasedWords\",[\"and\",\"or\",\"nor\",\"a\",\"an\",\"the\",\"so\",\"but\",\"to\",\"of\",\"at\",\"by\",\"from\",\"into\",\"on\",\"onto\",\"off\",\"out\",\"in\",\"over\",\"with\",\"for\"]),c(this,\"idSuffix\",new RegExp(\"(_ids|_id)$\",\"g\")),c(this,\"underbar\",new RegExp(\"_\",\"g\")),c(this,\"spaceOrUnderbar\",new RegExp(\"[ _]\",\"g\")),c(this,\"uppercase\",new RegExp(\"([A-Z])\",\"g\")),c(this,\"underbarPrefix\",new RegExp(\"^_\")),this.str=e,this.chain=n}return a(t,[{key:\"get\",value:function(){return this.str}},{key:\"applyRules\",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:\"singularize\",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:\"camelize\",value:function(t,e){for(var n=(t=t||this.str).split(\"/\"),r=0;r1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?\"\":\"_\")+\"id\",this.str=t,!0===this.chain?this:t}},{key:\"ordinalize\",value:function(t){for(var e=(t=t||this.str).split(\" \"),n=0;n1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=A(e)?e:[e],!A(e))return e instanceof V&&e.extend(t),t;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};s(this,t),this.resource=e,this.adapter=n||I(),this.namespace=yt(e),this.storage=new D,this.options=r,this.extendActions(r.actions)}return a(t,[{key:\"extendActions\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Et(this,t)}},{key:\"deposit\",value:function(t){return t}},{key:\"serialize\",value:function(t){return Rt(\"resource\",wt(this.resource),t,this.adapter)}},{key:\"afterFetch\",value:function(t){return function(t,e){if(\"function\"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),A(e)){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.post(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"update\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(function(){var i=o(regeneratorRuntime.mark((function i(o,s){var u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,e.adapter.put(\"\".concat(e.namespace,\"/\").concat(t),n,r).then(e.afterFetch.bind(e)).catch(s);case 2:u=i.sent,o(u);case 4:case\"end\":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:\"findRecord\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.adapter.get(\"\".concat(e.namespace,\"/\").concat(t),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"findAll\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var n=o(regeneratorRuntime.mark((function n(r,i){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.adapter.get(\"\".concat(t.namespace),{},e).then(t.afterFetch.bind(t)).catch(i);case 2:o=n.sent,r(o);case 4:case\"end\":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}())}},{key:\"query\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"queryRecord\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.single=!0,new Promise(function(){var r=o(regeneratorRuntime.mark((function r(i,o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.adapter.get(\"\".concat(t.namespace),e,n).then(t.afterFetch.bind(t)).catch(o);case 2:s=r.sent,i(s);case 4:case\"end\":return r.stop()}}),r)})));return function(t,e){return r.apply(this,arguments)}}())}},{key:\"destroy\",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=B(t)?t.getAttribute(\"id\"):t;return new Promise(function(){var t=o(regeneratorRuntime.mark((function t(i,o){var s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.adapter.delete(\"\".concat(e.namespace,\"/\").concat(r),{},n).then(e.afterFetch.bind(e)).catch(o);case 2:s=t.sent,i(s);case 4:case\"end\":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}}]),t}(),Ot=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(s(this,t),this.version=n.version||\"v1\",this.options={version:this.version,host:n.host||\"https://api.fleetbase.io\",namespace:this.version||n.namespace,debug:r,publicKey:e},\"string\"!=typeof e||0===e.length)throw new Error(\"⚠️ Invalid public key given to Fleetbase SDK\");if(!U()&&e.toLowerCase().startsWith(\"$\"))throw new Error(\"Secret key provided. You must use a public key with Fleetbase Javascript SDK!\");this.adapter=n.adapter||I(this.options),this.orders=new jt(\"order\",this.adapter).extendActions(Z),this.entities=new jt(\"entity\",this.adapter),this.places=new jt(\"place\",this.adapter),this.drivers=new jt(\"driver\",this.adapter),this.vehicles=new jt(\"vehicle\",this.adapter),this.vendors=new jt(\"vendor\",this.adapter),this.contacts=new jt(\"contact\",this.adapter)}return a(t,[{key:\"setAdapter\",value:function(t){this.adapter=t}},{key:\"getAdapter\",value:function(){return this.adapter}}],[{key:\"newInstance\",value:function(){return d(t,Array.prototype.slice.call(arguments))}}]),t}();export default Ot;export{vt as Adapter,ft as BrowserAdapter,D as Collection,ut as Contact,ot as Driver,gt as EmberJsAdapter,tt as Entity,K as GoogleAddress,dt as NodeAdapter,Q as Order,X as Payload,et as Place,M as Point,Y as Resource,ct as ServiceArea,lt as ServiceQuote,ht as ServiceRate,jt as Store,V as StoreActions,rt as TrackingStatus,it as Vehicle,st as Vendor,nt as Waypoint,at as Zone,mt as camelize,wt as classify,kt as dasherize,Et as extendStoreActions,N as isLatitude,q as isLongitude,U as isNodeEnvironment,B as isResource,yt as pluralize,bt as singularize};\n//# sourceMappingURL=fleetbase.js.map\n","import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n\n getStripeEphemeralKey(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-ephemeral-key', params);\n }\n\n getStripeSetupIntent(params = {}) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/stripe-setup-intent', params);\n }\n}\n\nexport { customerActions };\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n 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\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\n\nexport default function isDate(value) {\n requiredArgs(1, arguments);\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import isDate from \"../isDate/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now `isValid` doesn't throw an exception\n * if the first argument is not an instance of Date.\n * Instead, argument is converted beforehand using `toDate`.\n *\n * Examples:\n *\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\n * |---------------------------|---------------|---------------|\n * | `new Date()` | `true` | `true` |\n * | `new Date('2016-01-01')` | `true` | `true` |\n * | `new Date('')` | `false` | `false` |\n * | `new Date(1488370835081)` | `true` | `true` |\n * | `new Date(NaN)` | `false` | `false` |\n * | `'2016-01-01'` | `TypeError` | `false` |\n * | `''` | `TypeError` | `false` |\n * | `1488370835081` | `TypeError` | `true` |\n * | `NaN` | `TypeError` | `false` |\n *\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\n * that try to coerce arguments to the expected type\n * (which is also the case with other *date-fns* functions).\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\n\nexport default function isValid(dirtyDate) {\n requiredArgs(1, arguments);\n\n if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(Number(date));\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function (token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\n if (typeof tokenValue === 'string') {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace('{{count}}', count.toString());\n }\n\n if (options !== null && options !== void 0 && options.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return 'in ' + result;\n } else {\n return result + ' ago';\n }\n }\n\n return result;\n};\n\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar timeFormats = {\n full: 'h:mm:ss a zzzz',\n long: 'h:mm:ss a z',\n medium: 'h:mm:ss a',\n short: 'h:mm a'\n};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: 'P'\n};\n\nvar formatRelative = function (token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, dirtyOptions) {\n var options = dirtyOptions || {};\n var context = options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challange you to try to remove it!\n\n return valuesArray[index];\n };\n}","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n 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],\n 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]\n};\nvar matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i\n }\n};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function (index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\n}; // Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar dayValues = {\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar dayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n }\n};\nvar formattingDayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n }\n};\n\nvar ordinalNumber = function (dirtyNumber, _options) {\n var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function (quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nvar formatters = {\n // Year\n y: function (date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate, dirtyOptions);\n var year = date.getUTCFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import toInteger from \"../toInteger/index.js\";\nimport getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import lightFormatters from \"../lightFormatters/index.js\";\nimport getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nvar dayPeriodEnum = {\n am: 'am',\n pm: 'pm',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n};\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\n },\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case 'e':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n }\n\n switch (token) {\n case 'b':\n case 'bb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return 'Z';\n }\n\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n}\n\nfunction timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n}\n\nfunction dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/);\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n}\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'D') {\n throw new RangeError(\"Use `d` instead of `D` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'DD') {\n throw new RangeError(\"Use `dd` instead of `DD` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n }\n}","import isValid from \"../isValid/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport setUTCDay from \"../../../_lib/setUTCDay/index.js\";\nimport setUTCISODay from \"../../../_lib/setUTCISODay/index.js\";\nimport setUTCISOWeek from \"../../../_lib/setUTCISOWeek/index.js\";\nimport setUTCWeek from \"../../../_lib/setUTCWeek/index.js\";\nimport startOfUTCISOWeek from \"../../../_lib/startOfUTCISOWeek/index.js\";\nimport startOfUTCWeek from \"../../../_lib/startOfUTCWeek/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/\n};\n\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'e':\n case 'ee':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'c':\n case 'cc':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCWeek from \"../getUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCISOWeek from \"../getUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport parsers from \"./_lib/parsers/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 0001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward (toDate no longer accepts a string)\n * toDate(1392098430000) // Unix to timestamp\n * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} referenceDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {\n requiredArgs(3, arguments);\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyReferenceDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale\n }; // If timezone isn't specified, it will be set to the system timezone\n\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n subPriority: -1,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n subPriority: parser.subPriority || 0,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).sort(function (a, b) {\n return b.subPriority - a.subPriority;\n });\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyReferenceDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst objectToParams = (obj = {}, prefix = null) => {\n if (obj === null || obj === undefined) {\n return {};\n }\n\n const parsed = {};\n const keys = Object.keys(obj);\n\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n const value = obj[key];\n\n if (key && value) {\n if (prefix && typeof prefix === 'string') {\n parsed[`${prefix}[${key}]`] = value;\n continue;\n }\n\n parsed[key] = value;\n }\n }\n\n return parsed;\n};\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n\n createStripeSetupIntent: function (customer, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n return this.adapter.post(`${this.namespace}/stripe-setup-intent`, { customer }, options);\n },\n\n updateStripePaymentIntent: function (paymentIntent, customer, cart, serviceQuote, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n return this.adapter.put(`${this.namespace}/stripe-update-payment-intent`, { paymentIntent, customer, cart, serviceQuote, ...orderOptions }, options);\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nexport const resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nfunction toStudlyCase(str) {\n return str\n .split(/[^a-zA-Z0-9]/) // Split by non-alphanumeric characters\n .filter(Boolean) // Remove empty elements\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize the first letter of each word\n .join(''); // Join the words together without spaces\n}\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const classKey = toStudlyCase(className);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][classKey]) {\n throw new Error(`No ${singularize(type)} named ${className} (${classKey}) to resolve`);\n }\n\n return new this[key][classKey](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n\nexport default Resolver;\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n"],"names":["isArray","Array","StorefrontResource","Resource","adapter","store","StorefrontStore","this","resource","onAfterFetch","syncAttributes","bind","actions","options","_this$options","reviewActions","StoreActions","count","storeId","params","get","namespace","Review","attributes","isPhone","phone","test","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","length","Product","getAttribute","getAttributes","price","sale_price","isOnSale","id","then","reviews","Collection","map","_this","Category","category","products","customerActions","login","identity","password","post","Error","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","token","setHeaders","endpoint","method","headers","toLowerCase","response","console","error","performAuthorizedRequest","places","Place","_this2","orders","Order","_this3","cartActions","undefined","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toInteger","dirtyNumber","NaN","number","Number","isNaN","Math","ceil","floor","requiredArgs","required","args","TypeError","toDate","argument","arguments","argStr","Object","prototype","toString","call","Date","getTime","warn","stack","addMilliseconds","dirtyDate","dirtyAmount","timestamp","getTimezoneOffsetInMilliseconds","date","utcDate","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isDate","value","isValid","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","result","tokenValue","replace","addSuffix","comparison","buildFormatLongFn","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","dirtyIndex","dirtyOptions","valuesArray","context","formattingValues","defaultFormattingWidth","_defaultWidth","_width","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","key","pattern","findKey","valueCallback","rest","slice","object","predicate","hasOwnProperty","array","formatDistance","formatRelative","_date","_baseDate","_options","localize","ordinalNumber","rem100","era","narrow","abbreviated","wide","quarter","month","day","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","weekStartsOn","firstWeekContainsDate","subMilliseconds","addLeadingZeros","targetLength","sign","output","abs","y","signedYear","getUTCFullYear","year","M","getUTCMonth","d","getUTCDate","a","dayPeriodEnumValue","getUTCHours","toUpperCase","h","H","m","getUTCMinutes","s","getUTCSeconds","S","numberOfDigits","milliseconds","getUTCMilliseconds","pow","startOfUTCISOWeek","getUTCDay","diff","setUTCDate","setUTCHours","getUTCISOWeekYear","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","startOfUTCISOWeekYear","fourthOfJanuary","getUTCISOWeek","round","startOfUTCWeek","locale","localeWeekStartsOn","defaultWeekStartsOn","RangeError","getUTCWeekYear","localeFirstWeekContainsDate","defaultFirstWeekContainsDate","firstWeekOfNextYear","firstWeekOfThisYear","startOfUTCWeekYear","firstWeek","getUTCWeek","dayPeriodEnum","formatters","G","unit","lightFormatters","Y","signedWeekYear","weekYear","R","u","Q","q","L","w","week","I","isoWeek","D","dayOfYear","setUTCMonth","startOfYearTimestamp","difference","getUTCDayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","dirtyDelimiter","absOffset","minutes","delimiter","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeFormat","datePattern","timePattern","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","concat","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","dirtyFormatStr","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","assign","target","dirtyObject","property","setUTCDay","dirtyDay","currentDay","remainder","dayIndex","numericPatterns","timezonePatterns","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","enumValue","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","isLeapYearIndex","parsers","priority","parse","set","flags","incompatibleTokens","isTwoDigitYear","validate","normalizedTwoDigitYear","_match","_flags","firstWeekOfYear","dirtyWeek","setUTCWeek","dirtyISOWeek","setUTCISOWeek","subPriority","isLeapYear","wholeWeekDays","setUTCISODay","isPM","setUTCMinutes","setUTCSeconds","setUTCMilliseconds","timestampIsSet","_token","notWhitespaceRegExp","dirtyDateString","dirtyFormatString","dirtyReferenceDate","dateString","formatString","subFnOptions","setters","dateToSystemTimezone","tokens","usedTokens","parser","incompatibleToken","_i","usedToken","fullToken","push","uniquePrioritySetters","setter","sort","filter","setterArray","convertedDate","setFullYear","setHours","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","gateways","_this4","_this5","DeliveryServiceQuote","ServiceQuote","Adapter","origin","destination","cart","config","all","_origin","_destination","_cart","serviceQuotes","serviceQuote","quote","fetchServiceQuotesFromCart","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","createStripeSetupIntent","updateStripePaymentIntent","paymentIntent","Checkout","resources","adapters","BrowserAdapter","NodeAdapter","toStudlyCase","str","Boolean","word","charAt","Resolver","lookup","className","pluralize","classKey","singularize","extendStoreActions","json","classify"],"mappings":"0pQAAQA,EAAYC,MAAZD,QAAAA,EAAAA,oBAAAA,eAAAA,EAAAA,szrCCGaE,mBAA2BC,kHAOjCC,qBACFA,QAAUA,OACVC,MAAQ,IAAIC,GAAgBC,KAAKC,SAAUJ,EAAS,CACrDK,aAAcF,KAAKG,eAAeC,KAAKJ,MACvCK,kBAASL,KAAKM,4BAALC,EAAcF,UAGpBL,cCdTQ,GAAgB,IAAIC,GAAa,CACnCC,MAAO,SAAUC,OAASL,yDAAU,GAC1BM,EAAS,UAEXD,IACAC,EAAOd,MAAQa,GAGZX,KAAKH,QAAQgB,cAAOb,KAAKc,oBAAmBF,EAAQN,MAI9CS,mBAAenB,gCACpBoB,yDAAa,GAAInB,yCAASS,yDAAU,gCACtCU,EAAYnB,EAAS,SAAUS,qCAGzC,qCAIA,qCAIA,qBC5BEW,GAAU,eAACC,yDAAQ,SACd,iDAAiDC,KAAKD,ICDlD,SAASE,SAAeC,yDAAS,EAAGC,yDAAW,MAAOC,yDAAkB,gBAC5E,IAA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AYse,GAAYrb,qBAAekb,eAAcE,4BAGxD3hB,KAAKmN,GAAKwU,KAAa/gB,aAIpC4gB,GAAS,oBACAD,8BAAYha,aCpDNxH,mBAAwB6e,0DAE5BrX,kDAGb,eAAclH,yDAAU,UACbwhB,GAAmB7hB,KAAMK,4BAGpC,SAAUyhB,UACCN,GAAO,WAAYO,GAAS/hB,KAAKC,UAAW6hB,EAAM9hB,KAAKH"} \ No newline at end of file diff --git a/dist/esm/storefront.js b/dist/esm/storefront.js index 744e115..5c1e33d 100644 --- a/dist/esm/storefront.js +++ b/dist/esm/storefront.js @@ -1,2 +1,2 @@ -import{Resource as t,StoreActions as e,isNodeEnvironment as r,Collection as n,Place as a,Order as o,Adapter as i,ServiceQuote as s,isResource as u,pluralize as c,singularize as d,BrowserAdapter as h,NodeAdapter as l,extendStoreActions as f,classify as g,Store as p}from"@fleetbase/sdk";function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function v(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function k(t,e,r,n,a,o,i){try{var s=t[o](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,a)}function x(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){k(o,n,a,i,s,"next",t)}function s(t){k(o,n,a,i,s,"throw",t)}i(void 0)}))}}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},r={};return t&&(r.store=t),this.adapter.get("".concat(this.namespace,"/count"),r,e)}}),F=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"review",a)}return D(r,[{key:"getMedia",value:function(){}},{key:"getPhotos",value:function(){}},{key:"getVideos",value:function(){}}]),r}();function W(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symbol";return new Intl.NumberFormat("en-US",{style:"currency",currency:e,currencyDisplay:r}).format(t)}var R=function(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var r=b(t);if("object"===r){var n=t.size;if("number"==typeof n)return!n}if("number"==typeof t.length&&"function"!==r)return!t.length;if("object"===r){var a=t.length;if("number"==typeof a)return!a}return!1},I=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"product",a)}return D(r,[{key:"variants",value:function(){return this.getAttribute("variants")}},{key:"addons",value:function(){return this.getAttribute("addon_categories")}},{key:"isOnSale",get:function(){return this.getAttribute("is_on_sale")}},{key:"isNotOnSale",get:function(){return!this.getAttribute("is_on_sale")}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["price","sale_price","currency"]),e=t.price,r=t.sale_price,n=t.currency;return this.isOnSale?R(r)||R(n)?null:W(r/100,n):R(e)||R(n)?null:W(e/100,n)}},{key:"getReviews",value:function(){var t=this;return this.adapter.get("reviews",{store:this.id}).then((function(e){return new n(e.map((function(e){return new F(e,t.adapter)})))}))}}]),r}(),Q=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"category",a)}return D(r,[{key:"getProducts",value:function(){var t=this;return this.adapter.get("products",{category:this.id}).then((function(e){return new n(e.map((function(e){return new I(e,t.adapter)})))}))}}]),r}(),G=new e({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("customers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("customers/login",w({identity:t,password:e},r)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers/verify-code",w({identity:t,code:e},r)).then(this.afterFetch.bind(this))},requestCreationCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"email";return this.adapter.post("customers/request-creation-code",{identity:t,mode:e})},create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("customers",w({identity:t,code:e},r)).then(this.afterFetch.bind(this))},retrieve:function(t){return this.findRecord(t)}}),_=function(t){S(c,j);var e,r,i,s,u=Y(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,c),u.call(this,t,e,"customer",w({actions:G},r))}return D(c,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ze(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"token",get:function(){return this.getAttribute("token")}},{key:"syncDevice",value:(s=x(y().mark((function t(e){var r=this;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.setHeaders({"Customer-Token":this.token}).post("customers/register-device",e).then((function(){return r})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"performAuthorizedRequest",value:(i=x(y().mark((function t(e){var r,n,a,o,i=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},n=i.length>2&&void 0!==i[2]?i[2]:"GET",t.prev=2,a={"Customer-Token":this.token},t.next=6,this.adapter.setHeaders(a)[n.toLowerCase()](e,r);case 6:return o=t.sent,t.abrupt("return",o);case 10:throw t.prev=10,t.t0=t.catch(2),console.error("Error in ".concat(n," request to ").concat(e,":"),t.t0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[2,10]])}))),function(t){return i.apply(this,arguments)})},{key:"getSavedPlaces",value:(r=x(y().mark((function t(){var e,r=this;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.performAuthorizedRequest("customers/places");case 3:return e=t.sent,t.abrupt("return",new n(e.map((function(t){return new a(t,r.adapter)}))));case 7:throw t.prev=7,t.t0=t.catch(0),new Error("Failed to retrieve saved places");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(){return r.apply(this,arguments)})},{key:"getOrderHistory",value:(e=x(y().mark((function t(){var e,r,a=this,i=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},t.prev=1,t.next=4,this.performAuthorizedRequest("customers/orders",e);case 4:return r=t.sent,t.abrupt("return",new n(r.map((function(t){return new o(t,a.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),new Error("Failed to retrieve order history");case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(){return e.apply(this,arguments)})}]),c}(),B=Array.isArray,z=new e({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,add:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/").concat(e),w(w({},n),{},{quantity:r}),a).then(this.afterFetch.bind(this))},update:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/").concat(e),w(w({},n),{},{quantity:r}),a).then(this.afterFetch.bind(this))},remove:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/").concat(e),{},r).then(this.afterFetch.bind(this))},empty:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.put("".concat(this.namespace,"/").concat(t,"/empty"),{},e).then(this.afterFetch.bind(this))},retrieve:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.findRecord(t)}}),X=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"cart",w({actions:z},a))}return D(r,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t instanceof I&&(t=t.id),this.store.add(this.id,t,e,r,n)}},{key:"update",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.store.update(this.id,t,e,r,n)}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.remove(this.id,t,e)}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.empty(this.id,t)}},{key:"delete",value:function(){return this.destroy()}},{key:"refresh",value:function(){return this.store.retrieve(this.id)}},{key:"subtotal",value:function(){var t=0;return this.contents().forEach((function(e){t+=e.subtotal})),t}},{key:"contents",value:function(){return this.getAttribute("items",[])}},{key:"hasProduct",value:function(t){return-1!==this.contents().findIndex((function(e){return e.product_id===t}))}},{key:"isEmpty",get:function(){var t=this.contents();return!B(t)||0===t.length}},{key:"isNotEmpty",get:function(){return!this.isEmpty}}]),r}(),$=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"payment-gateway",a)}return D(r,[{key:"type",get:function(){return this.getAttribute("type")}},{key:"code",get:function(){return this.getAttribute("code")}},{key:"isCashGateway",get:function(){return"cash"===this.type}},{key:"isStripeGateway",get:function(){return"stripe"===this.type}},{key:"setCheckoutToken",value:function(t){this.token=t}},{key:"getCheckoutToken",value:function(){return this.token}},{key:"findRecord",value:function(){throw new Error("There is no findRecord() method for payment gateways!")}},{key:"create",value:function(){throw new Error("There is no create() method for payment gateways!")}},{key:"update",value:function(){throw new Error("There is no update() method for payment gateways!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method for payment gateways!")}},{key:"reload",value:function(){throw new Error("There is no reload() method for payment gateways!")}}]),r}();function K(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function U(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function J(t,e){const r=K(t);return isNaN(e)?U(t,NaN):e?(r.setDate(r.getDate()+e),r):r}const V=6048e5,Z=864e5;let tt={};function et(){return tt}function rt(t,e){const r=et(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=K(t),o=a.getDay(),i=(o=a.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function ot(t){const e=K(t);return e.setHours(0,0,0,0),e}function it(t){const 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 st(t){if(!(e=t,e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)||"number"==typeof t))return!1;var e;const r=K(t);return!isNaN(Number(r))}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"}};function ct(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const dt={date:ct({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ct({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ct({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ht={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function lt(t){return(e,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=r?.width?String(r.width):e;n=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=r?.width?String(r.width):t.defaultWidth;n=t.values[a]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function ft(t){return(e,r={})=>{const n=r.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t,e){for(let r=0;rt.test(i))):function(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r;return}(s,(t=>t.test(i)));let c;c=t.valueCallback?t.valueCallback(u):u,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var gt;const pt={code:"en-US",formatDistance:(t,e,r)=>{let n;const a=ut[t];return n="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:dt,formatRelative:(t,e,r,n)=>ht[t],localize:{ordinalNumber:(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:lt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:lt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:lt({values:{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"]},defaultWidth:"wide"}),day:lt({values:{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"]},defaultWidth:"wide"}),dayPeriod:lt({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(gt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const r=t.match(gt.matchPattern);if(!r)return null;const n=r[0],a=t.match(gt.parsePattern);if(!a)return null;let o=gt.valueCallback?gt.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(n.length)}}),era:ft({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ft({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:ft({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:ft({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:ft({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function mt(t){const e=K(t),r=function(t,e){const r=ot(t),n=ot(e),a=r.getTime()-it(r),o=n.getTime()-it(n);return Math.round((a-o)/Z)}(e,function(t){const e=K(t),r=U(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}(e));return r+1}function wt(t){const e=K(t),r=nt(e).getTime()-function(t){const e=at(t),r=U(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),nt(r)}(e).getTime();return Math.round(r/V)+1}function yt(t,e){const r=K(t),n=r.getFullYear(),a=et(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=U(t,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const s=rt(i,e),u=U(t,0);u.setFullYear(n,0,o),u.setHours(0,0,0,0);const c=rt(u,e);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function vt(t,e){const r=K(t),n=rt(r,e).getTime()-function(t,e){const r=et(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=yt(t,e),o=U(t,0);return o.setFullYear(a,0,n),o.setHours(0,0,0,0),rt(o,e)}(r,e).getTime();return Math.round(n/V)+1}function bt(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const kt={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return bt("yy"===e?n%100:n,e.length)},M(t,e){const r=t.getMonth();return"M"===e?String(r+1):bt(r+1,2)},d:(t,e)=>bt(t.getDate(),e.length),a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>bt(t.getHours()%12||12,e.length),H:(t,e)=>bt(t.getHours(),e.length),m:(t,e)=>bt(t.getMinutes(),e.length),s:(t,e)=>bt(t.getSeconds(),e.length),S(t,e){const r=e.length,n=t.getMilliseconds();return bt(Math.floor(n*Math.pow(10,r-3)),e.length)}},xt="midnight",Tt="noon",Mt="morning",Dt="afternoon",Pt="evening",St="night",Et={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return r.ordinalNumber(n,{unit:"year"})}return kt.y(t,e)},Y:function(t,e,r,n){const a=yt(t,n),o=a>0?a:1-a;if("YY"===e){return bt(o%100,2)}return"Yo"===e?r.ordinalNumber(o,{unit:"year"}):bt(o,e.length)},R:function(t,e){return bt(at(t),e.length)},u:function(t,e){return bt(t.getFullYear(),e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return bt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return bt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return kt.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return bt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const a=vt(t,n);return"wo"===e?r.ordinalNumber(a,{unit:"week"}):bt(a,e.length)},I:function(t,e,r){const n=wt(t);return"Io"===e?r.ordinalNumber(n,{unit:"week"}):bt(n,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):kt.d(t,e)},D:function(t,e,r){const n=mt(t);return"Do"===e?r.ordinalNumber(n,{unit:"dayOfYear"}):bt(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const a=t.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return bt(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const a=t.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return bt(o,e.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return bt(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let a;switch(a=12===n?Tt:0===n?xt:n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let a;switch(a=n>=17?Pt:n>=12?Dt:n>=4?Mt:St,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return kt.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):kt.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return"Ko"===e?r.ordinalNumber(n,{unit:"hour"}):bt(n,e.length)},k:function(t,e,r){let n=t.getHours();return 0===n&&(n=24),"ko"===e?r.ordinalNumber(n,{unit:"hour"}):bt(n,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):kt.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):kt.s(t,e)},S:function(t,e){return kt.S(t,e)},X:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return At(a);case"XXXX":case"XX":return qt(a);default:return qt(a,":")}},x:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return At(a);case"xxxx":case"xx":return qt(a);default:return qt(a,":")}},O:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ot(a,":");default:return"GMT"+qt(a,":")}},z:function(t,e,r,n){const a=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ot(a,":");default:return"GMT"+qt(a,":")}},t:function(t,e,r,n){const a=n._originalDate||t;return bt(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,r,n){return bt((n._originalDate||t).getTime(),e.length)}};function Ot(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=Math.floor(n/60),o=n%60;return 0===o?r+String(a):r+String(a)+e+bt(o,2)}function At(t,e){if(t%60==0){return(t>0?"-":"+")+bt(Math.abs(t)/60,2)}return qt(t,e)}function qt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t);return r+bt(Math.floor(n/60),2)+e+bt(n%60,2)}const Ht=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Yt=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Nt={p:Yt,P:(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return Ht(t,e);let o;switch(n){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",Ht(n,e)).replace("{{time}}",Yt(a,e))}},Lt=["D","DD"],jt=["YY","YYYY"];function Ct(t){return-1!==Lt.indexOf(t)}function Ft(t){return-1!==jt.indexOf(t)}function Wt(t,e,r){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const Rt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,It=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qt=/^'([^]*?)'?$/,Gt=/''/g,_t=/[a-zA-Z]/;function Bt(t,e,r){const n=et(),a=r?.locale??n.locale??pt,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=K(t);if(!st(s))throw new RangeError("Invalid time value");const u={firstWeekContainsDate:o,weekStartsOn:i,locale:a,_originalDate:s};return e.match(It).map((function(t){const e=t[0];if("p"===e||"P"===e){return(0,Nt[e])(t,a.formatLong)}return t})).join("").match(Rt).map((function(n){if("''"===n)return"'";const o=n[0];if("'"===o)return function(t){const e=t.match(Qt);if(!e)return t;return e[1].replace(Gt,"'")}(n);const i=Et[o];if(i)return!r?.useAdditionalWeekYearTokens&&Ft(n)&&Wt(n,e,String(t)),!r?.useAdditionalDayOfYearTokens&&Ct(n)&&Wt(n,e,String(t)),i(s,n,a.localize,u);if(o.match(_t))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return n})).join("")}class zt{subPriority=0;validate(t,e){return!0}}class Xt extends zt{constructor(t,e,r,n,a){super(),this.value=t,this.validateValue=e,this.setValue=r,this.priority=n,a&&(this.subPriority=a)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,r){return this.setValue(t,e,this.value,r)}}class $t extends zt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:U(t,function(t,e){const r=e instanceof Date?U(e,0):new e(0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}(t,Date))}}class Kt{run(t,e,r,n){const a=this.parse(t,e,r,n);return a?{setter:new Xt(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,e,r){return!0}}const Ut=/^(1[0-2]|0?\d)/,Jt=/^(3[0-1]|[0-2]?\d)/,Vt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Zt=/^(5[0-3]|[0-4]?\d)/,te=/^(2[0-3]|[0-1]?\d)/,ee=/^(2[0-4]|[0-1]?\d)/,re=/^(1[0-1]|0?\d)/,ne=/^(1[0-2]|0?\d)/,ae=/^[0-5]?\d/,oe=/^[0-5]?\d/,ie=/^\d/,se=/^\d{1,2}/,ue=/^\d{1,3}/,ce=/^\d{1,4}/,de=/^-?\d+/,he=/^-?\d/,le=/^-?\d{1,2}/,fe=/^-?\d{1,3}/,ge=/^-?\d{1,4}/,pe=/^([+-])(\d{2})(\d{2})?|Z/,me=/^([+-])(\d{2})(\d{2})|Z/,we=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ye=/^([+-])(\d{2}):(\d{2})|Z/,ve=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function be(t,e){return t?{value:e(t.value),rest:t.rest}:t}function ke(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function xe(t,e){const r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:e.slice(r[0].length)}}function Te(t){return ke(de,t)}function Me(t,e){switch(t){case 1:return ke(ie,e);case 2:return ke(se,e);case 3:return ke(ue,e);case 4:return ke(ce,e);default:return ke(new RegExp("^\\d{1,"+t+"}"),e)}}function De(t,e){switch(t){case 1:return ke(he,e);case 2:return ke(le,e);case 3:return ke(fe,e);case 4:return ke(ge,e);default:return ke(new RegExp("^-?\\d{1,"+t+"}"),e)}}function Pe(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Se(t,e){const r=e>0,n=r?e:1-e;let a;if(n<=50)a=t||100;else{const e=n+50;a=t+100*Math.floor(e/100)-(t>=e%100?100:0)}return r?a:1-a}function Ee(t){return t%400==0||t%4==0&&t%100!=0}const Oe=[31,28,31,30,31,30,31,31,30,31,30,31],Ae=[31,29,31,30,31,30,31,31,30,31,30,31];function qe(t,e,r){const n=et(),a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=K(t),i=o.getDay(),s=7-a;return J(o,e<0||e>6?e-(i+s)%7:((e%7+7)%7+s)%7-(i+s)%7)}function He(t,e){const r=K(t),n=function(t){let e=K(t).getDay();return 0===e&&(e=7),e}(r);return J(r,e-n)}const Ye={G:new class extends Kt{priority=140;parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends Kt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return be(Me(4,t),n);case"yo":return be(r.ordinalNumber(t,{unit:"year"}),n);default:return be(Me(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const n=t.getFullYear();if(r.isTwoDigitYear){const e=Se(r.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const a="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}},Y:new class extends Kt{priority=130;parse(t,e,r){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return be(Me(4,t),n);case"Yo":return be(r.ordinalNumber(t,{unit:"year"}),n);default:return be(Me(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,n){const a=yt(t,n);if(r.isTwoDigitYear){const e=Se(r.year,a);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,n)}const o="era"in e&&1!==e.era?1-r.year:r.year;return t.setFullYear(o,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Kt{priority=130;parse(t,e){return De("R"===e?4:e.length,t)}set(t,e,r){const n=U(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),nt(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Kt{priority=130;parse(t,e){return De("u"===e?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Kt{priority=120;parse(t,e,r){switch(e){case"Q":case"QQ":return Me(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Kt{priority=120;parse(t,e,r){switch(e){case"q":case"qq":return Me(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth(3*(r-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Kt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"M":return be(ke(Ut,t),n);case"MM":return be(Me(2,t),n);case"Mo":return be(r.ordinalNumber(t,{unit:"month"}),n);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}},L:new class extends Kt{priority=110;parse(t,e,r){const n=t=>t-1;switch(e){case"L":return be(ke(Ut,t),n);case"LL":return be(Me(2,t),n);case"Lo":return be(r.ordinalNumber(t,{unit:"month"}),n);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Kt{priority=100;parse(t,e,r){switch(e){case"w":return ke(Zt,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,n){return rt(function(t,e,r){const n=K(t),a=vt(n,r)-e;return n.setDate(n.getDate()-7*a),n}(t,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Kt{priority=100;parse(t,e,r){switch(e){case"I":return ke(Zt,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return nt(function(t,e){const r=K(t),n=wt(r)-e;return r.setDate(r.getDate()-7*n),r}(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Kt{priority=90;subPriority=1;parse(t,e,r){switch(e){case"d":return ke(Jt,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return Me(e.length,t)}}validate(t,e){const r=Ee(t.getFullYear()),n=t.getMonth();return r?e>=1&&e<=Ae[n]:e>=1&&e<=Oe[n]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Kt{priority=90;subpriority=1;parse(t,e,r){switch(e){case"D":case"DD":return ke(Vt,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return Me(e.length,t)}}validate(t,e){return Ee(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Kt{priority=90;parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=qe(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Kt{priority=90;parse(t,e,r,n){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return be(Me(e.length,t),a);case"eo":return be(r.ordinalNumber(t,{unit:"day"}),a);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=qe(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Kt{priority=90;parse(t,e,r,n){const a=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return be(Me(e.length,t),a);case"co":return be(r.ordinalNumber(t,{unit:"day"}),a);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,n){return(t=qe(t,r,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Kt{priority=90;parse(t,e,r){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return Me(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return be(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return be(r.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return be(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n);default:return be(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return(t=He(t,r)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Pe(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Pe(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Kt{priority=80;parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Pe(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"h":return ke(ne,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const n=t.getHours()>=12;return n&&r<12?t.setHours(r+12,0,0,0):n||12!==r?t.setHours(r,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"H":return ke(te,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"K":return ke(re,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Kt{priority=70;parse(t,e,r){switch(e){case"k":return ke(ee,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return Me(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const n=r<=24?r%24:r;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Kt{priority=60;parse(t,e,r){switch(e){case"m":return ke(ae,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]},s:new class extends Kt{priority=50;parse(t,e,r){switch(e){case"s":return ke(oe,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return Me(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]},S:new class extends Kt{priority=30;parse(t,e){return be(Me(e.length,t),(t=>Math.floor(t*Math.pow(10,3-e.length))))}set(t,e,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]},X:new class extends Kt{priority=10;parse(t,e){switch(e){case"X":return xe(pe,t);case"XX":return xe(me,t);case"XXXX":return xe(we,t);case"XXXXX":return xe(ve,t);default:return xe(ye,t)}}set(t,e,r){return e.timestampIsSet?t:U(t,t.getTime()-it(t)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Kt{priority=10;parse(t,e){switch(e){case"x":return xe(pe,t);case"xx":return xe(me,t);case"xxxx":return xe(we,t);case"xxxxx":return xe(ve,t);default:return xe(ye,t)}}set(t,e,r){return e.timestampIsSet?t:U(t,t.getTime()-it(t)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Kt{priority=40;parse(t){return Te(t)}set(t,e,r){return[U(t,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Kt{priority=20;parse(t){return Te(t)}set(t,e,r){return[U(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},Ne=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Le=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,je=/^'([^]*?)'?$/,Ce=/''/g,Fe=/\S/,We=/[a-zA-Z]/;function Re(t,e,r,n){const a=Object.assign({},et()),o=n?.locale??a.locale??pt,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===e)return""===t?K(r):U(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o},c=[new $t],d=e.match(Le).map((t=>{const e=t[0];if(e in Nt){return(0,Nt[e])(t,o.formatLong)}return t})).join("").match(Ne),h=[];for(let a of d){!n?.useAdditionalWeekYearTokens&&Ft(a)&&Wt(a,e,t),!n?.useAdditionalDayOfYearTokens&&Ct(a)&&Wt(a,e,t);const i=a[0],s=Ye[i];if(s){const{incompatibleTokens:e}=s;if(Array.isArray(e)){const t=h.find((t=>e.includes(t.token)||t.token===i));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${a}\` at the same time`)}else if("*"===s.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${a}\` and any other token at the same time`);h.push({token:i,fullToken:a});const n=s.run(t,a,o.match,u);if(!n)return U(r,NaN);c.push(n.setter),t=n.rest}else{if(i.match(We))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===a?a="'":"'"===i&&(a=a.match(je)[1].replace(Ce,"'")),0!==t.indexOf(a))return U(r,NaN);t=t.slice(a.length)}}if(t.length>0&&Fe.test(t))return U(r,NaN);const l=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,r)=>r.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let f=K(r);if(isNaN(f.getTime()))return U(r,NaN);const g={};for(const t of l){if(!t.validate(f,u))return U(r,NaN);const e=t.set(f,g,u);Array.isArray(e)?(f=e[0],Object.assign(g,e[1])):f=e}return U(r,f)}var Ie=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"store-hour",a)}return D(r,[{key:"day",get:function(){return this.getAttribute("day")}},{key:"isClosed",get:function(){return null===this.getAttribute("start")&&null===this.getAttribute("end")}},{key:"is24Hours",get:function(){var t=this.startDateInstance,e=this.endDateInstance,r=Math.abs(t-e);return Math.floor(r/1e3/60)/60>23}},{key:"startDateInstance",get:function(){if(!this.hasAttribute("start"))return null;var t=this.getAttribute("start"),e=3===t.split(":").length;return Re(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"endDateInstance",get:function(){if(!this.hasAttribute("end"))return null;var t=this.getAttribute("end"),e=3===t.split(":").length;return Re(t,e?"HH:mm:ss":"HH:mm",new Date)}},{key:"humanReadableHoursRange",get:function(){return st(this.startDateInstance)&&st(this.endDateInstance)?"".concat(Bt(this.startDateInstance,"p")," - ").concat(Bt(this.endDateInstance,"p")):"".concat(this.start," - ").concat(this.end)}},{key:"humanReadableHours",get:function(){return this.isClosed?"Closed":this.is24Hours?"24 Hours":this.humanReadableHoursRange}},{key:"create",value:function(){throw new Error("There is no create() method store location!")}},{key:"update",value:function(){throw new Error("There is no update() method store location!")}},{key:"destroy",value:function(){throw new Error("There is no destroy() method store location!")}},{key:"reload",value:function(){throw new Error("There is no reload() method store location!")}}]),r}(),Qe=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"store-location",a)}return D(r,[{key:"latitude",get:function(){return this.getAttribute("place.location.coordinates.1")}},{key:"longitude",get:function(){return this.getAttribute("place.location.coordinates.0")}},{key:"hours",get:function(){return new n(this.getAttribute("hours").map((function(t){return new Ie(t)})))}},{key:"isAlwaysOpen",get:function(){return this.hours.every((function(t){return null==t?void 0:t.is24Hours}))}},{key:"today",get:function(){var t=Bt(new Date,"EEEE");return this.schedule[t]}},{key:"schedule",get:function(){for(var t={},e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"store",a)}return D(r,[{key:"getReviews",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("reviews",w({store:this.id},e)).then((function(e){return new n(e.map((function(e){return new F(e,t.adapter)})))}))}},{key:"getLocations",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("locations",w({store:this.id},e)).then((function(e){return new n(e.map((function(e){return e.place&&(e.place=new a(e.place)),new Qe(e,t.adapter)})))}))}},{key:"getLocation",value:function(t){var e=this;return this.adapter.get("locations/".concat(t),{store:this.id}).then((function(t){return new Qe(t,e.adapter)}))}},{key:"getPaymentGateways",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("gateways",e).then((function(e){return new n(e.map((function(e){return new $(e,t.adapter)})))}))}},{key:"getPaymentGateway",value:function(t){var e=this;return this.adapter.get("gateways/".concat(t)).then((function(t){return new $(t,e.adapter)}))}}]),r}(),_e=function(t){S(s,j);var e,r,a,o,i=Y(s);function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,s),i.call(this,t,e,"network",r)}return D(s,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(o=x(y().mark((function t(e,r){var a,o,i=this,s=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=s.length>2&&void 0!==s[2]?s[2]:{},t.prev=1,t.next=4,this.adapter.get(e,a);case 4:return o=t.sent,t.abrupt("return",new n(o.map((function(t){return new r(t,i.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),console.error("Error fetching ".concat(e,":"),t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t,e){return o.apply(this,arguments)})},{key:"getStores",value:(a=x(y().mark((function t(){var e,r=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",Ge,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getStoreLocations",value:(r=x(y().mark((function t(){var e,r=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",Qe,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getPaymentGateways",value:(e=x(y().mark((function t(){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",$));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),s}(),Be=Array.isArray,ze=function(t){S(o,s);var e,r,a=Y(o);function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,o),e instanceof i?H(t,t=a.call(this,{},e,"service-quote",n)):a.call(this,e,r,"service-quote",n)}return D(o,[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=new Ze(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"formattedAmount",get:function(){var t=this.getAttributes(["amount","currency"]),e=t.amount,r=t.currency;return R(e)||R(r)?null:W(e/100,r)}},{key:"fetchServiceQuotesFromCart",value:(r=x(y().mark((function t(e,r,a){var i,s,u,c,d,h,l=this,f=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=f.length>3&&void 0!==f[3]?f[3]:"storefront",d=f.length>4&&void 0!==f[4]&&f[4],null!==(i=e)&&void 0!==i&&i.id&&(e=e.id),null!==(s=r)&&void 0!==s&&s.id&&(r=r.id),null!==(u=a)&&void 0!==u&&u.id&&(a=a.id),t.prev=5,t.next=8,this.adapter.get("service-quotes/from-cart",{origin:e,destination:r,cart:a,config:c,all:d});case 8:if(h=t.sent,!Be(h)){t.next=11;break}return t.abrupt("return",new n(h.map((function(t){return new o(t,l.adapter)}))));case 11:return t.abrupt("return",new o(h,this.adapter));case 14:throw t.prev=14,t.t0=t.catch(5),console.error("Error fetching service quotes:",t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t,e,n){return r.apply(this,arguments)})}],[{key:"getFromCart",value:(e=x(y().mark((function t(e,r,n,a){var i,s,u,c=arguments;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=c.length>4&&void 0!==c[4]?c[4]:"storefront",s=c.length>5&&void 0!==c[5]&&c[5],u=new o(e),t.abrupt("return",u.fetchServiceQuotesFromCart(r,n,a,i,s));case 4:case"end":return t.stop()}}),t)}))),function(t,r,n,a){return e.apply(this,arguments)})}]),o}(),Xe=new e({create:void 0,findAll:void 0,query:void 0,queryRecord:void 0,initialize:function(t,e,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return u(t)&&(t=t.id),u(e)&&(e=e.id),u(r)&&(r=r.id),u(n)&&(n=n.getAttribute("code")),this.adapter.get("".concat(this.namespace,"/before"),w(w({},a),{},{customer:t,cart:e,serviceQuote:r,gateway:n}),o)},captureOrder:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/capture"),{token:t,transactionDetails:e},r).then((function(t){return new o(t)}))}}),$e=function(t){S(r,j);var e=Y(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T(this,r),e.call(this,t,n,"checkout",a)}return D(r,[{key:"initialize",value:function(){var t;return(t=this.store).initialize.apply(t,arguments)}},{key:"captureOrder",value:function(){var t;return(t=this.store).captureOrder.apply(t,arguments)}}]),r}(),Ke={Product:I,Category:Q,Customer:_,Cart:X,DeliveryServiceQuote:ze,Store:Ge,StoreLocation:Qe,StoreHour:Ie,Checkout:$e,Review:F},Ue={BrowserAdapter:h,NodeAdapter:l},Je=function(){function t(){return T(this,t),this.resources=Ke,this.adapters=Ue,this.lookup.apply(this,arguments)}return D(t,[{key:"lookup",value:function(t,e){var r=c(t),n=Array.prototype.slice.call(arguments).slice(2);if(!this[r])throw new Error("Attempted to resolve invalid type");if(!this[r][e])throw new Error("No ".concat(d(t)," named ").concat(e," to resolve"));return q(this[r][e],N(n))}}]),t}(),Ve=function(){return q(Je,Array.prototype.slice.call(arguments))},Ze=function(t){S(r,p);var e=Y(r);function r(){return T(this,r),e.apply(this,arguments)}return D(r,[{key:"extendActions",value:function(){return f(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"serialize",value:function(t){return Ve("resource",g(this.resource),t,this.adapter)}}]),r}(),tr=function(){function t(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(T(this,t),this.version=a.version||"v1",this.options={version:this.version,host:a.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||a.namespace,publicKey:e,debug:o},!("string"==typeof(n=e)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=a.adapter||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r()?Ve("adapter","NodeAdapter",t):Ve("adapter","BrowserAdapter",t)}(this.options),this.products=new Ze("product",this.adapter),this.categories=new Ze("category",this.adapter),this.reviews=new Ze("review",this.adapter).extendActions(C),this.customers=new Ze("customer",this.adapter).extendActions(G),this.cart=new Ze("cart",this.adapter).extendActions(z),this.checkout=new Ze("checkout",this.adapter).extendActions(Xe)}return D(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",w({query:t},e)).then((function(t){return new n(t.map((function(t){return new I(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return q(t,Array.prototype.slice.call(arguments))}}]),t}();export{X as Cart,Q as Category,$e as Checkout,_ as Customer,ze as DeliveryServiceQuote,_e as Network,$ as PaymentGateway,I as Product,F as Review,Ge as Store,Ie as StoreHour,Qe as StoreLocation,tr as default}; +import{l as e,_ as r,a as n,S as a,b as o,c as i,d as u,e as c,f as h,g as v,P as d,h as l,i as f,j as g,k as w,r as y,m as k,n as m,o as b}from"./store-DTqxvCQ3.js";export{q as Cart,C as Category,t as Checkout,p as Customer,D as DeliveryServiceQuote,R as Review,s as StoreHour}from"./store-DTqxvCQ3.js";import{isNodeEnvironment as x,Collection as A}from"@fleetbase/sdk";var S=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o(this,t),i(this,t,[e,r,"network",n])}return r(t,a),n(t,[{key:"getTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("tags",t)}},{key:"getResourceCollection",value:(l=u(c().mark((function t(e,r){var n,a,s=this,o=arguments;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:{},t.prev=1,t.next=4,this.adapter.get(e,n);case 4:return a=t.sent,t.abrupt("return",new A(a.map((function(t){return new r(t,s.adapter)}))));case 8:throw t.prev=8,t.t0=t.catch(1),console.error("Error fetching ".concat(e,":"),t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t,e){return l.apply(this,arguments)})},{key:"getStores",value:(p=u(c().mark((function t(){var e,r=arguments;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("stores",h,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return p.apply(this,arguments)})},{key:"getStoreLocations",value:(s=u(c().mark((function t(){var e,r=arguments;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.abrupt("return",this.getResourceCollection("store-locations",v,e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"getPaymentGateways",value:(e=u(c().mark((function t(){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getResourceCollection("gateways",d));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]);var e,s,p,l}(),j=function(){function t(r){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(o(this,t),this.version=a.version||"v1",this.options={version:this.version,host:a.host||"https://api.fleetbase.io",namespace:"storefront/".concat(this.version)||a.namespace,publicKey:r,debug:s},!("string"==typeof(n=r)&&n.length>30&&(n.startsWith("store_")||n.startsWith("network_"))))throw new Error("⚠️ Invalid Storefront key given to Storefront SDK");this.adapter=a.adapter||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return x()?e("adapter","NodeAdapter",t):e("adapter","BrowserAdapter",t)}(this.options),this.products=new w("product",this.adapter),this.categories=new w("category",this.adapter),this.reviews=new w("review",this.adapter).extendActions(y),this.customers=new w("customer",this.adapter).extendActions(k),this.cart=new w("cart",this.adapter).extendActions(m),this.checkout=new w("checkout",this.adapter).extendActions(b)}return n(t,[{key:"about",value:function(){return this.adapter.get("about")}},{key:"lookup",value:function(t){return this.adapter.get("lookup/".concat(t))}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("search",f({query:t},e)).then((function(t){return new A(t.map((function(t){return new g(t)})))}))}},{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return l(t,Array.prototype.slice.call(arguments))}}])}();export{S as Network,d as PaymentGateway,g as Product,h as Store,v as StoreLocation,j as default,e as lookup}; //# sourceMappingURL=storefront.js.map diff --git a/dist/esm/storefront.js.map b/dist/esm/storefront.js.map index 6673aa6..737abeb 100644 --- a/dist/esm/storefront.js.map +++ b/dist/esm/storefront.js.map @@ -1 +1 @@ -{"version":3,"file":"storefront.js","sources":["../../src/resource.js","../../src/resources/review.js","../../src/utils/format-currency.js","../../src/utils/is-key-valid.js","../../src/utils/is-empty.js","../../src/resources/product.js","../../src/resources/category.js","../../src/resources/customer.js","../../src/utils/is-phone.js","../../src/resources/cart.js","../../src/resources/payment-gateway.js","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/toDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constructFrom.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/addDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isValid.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/isDate.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDayOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/format.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Setter.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/transpose.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/constants.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/utils.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setDay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getISODay.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/setISOWeek.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/parse.mjs","../../node_modules/.pnpm/date-fns@3.0.5/node_modules/date-fns/getDefaultOptions.mjs","../../src/resources/store-hour.js","../../src/resources/store-location.js","../../src/resources/store.js","../../src/resources/network.js","../../src/resources/delivery-service-quote.js","../../src/resources/checkout.js","../../src/resolver.js","../../src/store.js","../../src/storefront.js","../../src/utils/detect-adapter.js"],"sourcesContent":["import { Resource } from '@fleetbase/sdk';\nimport StorefrontStore from './store';\n\nexport default class StorefrontResource extends Resource {\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n}\n","import Resource from '../resource';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst reviewActions = new StoreActions({\n count: function (storeId, options = {}) {\n const params = {};\n\n if (storeId) {\n params.store = storeId;\n }\n\n return this.adapter.get(`${this.namespace}/count`, params, options);\n },\n});\n\nexport default class Review extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'review', options);\n }\n\n getMedia() {\n // @todo\n }\n\n getPhotos() {\n // @todo\n }\n\n getVideos() {\n // @todo\n }\n}\n\nexport { reviewActions };\n","export default function formatCurrency(amount = 0, currency = 'USD', currencyDisplay = 'symbol') {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n currencyDisplay,\n }).format(amount);\n}\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n","const isEmpty = (obj) => {\n const none = obj === null || obj === undefined;\n if (none) {\n return none;\n }\n\n if (typeof obj.size === 'number') {\n return !obj.size;\n }\n\n const objectType = typeof obj;\n\n if (objectType === 'object') {\n const { size } = obj;\n if (typeof size === 'number') {\n return !size;\n }\n }\n\n if (typeof obj.length === 'number' && objectType !== 'function') {\n return !obj.length;\n }\n\n if (objectType === 'object') {\n const { length } = obj;\n if (typeof length === 'number') {\n return !length;\n }\n }\n\n return false;\n};\n\nexport default isEmpty;\n","import Resource from '../resource';\nimport Review from './review';\nimport { formatCurrency, isEmpty } from '../utils';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Product extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'product', options);\n }\n\n variants() {\n return this.getAttribute('variants');\n }\n\n addons() {\n return this.getAttribute('addon_categories');\n }\n\n get isOnSale() {\n return this.getAttribute('is_on_sale');\n }\n\n get isNotOnSale() {\n return !this.getAttribute('is_on_sale');\n }\n\n get formattedAmount() {\n const { price, sale_price, currency } = this.getAttributes(['price', 'sale_price', 'currency']);\n\n if (this.isOnSale) {\n if (isEmpty(sale_price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(sale_price / 100, currency);\n }\n\n if (isEmpty(price) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(price / 100, currency);\n }\n\n getReviews() {\n return this.adapter.get('reviews', { store: this.id }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n}\n","import Resource from '../resource';\nimport Product from './product';\nimport { Collection } from '@fleetbase/sdk';\n\nexport default class Category extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'category', options);\n }\n\n getProducts() {\n return this.adapter.get('products', { category: this.id }).then((products) => {\n return new Collection(products.map((attributes) => new Product(attributes, this.adapter)));\n });\n }\n}\n","import { Collection, Order, Place, StoreActions } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport StorefrontStore from '../store';\nimport { isPhone } from '../utils';\n\nconst customerActions = new StoreActions({\n // const { error } = await storefront.customers.login('+1 111-1111');\n login: function (identity, password = null, attributes = {}) {\n // handle phone number authentication\n if (isPhone(identity)) {\n return this.adapter.post('customers/login-with-sms', { phone: identity });\n }\n\n if (!password) {\n throw new Error('Login requires password!');\n }\n\n return this.adapter.post('customers/login', { identity, password, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n verifyCode: function (identity, code, attributes = {}) {\n return this.adapter.post('customers/verify-code', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n requestCreationCode(identity, mode = 'email') {\n return this.adapter.post('customers/request-creation-code', {\n identity,\n mode,\n });\n },\n\n create(identity, code, attributes = {}) {\n return this.adapter.post('customers', { identity, code, ...attributes }).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id) {\n return this.findRecord(id);\n },\n});\n\nexport default class Customer extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'customer', {\n actions: customerActions,\n ...options,\n });\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get token() {\n return this.getAttribute('token');\n }\n\n async syncDevice(token) {\n return this.adapter\n .setHeaders({ 'Customer-Token': this.token })\n .post('customers/register-device', token)\n .then(() => {\n return this;\n });\n }\n\n async performAuthorizedRequest(endpoint, params = {}, method = 'GET') {\n try {\n const headers = { 'Customer-Token': this.token };\n const response = await this.adapter.setHeaders(headers)[method.toLowerCase()](endpoint, params);\n return response;\n } catch (error) {\n console.error(`Error in ${method} request to ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getSavedPlaces() {\n try {\n const places = await this.performAuthorizedRequest('customers/places');\n return new Collection(places.map((attributes) => new Place(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve saved places');\n }\n }\n\n async getOrderHistory(params = {}) {\n try {\n const orders = await this.performAuthorizedRequest('customers/orders', params);\n return new Collection(orders.map((attributes) => new Order(attributes, this.adapter)));\n } catch (error) {\n throw new Error('Failed to retrieve order history');\n }\n }\n}\n\nexport { customerActions };\n","const isPhone = (phone = '') => {\n return /^[+]?[\\s./0-9]*[(]?[0-9]{1,4}[)]?[-\\s./0-9]*$/g.test(phone);\n};\n\nexport default isPhone;\n","import Resource from '../resource';\nimport Product from './product';\nimport { StoreActions } from '@fleetbase/sdk';\n\nconst { isArray } = Array;\n\nconst cartActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n add: function (id, productId, quantity = 1, data = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/${id}/${productId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n update: function (id, cartItemId, quantity, data = {}, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/${cartItemId}`, { ...data, quantity }, options).then(this.afterFetch.bind(this));\n },\n\n remove: function (id, cartItemId, options = {}) {\n return this.adapter.delete(`${this.namespace}/${id}/${cartItemId}`, {}, options).then(this.afterFetch.bind(this));\n },\n\n empty: function (id, options = {}) {\n return this.adapter.put(`${this.namespace}/${id}/empty`, {}, options).then(this.afterFetch.bind(this));\n },\n\n retrieve: function (id = '') {\n return this.findRecord(id);\n },\n});\n\nexport default class Cart extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'cart', { actions: cartActions, ...options });\n }\n\n add(productId, quantity = 1, data = {}, options = {}) {\n if (productId instanceof Product) {\n productId = productId.id;\n }\n\n return this.store.add(this.id, productId, quantity, data, options);\n }\n\n update(cartItemId, quantity, data = {}, options = {}) {\n return this.store.update(this.id, cartItemId, quantity, data, options);\n }\n\n remove(cartItemId, options = {}) {\n return this.store.remove(this.id, cartItemId, options);\n }\n\n empty(options = {}) {\n return this.store.empty(this.id, options);\n }\n\n delete() {\n return this.destroy();\n }\n\n refresh() {\n return this.store.retrieve(this.id);\n }\n\n subtotal() {\n let subtotal = 0;\n\n this.contents().forEach((cartItem) => {\n subtotal += cartItem.subtotal;\n });\n\n return subtotal;\n }\n\n contents() {\n return this.getAttribute('items', []);\n }\n\n hasProduct(productId) {\n return this.contents().findIndex((cartItem) => cartItem.product_id === productId) !== -1;\n }\n\n get isEmpty() {\n const contents = this.contents();\n\n if (!isArray(contents)) {\n return true;\n }\n\n return contents.length === 0;\n }\n\n get isNotEmpty() {\n return !this.isEmpty;\n }\n}\n\nexport { cartActions };\n","import Resource from '../resource';\n\nexport default class PaymentGateway extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'payment-gateway', options);\n }\n\n get type() {\n return this.getAttribute('type');\n }\n\n get code() {\n return this.getAttribute('code');\n }\n\n get isCashGateway() {\n return this.type === 'cash';\n }\n\n get isStripeGateway() {\n return this.type === 'stripe';\n }\n\n setCheckoutToken(token) {\n this.token = token;\n }\n\n getCheckoutToken() {\n return this.token;\n }\n\n // remove default resource methods\n findRecord() {\n throw new Error('There is no findRecord() method for payment gateways!');\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method for payment gateways!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method for payment gateways!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method for payment gateways!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method for payment gateways!');\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n startOfDayRight.getTime() -\n getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff =\n startOfISOWeek(_date).getTime() - startOfISOWeekYear(_date).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff =\n startOfWeek(_date, options).getTime() -\n startOfWeekYear(_date, options).getTime();\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.floor(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n const originalDate = options._originalDate || date;\n const timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const protectedDayOfYearTokens = [\"D\", \"DD\"];\nconst protectedWeekYearTokens = [\"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nexport function throwProtectedError(token, format, input) {\n if (token === \"YYYY\") {\n throw new RangeError(\n `Use \\`yyyy\\` instead of \\`YYYY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"YY\") {\n throw new RangeError(\n `Use \\`yy\\` instead of \\`YY\\` (in \\`${format}\\`) for formatting years to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"D\") {\n throw new RangeError(\n `Use \\`d\\` instead of \\`D\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n } else if (token === \"DD\") {\n throw new RangeError(\n `Use \\`dd\\` instead of \\`DD\\` (in \\`${format}\\`) for formatting days of the month to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`,\n );\n }\n}\n","import { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate,\n };\n\n const result = formatStr\n .match(longFormattingTokensRegExp)\n .map(function (substring) {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n const formatter = formatters[firstCharacter];\n if (formatter) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(substring)\n ) {\n throwProtectedError(substring, formatStr, String(date));\n }\n return formatter(\n originalDate,\n substring,\n locale.localize,\n formatterOptions,\n );\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return substring;\n })\n .join(\"\");\n\n return result;\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { transpose } from \"../../transpose.mjs\";\nimport { constructFrom } from \"../../constructFrom.mjs\";\n\nconst TIMEZONE_UNIT_PRIORITY = 10;\n\nexport class Setter {\n subPriority = 0;\n\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nexport class ValueSetter extends Setter {\n constructor(\n value,\n\n validateValue,\n\n setValue,\n\n priority,\n subPriority,\n ) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nexport class DateToSystemTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n set(date, flags) {\n if (flags.timestampIsSet) return date;\n return constructFrom(date, transpose(date, Date));\n }\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name transpose\n * @category Generic Helpers\n * @summary Transpose the date to the given constructor.\n *\n * @description\n * The function transposes the date to the given constructor. It helps you\n * to transpose the date in the system time zone to say `UTCDate` or any other\n * date extension.\n *\n * @typeParam DateInputType - The input `Date` type derived from the passed argument.\n * @typeParam DateOutputType - The output `Date` type derived from the passed constructor.\n *\n * @param fromDate - The date to use values from\n * @param constructor - The date constructor to use\n *\n * @returns Date transposed to the given constructor\n *\n * @example\n * // Create July 10, 2022 00:00 in locale time zone\n * const date = new Date(2022, 6, 10)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'\n *\n * @example\n * // Transpose the date to July 10, 2022 00:00 in UTC\n * transpose(date, UTCDate)\n * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'\n */\nexport function transpose(fromDate, constructor) {\n const date =\n constructor instanceof Date\n ? constructFrom(constructor, 0)\n : new constructor(0);\n date.setFullYear(\n fromDate.getFullYear(),\n fromDate.getMonth(),\n fromDate.getDate(),\n );\n date.setHours(\n fromDate.getHours(),\n fromDate.getMinutes(),\n fromDate.getSeconds(),\n fromDate.getMilliseconds(),\n );\n return date;\n}\n\n// Fallback for modularized imports:\nexport default transpose;\n","import { ValueSetter } from \"./Setter.mjs\";\n\nexport class Parser {\n run(dateString, token, match, options) {\n const result = this.parse(dateString, token, match, options);\n if (!result) {\n return null;\n }\n\n return {\n setter: new ValueSetter(\n result.value,\n this.validate,\n this.set,\n this.priority,\n this.subPriority,\n ),\n rest: result.rest,\n };\n }\n\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n","export const numericPatterns = {\n month: /^(1[0-2]|0?\\d)/, // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/, // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/, // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/, // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/, // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/, // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/, // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/, // 0 to 12\n minute: /^[0-5]?\\d/, // 0 to 59\n second: /^[0-5]?\\d/, // 0 to 59\n\n singleDigit: /^\\d/, // 0 to 9\n twoDigits: /^\\d{1,2}/, // 0 to 99\n threeDigits: /^\\d{1,3}/, // 0 to 999\n fourDigits: /^\\d{1,4}/, // 0 to 9999\n\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/, // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/, // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/, // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/, // 0 to 9999, -0 to -9999\n};\n\nexport const timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/,\n};\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n millisecondsInSecond,\n} from \"../../constants.mjs\";\nimport { numericPatterns } from \"./constants.mjs\";\n\nexport function mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest,\n };\n}\n\nexport function parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n // Input is 'Z'\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1),\n };\n }\n\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n\n return {\n value:\n sign *\n (hours * millisecondsInHour +\n minutes * millisecondsInMinute +\n seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length),\n };\n}\n\nexport function parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\n\nexport function parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\n\nexport function dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\n\nexport function normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nexport function isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [\n 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n];\n\n// Day of the month\nexport class DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { addDays } from \"./addDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link setDay} function options.\n */\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the week of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the day of the week set\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setDay(date, day, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const currentDay = _date.getDay();\n\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n\n const delta = 7 - weekStartsOn;\n const diff =\n day < 0 || day > 6\n ? day - ((currentDay + delta) % 7)\n : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setDay;\n","import { addDays } from \"./addDays.mjs\";\nimport { getISODay } from \"./getISODay.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param day - The day of the ISO week of the new date\n *\n * @returns The new date with the day of the ISO week set\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport function setISODay(date, day) {\n const _date = toDate(date);\n const currentDay = getISODay(_date);\n const diff = day - currentDay;\n return addDays(_date, diff);\n}\n\n// Fallback for modularized imports:\nexport default setISODay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nexport function getISODay(date) {\n const _date = toDate(date);\n let day = _date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}\n\n// Fallback for modularized imports:\nexport default getISODay;\n","import { EraParser } from \"./parsers/EraParser.mjs\";\nimport { YearParser } from \"./parsers/YearParser.mjs\";\nimport { LocalWeekYearParser } from \"./parsers/LocalWeekYearParser.mjs\";\nimport { ISOWeekYearParser } from \"./parsers/ISOWeekYearParser.mjs\";\nimport { ExtendedYearParser } from \"./parsers/ExtendedYearParser.mjs\";\nimport { QuarterParser } from \"./parsers/QuarterParser.mjs\";\nimport { StandAloneQuarterParser } from \"./parsers/StandAloneQuarterParser.mjs\";\nimport { MonthParser } from \"./parsers/MonthParser.mjs\";\nimport { StandAloneMonthParser } from \"./parsers/StandAloneMonthParser.mjs\";\nimport { LocalWeekParser } from \"./parsers/LocalWeekParser.mjs\";\nimport { ISOWeekParser } from \"./parsers/ISOWeekParser.mjs\";\nimport { DateParser } from \"./parsers/DateParser.mjs\";\nimport { DayOfYearParser } from \"./parsers/DayOfYearParser.mjs\";\nimport { DayParser } from \"./parsers/DayParser.mjs\";\nimport { LocalDayParser } from \"./parsers/LocalDayParser.mjs\";\nimport { StandAloneLocalDayParser } from \"./parsers/StandAloneLocalDayParser.mjs\";\nimport { ISODayParser } from \"./parsers/ISODayParser.mjs\";\nimport { AMPMParser } from \"./parsers/AMPMParser.mjs\";\nimport { AMPMMidnightParser } from \"./parsers/AMPMMidnightParser.mjs\";\nimport { DayPeriodParser } from \"./parsers/DayPeriodParser.mjs\";\nimport { Hour1to12Parser } from \"./parsers/Hour1to12Parser.mjs\";\nimport { Hour0to23Parser } from \"./parsers/Hour0to23Parser.mjs\";\nimport { Hour0To11Parser } from \"./parsers/Hour0To11Parser.mjs\";\nimport { Hour1To24Parser } from \"./parsers/Hour1To24Parser.mjs\";\nimport { MinuteParser } from \"./parsers/MinuteParser.mjs\";\nimport { SecondParser } from \"./parsers/SecondParser.mjs\";\nimport { FractionOfSecondParser } from \"./parsers/FractionOfSecondParser.mjs\";\nimport { ISOTimezoneWithZParser } from \"./parsers/ISOTimezoneWithZParser.mjs\";\nimport { ISOTimezoneParser } from \"./parsers/ISOTimezoneParser.mjs\";\nimport { TimestampSecondsParser } from \"./parsers/TimestampSecondsParser.mjs\";\nimport { TimestampMillisecondsParser } from \"./parsers/TimestampMillisecondsParser.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here\nexport const parsers = {\n G: new EraParser(),\n y: new YearParser(),\n Y: new LocalWeekYearParser(),\n R: new ISOWeekYearParser(),\n u: new ExtendedYearParser(),\n Q: new QuarterParser(),\n q: new StandAloneQuarterParser(),\n M: new MonthParser(),\n L: new StandAloneMonthParser(),\n w: new LocalWeekParser(),\n I: new ISOWeekParser(),\n d: new DateParser(),\n D: new DayOfYearParser(),\n E: new DayParser(),\n e: new LocalDayParser(),\n c: new StandAloneLocalDayParser(),\n i: new ISODayParser(),\n a: new AMPMParser(),\n b: new AMPMMidnightParser(),\n B: new DayPeriodParser(),\n h: new Hour1to12Parser(),\n H: new Hour0to23Parser(),\n K: new Hour0To11Parser(),\n k: new Hour1To24Parser(),\n m: new MinuteParser(),\n s: new SecondParser(),\n S: new FractionOfSecondParser(),\n X: new ISOTimezoneWithZParser(),\n x: new ISOTimezoneParser(),\n t: new TimestampSecondsParser(),\n T: new TimestampMillisecondsParser(),\n};\n","import { Parser } from \"../Parser.mjs\";\n\nexport class EraParser extends Parser {\n priority = 140;\n\n parse(dateString, token, match) {\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return (\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n\n // A, B\n case \"GGGGG\":\n return match.era(dateString, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return (\n match.era(dateString, { width: \"wide\" }) ||\n match.era(dateString, { width: \"abbreviated\" }) ||\n match.era(dateString, { width: \"narrow\" })\n );\n }\n }\n\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n// | Year | y | yy | yyy | yyyy | yyyyy |\n// |----------|-------|----|-------|-------|-------|\n// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\nexport class YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\",\n });\n\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { getWeekYear } from \"../../../getWeekYear.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, normalizeTwoDigitYear, parseNDigits } from \"../utils.mjs\";\n\n// Local week-numbering year\nexport class LocalWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token, match) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\",\n });\n\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"year\",\n }),\n valueCallback,\n );\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(\n value.year,\n currentYear,\n );\n date.setFullYear(\n normalizedTwoDigitYear,\n 0,\n options.firstWeekContainsDate,\n );\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n const year =\n !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\n// ISO week-numbering year\nexport class ISOWeekYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigitsSigned } from \"../utils.mjs\";\n\nexport class ExtendedYearParser extends Parser {\n priority = 130;\n\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n\n return parseNDigitsSigned(token.length, dateString);\n }\n\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class QuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n case \"QQ\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { parseNDigits } from \"../utils.mjs\";\n\nexport class StandAloneQuarterParser extends Parser {\n priority = 120;\n\n parse(dateString, token, match) {\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n case \"qq\": // 01, 02, 03, 04\n return parseNDigits(token.length, dateString);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return match.ordinalNumber(dateString, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return (\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return (\n match.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"M\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // J, F, ..., D\n case \"MMMMM\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class StandAloneMonthParser extends Parser {\n priority = 110;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => value - 1;\n\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return mapValue(\n parseNumericPattern(numericPatterns.month, dateString),\n valueCallback,\n );\n // 01, 02, ..., 12\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"month\",\n }),\n valueCallback,\n );\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return (\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // J, F, ..., D\n case \"LLLLL\":\n return match.month(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return (\n match.month(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.month(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setWeek } from \"../../../setWeek.mjs\";\nimport { startOfWeek } from \"../../../startOfWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// Local week of year\nexport class LocalWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\",\n ];\n}\n","import { getWeek } from \"./getWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link setWeek} function options.\n */\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The week of the new date\n * @param options - An object with options\n *\n * @returns The new date with the local week set\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * const result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * const result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport function setWeek(date, week, options) {\n const _date = toDate(date);\n const diff = getWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setWeek;\n","import { setISOWeek } from \"../../../setISOWeek.mjs\";\nimport { startOfISOWeek } from \"../../../startOfISOWeek.mjs\";\nimport { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\n// ISO week of year\nexport class ISOWeekParser extends Parser {\n priority = 100;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { getISOWeek } from \"./getISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param week - The ISO week of the new date\n *\n * @returns The new date with the ISO week set\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport function setISOWeek(date, week) {\n const _date = toDate(date);\n const diff = getISOWeek(_date) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setISOWeek;\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport {\n isLeapYearIndex,\n parseNDigits,\n parseNumericPattern,\n} from \"../utils.mjs\";\n\nexport class DayOfYearParser extends Parser {\n priority = 90;\n\n subpriority = 1;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\n\n// Day of week\nexport class DayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"EEEEE\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"EEEE\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Local day of week\nexport class LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"e\":\n case \"ee\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"eo\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"eee\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // T\n case \"eeeee\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return (\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n\n // Tuesday\n case \"eeee\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"formatting\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"formatting\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"formatting\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { setDay } from \"../../../setDay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// Stand-alone local day of week\nexport class StandAloneLocalDayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case \"c\":\n case \"cc\": // 03\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n // 3rd\n case \"co\":\n return mapValue(\n match.ordinalNumber(dateString, {\n unit: \"day\",\n }),\n valueCallback,\n );\n // Tue\n case \"ccc\":\n return (\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // T\n case \"ccccc\":\n return match.day(dateString, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return (\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n\n // Tuesday\n case \"cccc\":\n default:\n return (\n match.day(dateString, { width: \"wide\", context: \"standalone\" }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\",\n }) ||\n match.day(dateString, { width: \"short\", context: \"standalone\" }) ||\n match.day(dateString, { width: \"narrow\", context: \"standalone\" })\n );\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\",\n ];\n}\n","import { setISODay } from \"../../../setISODay.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\n// ISO day of week\nexport class ISODayParser extends Parser {\n priority = 90;\n\n parse(dateString, token, match) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n\n switch (token) {\n // 2\n case \"i\":\n case \"ii\": // 02\n return parseNDigits(token.length, dateString);\n // 2nd\n case \"io\":\n return match.ordinalNumber(dateString, { unit: \"day\" });\n // Tue\n case \"iii\":\n return mapValue(\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // T\n case \"iiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tu\n case \"iiiiii\":\n return mapValue(\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n // Tuesday\n case \"iiii\":\n default:\n return mapValue(\n match.day(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"short\",\n context: \"formatting\",\n }) ||\n match.day(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n }),\n valueCallback,\n );\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\",\n ];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"aaaaa\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\nexport class AMPMMidnightParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"bbbbb\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { dayPeriodEnumToHours } from \"../utils.mjs\";\n\n// in the morning, in the afternoon, in the evening, at night\nexport class DayPeriodParser extends Parser {\n priority = 80;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return (\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n\n case \"BBBBB\":\n return match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return (\n match.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\",\n }) ||\n match.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\",\n })\n );\n }\n }\n\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1to12Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0to23Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour0To11Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class Hour1To24Parser extends Parser {\n priority = 70;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class MinuteParser extends Parser {\n priority = 60;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { numericPatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseNDigits, parseNumericPattern } from \"../utils.mjs\";\n\nexport class SecondParser extends Parser {\n priority = 50;\n\n parse(dateString, token, match) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { Parser } from \"../Parser.mjs\";\nimport { mapValue, parseNDigits } from \"../utils.mjs\";\n\nexport class FractionOfSecondParser extends Parser {\n priority = 30;\n\n parse(dateString, token) {\n const valueCallback = (value) =>\n Math.floor(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n\n incompatibleTokens = [\"t\", \"T\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601. +00:00 is `'Z'`)\nexport class ISOTimezoneWithZParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"XXXXX\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"../../../_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { timezonePatterns } from \"../constants.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseTimezonePattern } from \"../utils.mjs\";\n\n// Timezone (ISO-8601)\nexport class ISOTimezoneParser extends Parser {\n priority = 10;\n\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalMinutes,\n dateString,\n );\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(\n timezonePatterns.basicOptionalSeconds,\n dateString,\n );\n case \"xxxxx\":\n return parseTimezonePattern(\n timezonePatterns.extendedOptionalSeconds,\n dateString,\n );\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n\n set(date, flags, value) {\n if (flags.timestampIsSet) return date;\n return constructFrom(\n date,\n date.getTime() - getTimezoneOffsetInMilliseconds(date) - value,\n );\n }\n\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampSecondsParser extends Parser {\n priority = 40;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"../../../constructFrom.mjs\";\nimport { Parser } from \"../Parser.mjs\";\nimport { parseAnyDigitsSigned } from \"../utils.mjs\";\n\nexport class TimestampMillisecondsParser extends Parser {\n priority = 20;\n\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n\n incompatibleTokens = \"*\";\n}\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getDefaultOptions } from \"./getDefaultOptions.mjs\";\nimport { enUS as defaultLocale } from \"./locale/en-US.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n throwProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { parsers } from \"./parse/_lib/parsers.mjs\";\nimport { DateToSystemTimezoneSetter } from \"./parse/_lib/Setter.mjs\";\n\n/**\n * The {@link parse} function options.\n */\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\n\nconst notWhitespaceRegExp = /\\S/;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)\n * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateStr - The string to parse\n * @param formatStr - The string of tokens\n * @param referenceDate - defines values missing from the parsed dateString\n * @param options - An object with options.\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @returns The parsed date\n *\n * @throws `options.locale` must contain `match` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\nexport function parse(dateStr, formatStr, referenceDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n if (formatStr === \"\") {\n if (dateStr === \"\") {\n return toDate(referenceDate);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n // If timezone isn't specified, it will be set to the system timezone\n const setters = [new DateToSystemTimezoneSetter()];\n\n const tokens = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp);\n\n const usedTokens = [];\n\n for (let token of tokens) {\n if (\n !options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n if (\n !options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token)\n ) {\n throwProtectedError(token, formatStr, dateStr);\n }\n\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find(\n (usedToken) =>\n incompatibleTokens.includes(usedToken.token) ||\n usedToken.token === firstCharacter,\n );\n if (incompatibleToken) {\n throw new RangeError(\n `The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`,\n );\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(\n `The format string mustn't contain \\`${token}\\` and any other token at the same time`,\n );\n }\n\n usedTokens.push({ token: firstCharacter, fullToken: token });\n\n const parseResult = parser.run(\n dateStr,\n token,\n locale.match,\n subFnOptions,\n );\n\n if (!parseResult) {\n return constructFrom(referenceDate, NaN);\n }\n\n setters.push(parseResult.setter);\n\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n // Replace two single quote characters with one single quote character\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n }\n\n // Cut token from string, or, if string doesn't match the token, return Invalid Date\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return constructFrom(referenceDate, NaN);\n }\n }\n }\n\n // Check if the remaining input contains something other than whitespace\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const uniquePrioritySetters = setters\n .map((setter) => setter.priority)\n .sort((a, b) => b - a)\n .filter((priority, index, array) => array.indexOf(priority) === index)\n .map((priority) =>\n setters\n .filter((setter) => setter.priority === priority)\n .sort((a, b) => b.subPriority - a.subPriority),\n )\n .map((setterArray) => setterArray[0]);\n\n let date = toDate(referenceDate);\n\n if (isNaN(date.getTime())) {\n return constructFrom(referenceDate, NaN);\n }\n\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return constructFrom(referenceDate, NaN);\n }\n\n const result = setter.set(date, flags, subFnOptions);\n // Result is tuple (date, flags)\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n // Result is date\n } else {\n date = result;\n }\n }\n\n return constructFrom(referenceDate, date);\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default parse;\n","import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n","import Resource from '../resource';\nimport { format, parse, isValid } from 'date-fns';\n\nexport default class StoreHour extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-hour', options);\n }\n\n get day() {\n return this.getAttribute('day');\n }\n\n get isClosed() {\n return this.getAttribute('start') === null && this.getAttribute('end') === null;\n }\n\n get is24Hours() {\n const start = this.startDateInstance;\n const end = this.endDateInstance;\n const diff = Math.abs(start - end);\n const hours = Math.floor(diff / 1000 / 60) / 60;\n\n return hours > 23;\n }\n\n get startDateInstance() {\n if (!this.hasAttribute('start')) {\n return null;\n }\n\n const start = this.getAttribute('start');\n const includesSeconds = start.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(start, format, new Date());\n }\n\n get endDateInstance() {\n if (!this.hasAttribute('end')) {\n return null;\n }\n\n const end = this.getAttribute('end');\n const includesSeconds = end.split(':').length === 3;\n const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm';\n\n return parse(end, format, new Date());\n }\n\n get humanReadableHoursRange() {\n if (!isValid(this.startDateInstance) || !isValid(this.endDateInstance)) {\n return `${this.start} - ${this.end}`;\n }\n\n return `${format(this.startDateInstance, 'p')} - ${format(this.endDateInstance, 'p')}`;\n }\n\n get humanReadableHours() {\n if (this.isClosed) {\n return 'Closed';\n }\n\n if (this.is24Hours) {\n return '24 Hours';\n }\n\n return this.humanReadableHoursRange;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n\n // remove default resource methods\n reload() {\n throw new Error('There is no reload() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreHour from './store-hour';\nimport { Collection } from '@fleetbase/sdk';\nimport { format } from 'date-fns';\n\nexport default class StoreLocation extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store-location', options);\n }\n\n get latitude() {\n return this.getAttribute('place.location.coordinates.1');\n }\n\n get longitude() {\n return this.getAttribute('place.location.coordinates.0');\n }\n\n get hours() {\n return new Collection(this.getAttribute('hours').map((attributes) => new StoreHour(attributes)));\n }\n\n get isAlwaysOpen() {\n return this.hours.every((hour) => hour?.is24Hours);\n }\n\n get today() {\n const today = format(new Date(), 'EEEE');\n\n return this.schedule[today];\n }\n\n get schedule() {\n const schedule = {};\n const week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n\n for (let i = 0; i < week.length; i++) {\n const day = week[i];\n\n schedule[day] = new Collection();\n }\n\n for (let i = 0; i < this.hours.length; i++) {\n const hour = this.hours.objectAt(i);\n\n schedule[hour.day].pushObject(hour);\n }\n\n return schedule;\n }\n\n // remove default resource methods\n create() {\n throw new Error('There is no create() method store location!');\n }\n\n // remove default resource methods\n update() {\n throw new Error('There is no update() method store location!');\n }\n\n // remove default resource methods\n destroy() {\n throw new Error('There is no destroy() method store location!');\n }\n}\n","import Resource from '../resource';\nimport StoreLocation from './store-location';\nimport PaymentGateway from './payment-gateway';\nimport Review from './review';\nimport { Collection, Place } from '@fleetbase/sdk';\n\nexport default class Store extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'store', options);\n }\n\n getReviews(params = {}) {\n return this.adapter.get('reviews', { store: this.id, ...params }).then((reviews) => {\n return new Collection(reviews.map((attributes) => new Review(attributes, this.adapter)));\n });\n }\n\n getLocations(params = {}) {\n return this.adapter.get('locations', { store: this.id, ...params }).then((storeLocations) => {\n return new Collection(\n storeLocations.map((attributes) => {\n if (attributes.place) {\n attributes.place = new Place(attributes.place);\n }\n\n return new StoreLocation(attributes, this.adapter);\n })\n );\n });\n }\n\n getLocation(id) {\n return this.adapter.get(`locations/${id}`, { store: this.id }).then((attributes) => {\n return new StoreLocation(attributes, this.adapter);\n });\n }\n\n getPaymentGateways(params = {}) {\n return this.adapter.get('gateways', params).then((gateways) => {\n return new Collection(\n gateways.map((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n })\n );\n });\n }\n\n getPaymentGateway(id) {\n return this.adapter.get(`gateways/${id}`).then((attributes) => {\n return new PaymentGateway(attributes, this.adapter);\n });\n }\n}\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import { Adapter, Collection, ServiceQuote } from '@fleetbase/sdk';\nimport StorefrontStore from '../store';\nimport { formatCurrency, isEmpty } from '../utils';\n\nconst { isArray } = Array;\n\nexport default class DeliveryServiceQuote extends ServiceQuote {\n constructor(attributes = {}, adapter, options = {}) {\n if (attributes instanceof Adapter) {\n return super({}, attributes, 'service-quote', options);\n }\n\n super(attributes, adapter, 'service-quote', options);\n }\n\n /**\n * Set a new adapter to the resource instance, this will update the Store instance\n *\n * @param {Adapter} adapter\n * @return {Resource} this\n */\n setAdapter(adapter) {\n this.adapter = adapter;\n this.store = new StorefrontStore(this.resource, adapter, {\n onAfterFetch: this.syncAttributes.bind(this),\n actions: this.options?.actions,\n });\n\n return this;\n }\n\n get formattedAmount() {\n const { amount, currency } = this.getAttributes(['amount', 'currency']);\n\n if (isEmpty(amount) || isEmpty(currency)) {\n return null;\n }\n\n return formatCurrency(amount / 100, currency);\n }\n\n async fetchServiceQuotesFromCart(origin, destination, cart, config = 'storefront', all = false) {\n if (origin?.id) {\n origin = origin.id;\n }\n if (destination?.id) {\n destination = destination.id;\n }\n if (cart?.id) {\n cart = cart.id;\n }\n\n try {\n const serviceQuotes = await this.adapter.get('service-quotes/from-cart', {\n origin,\n destination,\n cart,\n config,\n all,\n });\n\n if (isArray(serviceQuotes)) {\n return new Collection(serviceQuotes.map((serviceQuote) => new DeliveryServiceQuote(serviceQuote, this.adapter)));\n }\n\n return new DeliveryServiceQuote(serviceQuotes, this.adapter);\n } catch (error) {\n console.error('Error fetching service quotes:', error);\n throw error;\n }\n }\n\n static async getFromCart(adapter, origin, destination, cart, config = 'storefront', all = false) {\n const quote = new DeliveryServiceQuote(adapter);\n return quote.fetchServiceQuotesFromCart(origin, destination, cart, config, all);\n }\n}\n","import { Order, StoreActions, isResource } from '@fleetbase/sdk';\nimport Resource from '../resource';\n\nconst checkoutActions = new StoreActions({\n create: undefined,\n findAll: undefined,\n query: undefined,\n queryRecord: undefined,\n\n initialize: function (customer, cart, serviceQuote, gateway, orderOptions = {}, options = {}) {\n if (isResource(customer)) {\n customer = customer.id;\n }\n\n if (isResource(cart)) {\n cart = cart.id;\n }\n\n if (isResource(serviceQuote)) {\n serviceQuote = serviceQuote.id;\n }\n\n if (isResource(gateway)) {\n gateway = gateway.getAttribute('code');\n }\n\n return this.adapter.get(`${this.namespace}/before`, { ...orderOptions, customer, cart, serviceQuote, gateway }, options);\n },\n\n captureOrder: function (token, transactionDetails = {}, options = {}) {\n return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson));\n },\n});\n\nexport default class Checkout extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'checkout', options);\n }\n\n initialize() {\n return this.store.initialize(...arguments);\n }\n\n captureOrder() {\n return this.store.captureOrder(...arguments);\n }\n}\n\nexport { checkoutActions };\n","import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources';\nimport { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk';\n\nconst resources = {\n Product,\n Category,\n Customer,\n Cart,\n DeliveryServiceQuote,\n Store,\n StoreLocation,\n StoreHour,\n Checkout,\n Review,\n};\n\nconst adapters = {\n BrowserAdapter,\n NodeAdapter,\n};\n\nclass Resolver {\n constructor() {\n this.resources = resources;\n this.adapters = adapters;\n\n return this.lookup(...arguments);\n }\n\n lookup(type, className) {\n const key = pluralize(type);\n const params = [...arguments].slice(2);\n\n if (!this[key]) {\n throw new Error('Attempted to resolve invalid type');\n }\n\n if (!this[key][className]) {\n throw new Error(`No ${singularize(type)} named ${className} to resolve`);\n }\n\n return new this[key][className](...params);\n }\n}\n\nconst lookup = function () {\n return new Resolver(...arguments);\n};\n\nexport { Resolver, lookup };\n","import { Store, classify, extendStoreActions } from '@fleetbase/sdk';\nimport { lookup } from './resolver';\n\nexport default class StorefrontStore extends Store {\n constructor() {\n super(...arguments);\n }\n\n extendActions(actions = []) {\n return extendStoreActions(this, actions);\n }\n\n serialize(json) {\n return lookup('resource', classify(this.resource), json, this.adapter);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network };\n","import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n"],"names":["StorefrontResource","_Resource","_inherits","Resource","_super","_createSuper","_classCallCheck","apply","this","arguments","_createClass","key","value","adapter","_this$options","store","StorefrontStore","resource","onAfterFetch","syncAttributes","bind","actions","options","reviewActions","StoreActions","count","storeId","length","undefined","params","get","concat","namespace","Review","attributes","call","formatCurrency","amount","currency","currencyDisplay","Intl","NumberFormat","style","format","isEmpty","obj","none","size","objectType","_typeof","Product","getAttribute","_this$getAttributes","getAttributes","price","sale_price","isOnSale","_this","id","then","reviews","Collection","map","Category","category","products","customerActions","login","identity","password","test","isPhone","post","phone","Error","_objectSpread","afterFetch","verifyCode","code","requestCreationCode","mode","create","retrieve","findRecord","Customer","_getOrderHistory","_getSavedPlaces","_performAuthorizedRequest","_syncDevice","_asyncToGenerator","_regeneratorRuntime","mark","_callee","token","wrap","_context","prev","next","abrupt","setHeaders","stop","_x","_callee2","endpoint","method","headers","response","_args2","_context2","toLowerCase","sent","t0","console","error","_x2","_callee3","places","_this2","_context3","performAuthorizedRequest","Place","_callee4","orders","_this3","_args4","_context4","Order","isArray","Array","cartActions","findAll","query","queryRecord","add","productId","quantity","data","update","cartItemId","put","remove","empty","Cart","destroy","subtotal","contents","forEach","cartItem","findIndex","product_id","PaymentGateway","type","toDate","argument","argStr","Object","prototype","toString","Date","constructor","NaN","constructFrom","date","addDays","_date","isNaN","setDate","getDate","millisecondsInWeek","millisecondsInDay","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setHours","startOfISOWeek","getISOWeekYear","year","getFullYear","fourthOfJanuaryOfNextYear","setFullYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTime","startOfDay","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMonth","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","isValid","Number","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","args","width","String","defaultWidth","formats","formatLong","full","long","medium","short","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","context","formattingValues","defaultFormattingWidth","values","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","array","predicate","pattern","object","hasOwnProperty","findKey","valueCallback","rest","slice","enUS","formatDistance","result","tokenValue","replace","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","rem100","era","narrow","abbreviated","wide","quarter","month","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseInt","parseResult","any","index","firstWeekContainsDate","getDayOfYear","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","Math","round","differenceInCalendarDays","cleanDate","startOfYear","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","abs","padStart","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","floor","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","b","hours","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","originalDate","T","offset","delimiter","sign","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","p","P","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","RangeError","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","formatterOptions","substring","firstCharacter","longFormatter","join","matched","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","Setter","subPriority","validate","_utcDate","ValueSetter","validateValue","setValue","priority","super","set","flags","DateToSystemTimezoneSetter","timestampIsSet","fromDate","transpose","Parser","run","dateString","parse","setter","_value","numericPatterns","timezonePatterns","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","isLeapYearIndex","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","setDay","currentDay","delta","setISODay","getISODay","parsers","incompatibleTokens","isTwoDigitYear","normalizedTwoDigitYear","_flags","firstWeekOfYear","setMonth","setWeek","setISOWeek","isLeapYear","subpriority","wholeWeekDays","isPM","setMinutes","setSeconds","setMilliseconds","notWhitespaceRegExp","dateStr","referenceDate","assign","getInternalDefaultOptions","subFnOptions","setters","tokens","usedTokens","parser","incompatibleToken","find","usedToken","includes","fullToken","push","uniquePrioritySetters","sort","filter","setterArray","StoreHour","start","startDateInstance","end","endDateInstance","hasAttribute","includesSeconds","split","isClosed","is24Hours","humanReadableHoursRange","StoreLocation","every","hour","schedule","objectAt","pushObject","Store","storeLocations","place","_this4","gateways","_this5","Network","_getPaymentGateways","_getStoreLocations","_getStores","_getResourceCollection","ResourceClass","resources","_args","getResourceCollection","_args3","DeliveryServiceQuote","_ServiceQuote","ServiceQuote","_getFromCart","_fetchServiceQuotesFromCart","Adapter","_possibleConstructorReturn","origin","destination","cart","_origin","_destination","_cart","config","all","serviceQuotes","serviceQuote","_x3","quote","fetchServiceQuotesFromCart","_x4","_x5","_x6","_x7","checkoutActions","initialize","customer","gateway","orderOptions","isResource","captureOrder","transactionDetails","orderJson","Checkout","_this$store","_this$store2","adapters","BrowserAdapter","NodeAdapter","Resolver","lookup","className","pluralize","singularize","_construct","_toConsumableArray","_Store","extendStoreActions","json","classify","Storefront","storeKey","debug","version","host","publicKey","startsWith","isNodeEnvironment","detectAdapter","categories","extendActions","customers","checkout","product"],"mappings":"stVACsC,IAEjBA,WAAkBC,GAAAC,EAAAF,EAASG,GAAT,IAAAC,EAAAC,EAAAL,GAAA,SAAAA,IAAA,OAAAM,OAAAN,GAAAI,EAAAG,MAAAC,KAAAC,UAAA,CAelC,OAfkCC,EAAAV,EAAA,CAAA,CAAAW,IAAA,aAAAC,MAOnC,SAAWC,GAAS,IAAAC,EAOhB,OANAN,KAAKK,QAAUA,EACfL,KAAKO,MAAQ,IAAIC,GAAgBR,KAAKS,SAAUJ,EAAS,CACrDK,aAAcV,KAAKW,eAAeC,KAAKZ,MACvCa,QAAqBP,QAAdA,EAAEN,KAAKc,eAALR,IAAYA,OAAZA,EAAAA,EAAcO,UAGpBb,IACX,KAACR,CAAA,ICfCuB,EAAgB,IAAIC,EAAa,CACnCC,MAAO,SAAUC,GAAuB,IAAdJ,E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,GAAG,CAAA,EACpB,OAAOD,KAAKK,QAAQiB,IAAI,SAAQ6C,EAAA,CAAIwD,MAAAA,GAAU7G,IAAWqC,MAAK,SAACM,GAC3D,OAAO,IAAIJ,EAAWI,EAASH,KAAI,SAACiiB,GAAO,OAAK,IAAI7iB,EAAQ6iB,EAAQ,IACxE,GACJ,GAAC,CAAAplB,IAAA,aAAAC,MAMD,SAAWC,GACPL,KAAKK,QAAUA,CACnB,GAAC,CAAAF,IAAA,aAAAC,MAED,WACI,OAAOJ,KAAKK,OAChB,IAAC,CAAA,CAAAF,IAAA,cAAAC,MAVD,WACI,OAAAgkB,EAAWM,EAAUld,MAAA4B,UAAA4G,MAAArO,KAAI1B,WAC7B,KAACykB,CAAA,CA/C0B","x_google_ignoreList":[11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]} \ No newline at end of file +{"version":3,"file":"storefront.js","sources":["../../src/utils/detect-adapter.js","../../src/resources/network.js","../../src/storefront.js","../../src/utils/is-key-valid.js"],"sourcesContent":["import { lookup } from '../resolver';\nimport { isNodeEnvironment } from '@fleetbase/sdk';\n\nconst detectAdapter = (options = {}) => {\n if (isNodeEnvironment()) {\n return lookup('adapter', 'NodeAdapter', options);\n }\n\n return lookup('adapter', 'BrowserAdapter', options);\n};\n\nexport default detectAdapter;\n","import { Collection } from '@fleetbase/sdk';\nimport Resource from '../resource';\nimport PaymentGateway from './payment-gateway';\nimport Store from './store';\nimport StoreLocation from './store-location';\n\nexport default class Network extends Resource {\n constructor(attributes = {}, adapter, options = {}) {\n super(attributes, adapter, 'network', options);\n }\n\n getTags(params = {}) {\n return this.adapter.get('tags', params);\n }\n\n async getResourceCollection(endpoint, ResourceClass, params = {}) {\n try {\n const resources = await this.adapter.get(endpoint, params);\n return new Collection(resources.map((attributes) => new ResourceClass(attributes, this.adapter)));\n } catch (error) {\n console.error(`Error fetching ${endpoint}:`, error);\n throw error;\n }\n }\n\n async getStores(params = {}) {\n return this.getResourceCollection('stores', Store, params);\n }\n\n async getStoreLocations(params = {}) {\n return this.getResourceCollection('store-locations', StoreLocation, params);\n }\n\n async getPaymentGateways() {\n return this.getResourceCollection('gateways', PaymentGateway);\n }\n}\n","import StorefrontStore from './store';\nimport { detectAdapter, isKeyValid } from './utils';\nimport { lookup } from './resolver';\nimport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources';\nimport { cartActions } from './resources/cart';\nimport { customerActions } from './resources/customer';\nimport { checkoutActions } from './resources/checkout';\nimport { reviewActions } from './resources/review';\nimport { Collection } from '@fleetbase/sdk';\n\n/**\n * // instance\n * const storefront = new Storefront();\n *\n */\n\nexport default class Storefront {\n /**\n * Builds an instance of the Fleetbase Storefront SDK\n *\n * @param {String} storeKey The access key for the storefront store\n * @param {Object} config The config object\n * @param {Boolean} debug Enable debug mode\n * @return {Storefront} Instance\n */\n constructor(storeKey, config = {}, debug = false) {\n this.version = config.version || 'v1';\n this.options = {\n version: this.version,\n host: config.host || 'https://api.fleetbase.io',\n namespace: `storefront/${this.version}` || config.namespace,\n publicKey: storeKey,\n debug,\n };\n\n if (!isKeyValid(storeKey)) {\n throw new Error('⚠️ Invalid Storefront key given to Storefront SDK');\n }\n\n this.adapter = config.adapter || detectAdapter(this.options);\n\n this.products = new StorefrontStore('product', this.adapter);\n this.categories = new StorefrontStore('category', this.adapter);\n this.reviews = new StorefrontStore('review', this.adapter).extendActions(reviewActions);\n this.customers = new StorefrontStore('customer', this.adapter).extendActions(customerActions);\n this.cart = new StorefrontStore('cart', this.adapter).extendActions(cartActions);\n this.checkout = new StorefrontStore('checkout', this.adapter).extendActions(checkoutActions);\n }\n\n /** loads information about this storefront */\n about() {\n return this.adapter.get('about');\n }\n\n /** lookup a specific store or network provided the ID */\n lookup(id) {\n return this.adapter.get(`lookup/${id}`);\n }\n\n /** search products in store or network */\n search(query, options = {}) {\n return this.adapter.get('search', { query, ...options }).then((products) => {\n return new Collection(products.map((product) => new Product(product)));\n });\n }\n\n static newInstance() {\n return new Storefront(...arguments);\n }\n\n setAdapter(adapter) {\n this.adapter = adapter;\n }\n\n getAdapter() {\n return this.adapter;\n }\n}\n\nexport { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network, lookup };\n","const isKeyValid = (key) => {\n return typeof key === 'string' && key.length > 30 && (key.startsWith('store_') || key.startsWith('network_'));\n};\n\nexport default isKeyValid;\n"],"names":["Network","attributes","arguments","length","undefined","adapter","options","_classCallCheck","_callSuper","_inherits","Resource","_createClass","key","value","params","this","get","_getResourceCollection","_asyncToGenerator","_regeneratorRuntime","mark","_callee","endpoint","ResourceClass","resources","_this","_args","wrap","_context","prev","next","sent","abrupt","Collection","map","t0","console","error","concat","stop","_x","_x2","apply","_getStores","_callee2","_args2","_context2","getResourceCollection","Store","_getStoreLocations","_callee3","_args3","_context3","StoreLocation","_getPaymentGateways","_callee4","_context4","PaymentGateway","Storefront","storeKey","config","debug","version","host","namespace","publicKey","startsWith","Error","isNodeEnvironment","lookup","detectAdapter","products","StorefrontStore","categories","reviews","extendActions","reviewActions","customers","customerActions","cart","cartActions","checkout","checkoutActions","id","query","_objectSpread","then","product","Product","_construct","Array","prototype","slice","call"],"mappings":"mXAGA,ICGqBA,aACjB,SAAAA,IAAoD,IAAxCC,EAAUC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EAAEG,EAAOH,UAAAC,OAAAD,EAAAA,kBAAAE,EAAEE,EAAOJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EAAA,OAAAK,OAAAP,GAAAQ,EAAAR,KAAAA,EACxCC,CAAAA,EAAYI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KAAKV,QAAQW,cAAGsB,OAAW6C,GACtC,GAEA,CAAAvE,IAAA,SAAAC,MACA,SAAOuE,GAAqB,IAAd9E,EAAOJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EACtB,OAAOa,KAAKV,QAAQW,IAAI,SAAQqE,EAAA,CAAID,MAAAA,GAAU9E,IAAWgF,MAAK,SAACf,GAC3D,OAAO,IAAItC,EAAWsC,EAASrC,KAAI,SAACqD,GAAO,OAAK,IAAIC,EAAQD,EAAQ,IACxE,GACJ,GAAC,CAAA3E,IAAA,aAAAC,MAMD,SAAWR,GACPU,KAAKV,QAAUA,CACnB,GAAC,CAAAO,IAAA,aAAAC,MAED,WACI,OAAOE,KAAKV,OAChB,IAAC,CAAA,CAAAO,IAAA,cAAAC,MAVD,WACI,OAAA4E,EAAW/B,EAAUgC,MAAAC,UAAAC,MAAAC,KAAI3F,WAC7B,IAAC,CApD0B"} \ No newline at end of file diff --git a/package.json b/package.json index 67d9717..6524c03 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,21 @@ { "name": "@fleetbase/storefront", - "version": "1.1.9", + "version": "1.1.10", "description": "Fleetbase Storefront JS & Node SDK", - "main": "dist/cjs/storefront.js", - "module": "dist/esm/storefront.js", - "files": [ - "dist", - "src" + "author": "Ronald A. Richardson (https://ron.dev)", + "license": "BSD-3-Clause", + "keywords": [ + "fleetbase", + "ecommerce", + "api", + "ondemand", + "ecommerce", + "last", + "mile", + "delivery", + "logistics", + "ecommerce", + "app" ], "scripts": { "prebuild": "npm run lint", @@ -19,24 +28,25 @@ "prepare": "husky install", "format": "prettier . --write" }, + "main": "dist/cjs/storefront.js", + "module": "dist/esm/storefront.js", + "files": [ + "dist", + "src" + ], + "exports": { + ".": { + "import": "./dist/esm/storefront.js", + "require": "./dist/cjs/storefront.js" + }, + "./resolver": { + "import": "./dist/esm/resolver.js", + "require": "./dist/cjs/resolver.js" + } + }, "lint-staged": { "**/*": "prettier --write --ignore-unknown" }, - "keywords": [ - "fleetbase", - "ecommerce", - "api", - "ondemand", - "ecommerce", - "last", - "mile", - "delivery", - "logistics", - "ecommerce", - "app" - ], - "author": "Ronald A. Richardson (https://ron.dev)", - "license": "BSD-3-Clause", "devDependencies": { "@babel/core": "^7.23.6", "@babel/plugin-proposal-class-properties": "^7.18.6", @@ -62,7 +72,7 @@ "typescript": "^5.3.3" }, "dependencies": { - "@fleetbase/sdk": "1.2.8", + "@fleetbase/sdk": "1.2.10", "date-fns": "^3.0.5" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..5eddbf9 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,5406 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + .: + dependencies: + '@fleetbase/sdk': + specifier: 1.2.10 + version: 1.2.10 + date-fns: + specifier: ^3.0.5 + version: 3.6.0 + devDependencies: + '@babel/core': + specifier: ^7.23.6 + version: 7.26.0 + '@babel/plugin-proposal-class-properties': + specifier: ^7.18.6 + version: 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-decorators': + specifier: ^7.23.6 + version: 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-spread': + specifier: ^7.23.3 + version: 7.25.9(@babel/core@7.26.0) + '@babel/polyfill': + specifier: ^7.12.1 + version: 7.12.1 + '@babel/preset-env': + specifier: ^7.23.6 + version: 7.26.0(@babel/core@7.26.0) + '@babel/register': + specifier: ^7.22.15 + version: 7.25.9(@babel/core@7.26.0) + '@rollup/plugin-babel': + specifier: ^6.0.4 + version: 6.0.4(@babel/core@7.26.0)(rollup@4.29.1) + '@rollup/plugin-node-resolve': + specifier: ^15.2.3 + version: 15.3.1(rollup@4.29.1) + chai: + specifier: ^4.3.10 + version: 4.5.0 + eslint: + specifier: ^8.56.0 + version: 8.57.1 + eslint-config-airbnb-base: + specifier: ^15.0.0 + version: 15.0.0(eslint-plugin-import@2.31.0(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: + specifier: ^2.29.1 + version: 2.31.0(eslint@8.57.1) + husky: + specifier: ^8.0.3 + version: 8.0.3 + lint-staged: + specifier: ^15.2.0 + version: 15.2.11 + mocha: + specifier: ^10.2.0 + version: 10.8.2 + prettier: + specifier: 3.1.1 + version: 3.1.1 + rollup: + specifier: ^4.9.1 + version: 4.29.1 + rollup-plugin-eslint: + specifier: ^7.0.0 + version: 7.0.0 + rollup-plugin-terser: + specifier: ^7.0.2 + version: 7.0.2(rollup@4.29.1) + source-map-support: + specifier: ^0.5.21 + version: 0.5.21 + typescript: + specifier: ^5.3.3 + version: 5.7.2 + +packages: + '@ampproject/remapping@2.3.0': + resolution: { integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== } + engines: { node: '>=6.0.0' } + + '@babel/code-frame@7.26.2': + resolution: { integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== } + engines: { node: '>=6.9.0' } + + '@babel/compat-data@7.26.3': + resolution: { integrity: sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g== } + engines: { node: '>=6.9.0' } + + '@babel/core@7.26.0': + resolution: { integrity: sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== } + engines: { node: '>=6.9.0' } + + '@babel/generator@7.26.3': + resolution: { integrity: sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ== } + engines: { node: '>=6.9.0' } + + '@babel/helper-annotate-as-pure@7.25.9': + resolution: { integrity: sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== } + engines: { node: '>=6.9.0' } + + '@babel/helper-compilation-targets@7.25.9': + resolution: { integrity: sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== } + engines: { node: '>=6.9.0' } + + '@babel/helper-create-class-features-plugin@7.25.9': + resolution: { integrity: sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-create-regexp-features-plugin@7.26.3': + resolution: { integrity: sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-define-polyfill-provider@0.6.3': + resolution: { integrity: sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== } + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + + '@babel/helper-member-expression-to-functions@7.25.9': + resolution: { integrity: sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ== } + engines: { node: '>=6.9.0' } + + '@babel/helper-module-imports@7.25.9': + resolution: { integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== } + engines: { node: '>=6.9.0' } + + '@babel/helper-module-transforms@7.26.0': + resolution: { integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-optimise-call-expression@7.25.9': + resolution: { integrity: sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ== } + engines: { node: '>=6.9.0' } + + '@babel/helper-plugin-utils@7.25.9': + resolution: { integrity: sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== } + engines: { node: '>=6.9.0' } + + '@babel/helper-remap-async-to-generator@7.25.9': + resolution: { integrity: sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-replace-supers@7.25.9': + resolution: { integrity: sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-skip-transparent-expression-wrappers@7.25.9': + resolution: { integrity: sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA== } + engines: { node: '>=6.9.0' } + + '@babel/helper-string-parser@7.25.9': + resolution: { integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== } + engines: { node: '>=6.9.0' } + + '@babel/helper-validator-identifier@7.25.9': + resolution: { integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== } + engines: { node: '>=6.9.0' } + + '@babel/helper-validator-option@7.25.9': + resolution: { integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== } + engines: { node: '>=6.9.0' } + + '@babel/helper-wrap-function@7.25.9': + resolution: { integrity: sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g== } + engines: { node: '>=6.9.0' } + + '@babel/helpers@7.26.0': + resolution: { integrity: sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== } + engines: { node: '>=6.9.0' } + + '@babel/parser@7.26.3': + resolution: { integrity: sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== } + engines: { node: '>=6.0.0' } + hasBin: true + + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.9': + resolution: { integrity: sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.9': + resolution: { integrity: sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.9': + resolution: { integrity: sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.9': + resolution: { integrity: sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.13.0 + + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.9': + resolution: { integrity: sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-proposal-class-properties@7.18.6': + resolution: { integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== } + engines: { node: '>=6.9.0' } + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-proposal-decorators@7.25.9': + resolution: { integrity: sha512-smkNLL/O1ezy9Nhy4CNosc4Va+1wo5w4gzSZeLe6y6dM4mmHfYOCPolXQPHQxonZCF+ZyebxN9vqOolkYrSn5g== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2': + resolution: { integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-decorators@7.25.9': + resolution: { integrity: sha512-ryzI0McXUPJnRCvMo4lumIKZUzhYUO/ScI+Mz4YVaTLt04DHNSjEUjKVvbzQjZFLuod/cYEc07mJWhzl6v4DPg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-assertions@7.26.0': + resolution: { integrity: sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-attributes@7.26.0': + resolution: { integrity: sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-unicode-sets-regex@7.18.6': + resolution: { integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-transform-arrow-functions@7.25.9': + resolution: { integrity: sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-async-generator-functions@7.25.9': + resolution: { integrity: sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-async-to-generator@7.25.9': + resolution: { integrity: sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-block-scoped-functions@7.25.9': + resolution: { integrity: sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-block-scoping@7.25.9': + resolution: { integrity: sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-class-properties@7.25.9': + resolution: { integrity: sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-class-static-block@7.26.0': + resolution: { integrity: sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.12.0 + + '@babel/plugin-transform-classes@7.25.9': + resolution: { integrity: sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-computed-properties@7.25.9': + resolution: { integrity: sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-destructuring@7.25.9': + resolution: { integrity: sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-dotall-regex@7.25.9': + resolution: { integrity: sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-duplicate-keys@7.25.9': + resolution: { integrity: sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.9': + resolution: { integrity: sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-transform-dynamic-import@7.25.9': + resolution: { integrity: sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-exponentiation-operator@7.26.3': + resolution: { integrity: sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-export-namespace-from@7.25.9': + resolution: { integrity: sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-for-of@7.25.9': + resolution: { integrity: sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-function-name@7.25.9': + resolution: { integrity: sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-json-strings@7.25.9': + resolution: { integrity: sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-literals@7.25.9': + resolution: { integrity: sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-logical-assignment-operators@7.25.9': + resolution: { integrity: sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-member-expression-literals@7.25.9': + resolution: { integrity: sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-modules-amd@7.25.9': + resolution: { integrity: sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-modules-commonjs@7.26.3': + resolution: { integrity: sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-modules-systemjs@7.25.9': + resolution: { integrity: sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-modules-umd@7.25.9': + resolution: { integrity: sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-named-capturing-groups-regex@7.25.9': + resolution: { integrity: sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-transform-new-target@7.25.9': + resolution: { integrity: sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-nullish-coalescing-operator@7.25.9': + resolution: { integrity: sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-numeric-separator@7.25.9': + resolution: { integrity: sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-object-rest-spread@7.25.9': + resolution: { integrity: sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-object-super@7.25.9': + resolution: { integrity: sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-optional-catch-binding@7.25.9': + resolution: { integrity: sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-optional-chaining@7.25.9': + resolution: { integrity: sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-parameters@7.25.9': + resolution: { integrity: sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-private-methods@7.25.9': + resolution: { integrity: sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-private-property-in-object@7.25.9': + resolution: { integrity: sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-property-literals@7.25.9': + resolution: { integrity: sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-regenerator@7.25.9': + resolution: { integrity: sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-regexp-modifiers@7.26.0': + resolution: { integrity: sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-transform-reserved-words@7.25.9': + resolution: { integrity: sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-shorthand-properties@7.25.9': + resolution: { integrity: sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-spread@7.25.9': + resolution: { integrity: sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-sticky-regex@7.25.9': + resolution: { integrity: sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-template-literals@7.25.9': + resolution: { integrity: sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-typeof-symbol@7.25.9': + resolution: { integrity: sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-unicode-escapes@7.25.9': + resolution: { integrity: sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-unicode-property-regex@7.25.9': + resolution: { integrity: sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-unicode-regex@7.25.9': + resolution: { integrity: sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-unicode-sets-regex@7.25.9': + resolution: { integrity: sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/polyfill@7.12.1': + resolution: { integrity: sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g== } + deprecated: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information. + + '@babel/preset-env@7.26.0': + resolution: { integrity: sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/preset-modules@0.1.6-no-external-plugins': + resolution: { integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== } + peerDependencies: + '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 + + '@babel/register@7.25.9': + resolution: { integrity: sha512-8D43jXtGsYmEeDvm4MWHYUpWf8iiXgWYx3fW7E7Wb7Oe6FWqJPl5K6TuFW0dOwNZzEE5rjlaSJYH9JjrUKJszA== } + engines: { node: '>=6.9.0' } + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/runtime@7.26.0': + resolution: { integrity: sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== } + engines: { node: '>=6.9.0' } + + '@babel/template@7.25.9': + resolution: { integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== } + engines: { node: '>=6.9.0' } + + '@babel/traverse@7.26.4': + resolution: { integrity: sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w== } + engines: { node: '>=6.9.0' } + + '@babel/types@7.26.3': + resolution: { integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== } + engines: { node: '>=6.9.0' } + + '@eslint-community/eslint-utils@4.4.1': + resolution: { integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.12.1': + resolution: { integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== } + engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } + + '@eslint/eslintrc@2.1.4': + resolution: { integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + + '@eslint/js@8.57.1': + resolution: { integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + + '@fleetbase/sdk@1.2.10': + resolution: { integrity: sha512-IKqoufoY4NarQ/63lRtBJb/1i3ULrPpGORuWLNNzunM01ghD40wQOSAgbZkV2zh34WpHx7py6mOEHpe1z7CJBw== } + + '@humanwhocodes/config-array@0.13.0': + resolution: { integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw== } + engines: { node: '>=10.10.0' } + deprecated: Use @eslint/config-array instead + + '@humanwhocodes/module-importer@1.0.1': + resolution: { integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== } + engines: { node: '>=12.22' } + + '@humanwhocodes/object-schema@2.0.3': + resolution: { integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== } + deprecated: Use @eslint/object-schema instead + + '@jridgewell/gen-mapping@0.3.8': + resolution: { integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA== } + engines: { node: '>=6.0.0' } + + '@jridgewell/resolve-uri@3.1.2': + resolution: { integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== } + engines: { node: '>=6.0.0' } + + '@jridgewell/set-array@1.2.1': + resolution: { integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== } + engines: { node: '>=6.0.0' } + + '@jridgewell/source-map@0.3.6': + resolution: { integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== } + + '@jridgewell/sourcemap-codec@1.5.0': + resolution: { integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== } + + '@jridgewell/trace-mapping@0.3.25': + resolution: { integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== } + + '@nodelib/fs.scandir@2.1.5': + resolution: { integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== } + engines: { node: '>= 8' } + + '@nodelib/fs.stat@2.0.5': + resolution: { integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== } + engines: { node: '>= 8' } + + '@nodelib/fs.walk@1.2.8': + resolution: { integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== } + engines: { node: '>= 8' } + + '@rollup/plugin-babel@6.0.4': + resolution: { integrity: sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw== } + engines: { node: '>=14.0.0' } + peerDependencies: + '@babel/core': ^7.0.0 + '@types/babel__core': ^7.1.9 + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + '@types/babel__core': + optional: true + rollup: + optional: true + + '@rollup/plugin-node-resolve@15.3.1': + resolution: { integrity: sha512-tgg6b91pAybXHJQMAAwW9VuWBO6Thi+q7BCNARLwSqlmsHz0XYURtGvh/AuwSADXSI4h/2uHbs7s4FzlZDGSGA== } + engines: { node: '>=14.0.0' } + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/pluginutils@5.1.4': + resolution: { integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ== } + engines: { node: '>=14.0.0' } + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/rollup-android-arm-eabi@4.29.1': + resolution: { integrity: sha512-ssKhA8RNltTZLpG6/QNkCSge+7mBQGUqJRisZ2MDQcEGaK93QESEgWK2iOpIDZ7k9zPVkG5AS3ksvD5ZWxmItw== } + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.29.1': + resolution: { integrity: sha512-CaRfrV0cd+NIIcVVN/jx+hVLN+VRqnuzLRmfmlzpOzB87ajixsN/+9L5xNmkaUUvEbI5BmIKS+XTwXsHEb65Ew== } + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.29.1': + resolution: { integrity: sha512-2ORr7T31Y0Mnk6qNuwtyNmy14MunTAMx06VAPI6/Ju52W10zk1i7i5U3vlDRWjhOI5quBcrvhkCHyF76bI7kEw== } + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.29.1': + resolution: { integrity: sha512-j/Ej1oanzPjmN0tirRd5K2/nncAhS9W6ICzgxV+9Y5ZsP0hiGhHJXZ2JQ53iSSjj8m6cRY6oB1GMzNn2EUt6Ng== } + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.29.1': + resolution: { integrity: sha512-91C//G6Dm/cv724tpt7nTyP+JdN12iqeXGFM1SqnljCmi5yTXriH7B1r8AD9dAZByHpKAumqP1Qy2vVNIdLZqw== } + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.29.1': + resolution: { integrity: sha512-hEioiEQ9Dec2nIRoeHUP6hr1PSkXzQaCUyqBDQ9I9ik4gCXQZjJMIVzoNLBRGet+hIUb3CISMh9KXuCcWVW/8w== } + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.29.1': + resolution: { integrity: sha512-Py5vFd5HWYN9zxBv3WMrLAXY3yYJ6Q/aVERoeUFwiDGiMOWsMs7FokXihSOaT/PMWUty/Pj60XDQndK3eAfE6A== } + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.29.1': + resolution: { integrity: sha512-RiWpGgbayf7LUcuSNIbahr0ys2YnEERD4gYdISA06wa0i8RALrnzflh9Wxii7zQJEB2/Eh74dX4y/sHKLWp5uQ== } + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.29.1': + resolution: { integrity: sha512-Z80O+taYxTQITWMjm/YqNoe9d10OX6kDh8X5/rFCMuPqsKsSyDilvfg+vd3iXIqtfmp+cnfL1UrYirkaF8SBZA== } + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.29.1': + resolution: { integrity: sha512-fOHRtF9gahwJk3QVp01a/GqS4hBEZCV1oKglVVq13kcK3NeVlS4BwIFzOHDbmKzt3i0OuHG4zfRP0YoG5OF/rA== } + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-loongarch64-gnu@4.29.1': + resolution: { integrity: sha512-5a7q3tnlbcg0OodyxcAdrrCxFi0DgXJSoOuidFUzHZ2GixZXQs6Tc3CHmlvqKAmOs5eRde+JJxeIf9DonkmYkw== } + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-powerpc64le-gnu@4.29.1': + resolution: { integrity: sha512-9b4Mg5Yfz6mRnlSPIdROcfw1BU22FQxmfjlp/CShWwO3LilKQuMISMTtAu/bxmmrE6A902W2cZJuzx8+gJ8e9w== } + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.29.1': + resolution: { integrity: sha512-G5pn0NChlbRM8OJWpJFMX4/i8OEU538uiSv0P6roZcbpe/WfhEO+AT8SHVKfp8qhDQzaz7Q+1/ixMy7hBRidnQ== } + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.29.1': + resolution: { integrity: sha512-WM9lIkNdkhVwiArmLxFXpWndFGuOka4oJOZh8EP3Vb8q5lzdSCBuhjavJsw68Q9AKDGeOOIHYzYm4ZFvmWez5g== } + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.29.1': + resolution: { integrity: sha512-87xYCwb0cPGZFoGiErT1eDcssByaLX4fc0z2nRM6eMtV9njAfEE6OW3UniAoDhX4Iq5xQVpE6qO9aJbCFumKYQ== } + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.29.1': + resolution: { integrity: sha512-xufkSNppNOdVRCEC4WKvlR1FBDyqCSCpQeMMgv9ZyXqqtKBfkw1yfGMTUTs9Qsl6WQbJnsGboWCp7pJGkeMhKA== } + cpu: [x64] + os: [linux] + + '@rollup/rollup-win32-arm64-msvc@4.29.1': + resolution: { integrity: sha512-F2OiJ42m77lSkizZQLuC+jiZ2cgueWQL5YC9tjo3AgaEw+KJmVxHGSyQfDUoYR9cci0lAywv2Clmckzulcq6ig== } + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.29.1': + resolution: { integrity: sha512-rYRe5S0FcjlOBZQHgbTKNrqxCBUmgDJem/VQTCcTnA2KCabYSWQDrytOzX7avb79cAAweNmMUb/Zw18RNd4mng== } + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.29.1': + resolution: { integrity: sha512-+10CMg9vt1MoHj6x1pxyjPSMjHTIlqs8/tBztXvPAx24SKs9jwVnKqHJumlH/IzhaPUaj3T6T6wfZr8okdXaIg== } + cpu: [x64] + os: [win32] + + '@rtsao/scc@1.1.0': + resolution: { integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== } + + '@types/estree@1.0.6': + resolution: { integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== } + + '@types/json5@0.0.29': + resolution: { integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== } + + '@types/node@22.10.2': + resolution: { integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ== } + + '@types/resolve@1.20.2': + resolution: { integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== } + + '@ungap/structured-clone@1.2.1': + resolution: { integrity: sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA== } + + acorn-jsx@5.3.2: + resolution: { integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== } + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn@7.4.1: + resolution: { integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== } + engines: { node: '>=0.4.0' } + hasBin: true + + acorn@8.14.0: + resolution: { integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== } + engines: { node: '>=0.4.0' } + hasBin: true + + ajv@6.12.6: + resolution: { integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== } + + ansi-colors@4.1.3: + resolution: { integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== } + engines: { node: '>=6' } + + ansi-escapes@4.3.2: + resolution: { integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== } + engines: { node: '>=8' } + + ansi-escapes@7.0.0: + resolution: { integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw== } + engines: { node: '>=18' } + + ansi-regex@4.1.1: + resolution: { integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== } + engines: { node: '>=6' } + + ansi-regex@5.0.1: + resolution: { integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== } + engines: { node: '>=8' } + + ansi-regex@6.1.0: + resolution: { integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA== } + engines: { node: '>=12' } + + ansi-styles@3.2.1: + resolution: { integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== } + engines: { node: '>=4' } + + ansi-styles@4.3.0: + resolution: { integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== } + engines: { node: '>=8' } + + ansi-styles@6.2.1: + resolution: { integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== } + engines: { node: '>=12' } + + anymatch@3.1.3: + resolution: { integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== } + engines: { node: '>= 8' } + + argparse@1.0.10: + resolution: { integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== } + + argparse@2.0.1: + resolution: { integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== } + + array-buffer-byte-length@1.0.2: + resolution: { integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw== } + engines: { node: '>= 0.4' } + + array-includes@3.1.8: + resolution: { integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ== } + engines: { node: '>= 0.4' } + + array.prototype.findlastindex@1.2.5: + resolution: { integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ== } + engines: { node: '>= 0.4' } + + array.prototype.flat@1.3.3: + resolution: { integrity: sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg== } + engines: { node: '>= 0.4' } + + array.prototype.flatmap@1.3.3: + resolution: { integrity: sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg== } + engines: { node: '>= 0.4' } + + arraybuffer.prototype.slice@1.0.4: + resolution: { integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ== } + engines: { node: '>= 0.4' } + + assertion-error@1.1.0: + resolution: { integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== } + + astral-regex@1.0.0: + resolution: { integrity: sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== } + engines: { node: '>=4' } + + asynckit@0.4.0: + resolution: { integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== } + + available-typed-arrays@1.0.7: + resolution: { integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== } + engines: { node: '>= 0.4' } + + axios@1.7.9: + resolution: { integrity: sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw== } + + babel-plugin-polyfill-corejs2@0.4.12: + resolution: { integrity: sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og== } + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + + babel-plugin-polyfill-corejs3@0.10.6: + resolution: { integrity: sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== } + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + + babel-plugin-polyfill-regenerator@0.6.3: + resolution: { integrity: sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q== } + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + + balanced-match@1.0.2: + resolution: { integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== } + + binary-extensions@2.3.0: + resolution: { integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== } + engines: { node: '>=8' } + + brace-expansion@1.1.11: + resolution: { integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== } + + brace-expansion@2.0.1: + resolution: { integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== } + + braces@3.0.3: + resolution: { integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== } + engines: { node: '>=8' } + + browser-stdout@1.3.1: + resolution: { integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== } + + browserslist@4.24.3: + resolution: { integrity: sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA== } + engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 } + hasBin: true + + buffer-from@1.1.2: + resolution: { integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== } + + call-bind-apply-helpers@1.0.1: + resolution: { integrity: sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g== } + engines: { node: '>= 0.4' } + + call-bind@1.0.8: + resolution: { integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== } + engines: { node: '>= 0.4' } + + call-bound@1.0.3: + resolution: { integrity: sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA== } + engines: { node: '>= 0.4' } + + callsites@3.1.0: + resolution: { integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== } + engines: { node: '>=6' } + + camelcase@6.3.0: + resolution: { integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== } + engines: { node: '>=10' } + + caniuse-lite@1.0.30001690: + resolution: { integrity: sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w== } + + chai@4.5.0: + resolution: { integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw== } + engines: { node: '>=4' } + + chalk@2.4.2: + resolution: { integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== } + engines: { node: '>=4' } + + chalk@4.1.2: + resolution: { integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== } + engines: { node: '>=10' } + + chalk@5.3.0: + resolution: { integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== } + engines: { node: ^12.17.0 || ^14.13 || >=16.0.0 } + + chardet@0.7.0: + resolution: { integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== } + + check-error@1.0.3: + resolution: { integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== } + + chokidar@3.6.0: + resolution: { integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== } + engines: { node: '>= 8.10.0' } + + cli-cursor@3.1.0: + resolution: { integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== } + engines: { node: '>=8' } + + cli-cursor@5.0.0: + resolution: { integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw== } + engines: { node: '>=18' } + + cli-truncate@4.0.0: + resolution: { integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA== } + engines: { node: '>=18' } + + cli-width@3.0.0: + resolution: { integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== } + engines: { node: '>= 10' } + + cliui@7.0.4: + resolution: { integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== } + + clone-deep@4.0.1: + resolution: { integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== } + engines: { node: '>=6' } + + color-convert@1.9.3: + resolution: { integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== } + + color-convert@2.0.1: + resolution: { integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== } + engines: { node: '>=7.0.0' } + + color-name@1.1.3: + resolution: { integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== } + + color-name@1.1.4: + resolution: { integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== } + + colorette@2.0.20: + resolution: { integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== } + + combined-stream@1.0.8: + resolution: { integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== } + engines: { node: '>= 0.8' } + + commander@12.1.0: + resolution: { integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== } + engines: { node: '>=18' } + + commander@2.20.3: + resolution: { integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== } + + commondir@1.0.1: + resolution: { integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== } + + concat-map@0.0.1: + resolution: { integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== } + + confusing-browser-globals@1.0.11: + resolution: { integrity: sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== } + + convert-source-map@2.0.0: + resolution: { integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== } + + core-js-compat@3.39.0: + resolution: { integrity: sha512-VgEUx3VwlExr5no0tXlBt+silBvhTryPwCXRI2Id1PN8WTKu7MreethvddqOubrYxkFdv/RnYrqlv1sFNAUelw== } + + core-js@2.6.12: + resolution: { integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== } + deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. + + cross-fetch@4.1.0: + resolution: { integrity: sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw== } + + cross-spawn@6.0.6: + resolution: { integrity: sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw== } + engines: { node: '>=4.8' } + + cross-spawn@7.0.6: + resolution: { integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== } + engines: { node: '>= 8' } + + data-view-buffer@1.0.2: + resolution: { integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ== } + engines: { node: '>= 0.4' } + + data-view-byte-length@1.0.2: + resolution: { integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ== } + engines: { node: '>= 0.4' } + + data-view-byte-offset@1.0.1: + resolution: { integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ== } + engines: { node: '>= 0.4' } + + date-fns@3.6.0: + resolution: { integrity: sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww== } + + debug@3.2.7: + resolution: { integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== } + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.4.0: + resolution: { integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== } + engines: { node: '>=6.0' } + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + decamelize@4.0.0: + resolution: { integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== } + engines: { node: '>=10' } + + deep-eql@4.1.4: + resolution: { integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg== } + engines: { node: '>=6' } + + deep-is@0.1.4: + resolution: { integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== } + + deepmerge@4.3.1: + resolution: { integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== } + engines: { node: '>=0.10.0' } + + define-data-property@1.1.4: + resolution: { integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== } + engines: { node: '>= 0.4' } + + define-properties@1.2.1: + resolution: { integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== } + engines: { node: '>= 0.4' } + + delayed-stream@1.0.0: + resolution: { integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== } + engines: { node: '>=0.4.0' } + + diff@5.2.0: + resolution: { integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== } + engines: { node: '>=0.3.1' } + + doctrine@2.1.0: + resolution: { integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== } + engines: { node: '>=0.10.0' } + + doctrine@3.0.0: + resolution: { integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== } + engines: { node: '>=6.0.0' } + + dom-walk@0.1.2: + resolution: { integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== } + + dunder-proto@1.0.1: + resolution: { integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== } + engines: { node: '>= 0.4' } + + electron-to-chromium@1.5.76: + resolution: { integrity: sha512-CjVQyG7n7Sr+eBXE86HIulnL5N8xZY1sgmOPGuq/F0Rr0FJq63lg0kEtOIDfZBk44FnDLf6FUJ+dsJcuiUDdDQ== } + + emoji-regex@10.4.0: + resolution: { integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw== } + + emoji-regex@7.0.3: + resolution: { integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== } + + emoji-regex@8.0.0: + resolution: { integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== } + + environment@1.1.0: + resolution: { integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q== } + engines: { node: '>=18' } + + es-abstract@1.23.7: + resolution: { integrity: sha512-OygGC8kIcDhXX+6yAZRGLqwi2CmEXCbLQixeGUgYeR+Qwlppqmo7DIDr8XibtEBZp+fJcoYpoatp5qwLMEdcqQ== } + engines: { node: '>= 0.4' } + + es-define-property@1.0.1: + resolution: { integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== } + engines: { node: '>= 0.4' } + + es-errors@1.3.0: + resolution: { integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== } + engines: { node: '>= 0.4' } + + es-object-atoms@1.0.0: + resolution: { integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw== } + engines: { node: '>= 0.4' } + + es-set-tostringtag@2.0.3: + resolution: { integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ== } + engines: { node: '>= 0.4' } + + es-shim-unscopables@1.0.2: + resolution: { integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== } + + es-to-primitive@1.3.0: + resolution: { integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g== } + engines: { node: '>= 0.4' } + + escalade@3.2.0: + resolution: { integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== } + engines: { node: '>=6' } + + escape-string-regexp@1.0.5: + resolution: { integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== } + engines: { node: '>=0.8.0' } + + escape-string-regexp@4.0.0: + resolution: { integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== } + engines: { node: '>=10' } + + eslint-config-airbnb-base@15.0.0: + resolution: { integrity: sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig== } + engines: { node: ^10.12.0 || >=12.0.0 } + peerDependencies: + eslint: ^7.32.0 || ^8.2.0 + eslint-plugin-import: ^2.25.2 + + eslint-import-resolver-node@0.3.9: + resolution: { integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== } + + eslint-module-utils@2.12.0: + resolution: { integrity: sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg== } + engines: { node: '>=4' } + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + + eslint-plugin-import@2.31.0: + resolution: { integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A== } + engines: { node: '>=4' } + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + + eslint-scope@5.1.1: + resolution: { integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== } + engines: { node: '>=8.0.0' } + + eslint-scope@7.2.2: + resolution: { integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + + eslint-utils@1.4.3: + resolution: { integrity: sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== } + engines: { node: '>=6' } + + eslint-visitor-keys@1.3.0: + resolution: { integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== } + engines: { node: '>=4' } + + eslint-visitor-keys@3.4.3: + resolution: { integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + + eslint@6.8.0: + resolution: { integrity: sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== } + engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 } + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. + hasBin: true + + eslint@8.57.1: + resolution: { integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. + hasBin: true + + espree@6.2.1: + resolution: { integrity: sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== } + engines: { node: '>=6.0.0' } + + espree@9.6.1: + resolution: { integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + + esprima@4.0.1: + resolution: { integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== } + engines: { node: '>=4' } + hasBin: true + + esquery@1.6.0: + resolution: { integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== } + engines: { node: '>=0.10' } + + esrecurse@4.3.0: + resolution: { integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== } + engines: { node: '>=4.0' } + + estraverse@4.3.0: + resolution: { integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== } + engines: { node: '>=4.0' } + + estraverse@5.3.0: + resolution: { integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== } + engines: { node: '>=4.0' } + + estree-walker@0.6.1: + resolution: { integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== } + + estree-walker@2.0.2: + resolution: { integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== } + + esutils@2.0.3: + resolution: { integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== } + engines: { node: '>=0.10.0' } + + eventemitter3@5.0.1: + resolution: { integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== } + + execa@8.0.1: + resolution: { integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== } + engines: { node: '>=16.17' } + + external-editor@3.1.0: + resolution: { integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== } + engines: { node: '>=4' } + + fast-deep-equal@3.1.3: + resolution: { integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== } + + fast-json-stable-stringify@2.1.0: + resolution: { integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== } + + fast-levenshtein@2.0.6: + resolution: { integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== } + + fastq@1.18.0: + resolution: { integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw== } + + figures@3.2.0: + resolution: { integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== } + engines: { node: '>=8' } + + file-entry-cache@5.0.1: + resolution: { integrity: sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== } + engines: { node: '>=4' } + + file-entry-cache@6.0.1: + resolution: { integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== } + engines: { node: ^10.12.0 || >=12.0.0 } + + fill-range@7.1.1: + resolution: { integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== } + engines: { node: '>=8' } + + find-cache-dir@2.1.0: + resolution: { integrity: sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== } + engines: { node: '>=6' } + + find-up@3.0.0: + resolution: { integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== } + engines: { node: '>=6' } + + find-up@5.0.0: + resolution: { integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== } + engines: { node: '>=10' } + + flat-cache@2.0.1: + resolution: { integrity: sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== } + engines: { node: '>=4' } + + flat-cache@3.2.0: + resolution: { integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== } + engines: { node: ^10.12.0 || >=12.0.0 } + + flat@5.0.2: + resolution: { integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== } + hasBin: true + + flatted@2.0.2: + resolution: { integrity: sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== } + + flatted@3.3.2: + resolution: { integrity: sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA== } + + follow-redirects@1.15.9: + resolution: { integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== } + engines: { node: '>=4.0' } + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + + for-each@0.3.3: + resolution: { integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== } + + form-data@4.0.1: + resolution: { integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== } + engines: { node: '>= 6' } + + fs.realpath@1.0.0: + resolution: { integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== } + + fsevents@2.3.3: + resolution: { integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== } + engines: { node: ^8.16.0 || ^10.6.0 || >=11.0.0 } + os: [darwin] + + function-bind@1.1.2: + resolution: { integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== } + + function.prototype.name@1.1.8: + resolution: { integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q== } + engines: { node: '>= 0.4' } + + functional-red-black-tree@1.0.1: + resolution: { integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== } + + functions-have-names@1.2.3: + resolution: { integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== } + + gensync@1.0.0-beta.2: + resolution: { integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== } + engines: { node: '>=6.9.0' } + + get-caller-file@2.0.5: + resolution: { integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== } + engines: { node: 6.* || 8.* || >= 10.* } + + get-east-asian-width@1.3.0: + resolution: { integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ== } + engines: { node: '>=18' } + + get-func-name@2.0.2: + resolution: { integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== } + + get-intrinsic@1.2.6: + resolution: { integrity: sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA== } + engines: { node: '>= 0.4' } + + get-stream@8.0.1: + resolution: { integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA== } + engines: { node: '>=16' } + + get-symbol-description@1.1.0: + resolution: { integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg== } + engines: { node: '>= 0.4' } + + glob-parent@5.1.2: + resolution: { integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== } + engines: { node: '>= 6' } + + glob-parent@6.0.2: + resolution: { integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== } + engines: { node: '>=10.13.0' } + + glob@7.2.3: + resolution: { integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== } + deprecated: Glob versions prior to v9 are no longer supported + + glob@8.1.0: + resolution: { integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== } + engines: { node: '>=12' } + deprecated: Glob versions prior to v9 are no longer supported + + global@4.4.0: + resolution: { integrity: sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== } + + globals@11.12.0: + resolution: { integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== } + engines: { node: '>=4' } + + globals@12.4.0: + resolution: { integrity: sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== } + engines: { node: '>=8' } + + globals@13.24.0: + resolution: { integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== } + engines: { node: '>=8' } + + globalthis@1.0.4: + resolution: { integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== } + engines: { node: '>= 0.4' } + + gopd@1.2.0: + resolution: { integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== } + engines: { node: '>= 0.4' } + + graphemer@1.4.0: + resolution: { integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== } + + has-bigints@1.1.0: + resolution: { integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg== } + engines: { node: '>= 0.4' } + + has-flag@3.0.0: + resolution: { integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== } + engines: { node: '>=4' } + + has-flag@4.0.0: + resolution: { integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== } + engines: { node: '>=8' } + + has-property-descriptors@1.0.2: + resolution: { integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== } + + has-proto@1.2.0: + resolution: { integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ== } + engines: { node: '>= 0.4' } + + has-symbols@1.1.0: + resolution: { integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== } + engines: { node: '>= 0.4' } + + has-tostringtag@1.0.2: + resolution: { integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== } + engines: { node: '>= 0.4' } + + hasown@2.0.2: + resolution: { integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== } + engines: { node: '>= 0.4' } + + he@1.2.0: + resolution: { integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== } + hasBin: true + + human-signals@5.0.0: + resolution: { integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== } + engines: { node: '>=16.17.0' } + + husky@8.0.3: + resolution: { integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== } + engines: { node: '>=14' } + hasBin: true + + iconv-lite@0.4.24: + resolution: { integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== } + engines: { node: '>=0.10.0' } + + ignore@4.0.6: + resolution: { integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== } + engines: { node: '>= 4' } + + ignore@5.3.2: + resolution: { integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== } + engines: { node: '>= 4' } + + import-fresh@3.3.0: + resolution: { integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== } + engines: { node: '>=6' } + + imurmurhash@0.1.4: + resolution: { integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== } + engines: { node: '>=0.8.19' } + + inflight@1.0.6: + resolution: { integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== } + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + + inherits@2.0.4: + resolution: { integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== } + + inquirer@7.3.3: + resolution: { integrity: sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== } + engines: { node: '>=8.0.0' } + + internal-slot@1.1.0: + resolution: { integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw== } + engines: { node: '>= 0.4' } + + is-array-buffer@3.0.5: + resolution: { integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A== } + engines: { node: '>= 0.4' } + + is-async-function@2.0.0: + resolution: { integrity: sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA== } + engines: { node: '>= 0.4' } + + is-bigint@1.1.0: + resolution: { integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ== } + engines: { node: '>= 0.4' } + + is-binary-path@2.1.0: + resolution: { integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== } + engines: { node: '>=8' } + + is-boolean-object@1.2.1: + resolution: { integrity: sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng== } + engines: { node: '>= 0.4' } + + is-callable@1.2.7: + resolution: { integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== } + engines: { node: '>= 0.4' } + + is-core-module@2.16.1: + resolution: { integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== } + engines: { node: '>= 0.4' } + + is-data-view@1.0.2: + resolution: { integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw== } + engines: { node: '>= 0.4' } + + is-date-object@1.1.0: + resolution: { integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg== } + engines: { node: '>= 0.4' } + + is-extglob@2.1.1: + resolution: { integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== } + engines: { node: '>=0.10.0' } + + is-finalizationregistry@1.1.1: + resolution: { integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg== } + engines: { node: '>= 0.4' } + + is-fullwidth-code-point@2.0.0: + resolution: { integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== } + engines: { node: '>=4' } + + is-fullwidth-code-point@3.0.0: + resolution: { integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== } + engines: { node: '>=8' } + + is-fullwidth-code-point@4.0.0: + resolution: { integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ== } + engines: { node: '>=12' } + + is-fullwidth-code-point@5.0.0: + resolution: { integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA== } + engines: { node: '>=18' } + + is-generator-function@1.0.10: + resolution: { integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== } + engines: { node: '>= 0.4' } + + is-glob@4.0.3: + resolution: { integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== } + engines: { node: '>=0.10.0' } + + is-map@2.0.3: + resolution: { integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== } + engines: { node: '>= 0.4' } + + is-module@1.0.0: + resolution: { integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== } + + is-number-object@1.1.1: + resolution: { integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw== } + engines: { node: '>= 0.4' } + + is-number@7.0.0: + resolution: { integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== } + engines: { node: '>=0.12.0' } + + is-path-inside@3.0.3: + resolution: { integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== } + engines: { node: '>=8' } + + is-plain-obj@2.1.0: + resolution: { integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== } + engines: { node: '>=8' } + + is-plain-object@2.0.4: + resolution: { integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== } + engines: { node: '>=0.10.0' } + + is-regex@1.2.1: + resolution: { integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g== } + engines: { node: '>= 0.4' } + + is-set@2.0.3: + resolution: { integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== } + engines: { node: '>= 0.4' } + + is-shared-array-buffer@1.0.4: + resolution: { integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A== } + engines: { node: '>= 0.4' } + + is-stream@3.0.0: + resolution: { integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== } + engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + + is-string@1.1.1: + resolution: { integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA== } + engines: { node: '>= 0.4' } + + is-symbol@1.1.1: + resolution: { integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w== } + engines: { node: '>= 0.4' } + + is-typed-array@1.1.15: + resolution: { integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ== } + engines: { node: '>= 0.4' } + + is-unicode-supported@0.1.0: + resolution: { integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== } + engines: { node: '>=10' } + + is-weakmap@2.0.2: + resolution: { integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w== } + engines: { node: '>= 0.4' } + + is-weakref@1.1.0: + resolution: { integrity: sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q== } + engines: { node: '>= 0.4' } + + is-weakset@2.0.4: + resolution: { integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ== } + engines: { node: '>= 0.4' } + + isarray@2.0.5: + resolution: { integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== } + + isexe@2.0.0: + resolution: { integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== } + + isobject@3.0.1: + resolution: { integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== } + engines: { node: '>=0.10.0' } + + jest-worker@26.6.2: + resolution: { integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== } + engines: { node: '>= 10.13.0' } + + js-tokens@4.0.0: + resolution: { integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== } + + js-yaml@3.14.1: + resolution: { integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== } + hasBin: true + + js-yaml@4.1.0: + resolution: { integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== } + hasBin: true + + jsesc@3.0.2: + resolution: { integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== } + engines: { node: '>=6' } + hasBin: true + + jsesc@3.1.0: + resolution: { integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== } + engines: { node: '>=6' } + hasBin: true + + json-buffer@3.0.1: + resolution: { integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== } + + json-schema-traverse@0.4.1: + resolution: { integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== } + + json-stable-stringify-without-jsonify@1.0.1: + resolution: { integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== } + + json5@1.0.2: + resolution: { integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== } + hasBin: true + + json5@2.2.3: + resolution: { integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== } + engines: { node: '>=6' } + hasBin: true + + keyv@4.5.4: + resolution: { integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== } + + kind-of@6.0.3: + resolution: { integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== } + engines: { node: '>=0.10.0' } + + levn@0.3.0: + resolution: { integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== } + engines: { node: '>= 0.8.0' } + + levn@0.4.1: + resolution: { integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== } + engines: { node: '>= 0.8.0' } + + lilconfig@3.1.3: + resolution: { integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw== } + engines: { node: '>=14' } + + lint-staged@15.2.11: + resolution: { integrity: sha512-Ev6ivCTYRTGs9ychvpVw35m/bcNDuBN+mnTeObCL5h+boS5WzBEC6LHI4I9F/++sZm1m+J2LEiy0gxL/R9TBqQ== } + engines: { node: '>=18.12.0' } + hasBin: true + + listr2@8.2.5: + resolution: { integrity: sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ== } + engines: { node: '>=18.0.0' } + + locate-path@3.0.0: + resolution: { integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== } + engines: { node: '>=6' } + + locate-path@6.0.0: + resolution: { integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== } + engines: { node: '>=10' } + + lodash.debounce@4.0.8: + resolution: { integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== } + + lodash.merge@4.6.2: + resolution: { integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== } + + lodash@4.17.21: + resolution: { integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== } + + log-symbols@4.1.0: + resolution: { integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== } + engines: { node: '>=10' } + + log-update@6.1.0: + resolution: { integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w== } + engines: { node: '>=18' } + + loupe@2.3.7: + resolution: { integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== } + + lru-cache@5.1.1: + resolution: { integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== } + + make-dir@2.1.0: + resolution: { integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== } + engines: { node: '>=6' } + + math-intrinsics@1.1.0: + resolution: { integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== } + engines: { node: '>= 0.4' } + + merge-stream@2.0.0: + resolution: { integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== } + + micromatch@4.0.8: + resolution: { integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== } + engines: { node: '>=8.6' } + + mime-db@1.52.0: + resolution: { integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== } + engines: { node: '>= 0.6' } + + mime-types@2.1.35: + resolution: { integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== } + engines: { node: '>= 0.6' } + + mimic-fn@2.1.0: + resolution: { integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== } + engines: { node: '>=6' } + + mimic-fn@4.0.0: + resolution: { integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== } + engines: { node: '>=12' } + + mimic-function@5.0.1: + resolution: { integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA== } + engines: { node: '>=18' } + + min-document@2.19.0: + resolution: { integrity: sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ== } + + minimatch@3.1.2: + resolution: { integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== } + + minimatch@5.1.6: + resolution: { integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== } + engines: { node: '>=10' } + + minimist@1.2.8: + resolution: { integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== } + + mkdirp@0.5.6: + resolution: { integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== } + hasBin: true + + mocha@10.8.2: + resolution: { integrity: sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg== } + engines: { node: '>= 14.0.0' } + hasBin: true + + ms@2.1.3: + resolution: { integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== } + + mute-stream@0.0.8: + resolution: { integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== } + + natural-compare@1.4.0: + resolution: { integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== } + + nice-try@1.0.5: + resolution: { integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== } + + node-fetch@2.7.0: + resolution: { integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== } + engines: { node: 4.x || >=6.0.0 } + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + node-releases@2.0.19: + resolution: { integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== } + + normalize-path@3.0.0: + resolution: { integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== } + engines: { node: '>=0.10.0' } + + npm-run-path@5.3.0: + resolution: { integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ== } + engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + + object-inspect@1.13.3: + resolution: { integrity: sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== } + engines: { node: '>= 0.4' } + + object-keys@1.1.1: + resolution: { integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== } + engines: { node: '>= 0.4' } + + object.assign@4.1.7: + resolution: { integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw== } + engines: { node: '>= 0.4' } + + object.entries@1.1.8: + resolution: { integrity: sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ== } + engines: { node: '>= 0.4' } + + object.fromentries@2.0.8: + resolution: { integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ== } + engines: { node: '>= 0.4' } + + object.groupby@1.0.3: + resolution: { integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ== } + engines: { node: '>= 0.4' } + + object.values@1.2.1: + resolution: { integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA== } + engines: { node: '>= 0.4' } + + once@1.4.0: + resolution: { integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== } + + onetime@5.1.2: + resolution: { integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== } + engines: { node: '>=6' } + + onetime@6.0.0: + resolution: { integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== } + engines: { node: '>=12' } + + onetime@7.0.0: + resolution: { integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ== } + engines: { node: '>=18' } + + optionator@0.8.3: + resolution: { integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== } + engines: { node: '>= 0.8.0' } + + optionator@0.9.4: + resolution: { integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== } + engines: { node: '>= 0.8.0' } + + os-tmpdir@1.0.2: + resolution: { integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== } + engines: { node: '>=0.10.0' } + + p-limit@2.3.0: + resolution: { integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== } + engines: { node: '>=6' } + + p-limit@3.1.0: + resolution: { integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== } + engines: { node: '>=10' } + + p-locate@3.0.0: + resolution: { integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== } + engines: { node: '>=6' } + + p-locate@5.0.0: + resolution: { integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== } + engines: { node: '>=10' } + + p-try@2.2.0: + resolution: { integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== } + engines: { node: '>=6' } + + parent-module@1.0.1: + resolution: { integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== } + engines: { node: '>=6' } + + path-exists@3.0.0: + resolution: { integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== } + engines: { node: '>=4' } + + path-exists@4.0.0: + resolution: { integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== } + engines: { node: '>=8' } + + path-is-absolute@1.0.1: + resolution: { integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== } + engines: { node: '>=0.10.0' } + + path-key@2.0.1: + resolution: { integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== } + engines: { node: '>=4' } + + path-key@3.1.1: + resolution: { integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== } + engines: { node: '>=8' } + + path-key@4.0.0: + resolution: { integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== } + engines: { node: '>=12' } + + path-parse@1.0.7: + resolution: { integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== } + + pathval@1.1.1: + resolution: { integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== } + + picocolors@1.1.1: + resolution: { integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== } + + picomatch@2.3.1: + resolution: { integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== } + engines: { node: '>=8.6' } + + picomatch@4.0.2: + resolution: { integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== } + engines: { node: '>=12' } + + pidtree@0.6.0: + resolution: { integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== } + engines: { node: '>=0.10' } + hasBin: true + + pify@4.0.1: + resolution: { integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== } + engines: { node: '>=6' } + + pirates@4.0.6: + resolution: { integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== } + engines: { node: '>= 6' } + + pkg-dir@3.0.0: + resolution: { integrity: sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== } + engines: { node: '>=6' } + + possible-typed-array-names@1.0.0: + resolution: { integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== } + engines: { node: '>= 0.4' } + + prelude-ls@1.1.2: + resolution: { integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== } + engines: { node: '>= 0.8.0' } + + prelude-ls@1.2.1: + resolution: { integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== } + engines: { node: '>= 0.8.0' } + + prettier@3.1.1: + resolution: { integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw== } + engines: { node: '>=14' } + hasBin: true + + process@0.11.10: + resolution: { integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== } + engines: { node: '>= 0.6.0' } + + progress@2.0.3: + resolution: { integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== } + engines: { node: '>=0.4.0' } + + proxy-from-env@1.1.0: + resolution: { integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== } + + punycode@2.3.1: + resolution: { integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== } + engines: { node: '>=6' } + + queue-microtask@1.2.3: + resolution: { integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== } + + randombytes@2.1.0: + resolution: { integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== } + + readdirp@3.6.0: + resolution: { integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== } + engines: { node: '>=8.10.0' } + + reflect.getprototypeof@1.0.9: + resolution: { integrity: sha512-r0Ay04Snci87djAsI4U+WNRcSw5S4pOH7qFjd/veA5gC7TbqESR3tcj28ia95L/fYUDw11JKP7uqUKUAfVvV5Q== } + engines: { node: '>= 0.4' } + + regenerate-unicode-properties@10.2.0: + resolution: { integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA== } + engines: { node: '>=4' } + + regenerate@1.4.2: + resolution: { integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== } + + regenerator-runtime@0.13.11: + resolution: { integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== } + + regenerator-runtime@0.14.1: + resolution: { integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== } + + regenerator-transform@0.15.2: + resolution: { integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== } + + regexp.prototype.flags@1.5.3: + resolution: { integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ== } + engines: { node: '>= 0.4' } + + regexpp@2.0.1: + resolution: { integrity: sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== } + engines: { node: '>=6.5.0' } + + regexpu-core@6.2.0: + resolution: { integrity: sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA== } + engines: { node: '>=4' } + + regjsgen@0.8.0: + resolution: { integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q== } + + regjsparser@0.12.0: + resolution: { integrity: sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ== } + hasBin: true + + require-directory@2.1.1: + resolution: { integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== } + engines: { node: '>=0.10.0' } + + resolve-from@4.0.0: + resolution: { integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== } + engines: { node: '>=4' } + + resolve@1.22.10: + resolution: { integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== } + engines: { node: '>= 0.4' } + hasBin: true + + restore-cursor@3.1.0: + resolution: { integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== } + engines: { node: '>=8' } + + restore-cursor@5.1.0: + resolution: { integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA== } + engines: { node: '>=18' } + + reusify@1.0.4: + resolution: { integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== } + engines: { iojs: '>=1.0.0', node: '>=0.10.0' } + + rfdc@1.4.1: + resolution: { integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== } + + rimraf@2.6.3: + resolution: { integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== } + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + + rimraf@3.0.2: + resolution: { integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== } + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + + rollup-plugin-eslint@7.0.0: + resolution: { integrity: sha512-u35kXiY11ULeNQGTlRkYx7uGJ/hS/Dx3wj8f9YVC3oMLTGU9fOqQJsAKYtBFZU3gJ8Vt3gu8ppB1vnKl+7gatQ== } + + rollup-plugin-terser@7.0.2: + resolution: { integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== } + deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser + peerDependencies: + rollup: ^2.0.0 + + rollup-pluginutils@2.8.2: + resolution: { integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== } + + rollup@4.29.1: + resolution: { integrity: sha512-RaJ45M/kmJUzSWDs1Nnd5DdV4eerC98idtUOVr6FfKcgxqvjwHmxc5upLF9qZU9EpsVzzhleFahrT3shLuJzIw== } + engines: { node: '>=18.0.0', npm: '>=8.0.0' } + hasBin: true + + run-async@2.4.1: + resolution: { integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== } + engines: { node: '>=0.12.0' } + + run-parallel@1.2.0: + resolution: { integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== } + + rxjs@6.6.7: + resolution: { integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== } + engines: { npm: '>=2.0.0' } + + safe-array-concat@1.1.3: + resolution: { integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q== } + engines: { node: '>=0.4' } + + safe-buffer@5.2.1: + resolution: { integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== } + + safe-regex-test@1.1.0: + resolution: { integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw== } + engines: { node: '>= 0.4' } + + safer-buffer@2.1.2: + resolution: { integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== } + + semver@5.7.2: + resolution: { integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== } + hasBin: true + + semver@6.3.1: + resolution: { integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== } + hasBin: true + + serialize-javascript@4.0.0: + resolution: { integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== } + + serialize-javascript@6.0.2: + resolution: { integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== } + + set-function-length@1.2.2: + resolution: { integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== } + engines: { node: '>= 0.4' } + + set-function-name@2.0.2: + resolution: { integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== } + engines: { node: '>= 0.4' } + + shallow-clone@3.0.1: + resolution: { integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== } + engines: { node: '>=8' } + + shebang-command@1.2.0: + resolution: { integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== } + engines: { node: '>=0.10.0' } + + shebang-command@2.0.0: + resolution: { integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== } + engines: { node: '>=8' } + + shebang-regex@1.0.0: + resolution: { integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== } + engines: { node: '>=0.10.0' } + + shebang-regex@3.0.0: + resolution: { integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== } + engines: { node: '>=8' } + + side-channel-list@1.0.0: + resolution: { integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA== } + engines: { node: '>= 0.4' } + + side-channel-map@1.0.1: + resolution: { integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA== } + engines: { node: '>= 0.4' } + + side-channel-weakmap@1.0.2: + resolution: { integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A== } + engines: { node: '>= 0.4' } + + side-channel@1.1.0: + resolution: { integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== } + engines: { node: '>= 0.4' } + + signal-exit@3.0.7: + resolution: { integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== } + + signal-exit@4.1.0: + resolution: { integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== } + engines: { node: '>=14' } + + slice-ansi@2.1.0: + resolution: { integrity: sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== } + engines: { node: '>=6' } + + slice-ansi@5.0.0: + resolution: { integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ== } + engines: { node: '>=12' } + + slice-ansi@7.1.0: + resolution: { integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg== } + engines: { node: '>=18' } + + source-map-support@0.5.21: + resolution: { integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== } + + source-map@0.6.1: + resolution: { integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== } + engines: { node: '>=0.10.0' } + + sprintf-js@1.0.3: + resolution: { integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== } + + string-argv@0.3.2: + resolution: { integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== } + engines: { node: '>=0.6.19' } + + string-width@3.1.0: + resolution: { integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== } + engines: { node: '>=6' } + + string-width@4.2.3: + resolution: { integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== } + engines: { node: '>=8' } + + string-width@7.2.0: + resolution: { integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ== } + engines: { node: '>=18' } + + string.prototype.trim@1.2.10: + resolution: { integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA== } + engines: { node: '>= 0.4' } + + string.prototype.trimend@1.0.9: + resolution: { integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ== } + engines: { node: '>= 0.4' } + + string.prototype.trimstart@1.0.8: + resolution: { integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== } + engines: { node: '>= 0.4' } + + strip-ansi@5.2.0: + resolution: { integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== } + engines: { node: '>=6' } + + strip-ansi@6.0.1: + resolution: { integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== } + engines: { node: '>=8' } + + strip-ansi@7.1.0: + resolution: { integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== } + engines: { node: '>=12' } + + strip-bom@3.0.0: + resolution: { integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== } + engines: { node: '>=4' } + + strip-final-newline@3.0.0: + resolution: { integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== } + engines: { node: '>=12' } + + strip-json-comments@3.1.1: + resolution: { integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== } + engines: { node: '>=8' } + + supports-color@5.5.0: + resolution: { integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== } + engines: { node: '>=4' } + + supports-color@7.2.0: + resolution: { integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== } + engines: { node: '>=8' } + + supports-color@8.1.1: + resolution: { integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== } + engines: { node: '>=10' } + + supports-preserve-symlinks-flag@1.0.0: + resolution: { integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== } + engines: { node: '>= 0.4' } + + table@5.4.6: + resolution: { integrity: sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== } + engines: { node: '>=6.0.0' } + + terser@5.37.0: + resolution: { integrity: sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA== } + engines: { node: '>=10' } + hasBin: true + + text-table@0.2.0: + resolution: { integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== } + + through@2.3.8: + resolution: { integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== } + + tmp@0.0.33: + resolution: { integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== } + engines: { node: '>=0.6.0' } + + to-regex-range@5.0.1: + resolution: { integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== } + engines: { node: '>=8.0' } + + tr46@0.0.3: + resolution: { integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== } + + tsconfig-paths@3.15.0: + resolution: { integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== } + + tslib@1.14.1: + resolution: { integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== } + + type-check@0.3.2: + resolution: { integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== } + engines: { node: '>= 0.8.0' } + + type-check@0.4.0: + resolution: { integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== } + engines: { node: '>= 0.8.0' } + + type-detect@4.1.0: + resolution: { integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw== } + engines: { node: '>=4' } + + type-fest@0.20.2: + resolution: { integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== } + engines: { node: '>=10' } + + type-fest@0.21.3: + resolution: { integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== } + engines: { node: '>=10' } + + type-fest@0.8.1: + resolution: { integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== } + engines: { node: '>=8' } + + typed-array-buffer@1.0.3: + resolution: { integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw== } + engines: { node: '>= 0.4' } + + typed-array-byte-length@1.0.3: + resolution: { integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg== } + engines: { node: '>= 0.4' } + + typed-array-byte-offset@1.0.4: + resolution: { integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ== } + engines: { node: '>= 0.4' } + + typed-array-length@1.0.7: + resolution: { integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg== } + engines: { node: '>= 0.4' } + + typescript@5.7.2: + resolution: { integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg== } + engines: { node: '>=14.17' } + hasBin: true + + unbox-primitive@1.1.0: + resolution: { integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw== } + engines: { node: '>= 0.4' } + + undici-types@6.20.0: + resolution: { integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== } + + unicode-canonical-property-names-ecmascript@2.0.1: + resolution: { integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg== } + engines: { node: '>=4' } + + unicode-match-property-ecmascript@2.0.0: + resolution: { integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== } + engines: { node: '>=4' } + + unicode-match-property-value-ecmascript@2.2.0: + resolution: { integrity: sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg== } + engines: { node: '>=4' } + + unicode-property-aliases-ecmascript@2.1.0: + resolution: { integrity: sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== } + engines: { node: '>=4' } + + update-browserslist-db@1.1.1: + resolution: { integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== } + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + uri-js@4.4.1: + resolution: { integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== } + + v8-compile-cache@2.4.0: + resolution: { integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== } + + webidl-conversions@3.0.1: + resolution: { integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== } + + whatwg-url@5.0.0: + resolution: { integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== } + + which-boxed-primitive@1.1.1: + resolution: { integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA== } + engines: { node: '>= 0.4' } + + which-builtin-type@1.2.1: + resolution: { integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q== } + engines: { node: '>= 0.4' } + + which-collection@1.0.2: + resolution: { integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw== } + engines: { node: '>= 0.4' } + + which-typed-array@1.1.18: + resolution: { integrity: sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA== } + engines: { node: '>= 0.4' } + + which@1.3.1: + resolution: { integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== } + hasBin: true + + which@2.0.2: + resolution: { integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== } + engines: { node: '>= 8' } + hasBin: true + + word-wrap@1.2.5: + resolution: { integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== } + engines: { node: '>=0.10.0' } + + workerpool@6.5.1: + resolution: { integrity: sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== } + + wrap-ansi@7.0.0: + resolution: { integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== } + engines: { node: '>=10' } + + wrap-ansi@9.0.0: + resolution: { integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q== } + engines: { node: '>=18' } + + wrappy@1.0.2: + resolution: { integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== } + + write@1.0.3: + resolution: { integrity: sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== } + engines: { node: '>=4' } + + y18n@5.0.8: + resolution: { integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== } + engines: { node: '>=10' } + + yallist@3.1.1: + resolution: { integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== } + + yaml@2.6.1: + resolution: { integrity: sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg== } + engines: { node: '>= 14' } + hasBin: true + + yargs-parser@20.2.9: + resolution: { integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== } + engines: { node: '>=10' } + + yargs-unparser@2.0.0: + resolution: { integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== } + engines: { node: '>=10' } + + yargs@16.2.0: + resolution: { integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== } + engines: { node: '>=10' } + + yocto-queue@0.1.0: + resolution: { integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== } + engines: { node: '>=10' } + +snapshots: + '@ampproject/remapping@2.3.0': + dependencies: + '@jridgewell/gen-mapping': 0.3.8 + '@jridgewell/trace-mapping': 0.3.25 + + '@babel/code-frame@7.26.2': + dependencies: + '@babel/helper-validator-identifier': 7.25.9 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.26.3': {} + + '@babel/core@7.26.0': + dependencies: + '@ampproject/remapping': 2.3.0 + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.3 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helpers': 7.26.0 + '@babel/parser': 7.26.3 + '@babel/template': 7.25.9 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 + convert-source-map: 2.0.0 + debug: 4.4.0(supports-color@8.1.1) + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.26.3': + dependencies: + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 + '@jridgewell/gen-mapping': 0.3.8 + '@jridgewell/trace-mapping': 0.3.25 + jsesc: 3.1.0 + + '@babel/helper-annotate-as-pure@7.25.9': + dependencies: + '@babel/types': 7.26.3 + + '@babel/helper-compilation-targets@7.25.9': + dependencies: + '@babel/compat-data': 7.26.3 + '@babel/helper-validator-option': 7.25.9 + browserslist: 4.24.3 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-create-class-features-plugin@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-member-expression-to-functions': 7.25.9 + '@babel/helper-optimise-call-expression': 7.25.9 + '@babel/helper-replace-supers': 7.25.9(@babel/core@7.26.0) + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/traverse': 7.26.4 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-create-regexp-features-plugin@7.26.3(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + regexpu-core: 6.2.0 + semver: 6.3.1 + + '@babel/helper-define-polyfill-provider@0.6.3(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + debug: 4.4.0(supports-color@8.1.1) + lodash.debounce: 4.0.8 + resolve: 1.22.10 + transitivePeerDependencies: + - supports-color + + '@babel/helper-member-expression-to-functions@7.25.9': + dependencies: + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-imports@7.25.9': + dependencies: + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.26.0(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-module-imports': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + '@babel/traverse': 7.26.4 + transitivePeerDependencies: + - supports-color + + '@babel/helper-optimise-call-expression@7.25.9': + dependencies: + '@babel/types': 7.26.3 + + '@babel/helper-plugin-utils@7.25.9': {} + + '@babel/helper-remap-async-to-generator@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-wrap-function': 7.25.9 + '@babel/traverse': 7.26.4 + transitivePeerDependencies: + - supports-color + + '@babel/helper-replace-supers@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-member-expression-to-functions': 7.25.9 + '@babel/helper-optimise-call-expression': 7.25.9 + '@babel/traverse': 7.26.4 + transitivePeerDependencies: + - supports-color + + '@babel/helper-skip-transparent-expression-wrappers@7.25.9': + dependencies: + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 + transitivePeerDependencies: + - supports-color + + '@babel/helper-string-parser@7.25.9': {} + + '@babel/helper-validator-identifier@7.25.9': {} + + '@babel/helper-validator-option@7.25.9': {} + + '@babel/helper-wrap-function@7.25.9': + dependencies: + '@babel/template': 7.25.9 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 + transitivePeerDependencies: + - supports-color + + '@babel/helpers@7.26.0': + dependencies: + '@babel/template': 7.25.9 + '@babel/types': 7.26.3 + + '@babel/parser@7.26.3': + dependencies: + '@babel/types': 7.26.3 + + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/traverse': 7.26.4 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/plugin-transform-optional-chaining': 7.25.9(@babel/core@7.26.0) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/traverse': 7.26.4 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-proposal-decorators@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-decorators': 7.25.9(@babel/core@7.26.0) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + + '@babel/plugin-syntax-decorators@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-syntax-import-assertions@7.26.0(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-syntax-import-attributes@7.26.0(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-arrow-functions@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-async-generator-functions@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-remap-async-to-generator': 7.25.9(@babel/core@7.26.0) + '@babel/traverse': 7.26.4 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-async-to-generator@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-module-imports': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-remap-async-to-generator': 7.25.9(@babel/core@7.26.0) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-block-scoped-functions@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-block-scoping@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-class-properties@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-class-static-block@7.26.0(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-classes@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-replace-supers': 7.25.9(@babel/core@7.26.0) + '@babel/traverse': 7.26.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-computed-properties@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/template': 7.25.9 + + '@babel/plugin-transform-destructuring@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-dotall-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-duplicate-keys@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-dynamic-import@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-exponentiation-operator@7.26.3(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-export-namespace-from@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-for-of@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-function-name@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/traverse': 7.26.4 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-json-strings@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-literals@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-logical-assignment-operators@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-member-expression-literals@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-modules-amd@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-modules-commonjs@7.26.3(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-modules-systemjs@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + '@babel/traverse': 7.26.4 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-modules-umd@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-named-capturing-groups-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-new-target@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-nullish-coalescing-operator@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-numeric-separator@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-object-rest-spread@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-transform-parameters': 7.25.9(@babel/core@7.26.0) + + '@babel/plugin-transform-object-super@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-replace-supers': 7.25.9(@babel/core@7.26.0) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-optional-catch-binding@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-optional-chaining@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-parameters@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-private-methods@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-private-property-in-object@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-property-literals@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-regenerator@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + regenerator-transform: 0.15.2 + + '@babel/plugin-transform-regexp-modifiers@7.26.0(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-reserved-words@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-shorthand-properties@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-spread@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-sticky-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-template-literals@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-typeof-symbol@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-unicode-escapes@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-unicode-property-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-unicode-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-unicode-sets-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/polyfill@7.12.1': + dependencies: + core-js: 2.6.12 + regenerator-runtime: 0.13.11 + + '@babel/preset-env@7.26.0(@babel/core@7.26.0)': + dependencies: + '@babel/compat-data': 7.26.3 + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-validator-option': 7.25.9 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.26.0) + '@babel/plugin-syntax-import-assertions': 7.26.0(@babel/core@7.26.0) + '@babel/plugin-syntax-import-attributes': 7.26.0(@babel/core@7.26.0) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-transform-arrow-functions': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-async-generator-functions': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-async-to-generator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-block-scoped-functions': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-block-scoping': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-class-properties': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-class-static-block': 7.26.0(@babel/core@7.26.0) + '@babel/plugin-transform-classes': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-computed-properties': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-destructuring': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-dotall-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-duplicate-keys': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-dynamic-import': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-exponentiation-operator': 7.26.3(@babel/core@7.26.0) + '@babel/plugin-transform-export-namespace-from': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-for-of': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-function-name': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-json-strings': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-literals': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-logical-assignment-operators': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-member-expression-literals': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-modules-amd': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.26.3(@babel/core@7.26.0) + '@babel/plugin-transform-modules-systemjs': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-modules-umd': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-named-capturing-groups-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-new-target': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-nullish-coalescing-operator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-numeric-separator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-object-rest-spread': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-object-super': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-optional-catch-binding': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-optional-chaining': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-parameters': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-private-methods': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-private-property-in-object': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-property-literals': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-regenerator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-regexp-modifiers': 7.26.0(@babel/core@7.26.0) + '@babel/plugin-transform-reserved-words': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-shorthand-properties': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-spread': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-sticky-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-template-literals': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-typeof-symbol': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-escapes': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-property-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-sets-regex': 7.25.9(@babel/core@7.26.0) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.26.0) + babel-plugin-polyfill-corejs2: 0.4.12(@babel/core@7.26.0) + babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.26.0) + babel-plugin-polyfill-regenerator: 0.6.3(@babel/core@7.26.0) + core-js-compat: 3.39.0 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/types': 7.26.3 + esutils: 2.0.3 + + '@babel/register@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + clone-deep: 4.0.1 + find-cache-dir: 2.1.0 + make-dir: 2.1.0 + pirates: 4.0.6 + source-map-support: 0.5.21 + + '@babel/runtime@7.26.0': + dependencies: + regenerator-runtime: 0.14.1 + + '@babel/template@7.25.9': + dependencies: + '@babel/code-frame': 7.26.2 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 + + '@babel/traverse@7.26.4': + dependencies: + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.3 + '@babel/parser': 7.26.3 + '@babel/template': 7.25.9 + '@babel/types': 7.26.3 + debug: 4.4.0(supports-color@8.1.1) + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.26.3': + dependencies: + '@babel/helper-string-parser': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + + '@eslint-community/eslint-utils@4.4.1(eslint@8.57.1)': + dependencies: + eslint: 8.57.1 + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.12.1': {} + + '@eslint/eslintrc@2.1.4': + dependencies: + ajv: 6.12.6 + debug: 4.4.0(supports-color@8.1.1) + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.3.2 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + '@eslint/js@8.57.1': {} + + '@fleetbase/sdk@1.2.10': + dependencies: + '@babel/runtime': 7.26.0 + axios: 1.7.9 + cross-fetch: 4.1.0 + global: 4.4.0 + rollup: 4.29.1 + transitivePeerDependencies: + - debug + - encoding + + '@humanwhocodes/config-array@0.13.0': + dependencies: + '@humanwhocodes/object-schema': 2.0.3 + debug: 4.4.0(supports-color@8.1.1) + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/object-schema@2.0.3': {} + + '@jridgewell/gen-mapping@0.3.8': + dependencies: + '@jridgewell/set-array': 1.2.1 + '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/set-array@1.2.1': {} + + '@jridgewell/source-map@0.3.6': + dependencies: + '@jridgewell/gen-mapping': 0.3.8 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/sourcemap-codec@1.5.0': {} + + '@jridgewell/trace-mapping@0.3.25': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.18.0 + + '@rollup/plugin-babel@6.0.4(@babel/core@7.26.0)(rollup@4.29.1)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-module-imports': 7.25.9 + '@rollup/pluginutils': 5.1.4(rollup@4.29.1) + optionalDependencies: + rollup: 4.29.1 + transitivePeerDependencies: + - supports-color + + '@rollup/plugin-node-resolve@15.3.1(rollup@4.29.1)': + dependencies: + '@rollup/pluginutils': 5.1.4(rollup@4.29.1) + '@types/resolve': 1.20.2 + deepmerge: 4.3.1 + is-module: 1.0.0 + resolve: 1.22.10 + optionalDependencies: + rollup: 4.29.1 + + '@rollup/pluginutils@5.1.4(rollup@4.29.1)': + dependencies: + '@types/estree': 1.0.6 + estree-walker: 2.0.2 + picomatch: 4.0.2 + optionalDependencies: + rollup: 4.29.1 + + '@rollup/rollup-android-arm-eabi@4.29.1': + optional: true + + '@rollup/rollup-android-arm64@4.29.1': + optional: true + + '@rollup/rollup-darwin-arm64@4.29.1': + optional: true + + '@rollup/rollup-darwin-x64@4.29.1': + optional: true + + '@rollup/rollup-freebsd-arm64@4.29.1': + optional: true + + '@rollup/rollup-freebsd-x64@4.29.1': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.29.1': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.29.1': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.29.1': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.29.1': + optional: true + + '@rollup/rollup-linux-loongarch64-gnu@4.29.1': + optional: true + + '@rollup/rollup-linux-powerpc64le-gnu@4.29.1': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.29.1': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.29.1': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.29.1': + optional: true + + '@rollup/rollup-linux-x64-musl@4.29.1': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.29.1': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.29.1': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.29.1': + optional: true + + '@rtsao/scc@1.1.0': {} + + '@types/estree@1.0.6': {} + + '@types/json5@0.0.29': {} + + '@types/node@22.10.2': + dependencies: + undici-types: 6.20.0 + + '@types/resolve@1.20.2': {} + + '@ungap/structured-clone@1.2.1': {} + + acorn-jsx@5.3.2(acorn@7.4.1): + dependencies: + acorn: 7.4.1 + + acorn-jsx@5.3.2(acorn@8.14.0): + dependencies: + acorn: 8.14.0 + + acorn@7.4.1: {} + + acorn@8.14.0: {} + + ajv@6.12.6: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ansi-colors@4.1.3: {} + + ansi-escapes@4.3.2: + dependencies: + type-fest: 0.21.3 + + ansi-escapes@7.0.0: + dependencies: + environment: 1.1.0 + + ansi-regex@4.1.1: {} + + ansi-regex@5.0.1: {} + + ansi-regex@6.1.0: {} + + ansi-styles@3.2.1: + dependencies: + color-convert: 1.9.3 + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + ansi-styles@6.2.1: {} + + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + + argparse@1.0.10: + dependencies: + sprintf-js: 1.0.3 + + argparse@2.0.1: {} + + array-buffer-byte-length@1.0.2: + dependencies: + call-bound: 1.0.3 + is-array-buffer: 3.0.5 + + array-includes@3.1.8: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.7 + es-object-atoms: 1.0.0 + get-intrinsic: 1.2.6 + is-string: 1.1.1 + + array.prototype.findlastindex@1.2.5: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.7 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + es-shim-unscopables: 1.0.2 + + array.prototype.flat@1.3.3: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.7 + es-shim-unscopables: 1.0.2 + + array.prototype.flatmap@1.3.3: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.7 + es-shim-unscopables: 1.0.2 + + arraybuffer.prototype.slice@1.0.4: + dependencies: + array-buffer-byte-length: 1.0.2 + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + is-array-buffer: 3.0.5 + + assertion-error@1.1.0: {} + + astral-regex@1.0.0: {} + + asynckit@0.4.0: {} + + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.0.0 + + axios@1.7.9: + dependencies: + follow-redirects: 1.15.9 + form-data: 4.0.1 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + + babel-plugin-polyfill-corejs2@0.4.12(@babel/core@7.26.0): + dependencies: + '@babel/compat-data': 7.26.3 + '@babel/core': 7.26.0 + '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.26.0) + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + babel-plugin-polyfill-corejs3@0.10.6(@babel/core@7.26.0): + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.26.0) + core-js-compat: 3.39.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-polyfill-regenerator@0.6.3(@babel/core@7.26.0): + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.26.0) + transitivePeerDependencies: + - supports-color + + balanced-match@1.0.2: {} + + binary-extensions@2.3.0: {} + + brace-expansion@1.1.11: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + brace-expansion@2.0.1: + dependencies: + balanced-match: 1.0.2 + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + browser-stdout@1.3.1: {} + + browserslist@4.24.3: + dependencies: + caniuse-lite: 1.0.30001690 + electron-to-chromium: 1.5.76 + node-releases: 2.0.19 + update-browserslist-db: 1.1.1(browserslist@4.24.3) + + buffer-from@1.1.2: {} + + call-bind-apply-helpers@1.0.1: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + call-bind@1.0.8: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-define-property: 1.0.1 + get-intrinsic: 1.2.6 + set-function-length: 1.2.2 + + call-bound@1.0.3: + dependencies: + call-bind-apply-helpers: 1.0.1 + get-intrinsic: 1.2.6 + + callsites@3.1.0: {} + + camelcase@6.3.0: {} + + caniuse-lite@1.0.30001690: {} + + chai@4.5.0: + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.3 + deep-eql: 4.1.4 + get-func-name: 2.0.2 + loupe: 2.3.7 + pathval: 1.1.1 + type-detect: 4.1.0 + + chalk@2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + chalk@5.3.0: {} + + chardet@0.7.0: {} + + check-error@1.0.3: + dependencies: + get-func-name: 2.0.2 + + chokidar@3.6.0: + dependencies: + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + + cli-cursor@3.1.0: + dependencies: + restore-cursor: 3.1.0 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-truncate@4.0.0: + dependencies: + slice-ansi: 5.0.0 + string-width: 7.2.0 + + cli-width@3.0.0: {} + + cliui@7.0.4: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + clone-deep@4.0.1: + dependencies: + is-plain-object: 2.0.4 + kind-of: 6.0.3 + shallow-clone: 3.0.1 + + color-convert@1.9.3: + dependencies: + color-name: 1.1.3 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.3: {} + + color-name@1.1.4: {} + + colorette@2.0.20: {} + + combined-stream@1.0.8: + dependencies: + delayed-stream: 1.0.0 + + commander@12.1.0: {} + + commander@2.20.3: {} + + commondir@1.0.1: {} + + concat-map@0.0.1: {} + + confusing-browser-globals@1.0.11: {} + + convert-source-map@2.0.0: {} + + core-js-compat@3.39.0: + dependencies: + browserslist: 4.24.3 + + core-js@2.6.12: {} + + cross-fetch@4.1.0: + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + + cross-spawn@6.0.6: + dependencies: + nice-try: 1.0.5 + path-key: 2.0.1 + semver: 5.7.2 + shebang-command: 1.2.0 + which: 1.3.1 + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + data-view-buffer@1.0.2: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + is-data-view: 1.0.2 + + data-view-byte-length@1.0.2: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + is-data-view: 1.0.2 + + data-view-byte-offset@1.0.1: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + is-data-view: 1.0.2 + + date-fns@3.6.0: {} + + debug@3.2.7: + dependencies: + ms: 2.1.3 + + debug@4.4.0(supports-color@8.1.1): + dependencies: + ms: 2.1.3 + optionalDependencies: + supports-color: 8.1.1 + + decamelize@4.0.0: {} + + deep-eql@4.1.4: + dependencies: + type-detect: 4.1.0 + + deep-is@0.1.4: {} + + deepmerge@4.3.1: {} + + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + + define-properties@1.2.1: + dependencies: + define-data-property: 1.1.4 + has-property-descriptors: 1.0.2 + object-keys: 1.1.1 + + delayed-stream@1.0.0: {} + + diff@5.2.0: {} + + doctrine@2.1.0: + dependencies: + esutils: 2.0.3 + + doctrine@3.0.0: + dependencies: + esutils: 2.0.3 + + dom-walk@0.1.2: {} + + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + + electron-to-chromium@1.5.76: {} + + emoji-regex@10.4.0: {} + + emoji-regex@7.0.3: {} + + emoji-regex@8.0.0: {} + + environment@1.1.0: {} + + es-abstract@1.23.7: + dependencies: + array-buffer-byte-length: 1.0.2 + arraybuffer.prototype.slice: 1.0.4 + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.3 + data-view-buffer: 1.0.2 + data-view-byte-length: 1.0.2 + data-view-byte-offset: 1.0.1 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + es-set-tostringtag: 2.0.3 + es-to-primitive: 1.3.0 + function.prototype.name: 1.1.8 + get-intrinsic: 1.2.6 + get-symbol-description: 1.1.0 + globalthis: 1.0.4 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + has-proto: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + internal-slot: 1.1.0 + is-array-buffer: 3.0.5 + is-callable: 1.2.7 + is-data-view: 1.0.2 + is-regex: 1.2.1 + is-shared-array-buffer: 1.0.4 + is-string: 1.1.1 + is-typed-array: 1.1.15 + is-weakref: 1.1.0 + math-intrinsics: 1.1.0 + object-inspect: 1.13.3 + object-keys: 1.1.1 + object.assign: 4.1.7 + regexp.prototype.flags: 1.5.3 + safe-array-concat: 1.1.3 + safe-regex-test: 1.1.0 + string.prototype.trim: 1.2.10 + string.prototype.trimend: 1.0.9 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.3 + typed-array-byte-length: 1.0.3 + typed-array-byte-offset: 1.0.4 + typed-array-length: 1.0.7 + unbox-primitive: 1.1.0 + which-typed-array: 1.1.18 + + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-object-atoms@1.0.0: + dependencies: + es-errors: 1.3.0 + + es-set-tostringtag@2.0.3: + dependencies: + get-intrinsic: 1.2.6 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + + es-shim-unscopables@1.0.2: + dependencies: + hasown: 2.0.2 + + es-to-primitive@1.3.0: + dependencies: + is-callable: 1.2.7 + is-date-object: 1.1.0 + is-symbol: 1.1.1 + + escalade@3.2.0: {} + + escape-string-regexp@1.0.5: {} + + escape-string-regexp@4.0.0: {} + + eslint-config-airbnb-base@15.0.0(eslint-plugin-import@2.31.0(eslint@8.57.1))(eslint@8.57.1): + dependencies: + confusing-browser-globals: 1.0.11 + eslint: 8.57.1 + eslint-plugin-import: 2.31.0(eslint@8.57.1) + object.assign: 4.1.7 + object.entries: 1.1.8 + semver: 6.3.1 + + eslint-import-resolver-node@0.3.9: + dependencies: + debug: 3.2.7 + is-core-module: 2.16.1 + resolve: 1.22.10 + transitivePeerDependencies: + - supports-color + + eslint-module-utils@2.12.0(eslint-import-resolver-node@0.3.9)(eslint@8.57.1): + dependencies: + debug: 3.2.7 + optionalDependencies: + eslint: 8.57.1 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + + eslint-plugin-import@2.31.0(eslint@8.57.1): + dependencies: + '@rtsao/scc': 1.1.0 + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 + array.prototype.flat: 1.3.3 + array.prototype.flatmap: 1.3.3 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 8.57.1 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.12.0(eslint-import-resolver-node@0.3.9)(eslint@8.57.1) + hasown: 2.0.2 + is-core-module: 2.16.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.1 + semver: 6.3.1 + string.prototype.trimend: 1.0.9 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + + eslint-scope@5.1.1: + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + + eslint-scope@7.2.2: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-utils@1.4.3: + dependencies: + eslint-visitor-keys: 1.3.0 + + eslint-visitor-keys@1.3.0: {} + + eslint-visitor-keys@3.4.3: {} + + eslint@6.8.0: + dependencies: + '@babel/code-frame': 7.26.2 + ajv: 6.12.6 + chalk: 2.4.2 + cross-spawn: 6.0.6 + debug: 4.4.0(supports-color@8.1.1) + doctrine: 3.0.0 + eslint-scope: 5.1.1 + eslint-utils: 1.4.3 + eslint-visitor-keys: 1.3.0 + espree: 6.2.1 + esquery: 1.6.0 + esutils: 2.0.3 + file-entry-cache: 5.0.1 + functional-red-black-tree: 1.0.1 + glob-parent: 5.1.2 + globals: 12.4.0 + ignore: 4.0.6 + import-fresh: 3.3.0 + imurmurhash: 0.1.4 + inquirer: 7.3.3 + is-glob: 4.0.3 + js-yaml: 3.14.1 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.3.0 + lodash: 4.17.21 + minimatch: 3.1.2 + mkdirp: 0.5.6 + natural-compare: 1.4.0 + optionator: 0.8.3 + progress: 2.0.3 + regexpp: 2.0.1 + semver: 6.3.1 + strip-ansi: 5.2.0 + strip-json-comments: 3.1.1 + table: 5.4.6 + text-table: 0.2.0 + v8-compile-cache: 2.4.0 + transitivePeerDependencies: + - supports-color + + eslint@8.57.1: + dependencies: + '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.1) + '@eslint-community/regexpp': 4.12.1 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.1 + '@humanwhocodes/config-array': 0.13.0 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.1 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.6 + debug: 4.4.0(supports-color@8.1.1) + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + + espree@6.2.1: + dependencies: + acorn: 7.4.1 + acorn-jsx: 5.3.2(acorn@7.4.1) + eslint-visitor-keys: 1.3.0 + + espree@9.6.1: + dependencies: + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) + eslint-visitor-keys: 3.4.3 + + esprima@4.0.1: {} + + esquery@1.6.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@4.3.0: {} + + estraverse@5.3.0: {} + + estree-walker@0.6.1: {} + + estree-walker@2.0.2: {} + + esutils@2.0.3: {} + + eventemitter3@5.0.1: {} + + execa@8.0.1: + dependencies: + cross-spawn: 7.0.6 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.3.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + + external-editor@3.1.0: + dependencies: + chardet: 0.7.0 + iconv-lite: 0.4.24 + tmp: 0.0.33 + + fast-deep-equal@3.1.3: {} + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} + + fastq@1.18.0: + dependencies: + reusify: 1.0.4 + + figures@3.2.0: + dependencies: + escape-string-regexp: 1.0.5 + + file-entry-cache@5.0.1: + dependencies: + flat-cache: 2.0.1 + + file-entry-cache@6.0.1: + dependencies: + flat-cache: 3.2.0 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + find-cache-dir@2.1.0: + dependencies: + commondir: 1.0.1 + make-dir: 2.1.0 + pkg-dir: 3.0.0 + + find-up@3.0.0: + dependencies: + locate-path: 3.0.0 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + flat-cache@2.0.1: + dependencies: + flatted: 2.0.2 + rimraf: 2.6.3 + write: 1.0.3 + + flat-cache@3.2.0: + dependencies: + flatted: 3.3.2 + keyv: 4.5.4 + rimraf: 3.0.2 + + flat@5.0.2: {} + + flatted@2.0.2: {} + + flatted@3.3.2: {} + + follow-redirects@1.15.9: {} + + for-each@0.3.3: + dependencies: + is-callable: 1.2.7 + + form-data@4.0.1: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + + fs.realpath@1.0.0: {} + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + function.prototype.name@1.1.8: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + define-properties: 1.2.1 + functions-have-names: 1.2.3 + hasown: 2.0.2 + is-callable: 1.2.7 + + functional-red-black-tree@1.0.1: {} + + functions-have-names@1.2.3: {} + + gensync@1.0.0-beta.2: {} + + get-caller-file@2.0.5: {} + + get-east-asian-width@1.3.0: {} + + get-func-name@2.0.2: {} + + get-intrinsic@1.2.6: + dependencies: + call-bind-apply-helpers: 1.0.1 + dunder-proto: 1.0.1 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + function-bind: 1.1.2 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + + get-stream@8.0.1: {} + + get-symbol-description@1.1.0: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + glob@8.1.0: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + + global@4.4.0: + dependencies: + min-document: 2.19.0 + process: 0.11.10 + + globals@11.12.0: {} + + globals@12.4.0: + dependencies: + type-fest: 0.8.1 + + globals@13.24.0: + dependencies: + type-fest: 0.20.2 + + globalthis@1.0.4: + dependencies: + define-properties: 1.2.1 + gopd: 1.2.0 + + gopd@1.2.0: {} + + graphemer@1.4.0: {} + + has-bigints@1.1.0: {} + + has-flag@3.0.0: {} + + has-flag@4.0.0: {} + + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.1 + + has-proto@1.2.0: + dependencies: + dunder-proto: 1.0.1 + + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + + he@1.2.0: {} + + human-signals@5.0.0: {} + + husky@8.0.3: {} + + iconv-lite@0.4.24: + dependencies: + safer-buffer: 2.1.2 + + ignore@4.0.6: {} + + ignore@5.3.2: {} + + import-fresh@3.3.0: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + imurmurhash@0.1.4: {} + + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + inherits@2.0.4: {} + + inquirer@7.3.3: + dependencies: + ansi-escapes: 4.3.2 + chalk: 4.1.2 + cli-cursor: 3.1.0 + cli-width: 3.0.0 + external-editor: 3.1.0 + figures: 3.2.0 + lodash: 4.17.21 + mute-stream: 0.0.8 + run-async: 2.4.1 + rxjs: 6.6.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + through: 2.3.8 + + internal-slot@1.1.0: + dependencies: + es-errors: 1.3.0 + hasown: 2.0.2 + side-channel: 1.1.0 + + is-array-buffer@3.0.5: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + get-intrinsic: 1.2.6 + + is-async-function@2.0.0: + dependencies: + has-tostringtag: 1.0.2 + + is-bigint@1.1.0: + dependencies: + has-bigints: 1.1.0 + + is-binary-path@2.1.0: + dependencies: + binary-extensions: 2.3.0 + + is-boolean-object@1.2.1: + dependencies: + call-bound: 1.0.3 + has-tostringtag: 1.0.2 + + is-callable@1.2.7: {} + + is-core-module@2.16.1: + dependencies: + hasown: 2.0.2 + + is-data-view@1.0.2: + dependencies: + call-bound: 1.0.3 + get-intrinsic: 1.2.6 + is-typed-array: 1.1.15 + + is-date-object@1.1.0: + dependencies: + call-bound: 1.0.3 + has-tostringtag: 1.0.2 + + is-extglob@2.1.1: {} + + is-finalizationregistry@1.1.1: + dependencies: + call-bound: 1.0.3 + + is-fullwidth-code-point@2.0.0: {} + + is-fullwidth-code-point@3.0.0: {} + + is-fullwidth-code-point@4.0.0: {} + + is-fullwidth-code-point@5.0.0: + dependencies: + get-east-asian-width: 1.3.0 + + is-generator-function@1.0.10: + dependencies: + has-tostringtag: 1.0.2 + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-map@2.0.3: {} + + is-module@1.0.0: {} + + is-number-object@1.1.1: + dependencies: + call-bound: 1.0.3 + has-tostringtag: 1.0.2 + + is-number@7.0.0: {} + + is-path-inside@3.0.3: {} + + is-plain-obj@2.1.0: {} + + is-plain-object@2.0.4: + dependencies: + isobject: 3.0.1 + + is-regex@1.2.1: + dependencies: + call-bound: 1.0.3 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + + is-set@2.0.3: {} + + is-shared-array-buffer@1.0.4: + dependencies: + call-bound: 1.0.3 + + is-stream@3.0.0: {} + + is-string@1.1.1: + dependencies: + call-bound: 1.0.3 + has-tostringtag: 1.0.2 + + is-symbol@1.1.1: + dependencies: + call-bound: 1.0.3 + has-symbols: 1.1.0 + safe-regex-test: 1.1.0 + + is-typed-array@1.1.15: + dependencies: + which-typed-array: 1.1.18 + + is-unicode-supported@0.1.0: {} + + is-weakmap@2.0.2: {} + + is-weakref@1.1.0: + dependencies: + call-bound: 1.0.3 + + is-weakset@2.0.4: + dependencies: + call-bound: 1.0.3 + get-intrinsic: 1.2.6 + + isarray@2.0.5: {} + + isexe@2.0.0: {} + + isobject@3.0.1: {} + + jest-worker@26.6.2: + dependencies: + '@types/node': 22.10.2 + merge-stream: 2.0.0 + supports-color: 7.2.0 + + js-tokens@4.0.0: {} + + js-yaml@3.14.1: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + + js-yaml@4.1.0: + dependencies: + argparse: 2.0.1 + + jsesc@3.0.2: {} + + jsesc@3.1.0: {} + + json-buffer@3.0.1: {} + + json-schema-traverse@0.4.1: {} + + json-stable-stringify-without-jsonify@1.0.1: {} + + json5@1.0.2: + dependencies: + minimist: 1.2.8 + + json5@2.2.3: {} + + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + + kind-of@6.0.3: {} + + levn@0.3.0: + dependencies: + prelude-ls: 1.1.2 + type-check: 0.3.2 + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + lilconfig@3.1.3: {} + + lint-staged@15.2.11: + dependencies: + chalk: 5.3.0 + commander: 12.1.0 + debug: 4.4.0(supports-color@8.1.1) + execa: 8.0.1 + lilconfig: 3.1.3 + listr2: 8.2.5 + micromatch: 4.0.8 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.6.1 + transitivePeerDependencies: + - supports-color + + listr2@8.2.5: + dependencies: + cli-truncate: 4.0.0 + colorette: 2.0.20 + eventemitter3: 5.0.1 + log-update: 6.1.0 + rfdc: 1.4.1 + wrap-ansi: 9.0.0 + + locate-path@3.0.0: + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + + lodash.debounce@4.0.8: {} + + lodash.merge@4.6.2: {} + + lodash@4.17.21: {} + + log-symbols@4.1.0: + dependencies: + chalk: 4.1.2 + is-unicode-supported: 0.1.0 + + log-update@6.1.0: + dependencies: + ansi-escapes: 7.0.0 + cli-cursor: 5.0.0 + slice-ansi: 7.1.0 + strip-ansi: 7.1.0 + wrap-ansi: 9.0.0 + + loupe@2.3.7: + dependencies: + get-func-name: 2.0.2 + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + make-dir@2.1.0: + dependencies: + pify: 4.0.1 + semver: 5.7.2 + + math-intrinsics@1.1.0: {} + + merge-stream@2.0.0: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + + mime-db@1.52.0: {} + + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + + mimic-fn@2.1.0: {} + + mimic-fn@4.0.0: {} + + mimic-function@5.0.1: {} + + min-document@2.19.0: + dependencies: + dom-walk: 0.1.2 + + minimatch@3.1.2: + dependencies: + brace-expansion: 1.1.11 + + minimatch@5.1.6: + dependencies: + brace-expansion: 2.0.1 + + minimist@1.2.8: {} + + mkdirp@0.5.6: + dependencies: + minimist: 1.2.8 + + mocha@10.8.2: + dependencies: + ansi-colors: 4.1.3 + browser-stdout: 1.3.1 + chokidar: 3.6.0 + debug: 4.4.0(supports-color@8.1.1) + diff: 5.2.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 8.1.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.1.6 + ms: 2.1.3 + serialize-javascript: 6.0.2 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.5.1 + yargs: 16.2.0 + yargs-parser: 20.2.9 + yargs-unparser: 2.0.0 + + ms@2.1.3: {} + + mute-stream@0.0.8: {} + + natural-compare@1.4.0: {} + + nice-try@1.0.5: {} + + node-fetch@2.7.0: + dependencies: + whatwg-url: 5.0.0 + + node-releases@2.0.19: {} + + normalize-path@3.0.0: {} + + npm-run-path@5.3.0: + dependencies: + path-key: 4.0.0 + + object-inspect@1.13.3: {} + + object-keys@1.1.1: {} + + object.assign@4.1.7: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + has-symbols: 1.1.0 + object-keys: 1.1.1 + + object.entries@1.1.8: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + + object.fromentries@2.0.8: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.7 + es-object-atoms: 1.0.0 + + object.groupby@1.0.3: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.7 + + object.values@1.2.1: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + + onetime@5.1.2: + dependencies: + mimic-fn: 2.1.0 + + onetime@6.0.0: + dependencies: + mimic-fn: 4.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + optionator@0.8.3: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.3.0 + prelude-ls: 1.1.2 + type-check: 0.3.2 + word-wrap: 1.2.5 + + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + os-tmpdir@1.0.2: {} + + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@3.0.0: + dependencies: + p-limit: 2.3.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + p-try@2.2.0: {} + + parent-module@1.0.1: + dependencies: + callsites: 3.1.0 + + path-exists@3.0.0: {} + + path-exists@4.0.0: {} + + path-is-absolute@1.0.1: {} + + path-key@2.0.1: {} + + path-key@3.1.1: {} + + path-key@4.0.0: {} + + path-parse@1.0.7: {} + + pathval@1.1.1: {} + + picocolors@1.1.1: {} + + picomatch@2.3.1: {} + + picomatch@4.0.2: {} + + pidtree@0.6.0: {} + + pify@4.0.1: {} + + pirates@4.0.6: {} + + pkg-dir@3.0.0: + dependencies: + find-up: 3.0.0 + + possible-typed-array-names@1.0.0: {} + + prelude-ls@1.1.2: {} + + prelude-ls@1.2.1: {} + + prettier@3.1.1: {} + + process@0.11.10: {} + + progress@2.0.3: {} + + proxy-from-env@1.1.0: {} + + punycode@2.3.1: {} + + queue-microtask@1.2.3: {} + + randombytes@2.1.0: + dependencies: + safe-buffer: 5.2.1 + + readdirp@3.6.0: + dependencies: + picomatch: 2.3.1 + + reflect.getprototypeof@1.0.9: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + dunder-proto: 1.0.1 + es-abstract: 1.23.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + gopd: 1.2.0 + which-builtin-type: 1.2.1 + + regenerate-unicode-properties@10.2.0: + dependencies: + regenerate: 1.4.2 + + regenerate@1.4.2: {} + + regenerator-runtime@0.13.11: {} + + regenerator-runtime@0.14.1: {} + + regenerator-transform@0.15.2: + dependencies: + '@babel/runtime': 7.26.0 + + regexp.prototype.flags@1.5.3: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-errors: 1.3.0 + set-function-name: 2.0.2 + + regexpp@2.0.1: {} + + regexpu-core@6.2.0: + dependencies: + regenerate: 1.4.2 + regenerate-unicode-properties: 10.2.0 + regjsgen: 0.8.0 + regjsparser: 0.12.0 + unicode-match-property-ecmascript: 2.0.0 + unicode-match-property-value-ecmascript: 2.2.0 + + regjsgen@0.8.0: {} + + regjsparser@0.12.0: + dependencies: + jsesc: 3.0.2 + + require-directory@2.1.1: {} + + resolve-from@4.0.0: {} + + resolve@1.22.10: + dependencies: + is-core-module: 2.16.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + + restore-cursor@3.1.0: + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + reusify@1.0.4: {} + + rfdc@1.4.1: {} + + rimraf@2.6.3: + dependencies: + glob: 7.2.3 + + rimraf@3.0.2: + dependencies: + glob: 7.2.3 + + rollup-plugin-eslint@7.0.0: + dependencies: + eslint: 6.8.0 + rollup-pluginutils: 2.8.2 + transitivePeerDependencies: + - supports-color + + rollup-plugin-terser@7.0.2(rollup@4.29.1): + dependencies: + '@babel/code-frame': 7.26.2 + jest-worker: 26.6.2 + rollup: 4.29.1 + serialize-javascript: 4.0.0 + terser: 5.37.0 + + rollup-pluginutils@2.8.2: + dependencies: + estree-walker: 0.6.1 + + rollup@4.29.1: + dependencies: + '@types/estree': 1.0.6 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.29.1 + '@rollup/rollup-android-arm64': 4.29.1 + '@rollup/rollup-darwin-arm64': 4.29.1 + '@rollup/rollup-darwin-x64': 4.29.1 + '@rollup/rollup-freebsd-arm64': 4.29.1 + '@rollup/rollup-freebsd-x64': 4.29.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.29.1 + '@rollup/rollup-linux-arm-musleabihf': 4.29.1 + '@rollup/rollup-linux-arm64-gnu': 4.29.1 + '@rollup/rollup-linux-arm64-musl': 4.29.1 + '@rollup/rollup-linux-loongarch64-gnu': 4.29.1 + '@rollup/rollup-linux-powerpc64le-gnu': 4.29.1 + '@rollup/rollup-linux-riscv64-gnu': 4.29.1 + '@rollup/rollup-linux-s390x-gnu': 4.29.1 + '@rollup/rollup-linux-x64-gnu': 4.29.1 + '@rollup/rollup-linux-x64-musl': 4.29.1 + '@rollup/rollup-win32-arm64-msvc': 4.29.1 + '@rollup/rollup-win32-ia32-msvc': 4.29.1 + '@rollup/rollup-win32-x64-msvc': 4.29.1 + fsevents: 2.3.3 + + run-async@2.4.1: {} + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + + rxjs@6.6.7: + dependencies: + tslib: 1.14.1 + + safe-array-concat@1.1.3: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + get-intrinsic: 1.2.6 + has-symbols: 1.1.0 + isarray: 2.0.5 + + safe-buffer@5.2.1: {} + + safe-regex-test@1.1.0: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + is-regex: 1.2.1 + + safer-buffer@2.1.2: {} + + semver@5.7.2: {} + + semver@6.3.1: {} + + serialize-javascript@4.0.0: + dependencies: + randombytes: 2.1.0 + + serialize-javascript@6.0.2: + dependencies: + randombytes: 2.1.0 + + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.6 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + + set-function-name@2.0.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.2 + + shallow-clone@3.0.1: + dependencies: + kind-of: 6.0.3 + + shebang-command@1.2.0: + dependencies: + shebang-regex: 1.0.0 + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@1.0.0: {} + + shebang-regex@3.0.0: {} + + side-channel-list@1.0.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.3 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + object-inspect: 1.13.3 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + object-inspect: 1.13.3 + side-channel-map: 1.0.1 + + side-channel@1.1.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.3 + side-channel-list: 1.0.0 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + + signal-exit@3.0.7: {} + + signal-exit@4.1.0: {} + + slice-ansi@2.1.0: + dependencies: + ansi-styles: 3.2.1 + astral-regex: 1.0.0 + is-fullwidth-code-point: 2.0.0 + + slice-ansi@5.0.0: + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 4.0.0 + + slice-ansi@7.1.0: + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + + source-map-support@0.5.21: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + + source-map@0.6.1: {} + + sprintf-js@1.0.3: {} + + string-argv@0.3.2: {} + + string-width@3.1.0: + dependencies: + emoji-regex: 7.0.3 + is-fullwidth-code-point: 2.0.0 + strip-ansi: 5.2.0 + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + string-width@7.2.0: + dependencies: + emoji-regex: 10.4.0 + get-east-asian-width: 1.3.0 + strip-ansi: 7.1.0 + + string.prototype.trim@1.2.10: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + define-data-property: 1.1.4 + define-properties: 1.2.1 + es-abstract: 1.23.7 + es-object-atoms: 1.0.0 + has-property-descriptors: 1.0.2 + + string.prototype.trimend@1.0.9: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + + string.prototype.trimstart@1.0.8: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + + strip-ansi@5.2.0: + dependencies: + ansi-regex: 4.1.1 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-ansi@7.1.0: + dependencies: + ansi-regex: 6.1.0 + + strip-bom@3.0.0: {} + + strip-final-newline@3.0.0: {} + + strip-json-comments@3.1.1: {} + + supports-color@5.5.0: + dependencies: + has-flag: 3.0.0 + + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + + supports-color@8.1.1: + dependencies: + has-flag: 4.0.0 + + supports-preserve-symlinks-flag@1.0.0: {} + + table@5.4.6: + dependencies: + ajv: 6.12.6 + lodash: 4.17.21 + slice-ansi: 2.1.0 + string-width: 3.1.0 + + terser@5.37.0: + dependencies: + '@jridgewell/source-map': 0.3.6 + acorn: 8.14.0 + commander: 2.20.3 + source-map-support: 0.5.21 + + text-table@0.2.0: {} + + through@2.3.8: {} + + tmp@0.0.33: + dependencies: + os-tmpdir: 1.0.2 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tr46@0.0.3: {} + + tsconfig-paths@3.15.0: + dependencies: + '@types/json5': 0.0.29 + json5: 1.0.2 + minimist: 1.2.8 + strip-bom: 3.0.0 + + tslib@1.14.1: {} + + type-check@0.3.2: + dependencies: + prelude-ls: 1.1.2 + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + type-detect@4.1.0: {} + + type-fest@0.20.2: {} + + type-fest@0.21.3: {} + + type-fest@0.8.1: {} + + typed-array-buffer@1.0.3: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + is-typed-array: 1.1.15 + + typed-array-byte-length@1.0.3: + dependencies: + call-bind: 1.0.8 + for-each: 0.3.3 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + + typed-array-byte-offset@1.0.4: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + for-each: 0.3.3 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + reflect.getprototypeof: 1.0.9 + + typed-array-length@1.0.7: + dependencies: + call-bind: 1.0.8 + for-each: 0.3.3 + gopd: 1.2.0 + is-typed-array: 1.1.15 + possible-typed-array-names: 1.0.0 + reflect.getprototypeof: 1.0.9 + + typescript@5.7.2: {} + + unbox-primitive@1.1.0: + dependencies: + call-bound: 1.0.3 + has-bigints: 1.1.0 + has-symbols: 1.1.0 + which-boxed-primitive: 1.1.1 + + undici-types@6.20.0: {} + + unicode-canonical-property-names-ecmascript@2.0.1: {} + + unicode-match-property-ecmascript@2.0.0: + dependencies: + unicode-canonical-property-names-ecmascript: 2.0.1 + unicode-property-aliases-ecmascript: 2.1.0 + + unicode-match-property-value-ecmascript@2.2.0: {} + + unicode-property-aliases-ecmascript@2.1.0: {} + + update-browserslist-db@1.1.1(browserslist@4.24.3): + dependencies: + browserslist: 4.24.3 + escalade: 3.2.0 + picocolors: 1.1.1 + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + v8-compile-cache@2.4.0: {} + + webidl-conversions@3.0.1: {} + + whatwg-url@5.0.0: + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + + which-boxed-primitive@1.1.1: + dependencies: + is-bigint: 1.1.0 + is-boolean-object: 1.2.1 + is-number-object: 1.1.1 + is-string: 1.1.1 + is-symbol: 1.1.1 + + which-builtin-type@1.2.1: + dependencies: + call-bound: 1.0.3 + function.prototype.name: 1.1.8 + has-tostringtag: 1.0.2 + is-async-function: 2.0.0 + is-date-object: 1.1.0 + is-finalizationregistry: 1.1.1 + is-generator-function: 1.0.10 + is-regex: 1.2.1 + is-weakref: 1.1.0 + isarray: 2.0.5 + which-boxed-primitive: 1.1.1 + which-collection: 1.0.2 + which-typed-array: 1.1.18 + + which-collection@1.0.2: + dependencies: + is-map: 2.0.3 + is-set: 2.0.3 + is-weakmap: 2.0.2 + is-weakset: 2.0.4 + + which-typed-array@1.1.18: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.3 + for-each: 0.3.3 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + + which@1.3.1: + dependencies: + isexe: 2.0.0 + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + word-wrap@1.2.5: {} + + workerpool@6.5.1: {} + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrap-ansi@9.0.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + + wrappy@1.0.2: {} + + write@1.0.3: + dependencies: + mkdirp: 0.5.6 + + y18n@5.0.8: {} + + yallist@3.1.1: {} + + yaml@2.6.1: {} + + yargs-parser@20.2.9: {} + + yargs-unparser@2.0.0: + dependencies: + camelcase: 6.3.0 + decamelize: 4.0.0 + flat: 5.0.2 + is-plain-obj: 2.1.0 + + yargs@16.2.0: + dependencies: + cliui: 7.0.4 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + + yocto-queue@0.1.0: {} diff --git a/rollup.config.js b/rollup.config.js index c5cd6e4..95ca04f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,12 +3,12 @@ const { nodeResolve } = require('@rollup/plugin-node-resolve'); const babel = require('@rollup/plugin-babel'); const pkg = require('./package.json'); -const input = ['src/storefront.js']; +const inputFiles = ['src/storefront.js', 'src/resolver.js']; module.exports = [ + // Base UMD config for storefront.js { - // umd - input, + input: 'src/storefront.js', plugins: [ nodeResolve({ browser: true, @@ -34,9 +34,37 @@ module.exports = [ include: ['lib/**'], }, }, + // Additional UMD config for resolver.js { - // esm and cjs - input, + input: 'src/resolver.js', + plugins: [ + nodeResolve({ + browser: true, + modulesOnly: true, + }), + babel({ + babelHelpers: 'bundled', + }), + terser(), + ], + output: [ + { + file: `dist/${pkg.name}/resolver.min.js`, + format: 'umd', + name: '@fleetbase/storefront/resolver', + esModule: false, + exports: 'named', + sourcemap: true, + }, + ], + watch: { + exclude: ['node_modules/**'], + include: ['lib/**'], + }, + }, + // Config for ESM and CJS + { + input: inputFiles, plugins: [ nodeResolve({ browser: true, diff --git a/src/resolver.js b/src/resolver.js index c050b5b..ad338bc 100644 --- a/src/resolver.js +++ b/src/resolver.js @@ -1,7 +1,7 @@ import { Product, Category, Customer, Cart, DeliveryServiceQuote, Store, StoreLocation, StoreHour, Checkout, Review } from './resources'; import { BrowserAdapter, NodeAdapter, pluralize, singularize } from '@fleetbase/sdk'; -const resources = { +export const resources = { Product, Category, Customer, @@ -19,6 +19,14 @@ const adapters = { NodeAdapter, }; +function toStudlyCase(str) { + return str + .split(/[^a-zA-Z0-9]/) // Split by non-alphanumeric characters + .filter(Boolean) // Remove empty elements + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize the first letter of each word + .join(''); // Join the words together without spaces +} + class Resolver { constructor() { this.resources = resources; @@ -29,17 +37,18 @@ class Resolver { lookup(type, className) { const key = pluralize(type); + const classKey = toStudlyCase(className); const params = [...arguments].slice(2); if (!this[key]) { throw new Error('Attempted to resolve invalid type'); } - if (!this[key][className]) { - throw new Error(`No ${singularize(type)} named ${className} to resolve`); + if (!this[key][classKey]) { + throw new Error(`No ${singularize(type)} named ${className} (${classKey}) to resolve`); } - return new this[key][className](...params); + return new this[key][classKey](...params); } } @@ -48,3 +57,5 @@ const lookup = function () { }; export { Resolver, lookup }; + +export default Resolver; diff --git a/src/resources/checkout.js b/src/resources/checkout.js index 1d166f6..3dcbca6 100644 --- a/src/resources/checkout.js +++ b/src/resources/checkout.js @@ -1,6 +1,31 @@ import { Order, StoreActions, isResource } from '@fleetbase/sdk'; import Resource from '../resource'; +const objectToParams = (obj = {}, prefix = null) => { + if (obj === null || obj === undefined) { + return {}; + } + + const parsed = {}; + const keys = Object.keys(obj); + + for (let index = 0; index < keys.length; index++) { + const key = keys[index]; + const value = obj[key]; + + if (key && value) { + if (prefix && typeof prefix === 'string') { + parsed[`${prefix}[${key}]`] = value; + continue; + } + + parsed[key] = value; + } + } + + return parsed; +}; + const checkoutActions = new StoreActions({ create: undefined, findAll: undefined, @@ -30,6 +55,30 @@ const checkoutActions = new StoreActions({ captureOrder: function (token, transactionDetails = {}, options = {}) { return this.adapter.post(`${this.namespace}/capture`, { token, transactionDetails }, options).then((orderJson) => new Order(orderJson)); }, + + createStripeSetupIntent: function (customer, options = {}) { + if (isResource(customer)) { + customer = customer.id; + } + + return this.adapter.post(`${this.namespace}/stripe-setup-intent`, { customer }, options); + }, + + updateStripePaymentIntent: function (paymentIntent, customer, cart, serviceQuote, orderOptions = {}, options = {}) { + if (isResource(customer)) { + customer = customer.id; + } + + if (isResource(cart)) { + cart = cart.id; + } + + if (isResource(serviceQuote)) { + serviceQuote = serviceQuote.id; + } + + return this.adapter.put(`${this.namespace}/stripe-update-payment-intent`, { paymentIntent, customer, cart, serviceQuote, ...orderOptions }, options); + }, }); export default class Checkout extends Resource { diff --git a/src/resources/customer.js b/src/resources/customer.js index e7d63de..5880287 100644 --- a/src/resources/customer.js +++ b/src/resources/customer.js @@ -103,6 +103,18 @@ export default class Customer extends Resource { throw new Error('Failed to retrieve order history'); } } + + getStripeEphemeralKey(params = {}) { + return this.adapter + .setHeaders({ 'Customer-Token': this.token }) + .post('customers/stripe-ephemeral-key', params); + } + + getStripeSetupIntent(params = {}) { + return this.adapter + .setHeaders({ 'Customer-Token': this.token }) + .post('customers/stripe-setup-intent', params); + } } export { customerActions }; diff --git a/src/storefront.js b/src/storefront.js index 4d3cad7..6f48f6c 100644 --- a/src/storefront.js +++ b/src/storefront.js @@ -1,5 +1,6 @@ import StorefrontStore from './store'; import { detectAdapter, isKeyValid } from './utils'; +import { lookup } from './resolver'; import { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network } from './resources'; import { cartActions } from './resources/cart'; import { customerActions } from './resources/customer'; @@ -51,6 +52,11 @@ export default class Storefront { return this.adapter.get('about'); } + /** lookup a specific store or network provided the ID */ + lookup(id) { + return this.adapter.get(`lookup/${id}`); + } + /** search products in store or network */ search(query, options = {}) { return this.adapter.get('search', { query, ...options }).then((products) => { @@ -71,4 +77,4 @@ export default class Storefront { } } -export { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network }; +export { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Review, Network, lookup };