UNPKG

headless-react-datepicker

Version:

A headless, highly customizable, multi-calendar date picker component for React. It supports various calendars and locales.

1 lines 206 kB
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{createContext as r,useMemo as n,useState as i,useCallback as o,useEffect as a,useContext as s,useRef as l}from"react";var c=function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};function d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function h(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;class u extends Array{constructor(e,t){if(super(e),this.sign=t,Object.setPrototypeOf(this,u.prototype),e>u.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded")}static BigInt(e){var t=Math.floor,r=Number.isFinite;if("number"==typeof e){if(0===e)return u.__zero();if(u.__isOneDigitInt(e))return 0>e?u.__oneDigit(-e,!0):u.__oneDigit(e,!1);if(!r(e)||t(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return u.__fromDouble(e)}if("string"==typeof e){const t=u.__fromString(e);if(null===t)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return t}if("boolean"==typeof e)return!0===e?u.__oneDigit(1,!1):u.__zero();if("object"==typeof e){if(e.constructor===u)return e;const t=u.__toPrimitive(e);return u.BigInt(t)}throw new TypeError("Cannot convert "+e+" to a BigInt")}toDebugString(){const e=["BigInt["];for(const t of this)e.push((t?(t>>>0).toString(16):t)+", ");return e.push("]"),e.join("")}toString(e=10){if(2>e||36<e)throw new RangeError("toString() radix argument must be between 2 and 36");return 0===this.length?"0":e&e-1?u.__toStringGeneric(this,e,!1):u.__toStringBasePowerOfTwo(this,e)}valueOf(){throw new Error("Convert JSBI instances to native numbers using `toNumber`.")}static toNumber(e){const t=e.length;if(0===t)return 0;if(1===t){const t=e.__unsignedDigit(0);return e.sign?-t:t}const r=e.__digit(t-1),n=u.__clz30(r),i=30*t-n;if(1024<i)return e.sign?-1/0:1/0;let o=i-1,a=r,s=t-1;const l=n+3;let c=32===l?0:a<<l;c>>>=12;const d=l-12;let h=12<=l?0:a<<20+l,m=20+l;for(0<d&&0<s&&(s--,a=e.__digit(s),c|=a>>>30-d,h=a<<d+2,m=d+2);0<m&&0<s;)s--,a=e.__digit(s),h|=30<=m?a<<m-30:a>>>30-m,m-=30;const f=u.__decideRounding(e,m,s,a);if((1===f||0===f&&!(1&~h))&&(h=h+1>>>0,0===h&&(c++,0!=c>>>20&&(c=0,o++,1023<o))))return e.sign?-1/0:1/0;const y=e.sign?-2147483648:0;return o=o+1023<<20,u.__kBitConversionInts[u.__kBitConversionIntHigh]=y|o|c,u.__kBitConversionInts[u.__kBitConversionIntLow]=h,u.__kBitConversionDouble[0]}static unaryMinus(e){if(0===e.length)return e;const t=e.__copy();return t.sign=!e.sign,t}static bitwiseNot(e){return e.sign?u.__absoluteSubOne(e).__trim():u.__absoluteAddOne(e,!0)}static exponentiate(e,t){if(t.sign)throw new RangeError("Exponent must be positive");if(0===t.length)return u.__oneDigit(1,!1);if(0===e.length)return e;if(1===e.length&&1===e.__digit(0))return!e.sign||1&t.__digit(0)?e:u.unaryMinus(e);if(1<t.length)throw new RangeError("BigInt too big");let r=t.__unsignedDigit(0);if(1===r)return e;if(r>=u.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===e.length&&2===e.__digit(0)){const t=1+(0|r/30),n=e.sign&&!!(1&r),i=new u(t,n);i.__initializeDigits();const o=1<<r%30;return i.__setDigit(t-1,o),i}let n=null,i=e;for(!!(1&r)&&(n=e),r>>=1;0!==r;r>>=1)i=u.multiply(i,i),1&r&&(n=null===n?i:u.multiply(n,i));return n}static multiply(e,t){if(0===e.length)return e;if(0===t.length)return t;let r=e.length+t.length;30<=e.__clzmsd()+t.__clzmsd()&&r--;const n=new u(r,e.sign!==t.sign);n.__initializeDigits();for(let r=0;r<e.length;r++)u.__multiplyAccumulate(t,e.__digit(r),n,r);return n.__trim()}static divide(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>u.__absoluteCompare(e,t))return u.__zero();const r=e.sign!==t.sign,n=t.__unsignedDigit(0);let i;if(1===t.length&&32767>=n){if(1===n)return r===e.sign?e:u.unaryMinus(e);i=u.__absoluteDivSmall(e,n,null)}else i=u.__absoluteDivLarge(e,t,!0,!1);return i.sign=r,i.__trim()}static remainder(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>u.__absoluteCompare(e,t))return e;const r=t.__unsignedDigit(0);if(1===t.length&&32767>=r){if(1===r)return u.__zero();const t=u.__absoluteModSmall(e,r);return 0===t?u.__zero():u.__oneDigit(t,e.sign)}const n=u.__absoluteDivLarge(e,t,!1,!0);return n.sign=e.sign,n.__trim()}static add(e,t){const r=e.sign;return r===t.sign?u.__absoluteAdd(e,t,r):0<=u.__absoluteCompare(e,t)?u.__absoluteSub(e,t,r):u.__absoluteSub(t,e,!r)}static subtract(e,t){const r=e.sign;return r===t.sign?0<=u.__absoluteCompare(e,t)?u.__absoluteSub(e,t,r):u.__absoluteSub(t,e,!r):u.__absoluteAdd(e,t,r)}static leftShift(e,t){return 0===t.length||0===e.length?e:t.sign?u.__rightShiftByAbsolute(e,t):u.__leftShiftByAbsolute(e,t)}static signedRightShift(e,t){return 0===t.length||0===e.length?e:t.sign?u.__leftShiftByAbsolute(e,t):u.__rightShiftByAbsolute(e,t)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(e,t){return 0>u.__compareToBigInt(e,t)}static lessThanOrEqual(e,t){return 0>=u.__compareToBigInt(e,t)}static greaterThan(e,t){return 0<u.__compareToBigInt(e,t)}static greaterThanOrEqual(e,t){return 0<=u.__compareToBigInt(e,t)}static equal(e,t){if(e.sign!==t.sign)return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e.__digit(r)!==t.__digit(r))return!1;return!0}static notEqual(e,t){return!u.equal(e,t)}static bitwiseAnd(e,t){var r=Math.max;if(!e.sign&&!t.sign)return u.__absoluteAnd(e,t).__trim();if(e.sign&&t.sign){const n=r(e.length,t.length)+1;let i=u.__absoluteSubOne(e,n);const o=u.__absoluteSubOne(t);return i=u.__absoluteOr(i,o,i),u.__absoluteAddOne(i,!0,i).__trim()}return e.sign&&([e,t]=[t,e]),u.__absoluteAndNot(e,u.__absoluteSubOne(t)).__trim()}static bitwiseXor(e,t){var r=Math.max;if(!e.sign&&!t.sign)return u.__absoluteXor(e,t).__trim();if(e.sign&&t.sign){const n=r(e.length,t.length),i=u.__absoluteSubOne(e,n),o=u.__absoluteSubOne(t);return u.__absoluteXor(i,o,i).__trim()}const n=r(e.length,t.length)+1;e.sign&&([e,t]=[t,e]);let i=u.__absoluteSubOne(t,n);return i=u.__absoluteXor(i,e,i),u.__absoluteAddOne(i,!0,i).__trim()}static bitwiseOr(e,t){const r=(0,Math.max)(e.length,t.length);if(!e.sign&&!t.sign)return u.__absoluteOr(e,t).__trim();if(e.sign&&t.sign){let n=u.__absoluteSubOne(e,r);const i=u.__absoluteSubOne(t);return n=u.__absoluteAnd(n,i,n),u.__absoluteAddOne(n,!0,n).__trim()}e.sign&&([e,t]=[t,e]);let n=u.__absoluteSubOne(t,r);return n=u.__absoluteAndNot(n,e,n),u.__absoluteAddOne(n,!0,n).__trim()}static asIntN(e,t){var r=Math.floor;if(0===t.length)return t;if(0>(e=r(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return u.__zero();if(e>=u.__kMaxLengthBits)return t;const n=0|(e+29)/30;if(t.length<n)return t;const i=t.__unsignedDigit(n-1),o=1<<(e-1)%30;if(t.length===n&&i<o)return t;if((i&o)!==o)return u.__truncateToNBits(e,t);if(!t.sign)return u.__truncateAndSubFromPowerOfTwo(e,t,!0);if(!(i&o-1)){for(let r=n-2;0<=r;r--)if(0!==t.__digit(r))return u.__truncateAndSubFromPowerOfTwo(e,t,!1);return t.length===n&&i===o?t:u.__truncateToNBits(e,t)}return u.__truncateAndSubFromPowerOfTwo(e,t,!1)}static asUintN(e,t){var r=Math.floor;if(0===t.length)return t;if(0>(e=r(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return u.__zero();if(t.sign){if(e>u.__kMaxLengthBits)throw new RangeError("BigInt too big");return u.__truncateAndSubFromPowerOfTwo(e,t,!1)}if(e>=u.__kMaxLengthBits)return t;const n=0|(e+29)/30;if(t.length<n)return t;const i=e%30;if(t.length==n){if(0===i)return t;if(0==t.__digit(n-1)>>>i)return t}return u.__truncateToNBits(e,t)}static ADD(e,t){if(e=u.__toPrimitive(e),t=u.__toPrimitive(t),"string"==typeof e)return"string"!=typeof t&&(t=t.toString()),e+t;if("string"==typeof t)return e.toString()+t;if(e=u.__toNumeric(e),t=u.__toNumeric(t),u.__isBigInt(e)&&u.__isBigInt(t))return u.add(e,t);if("number"==typeof e&&"number"==typeof t)return e+t;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(e,t){return u.__compare(e,t,0)}static LE(e,t){return u.__compare(e,t,1)}static GT(e,t){return u.__compare(e,t,2)}static GE(e,t){return u.__compare(e,t,3)}static EQ(e,t){for(;;){if(u.__isBigInt(e))return u.__isBigInt(t)?u.equal(e,t):u.EQ(t,e);if("number"==typeof e){if(u.__isBigInt(t))return u.__equalToNumber(t,e);if("object"!=typeof t)return e==t;t=u.__toPrimitive(t)}else if("string"==typeof e){if(u.__isBigInt(t))return null!==(e=u.__fromString(e))&&u.equal(e,t);if("object"!=typeof t)return e==t;t=u.__toPrimitive(t)}else if("boolean"==typeof e){if(u.__isBigInt(t))return u.__equalToNumber(t,+e);if("object"!=typeof t)return e==t;t=u.__toPrimitive(t)}else if("symbol"==typeof e){if(u.__isBigInt(t))return!1;if("object"!=typeof t)return e==t;t=u.__toPrimitive(t)}else{if("object"!=typeof e)return e==t;if("object"==typeof t&&t.constructor!==u)return e==t;e=u.__toPrimitive(e)}}}static NE(e,t){return!u.EQ(e,t)}static DataViewGetBigInt64(e,t,r=!1){return u.asIntN(64,u.DataViewGetBigUint64(e,t,r))}static DataViewGetBigUint64(e,t,r=!1){const[n,i]=r?[4,0]:[0,4],o=e.getUint32(t+n,r),a=e.getUint32(t+i,r),s=new u(3,!1);return s.__setDigit(0,1073741823&a),s.__setDigit(1,(268435455&o)<<2|a>>>30),s.__setDigit(2,o>>>28),s.__trim()}static DataViewSetBigInt64(e,t,r,n=!1){u.DataViewSetBigUint64(e,t,r,n)}static DataViewSetBigUint64(e,t,r,n=!1){let i=0,o=0;if(0<(r=u.asUintN(64,r)).length&&(o=r.__digit(0),1<r.length)){const e=r.__digit(1);o|=e<<30,i=e>>>2,2<r.length&&(i|=r.__digit(2)<<28)}const[a,s]=n?[4,0]:[0,4];e.setUint32(t+a,i,n),e.setUint32(t+s,o,n)}static __zero(){return new u(0,!1)}static __oneDigit(e,t){const r=new u(1,t);return r.__setDigit(0,e),r}__copy(){const e=new u(this.length,this.sign);for(let t=0;t<this.length;t++)e[t]=this[t];return e}__trim(){let e=this.length,t=this[e-1];for(;0===t;)e--,t=this[e-1],this.pop();return 0===e&&(this.sign=!1),this}__initializeDigits(){for(let e=0;e<this.length;e++)this[e]=0}static __decideRounding(e,t,r,n){if(0<t)return-1;let i;if(0>t)i=-t-1;else{if(0===r)return-1;r--,n=e.__digit(r),i=29}let o=1<<i;if(0==(n&o))return-1;if(o-=1,0!=(n&o))return 1;for(;0<r;)if(r--,0!==e.__digit(r))return 1;return 0}static __fromDouble(e){u.__kBitConversionDouble[0]=e;const t=(2047&u.__kBitConversionInts[u.__kBitConversionIntHigh]>>>20)-1023,r=1+(0|t/30),n=new u(r,0>e);let i=1048575&u.__kBitConversionInts[u.__kBitConversionIntHigh]|1048576,o=u.__kBitConversionInts[u.__kBitConversionIntLow];const a=t%30;let s,l=0;if(a<20){const e=20-a;l=e+32,s=i>>>e,i=i<<32-e|o>>>e,o<<=32-e}else if(20===a)l=32,s=i,i=o,o=0;else{const e=a-20;l=32-e,s=i<<e|o>>>32-e,i=o<<e,o=0}n.__setDigit(r-1,s);for(let e=r-2;0<=e;e--)0<l?(l-=30,s=i>>>2,i=i<<30|o>>>2,o<<=30):s=0,n.__setDigit(e,s);return n.__trim()}static __isWhitespace(e){return!!(13>=e&&9<=e)||(159>=e?32==e:131071>=e?160==e||5760==e:196607>=e?10>=(e&=131071)||40==e||41==e||47==e||95==e||4096==e:65279==e)}static __fromString(e,t=0){let r=0;const n=e.length;let i=0;if(i===n)return u.__zero();let o=e.charCodeAt(i);for(;u.__isWhitespace(o);){if(++i===n)return u.__zero();o=e.charCodeAt(i)}if(43===o){if(++i===n)return null;o=e.charCodeAt(i),r=1}else if(45===o){if(++i===n)return null;o=e.charCodeAt(i),r=-1}if(0===t){if(t=10,48===o){if(++i===n)return u.__zero();if(o=e.charCodeAt(i),88===o||120===o){if(t=16,++i===n)return null;o=e.charCodeAt(i)}else if(79===o||111===o){if(t=8,++i===n)return null;o=e.charCodeAt(i)}else if(66===o||98===o){if(t=2,++i===n)return null;o=e.charCodeAt(i)}}}else if(16===t&&48===o){if(++i===n)return u.__zero();if(o=e.charCodeAt(i),88===o||120===o){if(++i===n)return null;o=e.charCodeAt(i)}}if(0!=r&&10!==t)return null;for(;48===o;){if(++i===n)return u.__zero();o=e.charCodeAt(i)}const a=n-i;let s=u.__kMaxBitsPerChar[t],l=u.__kBitsPerCharTableMultiplier-1;if(a>1073741824/s)return null;const c=s*a+l>>>u.__kBitsPerCharTableShift,d=new u(0|(c+29)/30,!1),h=10>t?t:10,m=10<t?t-10:0;if(t&t-1){d.__initializeDigits();let r=!1,a=0;do{let c=0,f=1;for(;;){let s;if(o-48>>>0<h)s=o-48;else{if(!((32|o)-97>>>0<m)){r=!0;break}s=(32|o)-87}const l=f*t;if(1073741823<l)break;if(f=l,c=c*t+s,a++,++i===n){r=!0;break}o=e.charCodeAt(i)}l=30*u.__kBitsPerCharTableMultiplier-1;const y=0|(s*a+l>>>u.__kBitsPerCharTableShift)/30;d.__inplaceMultiplyAdd(f,c,y)}while(!r)}else{s>>=u.__kBitsPerCharTableShift;const t=[],r=[];let a=!1;do{let l=0,c=0;for(;;){let t;if(o-48>>>0<h)t=o-48;else{if(!((32|o)-97>>>0<m)){a=!0;break}t=(32|o)-87}if(c+=s,l=l<<s|t,++i===n){a=!0;break}if(o=e.charCodeAt(i),30<c+s)break}t.push(l),r.push(c)}while(!a);u.__fillFromParts(d,t,r)}if(i!==n){if(!u.__isWhitespace(o))return null;for(i++;i<n;i++)if(o=e.charCodeAt(i),!u.__isWhitespace(o))return null}return d.sign=-1==r,d.__trim()}static __fillFromParts(e,t,r){let n=0,i=0,o=0;for(let a=t.length-1;0<=a;a--){const s=t[a],l=r[a];i|=s<<o,o+=l,30===o?(e.__setDigit(n++,i),o=0,i=0):30<o&&(e.__setDigit(n++,1073741823&i),o-=30,i=s>>>l-o)}if(0!==i){if(n>=e.length)throw new Error("implementation bug");e.__setDigit(n++,i)}for(;n<e.length;n++)e.__setDigit(n,0)}static __toStringBasePowerOfTwo(e,t){const r=e.length;let n=t-1;n=(85&n>>>1)+(85&n),n=(51&n>>>2)+(51&n),n=(15&n>>>4)+(15&n);const i=n,o=t-1,a=e.__digit(r-1);let s=0|(30*r-u.__clz30(a)+i-1)/i;if(e.sign&&s++,268435456<s)throw new Error("string too long");const l=Array(s);let c=s-1,d=0,h=0;for(let t=0;t<r-1;t++){const r=e.__digit(t),n=(d|r<<h)&o;l[c--]=u.__kConversionChars[n];const a=i-h;for(d=r>>>a,h=30-a;h>=i;)l[c--]=u.__kConversionChars[d&o],d>>>=i,h-=i}const m=(d|a<<h)&o;for(l[c--]=u.__kConversionChars[m],d=a>>>i-h;0!==d;)l[c--]=u.__kConversionChars[d&o],d>>>=i;if(e.sign&&(l[c--]="-"),-1!=c)throw new Error("implementation bug");return l.join("")}static __toStringGeneric(e,t,r){const n=e.length;if(0===n)return"";if(1===n){let n=e.__unsignedDigit(0).toString(t);return!1===r&&e.sign&&(n="-"+n),n}const i=30*n-u.__clz30(e.__digit(n-1)),o=u.__kMaxBitsPerChar[t]-1;let a=i*u.__kBitsPerCharTableMultiplier;a+=o-1,a=0|a/o;const s=a+1>>1,l=u.exponentiate(u.__oneDigit(t,!1),u.__oneDigit(s,!1));let c,d;const h=l.__unsignedDigit(0);if(1===l.length&&32767>=h){c=new u(e.length,!1),c.__initializeDigits();let r=0;for(let t=2*e.length-1;0<=t;t--){const n=r<<15|e.__halfDigit(t);c.__setHalfDigit(t,0|n/h),r=0|n%h}d=r.toString(t)}else{const r=u.__absoluteDivLarge(e,l,!0,!0);c=r.quotient;const n=r.remainder.__trim();d=u.__toStringGeneric(n,t,!0)}c.__trim();let m=u.__toStringGeneric(c,t,!0);for(;d.length<s;)d="0"+d;return!1===r&&e.sign&&(m="-"+m),m+d}static __unequalSign(e){return e?-1:1}static __absoluteGreater(e){return e?-1:1}static __absoluteLess(e){return e?1:-1}static __compareToBigInt(e,t){const r=e.sign;if(r!==t.sign)return u.__unequalSign(r);const n=u.__absoluteCompare(e,t);return 0<n?u.__absoluteGreater(r):0>n?u.__absoluteLess(r):0}static __compareToNumber(e,t){if(u.__isOneDigitInt(t)){const r=e.sign,n=0>t;if(r!==n)return u.__unequalSign(r);if(0===e.length){if(n)throw new Error("implementation bug");return 0===t?0:-1}if(1<e.length)return u.__absoluteGreater(r);const i=Math.abs(t),o=e.__unsignedDigit(0);return o>i?u.__absoluteGreater(r):o<i?u.__absoluteLess(r):0}return u.__compareToDouble(e,t)}static __compareToDouble(e,t){if(t!=t)return t;if(t===1/0)return-1;if(t===-1/0)return 1;const r=e.sign;if(r!==0>t)return u.__unequalSign(r);if(0===t)throw new Error("implementation bug: should be handled elsewhere");if(0===e.length)return-1;u.__kBitConversionDouble[0]=t;const n=2047&u.__kBitConversionInts[u.__kBitConversionIntHigh]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");const i=n-1023;if(0>i)return u.__absoluteGreater(r);const o=e.length;let a=e.__digit(o-1);const s=u.__clz30(a),l=30*o-s,c=i+1;if(l<c)return u.__absoluteLess(r);if(l>c)return u.__absoluteGreater(r);let d=1048576|1048575&u.__kBitConversionInts[u.__kBitConversionIntHigh],h=u.__kBitConversionInts[u.__kBitConversionIntLow];const m=29-s;if(m!==(0|(l-1)%30))throw new Error("implementation bug");let f,y=0;if(20>m){const e=20-m;y=e+32,f=d>>>e,d=d<<32-e|h>>>e,h<<=32-e}else if(20===m)y=32,f=d,d=h,h=0;else{const e=m-20;y=32-e,f=d<<e|h>>>32-e,d=h<<e,h=0}if(a>>>=0,f>>>=0,a>f)return u.__absoluteGreater(r);if(a<f)return u.__absoluteLess(r);for(let t=o-2;0<=t;t--){0<y?(y-=30,f=d>>>2,d=d<<30|h>>>2,h<<=30):f=0;const n=e.__unsignedDigit(t);if(n>f)return u.__absoluteGreater(r);if(n<f)return u.__absoluteLess(r)}if(0!==d||0!==h){if(0===y)throw new Error("implementation bug");return u.__absoluteLess(r)}return 0}static __equalToNumber(e,t){var r=Math.abs;return u.__isOneDigitInt(t)?0===t?0===e.length:1===e.length&&e.sign===0>t&&e.__unsignedDigit(0)===r(t):0===u.__compareToDouble(e,t)}static __comparisonResultToBool(e,t){return 0===t?0>e:1===t?0>=e:2===t?0<e:3===t?0<=e:void 0}static __compare(e,t,r){if(e=u.__toPrimitive(e),t=u.__toPrimitive(t),"string"==typeof e&&"string"==typeof t)switch(r){case 0:return e<t;case 1:return e<=t;case 2:return e>t;case 3:return e>=t}if(u.__isBigInt(e)&&"string"==typeof t)return null!==(t=u.__fromString(t))&&u.__comparisonResultToBool(u.__compareToBigInt(e,t),r);if("string"==typeof e&&u.__isBigInt(t))return null!==(e=u.__fromString(e))&&u.__comparisonResultToBool(u.__compareToBigInt(e,t),r);if(e=u.__toNumeric(e),t=u.__toNumeric(t),u.__isBigInt(e)){if(u.__isBigInt(t))return u.__comparisonResultToBool(u.__compareToBigInt(e,t),r);if("number"!=typeof t)throw new Error("implementation bug");return u.__comparisonResultToBool(u.__compareToNumber(e,t),r)}if("number"!=typeof e)throw new Error("implementation bug");if(u.__isBigInt(t))return u.__comparisonResultToBool(u.__compareToNumber(t,e),2^r);if("number"!=typeof t)throw new Error("implementation bug");return 0===r?e<t:1===r?e<=t:2===r?e>t:3===r?e>=t:void 0}__clzmsd(){return u.__clz30(this.__digit(this.length-1))}static __absoluteAdd(e,t,r){if(e.length<t.length)return u.__absoluteAdd(t,e,r);if(0===e.length)return e;if(0===t.length)return e.sign===r?e:u.unaryMinus(e);let n=e.length;(0===e.__clzmsd()||t.length===e.length&&0===t.__clzmsd())&&n++;const i=new u(n,r);let o=0,a=0;for(;a<t.length;a++){const r=e.__digit(a)+t.__digit(a)+o;o=r>>>30,i.__setDigit(a,1073741823&r)}for(;a<e.length;a++){const t=e.__digit(a)+o;o=t>>>30,i.__setDigit(a,1073741823&t)}return a<i.length&&i.__setDigit(a,o),i.__trim()}static __absoluteSub(e,t,r){if(0===e.length)return e;if(0===t.length)return e.sign===r?e:u.unaryMinus(e);const n=new u(e.length,r);let i=0,o=0;for(;o<t.length;o++){const r=e.__digit(o)-t.__digit(o)-i;i=1&r>>>30,n.__setDigit(o,1073741823&r)}for(;o<e.length;o++){const t=e.__digit(o)-i;i=1&t>>>30,n.__setDigit(o,1073741823&t)}return n.__trim()}static __absoluteAddOne(e,t,r=null){const n=e.length;null===r?r=new u(n,t):r.sign=t;let i=1;for(let t=0;t<n;t++){const n=e.__digit(t)+i;i=n>>>30,r.__setDigit(t,1073741823&n)}return 0!=i&&r.__setDigitGrow(n,1),r}static __absoluteSubOne(e,t){const r=e.length,n=new u(t=t||r,!1);let i=1;for(let t=0;t<r;t++){const r=e.__digit(t)-i;i=1&r>>>30,n.__setDigit(t,1073741823&r)}if(0!=i)throw new Error("implementation bug");for(let e=r;e<t;e++)n.__setDigit(e,0);return n}static __absoluteAnd(e,t,r=null){let n=e.length,i=t.length,o=i;if(n<i){o=n;const r=e,a=n;e=t,n=i,t=r,i=a}let a=o;null===r?r=new u(a,!1):a=r.length;let s=0;for(;s<o;s++)r.__setDigit(s,e.__digit(s)&t.__digit(s));for(;s<a;s++)r.__setDigit(s,0);return r}static __absoluteAndNot(e,t,r=null){const n=e.length,i=t.length;let o=i;n<i&&(o=n);let a=n;null===r?r=new u(a,!1):a=r.length;let s=0;for(;s<o;s++)r.__setDigit(s,e.__digit(s)&~t.__digit(s));for(;s<n;s++)r.__setDigit(s,e.__digit(s));for(;s<a;s++)r.__setDigit(s,0);return r}static __absoluteOr(e,t,r=null){let n=e.length,i=t.length,o=i;if(n<i){o=n;const r=e,a=n;e=t,n=i,t=r,i=a}let a=n;null===r?r=new u(a,!1):a=r.length;let s=0;for(;s<o;s++)r.__setDigit(s,e.__digit(s)|t.__digit(s));for(;s<n;s++)r.__setDigit(s,e.__digit(s));for(;s<a;s++)r.__setDigit(s,0);return r}static __absoluteXor(e,t,r=null){let n=e.length,i=t.length,o=i;if(n<i){o=n;const r=e,a=n;e=t,n=i,t=r,i=a}let a=n;null===r?r=new u(a,!1):a=r.length;let s=0;for(;s<o;s++)r.__setDigit(s,e.__digit(s)^t.__digit(s));for(;s<n;s++)r.__setDigit(s,e.__digit(s));for(;s<a;s++)r.__setDigit(s,0);return r}static __absoluteCompare(e,t){const r=e.length-t.length;if(0!=r)return r;let n=e.length-1;for(;0<=n&&e.__digit(n)===t.__digit(n);)n--;return 0>n?0:e.__unsignedDigit(n)>t.__unsignedDigit(n)?1:-1}static __multiplyAccumulate(e,t,r,n){if(0===t)return;const i=32767&t,o=t>>>15;let a=0,s=0;for(let t,l=0;l<e.length;l++,n++){t=r.__digit(n);const c=e.__digit(l),d=32767&c,h=c>>>15,m=u.__imul(d,i),f=u.__imul(d,o),y=u.__imul(h,i);t+=s+m+a,a=t>>>30,t&=1073741823,t+=((32767&f)<<15)+((32767&y)<<15),a+=t>>>30,s=u.__imul(h,o)+(f>>>15)+(y>>>15),r.__setDigit(n,1073741823&t)}for(;0!=a||0!==s;n++){let e=r.__digit(n);e+=a+s,s=0,a=e>>>30,r.__setDigit(n,1073741823&e)}}static __internalMultiplyAdd(e,t,r,n,i){let o=r,a=0;for(let r=0;r<n;r++){const n=e.__digit(r),s=u.__imul(32767&n,t),l=u.__imul(n>>>15,t),c=s+((32767&l)<<15)+a+o;o=c>>>30,a=l>>>15,i.__setDigit(r,1073741823&c)}if(i.length>n)for(i.__setDigit(n++,o+a);n<i.length;)i.__setDigit(n++,0);else if(0!==o+a)throw new Error("implementation bug")}__inplaceMultiplyAdd(e,t,r){r>this.length&&(r=this.length);const n=32767&e,i=e>>>15;let o=0,a=t;for(let e=0;e<r;e++){const t=this.__digit(e),r=32767&t,s=t>>>15,l=u.__imul(r,n),c=u.__imul(r,i),d=u.__imul(s,n);let h=a+l+o;o=h>>>30,h&=1073741823,h+=((32767&c)<<15)+((32767&d)<<15),o+=h>>>30,a=u.__imul(s,i)+(c>>>15)+(d>>>15),this.__setDigit(e,1073741823&h)}if(0!=o||0!==a)throw new Error("implementation bug")}static __absoluteDivSmall(e,t,r=null){null===r&&(r=new u(e.length,!1));let n=0;for(let i,o=2*e.length-1;0<=o;o-=2){i=(n<<15|e.__halfDigit(o))>>>0;const a=0|i/t;n=0|i%t,i=(n<<15|e.__halfDigit(o-1))>>>0;const s=0|i/t;n=0|i%t,r.__setDigit(o>>>1,a<<15|s)}return r}static __absoluteModSmall(e,t){let r=0;for(let n=2*e.length-1;0<=n;n--){r=0|((r<<15|e.__halfDigit(n))>>>0)%t}return r}static __absoluteDivLarge(e,t,r,n){const i=t.__halfDigitLength(),o=t.length,a=e.__halfDigitLength()-i;let s=null;r&&(s=new u(a+2>>>1,!1),s.__initializeDigits());const l=new u(i+2>>>1,!1);l.__initializeDigits();const c=u.__clz15(t.__halfDigit(i-1));0<c&&(t=u.__specialLeftShift(t,c,0));const d=u.__specialLeftShift(e,c,1),h=t.__halfDigit(i-1);let m=0;for(let e,n=a;0<=n;n--){e=32767;const a=d.__halfDigit(n+i);if(a!==h){const r=(a<<15|d.__halfDigit(n+i-1))>>>0;e=0|r/h;let o=0|r%h;const s=t.__halfDigit(i-2),l=d.__halfDigit(n+i-2);for(;u.__imul(e,s)>>>0>(o<<16|l)>>>0&&(e--,o+=h,!(32767<o)););}u.__internalMultiplyAdd(t,e,0,o,l);let c=d.__inplaceSub(l,n,i+1);0!==c&&(c=d.__inplaceAdd(t,n,i),d.__setHalfDigit(n+i,32767&d.__halfDigit(n+i)+c),e--),r&&(1&n?m=e<<15:s.__setDigit(n>>>1,m|e))}if(n)return d.__inplaceRightShift(c),r?{quotient:s,remainder:d}:d;if(r)return s;throw new Error("unreachable")}static __clz15(e){return u.__clz30(e)-15}__inplaceAdd(e,t,r){let n=0;for(let i=0;i<r;i++){const r=this.__halfDigit(t+i)+e.__halfDigit(i)+n;n=r>>>15,this.__setHalfDigit(t+i,32767&r)}return n}__inplaceSub(e,t,r){let n=0;if(1&t){t>>=1;let i=this.__digit(t),o=32767&i,a=0;for(;a<r-1>>>1;a++){const r=e.__digit(a),s=(i>>>15)-(32767&r)-n;n=1&s>>>15,this.__setDigit(t+a,(32767&s)<<15|32767&o),i=this.__digit(t+a+1),o=(32767&i)-(r>>>15)-n,n=1&o>>>15}const s=e.__digit(a),l=(i>>>15)-(32767&s)-n;if(n=1&l>>>15,this.__setDigit(t+a,(32767&l)<<15|32767&o),t+a+1>=this.length)throw new RangeError("out of bounds");!(1&r)&&(i=this.__digit(t+a+1),o=(32767&i)-(s>>>15)-n,n=1&o>>>15,this.__setDigit(t+e.length,1073709056&i|32767&o))}else{t>>=1;let i=0;for(;i<e.length-1;i++){const r=this.__digit(t+i),o=e.__digit(i),a=(32767&r)-(32767&o)-n;n=1&a>>>15;const s=(r>>>15)-(o>>>15)-n;n=1&s>>>15,this.__setDigit(t+i,(32767&s)<<15|32767&a)}const o=this.__digit(t+i),a=e.__digit(i),s=(32767&o)-(32767&a)-n;n=1&s>>>15;let l=0;!(1&r)&&(l=(o>>>15)-(a>>>15)-n,n=1&l>>>15),this.__setDigit(t+i,(32767&l)<<15|32767&s)}return n}__inplaceRightShift(e){if(0===e)return;let t=this.__digit(0)>>>e;const r=this.length-1;for(let n=0;n<r;n++){const r=this.__digit(n+1);this.__setDigit(n,1073741823&r<<30-e|t),t=r>>>e}this.__setDigit(r,t)}static __specialLeftShift(e,t,r){const n=e.length,i=new u(n+r,!1);if(0===t){for(let t=0;t<n;t++)i.__setDigit(t,e.__digit(t));return 0<r&&i.__setDigit(n,0),i}let o=0;for(let r=0;r<n;r++){const n=e.__digit(r);i.__setDigit(r,1073741823&n<<t|o),o=n>>>30-t}return 0<r&&i.__setDigit(n,o),i}static __leftShiftByAbsolute(e,t){const r=u.__toShiftAmount(t);if(0>r)throw new RangeError("BigInt too big");const n=0|r/30,i=r%30,o=e.length,a=0!==i&&0!=e.__digit(o-1)>>>30-i,s=o+n+(a?1:0),l=new u(s,e.sign);if(0===i){let t=0;for(;t<n;t++)l.__setDigit(t,0);for(;t<s;t++)l.__setDigit(t,e.__digit(t-n))}else{let t=0;for(let e=0;e<n;e++)l.__setDigit(e,0);for(let r=0;r<o;r++){const o=e.__digit(r);l.__setDigit(r+n,1073741823&o<<i|t),t=o>>>30-i}if(a)l.__setDigit(o+n,t);else if(0!==t)throw new Error("implementation bug")}return l.__trim()}static __rightShiftByAbsolute(e,t){const r=e.length,n=e.sign,i=u.__toShiftAmount(t);if(0>i)return u.__rightShiftByMaximum(n);const o=0|i/30,a=i%30;let s=r-o;if(0>=s)return u.__rightShiftByMaximum(n);let l=!1;if(n)if(e.__digit(o)&(1<<a)-1)l=!0;else for(let t=0;t<o;t++)if(0!==e.__digit(t)){l=!0;break}if(l&&0===a){0==~e.__digit(r-1)&&s++}let c=new u(s,n);if(0===a){c.__setDigit(s-1,0);for(let t=o;t<r;t++)c.__setDigit(t-o,e.__digit(t))}else{let t=e.__digit(o)>>>a;const n=r-o-1;for(let r=0;r<n;r++){const n=e.__digit(r+o+1);c.__setDigit(r,1073741823&n<<30-a|t),t=n>>>a}c.__setDigit(n,t)}return l&&(c=u.__absoluteAddOne(c,!0,c)),c.__trim()}static __rightShiftByMaximum(e){return e?u.__oneDigit(1,!0):u.__zero()}static __toShiftAmount(e){if(1<e.length)return-1;const t=e.__unsignedDigit(0);return t>u.__kMaxLengthBits?-1:t}static __toPrimitive(e,t="default"){if("object"!=typeof e)return e;if(e.constructor===u)return e;if("undefined"!=typeof Symbol&&"symbol"==typeof Symbol.toPrimitive&&e[Symbol.toPrimitive]){const r=e[Symbol.toPrimitive](t);if("object"!=typeof r)return r;throw new TypeError("Cannot convert object to primitive value")}const r=e.valueOf;if(r){const t=r.call(e);if("object"!=typeof t)return t}const n=e.toString;if(n){const t=n.call(e);if("object"!=typeof t)return t}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(e){return u.__isBigInt(e)?e:+e}static __isBigInt(e){return"object"==typeof e&&null!==e&&e.constructor===u}static __truncateToNBits(e,t){const r=0|(e+29)/30,n=new u(r,t.sign),i=r-1;for(let e=0;e<i;e++)n.__setDigit(e,t.__digit(e));let o=t.__digit(i);if(0!=e%30){const t=32-e%30;o=o<<t>>>t}return n.__setDigit(i,o),n.__trim()}static __truncateAndSubFromPowerOfTwo(e,t,r){var n=Math.min;const i=0|(e+29)/30,o=new u(i,r);let a=0;const s=i-1;let l=0;for(const e=n(s,t.length);a<e;a++){const e=0-t.__digit(a)-l;l=1&e>>>30,o.__setDigit(a,1073741823&e)}for(;a<s;a++)o.__setDigit(a,1073741823&-l);let c=s<t.length?t.__digit(s):0;const d=e%30;let h;if(0==d)h=0-c-l,h&=1073741823;else{const e=32-d;c=c<<e>>>e;const t=1<<32-e;h=t-c-l,h&=t-1}return o.__setDigit(s,h),o.__trim()}__digit(e){return this[e]}__unsignedDigit(e){return this[e]>>>0}__setDigit(e,t){this[e]=0|t}__setDigitGrow(e,t){this[e]=0|t}__halfDigitLength(){const e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}__halfDigit(e){return 32767&this[e>>>1]>>>15*(1&e)}__setHalfDigit(e,t){const r=e>>>1,n=this.__digit(r),i=1&e?32767&n|t<<15:1073709056&n|32767&t;this.__setDigit(r,i)}static __digitPow(e,t){let r=1;for(;0<t;)1&t&&(r*=e),t>>>=1,e*=e;return r}static __detectBigEndian(){return u.__kBitConversionDouble[0]=-0,0!==u.__kBitConversionInts[0]}static __isOneDigitInt(e){return(1073741823&e)===e}}u.__kMaxLength=33554432,u.__kMaxLengthBits=u.__kMaxLength<<5,u.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],u.__kBitsPerCharTableShift=5,u.__kBitsPerCharTableMultiplier=1<<u.__kBitsPerCharTableShift,u.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],u.__kBitConversionBuffer=new ArrayBuffer(8),u.__kBitConversionDouble=new Float64Array(u.__kBitConversionBuffer),u.__kBitConversionInts=new Int32Array(u.__kBitConversionBuffer),u.__kBitConversionIntHigh=u.__detectBigEndian()?0:1,u.__kBitConversionIntLow=u.__detectBigEndian()?1:0,u.__clz30=Math.clz32?function(e){return Math.clz32(e)-2}:function(e){return 0===e?30:0|29-(0|Math.log(e>>>0)/Math.LN2)},u.__imul=Math.imul||function(e,t){return 0|e*t};const m={};function f(e,t){Object.defineProperty(e.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});for(const t of Object.getOwnPropertyNames(e)){const r=Object.getOwnPropertyDescriptor(e,t);r.configurable&&r.enumerable&&(r.enumerable=!1,Object.defineProperty(e,t,r))}for(const t of Object.getOwnPropertyNames(e.prototype)){const r=Object.getOwnPropertyDescriptor(e.prototype,t);r.configurable&&r.enumerable&&(r.enumerable=!1,Object.defineProperty(e.prototype,t,r))}y(t,e),y(`${t}.prototype`,e.prototype)}function y(e,t){const r=`%${e}%`;if(void 0!==m[r])throw new Error(`intrinsic ${e} already exists`);m[r]=t}function g(e){return m[e]}var w,p;const v="slot-epochNanoSeconds",_="slot-timezone-identifier",T="slot-year",b="slot-month",E="slot-day",I="slot-hour",D="slot-minute",C="slot-second",B="slot-millisecond",S="slot-microsecond",M="slot-nanosecond",k="slot-calendar",O="slot-date-brand",$="slot-year-month-brand",R="slot-month-day-brand",Y="slot-cached-instant",N="slot-time-zone",P="slot-years",x="slot-months",A="slot-weeks",F="slot-days",L="slot-hours",j="slot-minutes",U="slot-seconds",q="slot-milliseconds",Z="slot-microseconds",z="slot-nanoseconds",W="slot-calendar-identifier",H=new WeakMap,J=Symbol.for("@@Temporal__GetSlots");(w=globalThis)[J]||(w[J]=function(e){return H.get(e)});const G=globalThis[J],V=Symbol.for("@@Temporal__CreateSlots");(p=globalThis)[V]||(p[V]=function(e){H.set(e,Object.create(null))});const K=globalThis[V];function X(e,...t){if(!e||"object"!=typeof e)return!1;const r=G(e);return!!r&&t.every(e=>e in r)}function Q(e,t){const r=G(e)?.[t];if(void 0===r)throw new TypeError(`Missing internal slot ${t}`);return r}function ee(e,t,r){const n=G(e);if(void 0===n)throw new TypeError("Missing slots for the given container");if(n[t])throw new TypeError(`${t} already has set`);n[t]=r}const te=/\.[-A-Za-z_]|\.\.[-A-Za-z._]{1,12}|\.[-A-Za-z_][-A-Za-z._]{0,12}|[A-Za-z_][-A-Za-z._]{0,13}/,re=new RegExp("(?:"+[`(?:${te.source})(?:\\/(?:${te.source}))*`,"Etc/GMT(?:0|[-+]\\d{1,2})","GMT[-+]?0","EST5EDT","CST6CDT","MST7MDT","PST8PDT",/(?:[+\u2212-][0-2][0-9](?::?[0-5][0-9](?::?[0-5][0-9](?:[.,]\d{1,9})?)?)?)/.source].join("|")+")"),ne=/(?:[+\u2212-]\d{6}|\d{4})/,ie=/(?:0[1-9]|1[0-2])/,oe=/(?:0[1-9]|[12]\d|3[01])/,ae=new RegExp(`(${ne.source})(?:-(${ie.source})-(${oe.source})|(${ie.source})(${oe.source}))`),se=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,le=/([+\u2212-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/,ce=new RegExp(`([zZ])|${le.source}?`),de=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,he=new RegExp([`^${ae.source}`,`(?:(?:T|\\s+)${se.source}(?:${ce.source})?)?`,`(?:\\[!?(${re.source})\\])?`,`((?:${de.source})*)$`].join(""),"i"),ue=new RegExp([`^T?${se.source}`,`(?:${ce.source})?`,`(?:\\[!?${re.source}\\])?`,`((?:${de.source})*)$`].join(""),"i"),me=new RegExp(`^(${ne.source})-?(${ie.source})(?:\\[!?${re.source}\\])?((?:${de.source})*)$`),fe=new RegExp(`^(?:--)?(${ie.source})-?(${oe.source})(?:\\[!?${re.source}\\])?((?:${de.source})*)$`),ye=/(\d+)(?:[.,](\d{1,9}))?/,ge=new RegExp(`(?:${ye.source}H)?(?:${ye.source}M)?(?:${ye.source}S)?`),we=new RegExp(`^([+−-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${ge.source})?$`,"i"),pe=Array.prototype.includes,ve=Array.prototype.push,_e=globalThis.Intl.DateTimeFormat,Te=Math.min,be=Math.max,Ee=Math.abs,Ie=Math.floor,De=Math.sign,Ce=Math.trunc,Be=Number.isNaN,Se=Number.isFinite,Me=Number,ke=String,Oe=Number.MAX_SAFE_INTEGER,$e=Object.create,Re=Object.getOwnPropertyDescriptor,Ye=Reflect.apply,Ne=Reflect.ownKeys,Pe=u.BigInt(0),xe=u.BigInt(1),Ae=u.BigInt(60),Fe=u.BigInt(24),Le=u.BigInt(1e3),je=u.BigInt(1e6),Ue=u.BigInt(1e9),qe=u.BigInt(-1),Ze=u.multiply(u.BigInt(3600),Ue),ze=u.multiply(Ae,Ue),We=u.multiply(Ze,Fe),He=u.multiply(u.BigInt(-86400),u.BigInt(1e17)),Je=u.multiply(u.BigInt(86400),u.BigInt(1e17)),Ge=-271821,Ve=275760,Ke=u.multiply(u.BigInt(-388152),u.BigInt(1e13)),Xe=u.multiply(We,u.BigInt(3660)),Qe=u.multiply(We,u.BigInt(366)),et=u.multiply(We,u.BigInt(14)),tt=["iso8601","hebrew","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","islamicc","persian","ethiopic","ethioaa","coptic","chinese","dangi","roc","indian","buddhist","japanese","gregory"];function rt(e){return u.equal(e,Pe)}function nt(e,t){const r=e[t];if(void 0!==r)return r}function it(e,t,r){return Ye(e,t,arguments.length>2?r:[])}function ot(e){return"object"==typeof e&&null!==e||"function"==typeof e}function at(e){if("bigint"==typeof e)throw new TypeError("Cannot convert BigInt to number");return Me(e)}function st(e){const t=at(e);if(Be(t)||0===t)return 0;if(!Se(t))return t;const r=Ie(Ee(t));return 0===r?0:De(t)*r}function lt(e){if("number"!=typeof e||Be(e)||!Se(e))return!1;const t=Ee(e);return Ie(t)===t}function ct(e){if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a String");return ke(e)}function dt(e){const t=at(e);if(0===t)return 0;if(Be(t)||!Se(t))throw new RangeError("invalid number value");const r=Ce(t);return 0===r?0:r}function ht(e,t){const r=dt(e);if(r<=0){if(void 0!==t)throw new RangeError(`property '${t}' cannot be a a number less than one`);throw new RangeError("Cannot convert a number less than one to a positive integer")}return r}function ut(e){const t=at(e);if(!Se(t))throw new RangeError("infinity is out of range");if(!lt(t))throw new RangeError(`unsupported fractional value ${e}`);return 0===t?0:t}function mt(e,t){return{quotient:u.divide(e,t),remainder:u.remainder(e,t)}}function ft(e){return u.lessThan(e,Pe)}function yt(e){return rt(e)?0:ft(e)?-1:1}function gt(e){return u.lessThan(e,Pe)?u.multiply(e,qe):e}const wt=new Map([["year",dt],["month",ht],["monthCode",ct],["day",ht],["hour",dt],["minute",dt],["second",dt],["millisecond",dt],["microsecond",dt],["nanosecond",dt],["years",ut],["months",ut],["weeks",ut],["days",ut],["hours",ut],["minutes",ut],["seconds",ut],["milliseconds",ut],["microseconds",ut],["nanoseconds",ut],["era",ct],["eraYear",st],["offset",ct]]),pt=new Map([["hour",0],["minute",0],["second",0],["millisecond",0],["microsecond",0],["nanosecond",0]]),vt=[["years","year","date"],["months","month","date"],["weeks","week","date"],["days","day","date"],["hours","hour","time"],["minutes","minute","time"],["seconds","second","time"],["milliseconds","millisecond","time"],["microseconds","microsecond","time"],["nanoseconds","nanosecond","time"]],_t=new Map(vt.map(e=>[e[0],e[1]])),Tt=new Map(vt.map(([e,t])=>[t,e])),bt=vt.map(([,e])=>e),Et=Array.from(_t.keys()).sort(),It=new Map;function Dt(e){let t=It.get(e);return void 0===t&&(t=new _e("en-us",{timeZone:ke(e),hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),It.set(e,t)),t}function Ct(e){if(null==e)throw new TypeError(`Expected object not ${e}`);return Object(e)}function Bt(e,t,r,n){if(null==t)return;const i=Ne(t);for(const o of i)if(!r.some(e=>Object.is(e,o))&&Object.prototype.propertyIsEnumerable.call(t,o)){const r=t[o];if(n&&n.some(e=>Object.is(e,r)))continue;e[o]=r}}function St(e){return X(e,v)&&!X(e,N,k)}function Mt(e){return X(e,_)}function kt(e){return X(e,W)}function Ot(e){return X(e,P,x,F,L,j,U,q,Z,z)}function $t(e){return X(e,O)}function Rt(e){return X(e,I,D,C,B,S,M)&&!X(e,T,b,E)}function Yt(e){return X(e,T,b,E,I,D,C,B,S,M)}function Nt(e){return X(e,$)}function Pt(e){return X(e,R)}function xt(e){return X(e,v,N,k)}function At(e){if(X(e,k)||X(e,N))throw new TypeError("with() does not support a calendar or timeZone property");if(Rt(e))throw new TypeError("with() does not accept Temporal.PlainTime, use withPlainTime() instead");if(void 0!==e.calendar)throw new TypeError("with() does not support a calendar property");if(void 0!==e.timeZone)throw new TypeError("with() does not support a timeZone property")}function Ft(e,t){return"never"===t?"":Lt(Vr(e),t)}function Lt(e,t){return"never"===t||"auto"===t&&"iso8601"===e?"":`[${"critical"===t?"!":""}u-ca=${e}]`}function jt(e){const t=he.exec(e);if(!t)throw new RangeError(`invalid ISO 8601 string: ${e}`);let r=t[1];if("−"===r[0]&&(r=`-${r.slice(1)}`),"-000000"===r)throw new RangeError(`invalid ISO 8601 string: ${e}`);const n=st(r),i=st(t[2]||t[4]),o=st(t[3]||t[5]),a=st(t[6]),s=void 0!==t[6],l=st(t[7]||t[10]);let c=st(t[8]||t[11]);60===c&&(c=59);const d=(t[9]||t[12])+"000000000",h=st(d.slice(0,3)),u=st(d.slice(3,6)),m=st(d.slice(6,9));let f,y=!1;if(t[13])f=void 0,y=!0;else if(t[14]&&t[15]){const e="-"===t[14]||"−"===t[14]?"-":"+",r=t[15]||"00",n=t[16]||"00",i=t[17]||"00";let o=t[18]||"0";if(f=`${e}${r}:${n}`,+o){for(;o.endsWith("0");)o=o.slice(0,-1);f+=`:${i}.${o}`}else+i&&(f+=`:${i}`);"-00:00"===f&&(f="+00:00")}const g=t[19],w=t[20];let p;for(const[,e,t,r]of w.matchAll(de))if("u-ca"===t)void 0===p&&(p=r);else if("!"===e)throw new RangeError(`Unrecognized annotation: !${t}=${r}`);return ci(n,i,o,a,l,c,h,u,m),{year:n,month:i,day:o,hasTime:s,hour:a,minute:l,second:c,millisecond:h,microsecond:u,nanosecond:m,ianaName:g,offset:f,z:y,calendar:p}}function Ut(e){const t=me.exec(e);let r,n,i,o;if(t){let o=t[1];if("−"===o[0]&&(o=`-${o.slice(1)}`),"-000000"===o)throw new RangeError(`invalid ISO 8601 string: ${e}`);r=st(o),n=st(t[2]);const a=t[3];for(const[,e,t,r]of a.matchAll(de))if("u-ca"===t)void 0===i&&(i=r);else if("!"===e)throw new RangeError(`Unrecognized annotation: !${t}=${r}`);if(void 0!==i&&"iso8601"!==i)throw new RangeError("YYYY-MM format is only valid with iso8601 calendar")}else{let t;if(({year:r,month:n,calendar:i,day:o,z:t}=jt(e)),t)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:r,month:n,calendar:i,referenceISODay:o}}function qt(e){const t=fe.exec(e);let r,n,i,o;if(t){r=st(t[1]),n=st(t[2]);const e=t[3];for(const[,t,r,n]of e.matchAll(de))if("u-ca"===r)void 0===i&&(i=n);else if("!"===t)throw new RangeError(`Unrecognized annotation: !${r}=${n}`);if(void 0!==i&&"iso8601"!==i)throw new RangeError("MM-DD format is only valid with iso8601 calendar")}else{let t;if(({month:r,day:n,calendar:i,year:o,z:t}=jt(e)),t)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:r,day:n,calendar:i,referenceISOYear:o}}function Zt(e,t,r,n){let i=e,o=t,a=r;switch(n){case"reject":ai(i,o,a);break;case"constrain":({year:i,month:o,day:a}=ii(i,o,a))}return{year:i,month:o,day:a}}function zt(e,t,r,n,i,o,a){let s=e,l=t,c=r,d=n,h=i,u=o;switch(a){case"reject":li(s,l,c,d,h,u);break;case"constrain":({hour:s,minute:l,second:c,millisecond:d,microsecond:h,nanosecond:u}=function(e,t,r,n,i,o){return{hour:ni(e,0,23),minute:ni(t,0,59),second:ni(r,0,59),millisecond:ni(n,0,999),microsecond:ni(i,0,999),nanosecond:ni(o,0,999)}}(s,l,c,d,h,u))}return{hour:s,minute:l,second:c,millisecond:d,microsecond:h,nanosecond:u}}function Wt(e){if(!ot(e))return function(e){const t=we.exec(e);if(!t)throw new RangeError(`invalid duration: ${e}`);if(t.slice(2).every(e=>void 0===e))throw new RangeError(`invalid duration: ${e}`);const r="-"===t[1]||"−"===t[1]?-1:1,n=void 0===t[2]?0:dt(t[2])*r,i=void 0===t[3]?0:dt(t[3])*r,o=void 0===t[4]?0:dt(t[4])*r,a=void 0===t[5]?0:dt(t[5])*r,s=void 0===t[6]?0:dt(t[6])*r,l=t[7],c=t[8],d=t[9],h=t[10],u=t[11];let m=0,f=0,y=0;if(void 0!==l){if(c??d??h??u)throw new RangeError("only the smallest unit can be fractional");y=3600*st((l+"000000000").slice(0,9))*r}else if(m=void 0===c?0:dt(c)*r,void 0!==d){if(h??u)throw new RangeError("only the smallest unit can be fractional");y=60*st((d+"000000000").slice(0,9))*r}else f=void 0===h?0:dt(h)*r,void 0!==u&&(y=st((u+"000000000").slice(0,9))*r);const g=y%1e3,w=Ce(y/1e3)%1e3,p=Ce(y/1e6)%1e3;return f+=Ce(y/1e9)%60,m+=Ce(y/6e10),ui(n,i,o,a,s,m,f,p,w,g),{years:n,months:i,weeks:o,days:a,hours:s,minutes:m,seconds:f,milliseconds:p,microseconds:w,nanoseconds:g}}(ct(e));if(Ot(e))return{years:Q(e,P),months:Q(e,x),weeks:Q(e,A),days:Q(e,F),hours:Q(e,L),minutes:Q(e,j),seconds:Q(e,U),milliseconds:Q(e,q),microseconds:Q(e,Z),nanoseconds:Q(e,z)};const t={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0};let r=function(e){if(!ot(e))throw new TypeError("invalid duration-like");const t={years:void 0,months:void 0,weeks:void 0,days:void 0,hours:void 0,minutes:void 0,seconds:void 0,milliseconds:void 0,microseconds:void 0,nanoseconds:void 0};let r=!1;for(const n of Et){const i=e[n];void 0!==i&&(r=!0,t[n]=ut(i))}if(!r)throw new TypeError("invalid duration-like");return t}(e);for(const e of Et){const n=r[e];void 0!==n&&(t[e]=n)}let{years:n,months:i,weeks:o,days:a,hours:s,minutes:l,seconds:c,milliseconds:d,microseconds:h,nanoseconds:u}=t;return ui(n,i,o,a,s,l,c,d,h,u),{years:n,months:i,weeks:o,days:a,hours:s,minutes:l,seconds:c,milliseconds:d,microseconds:h,nanoseconds:u}}function Ht(e){return void 0===e?"constrain":io(e,"overflow",["constrain","reject"],"constrain")}function Jt(e){return void 0===e?"compatible":io(e,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function Gt(e,t){return io(e,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function Vt(e,t){return void 0===e?t:io(e,"offset",["prefer","use","ignore","reject"],t)}function Kt(e){return io(e,"calendarName",["auto","always","never","critical"],"auto")}function Xt(e){let t=e.roundingIncrement;if(void 0===t)return 1;if(t=at(t),!Se(t))throw new RangeError("roundingIncrement must be finite");const r=Ce(t);if(r<1||r>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return r}function Qt(e,t,r){const n=r?t:t-1;if(e>n)throw new RangeError(`roundingIncrement must be at least 1 and less than ${n}, not ${e}`);if(t%e!=0)throw new RangeError(`Rounding increment must divide evenly into ${t}`)}function er(e){const t=e.fractionalSecondDigits;if(void 0===t)return"auto";if("number"!=typeof t){if("auto"!==ct(t))throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return"auto"}const r=Ie(t);if(!Se(r)||r<0||r>9)throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return r}function tr(e,t){switch(e){case"minute":return{precision:"minute",unit:"minute",increment:1};case"second":return{precision:0,unit:"second",increment:1};case"millisecond":return{precision:3,unit:"millisecond",increment:1};case"microsecond":return{precision:6,unit:"microsecond",increment:1};case"nanosecond":return{precision:9,unit:"nanosecond",increment:1}}switch(t){case"auto":return{precision:t,unit:"nanosecond",increment:1};case 0:return{precision:t,unit:"second",increment:1};case 1:case 2:case 3:return{precision:t,unit:"millisecond",increment:10**(3-t)};case 4:case 5:case 6:return{precision:t,unit:"microsecond",increment:10**(6-t)};case 7:case 8:case 9:return{precision:t,unit:"nanosecond",increment:10**(9-t)};default:throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}const rr=Symbol("~required~");function nr(e,t,r,n,i=[]){const o=[];for(const[,e,t]of vt)"datetime"!==r&&r!==t||o.push(e);o.push(...i);let a=n;a===rr?a=void 0:void 0!==a&&o.push(a);const s=[...o];for(const e of o){const t=Tt.get(e);void 0!==t&&s.push(t)}let l=io(e,t,s,a);if(void 0===l&&n===rr)throw new RangeError(`${t} is required`);return _t.has(l)?_t.get(l):l}function ir(e){const t=e.relativeTo;if(void 0===t)return t;let r,n,i,o,a,s,l,c,d,h,u,m,f="option",y=!1;if(ot(t)){if(xt(t)||$t(t))return t;if(Yt(t))return cn(t);h=Gr(t);const e=Mr(h,["day","hour","microsecond","millisecond","minute","month","monthCode","nanosecond","second","year"]);e.push("timeZone","offset");const y=sr(t,e,[]),g=$e(null);g.overflow="constrain",({year:r,month:n,day:i,hour:o,minute:a,second:s,millisecond:l,microsecond:c,nanosecond:d}=dr(h,y,g)),m=y.offset,void 0===m&&(f="wall"),u=y.timeZone,void 0!==u&&(u=on(u))}else{let e,g;if(({year:r,month:n,day:i,hour:o,minute:a,second:s,millisecond:l,microsecond:c,nanosecond:d,calendar:h,ianaName:e,offset:m,z:g}=jt(ct(t))),e)u=on(e),g?f="exact":m||(f="wall"),y=!0;else if(g)throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");if(h||(h="iso8601"),!oo(h))throw new RangeError(`invalid calendar identifier ${h}`);h=ao(h)}return void 0===u?_r(r,n,i,h):Sr(wr(r,n,i,o,a,s,l,c,d,f,"option"===f?Sn(m):0,u,"compatible","reject",y),u,h)}function or(e,t,r,n,i,o,a,s,l,c){for(const[d,h]of[["years",e],["months",t],["weeks",r],["days",n],["hours",i],["minutes",o],["seconds",a],["milliseconds",s],["microseconds",l],["nanoseconds",c]])if(0!==h)return _t.get(d);return"nanosecond"}function ar(e,t){return bt.indexOf(e)>bt.indexOf(t)?t:e}function sr(e,t,r,{emptySourceErrorMessage:n}={emptySourceErrorMessage:"no supported properties found"}){const i=$e(null);let o=!1;t.sort();for(const n of t){let t=e[n];if(void 0!==t)o=!0,wt.has(n)&&(t=wt.get(n)(t)),i[n]=t;else if("partial"!==r){if(pe.call(r,n))throw new TypeError(`required property '${n}' missing or undefined`);t=pt.get(n),i[n]=t}}if("partial"===r&&!o)throw new TypeError(n);return i}function lr(e,t="complete"){const r=["hour","microsecond","millisecond","minute","nanosecond","second"],n=sr(e,r,"partial",{emptySourceErrorMessage:"invalid time-like"}),i={};for(const e of r){const r=Re(n,e);void 0!==r?i[e]=r.value:"complete"===t&&(i[e]=0)}return i}function cr(e,t){let r=e;if(ot(r)){if($t(r))return r;if(xt(r)&&(Ht(t),r=mn(Q(r,N),Q(r,Y),Q(r,k))),Yt(r))return Ht(t),_r(Q(r,T),Q(r,b),Q(r,E),Q(r,k));const e=Gr(r);return tn(e,sr(r,Mr(e,["day","month","monthCode","year"]),[]),t)}Ht(t);let{year:n,month:i,day:o,calendar:a,z:s}=function(e){return jt(e)}(ct(r));if(s)throw new RangeError("Z designator not supported for PlainDate");if(a||(a="iso8601"),!oo(a))throw new RangeError(`invalid calendar identifier ${a}`);return a=ao(a),_r(n,i,o,a)}function dr(e,t,r){let{hour:n,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:l}=lr(t);const c=Ht(r),d=tn(e,t,r),h=Q(d,T),u=Q(d,b),m=Q(d,E);return({hour:n,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:l}=zt(n,i,o,a,s,l,c)),{year:h,month:u,day:m,hour:n,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:l}}function hr(e,t){let r,n,i,o,a,s,l,c,d,h;if(ot(e)){if(Yt(e))return e;if(xt(e))return Ht(t),mn(Q(e,N),Q(e,Y),Q(e,k));if($t(e))return Ht(t),br(Q(e,T),Q(e,b),Q(e,E),0,0,0,0,0,0,Q(e,k));h=Gr(e);const u=sr(e,Mr(h,["day","hour","microsecond","millisecond","minute","month","monthCode","nanosecond","second","year"]),[]);({year:r,month:n,day:i,hour:o,minute:a,second:s,millisecond:l,microsecond:c,nanosecond:d}=dr(h,u,t))}else{let u;if(Ht(t),({year:r,month:n,day:i,hour:o,minute:a,second:s,millisecond:l,microsecond:c,nanosecond:d,calendar:h,z:u}=function(e){return jt(e)}(ct(e))),u)throw new RangeError("Z designator not supported for PlainDateTime");if(ci(r,n,i,o,a,s,l,c,d),h||(h="iso8601"),!oo(h))throw new RangeError(`invalid calendar identifier ${h}`);h=ao(h)}return br(r,n,i,o,a,s,l,c,d,h)}function ur(e){if(Ot(e))return e;let{years:t,months:r,weeks:n,days:i,hours:o,minutes:a,seconds:s,milliseconds:l,microseconds:c,nanoseconds:d}=Wt(e);return new(g("%Temporal.Duration%"))(t,r,n,i,o,a,s,l,c,d)}function mr(e){if(St(e))return e;if(xt(e))return new(g("%Temporal.Instant%"))(Q(e,v));const t=function(e){let{year:t,month:r,day:n,hour:i,minute:o,second:a,millisecond:s,microsecond:l,nanosecond:c,offset:d,z:h}=function(e){const t=jt(e);if(!t.z&&!t.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return t}(e);if(!h&&!d)throw new RangeError("Temporal.Instant requires a time zone offset");const u=h?0:Sn(d);({year:t,month:r,day:n,hour:i,minute:o,second:a,millisecond:s,microsecond:l,nanosecond:c}=Jn(t,r,n,i,o,a,s,l,c-u));const m=Rn(t,r,n,i,o,a,s,l,c);if(null===m)throw new RangeError("DateTime outside of supported range");return m}(ct(e));return new(g("%Temporal.Instant%"))(t)}function fr(e,t){let r=e;if(ot(r)){if(Pt(r))return r;let e,n;if(X(r,k))e=Q(r,k),n=!1;else{let t=r.calendar;n=void 0===t,void 0===t&&(t="iso8601"),e=Jr(t)}const i=sr(r,Mr(e,["day","month","monthCode","year"]),[]);return n&&void 0!==i.month&&void 0===i.monthCode&&void 0===i.year&&(i.year=1972),nn(e,i,t)}Ht(t);let{month:n,day:i,referenceISOYear:o,calendar:a}=qt(ct(r));if(void 0===a&&(a="iso8601"),!oo(a))throw new RangeError(`invalid calendar identifier ${a}`);return a=ao(a),void 0===o?(ai(1972,n,i),Ir(n,i,a)):nn(a,Ir(n,i,a,o))}function yr(e,t="constrain"){let r,n,i,o,a,s,l=e;if(ot(l)){if(Rt(l))return l;if(xt(l)&&(l=mn(Q(l,N),Q(l,Y),Q(l,k))),Yt(l))return new(g("%Temporal.PlainTime%"))(Q(l,I),Q(l,D),Q(l,C),Q(l,B),Q(l,S),Q(l,M));({hour:r,minute:n,second:i,millisecond:o,microsecond:a,nanosecond:s}=lr(l)),({hour:r,minute:n,second:i,millisecond:o,microsecond:a,nanosecond:s}=zt(r,n,i,o,a,s,t))}else({hour:r,minute:n,second:i,millisecond:o,microsecond:a,nanosecond:s}=function(e){const t=ue.exec(e);let r,n,i,o,a,s,l;if(t)