@creopse/react 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4603 -105
- package/dist/index.js +4604 -107
- package/dist/index.mjs +4604 -106
- package/package.json +2 -2
- package/types/components/core/RootContainer/RootContainer.d.ts +9 -0
- package/types/components/core/RootContainer/index.d.ts +1 -0
- package/types/components/widgets/MountedTeleport/MountedTeleport.d.ts +8 -0
- package/types/components/widgets/MountedTeleport/index.d.ts +1 -0
- package/types/components/widgets/ReadMore/ReadMore.d.ts +12 -0
- package/types/components/widgets/ReadMore/index.d.ts +1 -0
- package/types/components/widgets/StickyBottom/StickyBottom.d.ts +9 -0
- package/types/components/widgets/StickyBottom/index.d.ts +1 -0
- package/types/components/widgets/StickyTop/StickyTop.d.ts +9 -0
- package/types/components/widgets/StickyTop/index.d.ts +1 -0
- package/types/index.d.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var CreopseReactToolkit = function(exports, React2) {
|
|
1
|
+
var CreopseReactToolkit = function(exports, React2, reactDom) {
|
|
2
2
|
"use strict";
|
|
3
3
|
function _interopNamespaceDefault(e) {
|
|
4
4
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -241,15 +241,15 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
241
241
|
else validateChildKeys(children);
|
|
242
242
|
if (hasOwnProperty.call(config, "key")) {
|
|
243
243
|
children = getComponentNameFromType(type);
|
|
244
|
-
var
|
|
244
|
+
var keys2 = Object.keys(config).filter(function(k) {
|
|
245
245
|
return "key" !== k;
|
|
246
246
|
});
|
|
247
|
-
isStaticChildren = 0 <
|
|
248
|
-
didWarnAboutKeySpread[children + isStaticChildren] || (
|
|
247
|
+
isStaticChildren = 0 < keys2.length ? "{key: someKey, " + keys2.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
248
|
+
didWarnAboutKeySpread[children + isStaticChildren] || (keys2 = 0 < keys2.length ? "{" + keys2.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
249
249
|
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
250
250
|
isStaticChildren,
|
|
251
251
|
children,
|
|
252
|
-
|
|
252
|
+
keys2,
|
|
253
253
|
children
|
|
254
254
|
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
|
255
255
|
}
|
|
@@ -392,11 +392,11 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
392
392
|
if (index > -1)
|
|
393
393
|
arr.splice(index, 1);
|
|
394
394
|
}
|
|
395
|
-
const clamp = (
|
|
396
|
-
if (v >
|
|
397
|
-
return
|
|
398
|
-
if (v <
|
|
399
|
-
return
|
|
395
|
+
const clamp = (min2, max2, v) => {
|
|
396
|
+
if (v > max2)
|
|
397
|
+
return max2;
|
|
398
|
+
if (v < min2)
|
|
399
|
+
return min2;
|
|
400
400
|
return v;
|
|
401
401
|
};
|
|
402
402
|
function formatErrorMessage(message, errorCode) {
|
|
@@ -420,7 +420,7 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
420
420
|
}
|
|
421
421
|
const MotionGlobalConfig = {};
|
|
422
422
|
const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v);
|
|
423
|
-
function isObject(value) {
|
|
423
|
+
function isObject$1(value) {
|
|
424
424
|
return typeof value === "object" && value !== null;
|
|
425
425
|
}
|
|
426
426
|
const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v);
|
|
@@ -436,9 +436,9 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
436
436
|
const noop = /* @__NO_SIDE_EFFECTS__ */ (any) => any;
|
|
437
437
|
const combineFunctions = (a, b) => (v) => b(a(v));
|
|
438
438
|
const pipe = (...transformers) => transformers.reduce(combineFunctions);
|
|
439
|
-
const progress = /* @__NO_SIDE_EFFECTS__ */ (
|
|
440
|
-
const toFromDifference =
|
|
441
|
-
return toFromDifference === 0 ? 1 : (value -
|
|
439
|
+
const progress = /* @__NO_SIDE_EFFECTS__ */ (from2, to2, value) => {
|
|
440
|
+
const toFromDifference = to2 - from2;
|
|
441
|
+
return toFromDifference === 0 ? 1 : (value - from2) / toFromDifference;
|
|
442
442
|
};
|
|
443
443
|
class SubscriptionManager {
|
|
444
444
|
constructor() {
|
|
@@ -468,8 +468,8 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
468
468
|
this.subscriptions.length = 0;
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
const secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (
|
|
472
|
-
const millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (
|
|
471
|
+
const secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (seconds2) => seconds2 * 1e3;
|
|
472
|
+
const millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (milliseconds2) => milliseconds2 / 1e3;
|
|
473
473
|
function velocityPerSecond(velocity, frameDuration) {
|
|
474
474
|
return frameDuration ? velocity * (1e3 / frameDuration) : 0;
|
|
475
475
|
}
|
|
@@ -686,23 +686,23 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
686
686
|
return { schedule, cancel, state, steps };
|
|
687
687
|
}
|
|
688
688
|
const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
|
|
689
|
-
let now;
|
|
689
|
+
let now$1;
|
|
690
690
|
function clearTime() {
|
|
691
|
-
now = void 0;
|
|
691
|
+
now$1 = void 0;
|
|
692
692
|
}
|
|
693
693
|
const time = {
|
|
694
694
|
now: () => {
|
|
695
|
-
if (now === void 0) {
|
|
695
|
+
if (now$1 === void 0) {
|
|
696
696
|
time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now());
|
|
697
697
|
}
|
|
698
|
-
return now;
|
|
698
|
+
return now$1;
|
|
699
699
|
},
|
|
700
700
|
set: (newTime) => {
|
|
701
|
-
now = newTime;
|
|
701
|
+
now$1 = newTime;
|
|
702
702
|
queueMicrotask(clearTime);
|
|
703
703
|
}
|
|
704
704
|
};
|
|
705
|
-
const checkStringStartsWith = (
|
|
705
|
+
const checkStringStartsWith = (token2) => (key) => typeof key === "string" && key.startsWith(token2);
|
|
706
706
|
const isCSSVariableName = /* @__PURE__ */ checkStringStartsWith("--");
|
|
707
707
|
const startsAsVariableToken = /* @__PURE__ */ checkStringStartsWith("var(--");
|
|
708
708
|
const isCSSVariableToken = (value) => {
|
|
@@ -944,12 +944,12 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
944
944
|
function mixImmediate(a, b) {
|
|
945
945
|
return (p) => p > 0 ? b : a;
|
|
946
946
|
}
|
|
947
|
-
const mixNumber$1 = (
|
|
948
|
-
return
|
|
947
|
+
const mixNumber$1 = (from2, to2, progress2) => {
|
|
948
|
+
return from2 + (to2 - from2) * progress2;
|
|
949
949
|
};
|
|
950
|
-
const mixLinearColor = (
|
|
951
|
-
const fromExpo =
|
|
952
|
-
const expo = v * (
|
|
950
|
+
const mixLinearColor = (from2, to2, v) => {
|
|
951
|
+
const fromExpo = from2 * from2;
|
|
952
|
+
const expo = v * (to2 * to2 - fromExpo) + fromExpo;
|
|
953
953
|
return expo < 0 ? 0 : Math.sqrt(expo);
|
|
954
954
|
};
|
|
955
955
|
const colorTypes = [hex, rgba, hsla];
|
|
@@ -965,11 +965,11 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
965
965
|
}
|
|
966
966
|
return model;
|
|
967
967
|
}
|
|
968
|
-
const mixColor = (
|
|
969
|
-
const fromRGBA = asRGBA(
|
|
970
|
-
const toRGBA = asRGBA(
|
|
968
|
+
const mixColor = (from2, to2) => {
|
|
969
|
+
const fromRGBA = asRGBA(from2);
|
|
970
|
+
const toRGBA = asRGBA(to2);
|
|
971
971
|
if (!fromRGBA || !toRGBA) {
|
|
972
|
-
return mixImmediate(
|
|
972
|
+
return mixImmediate(from2, to2);
|
|
973
973
|
}
|
|
974
974
|
const blended = { ...fromRGBA };
|
|
975
975
|
return (v) => {
|
|
@@ -1056,12 +1056,12 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
1056
1056
|
return mixImmediate(origin, target);
|
|
1057
1057
|
}
|
|
1058
1058
|
};
|
|
1059
|
-
function mix(
|
|
1060
|
-
if (typeof
|
|
1061
|
-
return mixNumber$1(
|
|
1059
|
+
function mix(from2, to2, p) {
|
|
1060
|
+
if (typeof from2 === "number" && typeof to2 === "number" && typeof p === "number") {
|
|
1061
|
+
return mixNumber$1(from2, to2, p);
|
|
1062
1062
|
}
|
|
1063
|
-
const mixer = getMixer(
|
|
1064
|
-
return mixer(
|
|
1063
|
+
const mixer = getMixer(from2);
|
|
1064
|
+
return mixer(from2, to2);
|
|
1065
1065
|
}
|
|
1066
1066
|
const frameloopDriver = (update) => {
|
|
1067
1067
|
const passTimestamp = ({ timestamp }) => update(timestamp);
|
|
@@ -1209,8 +1209,8 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
const durationKeys = ["duration", "bounce"];
|
|
1211
1211
|
const physicsKeys = ["stiffness", "damping", "mass"];
|
|
1212
|
-
function isSpringType(options,
|
|
1213
|
-
return
|
|
1212
|
+
function isSpringType(options, keys2) {
|
|
1213
|
+
return keys2.some((key) => options[key] !== void 0);
|
|
1214
1214
|
}
|
|
1215
1215
|
function getSpringOptions(options) {
|
|
1216
1216
|
let springOptions = {
|
|
@@ -1318,19 +1318,19 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
1318
1318
|
options.type = "keyframes";
|
|
1319
1319
|
return options;
|
|
1320
1320
|
};
|
|
1321
|
-
function inertia({ keyframes: keyframes2, velocity = 0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed }) {
|
|
1321
|
+
function inertia({ keyframes: keyframes2, velocity = 0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min: min2, max: max2, restDelta = 0.5, restSpeed }) {
|
|
1322
1322
|
const origin = keyframes2[0];
|
|
1323
1323
|
const state = {
|
|
1324
1324
|
done: false,
|
|
1325
1325
|
value: origin
|
|
1326
1326
|
};
|
|
1327
|
-
const isOutOfBounds = (v) =>
|
|
1327
|
+
const isOutOfBounds = (v) => min2 !== void 0 && v < min2 || max2 !== void 0 && v > max2;
|
|
1328
1328
|
const nearestBoundary = (v) => {
|
|
1329
|
-
if (
|
|
1330
|
-
return
|
|
1331
|
-
if (
|
|
1332
|
-
return
|
|
1333
|
-
return Math.abs(
|
|
1329
|
+
if (min2 === void 0)
|
|
1330
|
+
return max2;
|
|
1331
|
+
if (max2 === void 0)
|
|
1332
|
+
return min2;
|
|
1333
|
+
return Math.abs(min2 - v) < Math.abs(max2 - v) ? min2 : max2;
|
|
1334
1334
|
};
|
|
1335
1335
|
let amplitude = power * velocity;
|
|
1336
1336
|
const ideal = origin + amplitude;
|
|
@@ -1423,20 +1423,20 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
1423
1423
|
};
|
|
1424
1424
|
return isClamp ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) : interpolator;
|
|
1425
1425
|
}
|
|
1426
|
-
function fillOffset(
|
|
1427
|
-
const
|
|
1426
|
+
function fillOffset(offset2, remaining) {
|
|
1427
|
+
const min2 = offset2[offset2.length - 1];
|
|
1428
1428
|
for (let i = 1; i <= remaining; i++) {
|
|
1429
1429
|
const offsetProgress = /* @__PURE__ */ progress(0, remaining, i);
|
|
1430
|
-
|
|
1430
|
+
offset2.push(mixNumber$1(min2, 1, offsetProgress));
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
1433
1433
|
function defaultOffset(arr) {
|
|
1434
|
-
const
|
|
1435
|
-
fillOffset(
|
|
1436
|
-
return
|
|
1434
|
+
const offset2 = [0];
|
|
1435
|
+
fillOffset(offset2, arr.length - 1);
|
|
1436
|
+
return offset2;
|
|
1437
1437
|
}
|
|
1438
|
-
function convertOffsetToTimes(
|
|
1439
|
-
return
|
|
1438
|
+
function convertOffsetToTimes(offset2, duration) {
|
|
1439
|
+
return offset2.map((o) => o * duration);
|
|
1440
1440
|
}
|
|
1441
1441
|
function defaultEasing(values, easing) {
|
|
1442
1442
|
return values.map(() => easing || easeInOut).splice(0, values.length - 1);
|
|
@@ -2458,10 +2458,10 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
2458
2458
|
const maxDepth = 4;
|
|
2459
2459
|
function getVariableValue(current, element, depth = 1) {
|
|
2460
2460
|
invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
|
|
2461
|
-
const [
|
|
2462
|
-
if (!
|
|
2461
|
+
const [token2, fallback] = parseCSSVariable(current);
|
|
2462
|
+
if (!token2)
|
|
2463
2463
|
return;
|
|
2464
|
-
const resolved = window.getComputedStyle(element).getPropertyValue(
|
|
2464
|
+
const resolved = window.getComputedStyle(element).getPropertyValue(token2);
|
|
2465
2465
|
if (resolved) {
|
|
2466
2466
|
const trimmed = resolved.trim();
|
|
2467
2467
|
return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;
|
|
@@ -2736,7 +2736,7 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
2736
2736
|
return type && typeof value === "number" ? type.transform(value) : value;
|
|
2737
2737
|
};
|
|
2738
2738
|
function isHTMLElement(element) {
|
|
2739
|
-
return isObject(element) && "offsetHeight" in element;
|
|
2739
|
+
return isObject$1(element) && "offsetHeight" in element;
|
|
2740
2740
|
}
|
|
2741
2741
|
const MAX_VELOCITY_DELTA = 30;
|
|
2742
2742
|
const isFloat = (value) => {
|
|
@@ -3181,7 +3181,7 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
3181
3181
|
return cancelEvents;
|
|
3182
3182
|
}
|
|
3183
3183
|
function isSVGElement(element) {
|
|
3184
|
-
return isObject(element) && "ownerSVGElement" in element;
|
|
3184
|
+
return isObject$1(element) && "ownerSVGElement" in element;
|
|
3185
3185
|
}
|
|
3186
3186
|
function isSVGSVGElement(element) {
|
|
3187
3187
|
return isSVGElement(element) && element.tagName === "svg";
|
|
@@ -3661,13 +3661,13 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
3661
3661
|
offset: "strokeDashoffset",
|
|
3662
3662
|
array: "strokeDasharray"
|
|
3663
3663
|
};
|
|
3664
|
-
function buildSVGPath(attrs, length, spacing = 1,
|
|
3664
|
+
function buildSVGPath(attrs, length, spacing = 1, offset2 = 0, useDashCase = true) {
|
|
3665
3665
|
attrs.pathLength = 1;
|
|
3666
|
-
const
|
|
3667
|
-
attrs[
|
|
3666
|
+
const keys2 = useDashCase ? dashKeys : camelKeys;
|
|
3667
|
+
attrs[keys2.offset] = px.transform(-offset2);
|
|
3668
3668
|
const pathLength = px.transform(length);
|
|
3669
3669
|
const pathSpacing = px.transform(spacing);
|
|
3670
|
-
attrs[
|
|
3670
|
+
attrs[keys2.array] = `${pathLength} ${pathSpacing}`;
|
|
3671
3671
|
}
|
|
3672
3672
|
function buildSVGAttrs(state, {
|
|
3673
3673
|
attrX,
|
|
@@ -4841,7 +4841,7 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
4841
4841
|
}
|
|
4842
4842
|
return ease;
|
|
4843
4843
|
};
|
|
4844
|
-
function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {
|
|
4844
|
+
function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from: from2, elapsed, ...transition }) {
|
|
4845
4845
|
return !!Object.keys(transition).length;
|
|
4846
4846
|
}
|
|
4847
4847
|
const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {
|
|
@@ -5504,18 +5504,18 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
5504
5504
|
}
|
|
5505
5505
|
return currentVelocity;
|
|
5506
5506
|
}
|
|
5507
|
-
function applyConstraints(point, { min, max }, elastic) {
|
|
5508
|
-
if (
|
|
5509
|
-
point = elastic ? mixNumber$1(
|
|
5510
|
-
} else if (
|
|
5511
|
-
point = elastic ? mixNumber$1(
|
|
5507
|
+
function applyConstraints(point, { min: min2, max: max2 }, elastic) {
|
|
5508
|
+
if (min2 !== void 0 && point < min2) {
|
|
5509
|
+
point = elastic ? mixNumber$1(min2, point, elastic.min) : Math.max(point, min2);
|
|
5510
|
+
} else if (max2 !== void 0 && point > max2) {
|
|
5511
|
+
point = elastic ? mixNumber$1(max2, point, elastic.max) : Math.min(point, max2);
|
|
5512
5512
|
}
|
|
5513
5513
|
return point;
|
|
5514
5514
|
}
|
|
5515
|
-
function calcRelativeAxisConstraints(axis,
|
|
5515
|
+
function calcRelativeAxisConstraints(axis, min2, max2) {
|
|
5516
5516
|
return {
|
|
5517
|
-
min:
|
|
5518
|
-
max:
|
|
5517
|
+
min: min2 !== void 0 ? axis.min + min2 : void 0,
|
|
5518
|
+
max: max2 !== void 0 ? axis.max + max2 - (axis.max - axis.min) : void 0
|
|
5519
5519
|
};
|
|
5520
5520
|
}
|
|
5521
5521
|
function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
|
|
@@ -5525,12 +5525,12 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
5525
5525
|
};
|
|
5526
5526
|
}
|
|
5527
5527
|
function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
|
|
5528
|
-
let
|
|
5529
|
-
let
|
|
5528
|
+
let min2 = constraintsAxis.min - layoutAxis.min;
|
|
5529
|
+
let max2 = constraintsAxis.max - layoutAxis.max;
|
|
5530
5530
|
if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) {
|
|
5531
|
-
[
|
|
5531
|
+
[min2, max2] = [max2, min2];
|
|
5532
5532
|
}
|
|
5533
|
-
return { min, max };
|
|
5533
|
+
return { min: min2, max: max2 };
|
|
5534
5534
|
}
|
|
5535
5535
|
function calcViewportConstraints(layoutBox, constraintsBox) {
|
|
5536
5536
|
return {
|
|
@@ -5650,16 +5650,16 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
5650
5650
|
const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag } = this.getProps();
|
|
5651
5651
|
if (!dragPropagation && !this.openDragLock)
|
|
5652
5652
|
return;
|
|
5653
|
-
const { offset } = info;
|
|
5653
|
+
const { offset: offset2 } = info;
|
|
5654
5654
|
if (dragDirectionLock && this.currentDirection === null) {
|
|
5655
|
-
this.currentDirection = getCurrentDirection(
|
|
5655
|
+
this.currentDirection = getCurrentDirection(offset2);
|
|
5656
5656
|
if (this.currentDirection !== null) {
|
|
5657
5657
|
onDirectionLock && onDirectionLock(this.currentDirection);
|
|
5658
5658
|
}
|
|
5659
5659
|
return;
|
|
5660
5660
|
}
|
|
5661
|
-
this.updateAxis("x", info.point,
|
|
5662
|
-
this.updateAxis("y", info.point,
|
|
5661
|
+
this.updateAxis("x", info.point, offset2);
|
|
5662
|
+
this.updateAxis("y", info.point, offset2);
|
|
5663
5663
|
this.visualElement.render();
|
|
5664
5664
|
onDrag && onDrag(event, info);
|
|
5665
5665
|
};
|
|
@@ -5720,12 +5720,12 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
5720
5720
|
}
|
|
5721
5721
|
animationState && animationState.setActive("whileDrag", false);
|
|
5722
5722
|
}
|
|
5723
|
-
updateAxis(axis, _point,
|
|
5723
|
+
updateAxis(axis, _point, offset2) {
|
|
5724
5724
|
const { drag: drag2 } = this.getProps();
|
|
5725
|
-
if (!
|
|
5725
|
+
if (!offset2 || !shouldDrag(axis, drag2, this.currentDirection))
|
|
5726
5726
|
return;
|
|
5727
5727
|
const axisValue = this.getAxisMotionValue(axis);
|
|
5728
|
-
let next = this.originPoint[axis] +
|
|
5728
|
+
let next = this.originPoint[axis] + offset2[axis];
|
|
5729
5729
|
if (this.constraints && this.constraints[axis]) {
|
|
5730
5730
|
next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);
|
|
5731
5731
|
}
|
|
@@ -5836,8 +5836,8 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
5836
5836
|
const { projection } = this.visualElement;
|
|
5837
5837
|
const axisValue = this.getAxisMotionValue(axis);
|
|
5838
5838
|
if (projection && projection.layout) {
|
|
5839
|
-
const { min, max } = projection.layout.layoutBox[axis];
|
|
5840
|
-
axisValue.set(point[axis] - mixNumber$1(
|
|
5839
|
+
const { min: min2, max: max2 } = projection.layout.layoutBox[axis];
|
|
5840
|
+
axisValue.set(point[axis] - mixNumber$1(min2, max2, 0.5));
|
|
5841
5841
|
}
|
|
5842
5842
|
});
|
|
5843
5843
|
}
|
|
@@ -5871,8 +5871,8 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
5871
5871
|
if (!shouldDrag(axis, drag2, null))
|
|
5872
5872
|
return;
|
|
5873
5873
|
const axisValue = this.getAxisMotionValue(axis);
|
|
5874
|
-
const { min, max } = this.constraints[axis];
|
|
5875
|
-
axisValue.set(mixNumber$1(
|
|
5874
|
+
const { min: min2, max: max2 } = this.constraints[axis];
|
|
5875
|
+
axisValue.set(mixNumber$1(min2, max2, boxProgress[axis]));
|
|
5876
5876
|
});
|
|
5877
5877
|
}
|
|
5878
5878
|
addListeners() {
|
|
@@ -5934,11 +5934,11 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
5934
5934
|
function shouldDrag(direction, drag2, currentDirection) {
|
|
5935
5935
|
return (drag2 === true || drag2 === direction) && (currentDirection === null || currentDirection === direction);
|
|
5936
5936
|
}
|
|
5937
|
-
function getCurrentDirection(
|
|
5937
|
+
function getCurrentDirection(offset2, lockThreshold = 10) {
|
|
5938
5938
|
let direction = null;
|
|
5939
|
-
if (Math.abs(
|
|
5939
|
+
if (Math.abs(offset2.y) > lockThreshold) {
|
|
5940
5940
|
direction = "y";
|
|
5941
|
-
} else if (Math.abs(
|
|
5941
|
+
} else if (Math.abs(offset2.x) > lockThreshold) {
|
|
5942
5942
|
direction = "x";
|
|
5943
5943
|
}
|
|
5944
5944
|
return direction;
|
|
@@ -6043,16 +6043,16 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
6043
6043
|
if (shadow.length > 5)
|
|
6044
6044
|
return original;
|
|
6045
6045
|
const template = complex.createTransformer(latest);
|
|
6046
|
-
const
|
|
6046
|
+
const offset2 = typeof shadow[0] !== "number" ? 1 : 0;
|
|
6047
6047
|
const xScale = projectionDelta.x.scale * treeScale.x;
|
|
6048
6048
|
const yScale = projectionDelta.y.scale * treeScale.y;
|
|
6049
|
-
shadow[0 +
|
|
6050
|
-
shadow[1 +
|
|
6049
|
+
shadow[0 + offset2] /= xScale;
|
|
6050
|
+
shadow[1 + offset2] /= yScale;
|
|
6051
6051
|
const averageScale = mixNumber$1(xScale, yScale, 0.5);
|
|
6052
|
-
if (typeof shadow[2 +
|
|
6053
|
-
shadow[2 +
|
|
6054
|
-
if (typeof shadow[3 +
|
|
6055
|
-
shadow[3 +
|
|
6052
|
+
if (typeof shadow[2 + offset2] === "number")
|
|
6053
|
+
shadow[2 + offset2] /= averageScale;
|
|
6054
|
+
if (typeof shadow[3 + offset2] === "number")
|
|
6055
|
+
shadow[3 + offset2] /= averageScale;
|
|
6056
6056
|
return template(shadow);
|
|
6057
6057
|
}
|
|
6058
6058
|
};
|
|
@@ -6238,13 +6238,13 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
6238
6238
|
}
|
|
6239
6239
|
const easeCrossfadeIn = /* @__PURE__ */ compress(0, 0.5, circOut);
|
|
6240
6240
|
const easeCrossfadeOut = /* @__PURE__ */ compress(0.5, 0.95, noop);
|
|
6241
|
-
function compress(
|
|
6241
|
+
function compress(min2, max2, easing) {
|
|
6242
6242
|
return (p) => {
|
|
6243
|
-
if (p <
|
|
6243
|
+
if (p < min2)
|
|
6244
6244
|
return 0;
|
|
6245
|
-
if (p >
|
|
6245
|
+
if (p > max2)
|
|
6246
6246
|
return 1;
|
|
6247
|
-
return easing(/* @__PURE__ */ progress(
|
|
6247
|
+
return easing(/* @__PURE__ */ progress(min2, max2, p));
|
|
6248
6248
|
};
|
|
6249
6249
|
}
|
|
6250
6250
|
function copyAxisInto(axis, originAxis) {
|
|
@@ -7448,13 +7448,13 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
7448
7448
|
output.origin = delta.origin;
|
|
7449
7449
|
output.originPoint = delta.originPoint;
|
|
7450
7450
|
}
|
|
7451
|
-
function mixAxis(output,
|
|
7452
|
-
output.min = mixNumber$1(
|
|
7453
|
-
output.max = mixNumber$1(
|
|
7451
|
+
function mixAxis(output, from2, to2, p) {
|
|
7452
|
+
output.min = mixNumber$1(from2.min, to2.min, p);
|
|
7453
|
+
output.max = mixNumber$1(from2.max, to2.max, p);
|
|
7454
7454
|
}
|
|
7455
|
-
function mixBox(output,
|
|
7456
|
-
mixAxis(output.x,
|
|
7457
|
-
mixAxis(output.y,
|
|
7455
|
+
function mixBox(output, from2, to2, p) {
|
|
7456
|
+
mixAxis(output.x, from2.x, to2.x, p);
|
|
7457
|
+
mixAxis(output.y, from2.y, to2.y, p);
|
|
7458
7458
|
}
|
|
7459
7459
|
function hasOpacityCrossfade(node) {
|
|
7460
7460
|
return node.animationValues && node.animationValues.opacityExit !== void 0;
|
|
@@ -7780,8 +7780,4505 @@ var CreopseReactToolkit = function(exports, React2) {
|
|
|
7780
7780
|
}
|
|
7781
7781
|
);
|
|
7782
7782
|
};
|
|
7783
|
+
const MountedTeleport = ({
|
|
7784
|
+
to: to2,
|
|
7785
|
+
children,
|
|
7786
|
+
disabled = false
|
|
7787
|
+
}) => {
|
|
7788
|
+
const [isMounted, setIsMounted] = React2.useState(false);
|
|
7789
|
+
const [targetElement, setTargetElement] = React2.useState(null);
|
|
7790
|
+
React2.useEffect(() => {
|
|
7791
|
+
setIsMounted(true);
|
|
7792
|
+
return () => {
|
|
7793
|
+
setIsMounted(false);
|
|
7794
|
+
};
|
|
7795
|
+
}, []);
|
|
7796
|
+
React2.useEffect(() => {
|
|
7797
|
+
if (!isMounted || disabled) {
|
|
7798
|
+
setTargetElement(null);
|
|
7799
|
+
return;
|
|
7800
|
+
}
|
|
7801
|
+
let target = null;
|
|
7802
|
+
if (typeof to2 === "string") {
|
|
7803
|
+
target = document.querySelector(to2);
|
|
7804
|
+
if (!target) {
|
|
7805
|
+
console.warn(
|
|
7806
|
+
`MountedTeleport: Target element not found for selector "${to2}"`
|
|
7807
|
+
);
|
|
7808
|
+
setTargetElement(null);
|
|
7809
|
+
return;
|
|
7810
|
+
}
|
|
7811
|
+
} else if (to2 instanceof HTMLElement) {
|
|
7812
|
+
target = to2;
|
|
7813
|
+
} else {
|
|
7814
|
+
console.warn(
|
|
7815
|
+
"MountedTeleport: Invalid target type. Expected string selector or HTMLElement."
|
|
7816
|
+
);
|
|
7817
|
+
setTargetElement(null);
|
|
7818
|
+
return;
|
|
7819
|
+
}
|
|
7820
|
+
setTargetElement(target);
|
|
7821
|
+
}, [to2, isMounted, disabled]);
|
|
7822
|
+
if (!isMounted || disabled || !targetElement) {
|
|
7823
|
+
return null;
|
|
7824
|
+
}
|
|
7825
|
+
return reactDom.createPortal(children, targetElement);
|
|
7826
|
+
};
|
|
7827
|
+
const ReadMore = ({
|
|
7828
|
+
moreStr = "Read more",
|
|
7829
|
+
lessStr = "Read less",
|
|
7830
|
+
link = "#",
|
|
7831
|
+
maxChars = 100,
|
|
7832
|
+
text,
|
|
7833
|
+
className = "",
|
|
7834
|
+
linkClassName = ""
|
|
7835
|
+
}) => {
|
|
7836
|
+
const [isExpanded, setIsExpanded] = React2.useState(false);
|
|
7837
|
+
const formattedText = () => {
|
|
7838
|
+
if (!isExpanded && text.length > maxChars) {
|
|
7839
|
+
return text.substring(0, maxChars).trim() + "...";
|
|
7840
|
+
}
|
|
7841
|
+
return text;
|
|
7842
|
+
};
|
|
7843
|
+
const handleToggle = (event) => {
|
|
7844
|
+
event.preventDefault();
|
|
7845
|
+
setIsExpanded(!isExpanded);
|
|
7846
|
+
};
|
|
7847
|
+
if (!text) {
|
|
7848
|
+
return null;
|
|
7849
|
+
}
|
|
7850
|
+
const shouldShowToggle = text.length > maxChars;
|
|
7851
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className, children: [
|
|
7852
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: formattedText() }),
|
|
7853
|
+
shouldShowToggle && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7854
|
+
" ",
|
|
7855
|
+
!isExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7856
|
+
"a",
|
|
7857
|
+
{
|
|
7858
|
+
href: link,
|
|
7859
|
+
onClick: handleToggle,
|
|
7860
|
+
className: linkClassName,
|
|
7861
|
+
role: "button",
|
|
7862
|
+
tabIndex: 0,
|
|
7863
|
+
onKeyDown: (e) => {
|
|
7864
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
7865
|
+
e.preventDefault();
|
|
7866
|
+
setIsExpanded(true);
|
|
7867
|
+
}
|
|
7868
|
+
},
|
|
7869
|
+
children: moreStr
|
|
7870
|
+
}
|
|
7871
|
+
) : lessStr && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7872
|
+
"a",
|
|
7873
|
+
{
|
|
7874
|
+
href: link,
|
|
7875
|
+
onClick: handleToggle,
|
|
7876
|
+
className: linkClassName,
|
|
7877
|
+
role: "button",
|
|
7878
|
+
tabIndex: 0,
|
|
7879
|
+
onKeyDown: (e) => {
|
|
7880
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
7881
|
+
e.preventDefault();
|
|
7882
|
+
setIsExpanded(false);
|
|
7883
|
+
}
|
|
7884
|
+
},
|
|
7885
|
+
children: lessStr
|
|
7886
|
+
}
|
|
7887
|
+
)
|
|
7888
|
+
] })
|
|
7889
|
+
] });
|
|
7890
|
+
};
|
|
7891
|
+
const StickyBottom = ({
|
|
7892
|
+
bottom = 0,
|
|
7893
|
+
zIndex = 1,
|
|
7894
|
+
className = "",
|
|
7895
|
+
children = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Sticky Bottom" })
|
|
7896
|
+
}) => {
|
|
7897
|
+
const elRef = React2.useRef(null);
|
|
7898
|
+
const [isSticky, setIsSticky] = React2.useState(false);
|
|
7899
|
+
const [width, setWidth] = React2.useState("auto");
|
|
7900
|
+
const [height, setHeight] = React2.useState("auto");
|
|
7901
|
+
React2.useEffect(() => {
|
|
7902
|
+
const handleScroll = () => {
|
|
7903
|
+
if (!elRef.current) return;
|
|
7904
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7905
|
+
const viewportHeight = window.innerHeight;
|
|
7906
|
+
const shouldStick = rect.bottom <= viewportHeight - bottom;
|
|
7907
|
+
if (shouldStick && !isSticky) {
|
|
7908
|
+
setWidth(rect.width + "px");
|
|
7909
|
+
setHeight(rect.height + "px");
|
|
7910
|
+
setIsSticky(true);
|
|
7911
|
+
} else if (!shouldStick && isSticky) {
|
|
7912
|
+
setIsSticky(false);
|
|
7913
|
+
setWidth("auto");
|
|
7914
|
+
}
|
|
7915
|
+
};
|
|
7916
|
+
const handleResize = () => {
|
|
7917
|
+
if (!isSticky && elRef.current) {
|
|
7918
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7919
|
+
setHeight(rect.height + "px");
|
|
7920
|
+
}
|
|
7921
|
+
};
|
|
7922
|
+
if (elRef.current) {
|
|
7923
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7924
|
+
setHeight(rect.height + "px");
|
|
7925
|
+
}
|
|
7926
|
+
window.addEventListener("scroll", handleScroll);
|
|
7927
|
+
window.addEventListener("resize", handleResize);
|
|
7928
|
+
handleScroll();
|
|
7929
|
+
return () => {
|
|
7930
|
+
window.removeEventListener("scroll", handleScroll);
|
|
7931
|
+
window.removeEventListener("resize", handleResize);
|
|
7932
|
+
};
|
|
7933
|
+
}, [bottom, isSticky]);
|
|
7934
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7935
|
+
"div",
|
|
7936
|
+
{
|
|
7937
|
+
ref: elRef,
|
|
7938
|
+
style: {
|
|
7939
|
+
height: isSticky ? height : "auto",
|
|
7940
|
+
zIndex
|
|
7941
|
+
},
|
|
7942
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7943
|
+
"div",
|
|
7944
|
+
{
|
|
7945
|
+
className,
|
|
7946
|
+
style: {
|
|
7947
|
+
position: isSticky ? "fixed" : "static",
|
|
7948
|
+
bottom: isSticky ? `${bottom}px` : "auto",
|
|
7949
|
+
width: isSticky ? width : "auto",
|
|
7950
|
+
zIndex
|
|
7951
|
+
},
|
|
7952
|
+
children
|
|
7953
|
+
}
|
|
7954
|
+
)
|
|
7955
|
+
}
|
|
7956
|
+
);
|
|
7957
|
+
};
|
|
7958
|
+
const StickyTop = ({
|
|
7959
|
+
top = 0,
|
|
7960
|
+
zIndex = 1,
|
|
7961
|
+
className = "",
|
|
7962
|
+
children = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Sticky Top" })
|
|
7963
|
+
}) => {
|
|
7964
|
+
const elRef = React2.useRef(null);
|
|
7965
|
+
const [isSticky, setIsSticky] = React2.useState(false);
|
|
7966
|
+
const [width, setWidth] = React2.useState("auto");
|
|
7967
|
+
const [height, setHeight] = React2.useState("auto");
|
|
7968
|
+
React2.useEffect(() => {
|
|
7969
|
+
const handleScroll = () => {
|
|
7970
|
+
if (!elRef.current) return;
|
|
7971
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7972
|
+
const shouldStick = rect.top <= top;
|
|
7973
|
+
if (shouldStick && !isSticky) {
|
|
7974
|
+
setWidth(rect.width + "px");
|
|
7975
|
+
setHeight(rect.height + "px");
|
|
7976
|
+
setIsSticky(true);
|
|
7977
|
+
} else if (!shouldStick && isSticky) {
|
|
7978
|
+
setIsSticky(false);
|
|
7979
|
+
setWidth("auto");
|
|
7980
|
+
}
|
|
7981
|
+
};
|
|
7982
|
+
const handleResize = () => {
|
|
7983
|
+
if (!isSticky && elRef.current) {
|
|
7984
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7985
|
+
setHeight(rect.height + "px");
|
|
7986
|
+
}
|
|
7987
|
+
};
|
|
7988
|
+
if (elRef.current) {
|
|
7989
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7990
|
+
setHeight(rect.height + "px");
|
|
7991
|
+
}
|
|
7992
|
+
window.addEventListener("scroll", handleScroll);
|
|
7993
|
+
window.addEventListener("resize", handleResize);
|
|
7994
|
+
handleScroll();
|
|
7995
|
+
return () => {
|
|
7996
|
+
window.removeEventListener("scroll", handleScroll);
|
|
7997
|
+
window.removeEventListener("resize", handleResize);
|
|
7998
|
+
};
|
|
7999
|
+
}, [top, isSticky]);
|
|
8000
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8001
|
+
"div",
|
|
8002
|
+
{
|
|
8003
|
+
ref: elRef,
|
|
8004
|
+
style: {
|
|
8005
|
+
height: isSticky ? height : "auto",
|
|
8006
|
+
zIndex
|
|
8007
|
+
},
|
|
8008
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8009
|
+
"div",
|
|
8010
|
+
{
|
|
8011
|
+
className,
|
|
8012
|
+
style: {
|
|
8013
|
+
position: isSticky ? "fixed" : "static",
|
|
8014
|
+
top: isSticky ? `${top}px` : "auto",
|
|
8015
|
+
width: isSticky ? width : "auto",
|
|
8016
|
+
zIndex
|
|
8017
|
+
},
|
|
8018
|
+
children
|
|
8019
|
+
}
|
|
8020
|
+
)
|
|
8021
|
+
}
|
|
8022
|
+
);
|
|
8023
|
+
};
|
|
8024
|
+
var MediaFileType;
|
|
8025
|
+
(function(MediaFileType2) {
|
|
8026
|
+
MediaFileType2[MediaFileType2["DOCUMENT"] = 1] = "DOCUMENT";
|
|
8027
|
+
MediaFileType2[MediaFileType2["IMAGE"] = 2] = "IMAGE";
|
|
8028
|
+
MediaFileType2[MediaFileType2["VIDEO"] = 3] = "VIDEO";
|
|
8029
|
+
MediaFileType2[MediaFileType2["AUDIO"] = 4] = "AUDIO";
|
|
8030
|
+
MediaFileType2[MediaFileType2["OTHER"] = 5] = "OTHER";
|
|
8031
|
+
})(MediaFileType || (MediaFileType = {}));
|
|
8032
|
+
var NewsArticleStatus;
|
|
8033
|
+
(function(NewsArticleStatus2) {
|
|
8034
|
+
NewsArticleStatus2[NewsArticleStatus2["DRAFT"] = 1] = "DRAFT";
|
|
8035
|
+
NewsArticleStatus2[NewsArticleStatus2["PENDING"] = 2] = "PENDING";
|
|
8036
|
+
NewsArticleStatus2[NewsArticleStatus2["PUBLISHED"] = 3] = "PUBLISHED";
|
|
8037
|
+
NewsArticleStatus2[NewsArticleStatus2["TRASH"] = 4] = "TRASH";
|
|
8038
|
+
})(NewsArticleStatus || (NewsArticleStatus = {}));
|
|
8039
|
+
var VideoDisplayType;
|
|
8040
|
+
(function(VideoDisplayType2) {
|
|
8041
|
+
VideoDisplayType2["VERTICAL"] = "vertical";
|
|
8042
|
+
VideoDisplayType2["HORIZONTAL"] = "horizontal";
|
|
8043
|
+
})(VideoDisplayType || (VideoDisplayType = {}));
|
|
8044
|
+
var VideoItemSource;
|
|
8045
|
+
(function(VideoItemSource2) {
|
|
8046
|
+
VideoItemSource2["SELF_HOSTED"] = "self-hosted";
|
|
8047
|
+
VideoItemSource2["YOUTUBE"] = "youtube";
|
|
8048
|
+
})(VideoItemSource || (VideoItemSource = {}));
|
|
8049
|
+
function slideToId(id2) {
|
|
8050
|
+
const element = document.getElementById(id2);
|
|
8051
|
+
if (element) {
|
|
8052
|
+
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
8053
|
+
} else {
|
|
8054
|
+
console.error(`Element with ID "${id2}" not found.`);
|
|
8055
|
+
}
|
|
8056
|
+
}
|
|
8057
|
+
//! moment.js
|
|
8058
|
+
//! version : 2.30.1
|
|
8059
|
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
8060
|
+
//! license : MIT
|
|
8061
|
+
//! momentjs.com
|
|
8062
|
+
var hookCallback;
|
|
8063
|
+
function hooks() {
|
|
8064
|
+
return hookCallback.apply(null, arguments);
|
|
8065
|
+
}
|
|
8066
|
+
function setHookCallback(callback) {
|
|
8067
|
+
hookCallback = callback;
|
|
8068
|
+
}
|
|
8069
|
+
function isArray(input) {
|
|
8070
|
+
return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]";
|
|
8071
|
+
}
|
|
8072
|
+
function isObject(input) {
|
|
8073
|
+
return input != null && Object.prototype.toString.call(input) === "[object Object]";
|
|
8074
|
+
}
|
|
8075
|
+
function hasOwnProp(a, b) {
|
|
8076
|
+
return Object.prototype.hasOwnProperty.call(a, b);
|
|
8077
|
+
}
|
|
8078
|
+
function isObjectEmpty(obj) {
|
|
8079
|
+
if (Object.getOwnPropertyNames) {
|
|
8080
|
+
return Object.getOwnPropertyNames(obj).length === 0;
|
|
8081
|
+
} else {
|
|
8082
|
+
var k;
|
|
8083
|
+
for (k in obj) {
|
|
8084
|
+
if (hasOwnProp(obj, k)) {
|
|
8085
|
+
return false;
|
|
8086
|
+
}
|
|
8087
|
+
}
|
|
8088
|
+
return true;
|
|
8089
|
+
}
|
|
8090
|
+
}
|
|
8091
|
+
function isUndefined(input) {
|
|
8092
|
+
return input === void 0;
|
|
8093
|
+
}
|
|
8094
|
+
function isNumber(input) {
|
|
8095
|
+
return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]";
|
|
8096
|
+
}
|
|
8097
|
+
function isDate(input) {
|
|
8098
|
+
return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]";
|
|
8099
|
+
}
|
|
8100
|
+
function map(arr, fn) {
|
|
8101
|
+
var res = [], i, arrLen = arr.length;
|
|
8102
|
+
for (i = 0; i < arrLen; ++i) {
|
|
8103
|
+
res.push(fn(arr[i], i));
|
|
8104
|
+
}
|
|
8105
|
+
return res;
|
|
8106
|
+
}
|
|
8107
|
+
function extend(a, b) {
|
|
8108
|
+
for (var i in b) {
|
|
8109
|
+
if (hasOwnProp(b, i)) {
|
|
8110
|
+
a[i] = b[i];
|
|
8111
|
+
}
|
|
8112
|
+
}
|
|
8113
|
+
if (hasOwnProp(b, "toString")) {
|
|
8114
|
+
a.toString = b.toString;
|
|
8115
|
+
}
|
|
8116
|
+
if (hasOwnProp(b, "valueOf")) {
|
|
8117
|
+
a.valueOf = b.valueOf;
|
|
8118
|
+
}
|
|
8119
|
+
return a;
|
|
8120
|
+
}
|
|
8121
|
+
function createUTC(input, format2, locale2, strict) {
|
|
8122
|
+
return createLocalOrUTC(input, format2, locale2, strict, true).utc();
|
|
8123
|
+
}
|
|
8124
|
+
function defaultParsingFlags() {
|
|
8125
|
+
return {
|
|
8126
|
+
empty: false,
|
|
8127
|
+
unusedTokens: [],
|
|
8128
|
+
unusedInput: [],
|
|
8129
|
+
overflow: -2,
|
|
8130
|
+
charsLeftOver: 0,
|
|
8131
|
+
nullInput: false,
|
|
8132
|
+
invalidEra: null,
|
|
8133
|
+
invalidMonth: null,
|
|
8134
|
+
invalidFormat: false,
|
|
8135
|
+
userInvalidated: false,
|
|
8136
|
+
iso: false,
|
|
8137
|
+
parsedDateParts: [],
|
|
8138
|
+
era: null,
|
|
8139
|
+
meridiem: null,
|
|
8140
|
+
rfc2822: false,
|
|
8141
|
+
weekdayMismatch: false
|
|
8142
|
+
};
|
|
8143
|
+
}
|
|
8144
|
+
function getParsingFlags(m) {
|
|
8145
|
+
if (m._pf == null) {
|
|
8146
|
+
m._pf = defaultParsingFlags();
|
|
8147
|
+
}
|
|
8148
|
+
return m._pf;
|
|
8149
|
+
}
|
|
8150
|
+
var some;
|
|
8151
|
+
if (Array.prototype.some) {
|
|
8152
|
+
some = Array.prototype.some;
|
|
8153
|
+
} else {
|
|
8154
|
+
some = function(fun) {
|
|
8155
|
+
var t = Object(this), len = t.length >>> 0, i;
|
|
8156
|
+
for (i = 0; i < len; i++) {
|
|
8157
|
+
if (i in t && fun.call(this, t[i], i, t)) {
|
|
8158
|
+
return true;
|
|
8159
|
+
}
|
|
8160
|
+
}
|
|
8161
|
+
return false;
|
|
8162
|
+
};
|
|
8163
|
+
}
|
|
8164
|
+
function isValid(m) {
|
|
8165
|
+
var flags = null, parsedParts = false, isNowValid = m._d && !isNaN(m._d.getTime());
|
|
8166
|
+
if (isNowValid) {
|
|
8167
|
+
flags = getParsingFlags(m);
|
|
8168
|
+
parsedParts = some.call(flags.parsedDateParts, function(i) {
|
|
8169
|
+
return i != null;
|
|
8170
|
+
});
|
|
8171
|
+
isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
|
|
8172
|
+
if (m._strict) {
|
|
8173
|
+
isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0;
|
|
8174
|
+
}
|
|
8175
|
+
}
|
|
8176
|
+
if (Object.isFrozen == null || !Object.isFrozen(m)) {
|
|
8177
|
+
m._isValid = isNowValid;
|
|
8178
|
+
} else {
|
|
8179
|
+
return isNowValid;
|
|
8180
|
+
}
|
|
8181
|
+
return m._isValid;
|
|
8182
|
+
}
|
|
8183
|
+
function createInvalid(flags) {
|
|
8184
|
+
var m = createUTC(NaN);
|
|
8185
|
+
if (flags != null) {
|
|
8186
|
+
extend(getParsingFlags(m), flags);
|
|
8187
|
+
} else {
|
|
8188
|
+
getParsingFlags(m).userInvalidated = true;
|
|
8189
|
+
}
|
|
8190
|
+
return m;
|
|
8191
|
+
}
|
|
8192
|
+
var momentProperties = hooks.momentProperties = [], updateInProgress = false;
|
|
8193
|
+
function copyConfig(to2, from2) {
|
|
8194
|
+
var i, prop, val, momentPropertiesLen = momentProperties.length;
|
|
8195
|
+
if (!isUndefined(from2._isAMomentObject)) {
|
|
8196
|
+
to2._isAMomentObject = from2._isAMomentObject;
|
|
8197
|
+
}
|
|
8198
|
+
if (!isUndefined(from2._i)) {
|
|
8199
|
+
to2._i = from2._i;
|
|
8200
|
+
}
|
|
8201
|
+
if (!isUndefined(from2._f)) {
|
|
8202
|
+
to2._f = from2._f;
|
|
8203
|
+
}
|
|
8204
|
+
if (!isUndefined(from2._l)) {
|
|
8205
|
+
to2._l = from2._l;
|
|
8206
|
+
}
|
|
8207
|
+
if (!isUndefined(from2._strict)) {
|
|
8208
|
+
to2._strict = from2._strict;
|
|
8209
|
+
}
|
|
8210
|
+
if (!isUndefined(from2._tzm)) {
|
|
8211
|
+
to2._tzm = from2._tzm;
|
|
8212
|
+
}
|
|
8213
|
+
if (!isUndefined(from2._isUTC)) {
|
|
8214
|
+
to2._isUTC = from2._isUTC;
|
|
8215
|
+
}
|
|
8216
|
+
if (!isUndefined(from2._offset)) {
|
|
8217
|
+
to2._offset = from2._offset;
|
|
8218
|
+
}
|
|
8219
|
+
if (!isUndefined(from2._pf)) {
|
|
8220
|
+
to2._pf = getParsingFlags(from2);
|
|
8221
|
+
}
|
|
8222
|
+
if (!isUndefined(from2._locale)) {
|
|
8223
|
+
to2._locale = from2._locale;
|
|
8224
|
+
}
|
|
8225
|
+
if (momentPropertiesLen > 0) {
|
|
8226
|
+
for (i = 0; i < momentPropertiesLen; i++) {
|
|
8227
|
+
prop = momentProperties[i];
|
|
8228
|
+
val = from2[prop];
|
|
8229
|
+
if (!isUndefined(val)) {
|
|
8230
|
+
to2[prop] = val;
|
|
8231
|
+
}
|
|
8232
|
+
}
|
|
8233
|
+
}
|
|
8234
|
+
return to2;
|
|
8235
|
+
}
|
|
8236
|
+
function Moment(config) {
|
|
8237
|
+
copyConfig(this, config);
|
|
8238
|
+
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
|
|
8239
|
+
if (!this.isValid()) {
|
|
8240
|
+
this._d = /* @__PURE__ */ new Date(NaN);
|
|
8241
|
+
}
|
|
8242
|
+
if (updateInProgress === false) {
|
|
8243
|
+
updateInProgress = true;
|
|
8244
|
+
hooks.updateOffset(this);
|
|
8245
|
+
updateInProgress = false;
|
|
8246
|
+
}
|
|
8247
|
+
}
|
|
8248
|
+
function isMoment(obj) {
|
|
8249
|
+
return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
|
|
8250
|
+
}
|
|
8251
|
+
function warn(msg) {
|
|
8252
|
+
if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
|
|
8253
|
+
console.warn("Deprecation warning: " + msg);
|
|
8254
|
+
}
|
|
8255
|
+
}
|
|
8256
|
+
function deprecate(msg, fn) {
|
|
8257
|
+
var firstTime = true;
|
|
8258
|
+
return extend(function() {
|
|
8259
|
+
if (hooks.deprecationHandler != null) {
|
|
8260
|
+
hooks.deprecationHandler(null, msg);
|
|
8261
|
+
}
|
|
8262
|
+
if (firstTime) {
|
|
8263
|
+
var args = [], arg, i, key, argLen = arguments.length;
|
|
8264
|
+
for (i = 0; i < argLen; i++) {
|
|
8265
|
+
arg = "";
|
|
8266
|
+
if (typeof arguments[i] === "object") {
|
|
8267
|
+
arg += "\n[" + i + "] ";
|
|
8268
|
+
for (key in arguments[0]) {
|
|
8269
|
+
if (hasOwnProp(arguments[0], key)) {
|
|
8270
|
+
arg += key + ": " + arguments[0][key] + ", ";
|
|
8271
|
+
}
|
|
8272
|
+
}
|
|
8273
|
+
arg = arg.slice(0, -2);
|
|
8274
|
+
} else {
|
|
8275
|
+
arg = arguments[i];
|
|
8276
|
+
}
|
|
8277
|
+
args.push(arg);
|
|
8278
|
+
}
|
|
8279
|
+
warn(
|
|
8280
|
+
msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack
|
|
8281
|
+
);
|
|
8282
|
+
firstTime = false;
|
|
8283
|
+
}
|
|
8284
|
+
return fn.apply(this, arguments);
|
|
8285
|
+
}, fn);
|
|
8286
|
+
}
|
|
8287
|
+
var deprecations = {};
|
|
8288
|
+
function deprecateSimple(name, msg) {
|
|
8289
|
+
if (hooks.deprecationHandler != null) {
|
|
8290
|
+
hooks.deprecationHandler(name, msg);
|
|
8291
|
+
}
|
|
8292
|
+
if (!deprecations[name]) {
|
|
8293
|
+
warn(msg);
|
|
8294
|
+
deprecations[name] = true;
|
|
8295
|
+
}
|
|
8296
|
+
}
|
|
8297
|
+
hooks.suppressDeprecationWarnings = false;
|
|
8298
|
+
hooks.deprecationHandler = null;
|
|
8299
|
+
function isFunction(input) {
|
|
8300
|
+
return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]";
|
|
8301
|
+
}
|
|
8302
|
+
function set(config) {
|
|
8303
|
+
var prop, i;
|
|
8304
|
+
for (i in config) {
|
|
8305
|
+
if (hasOwnProp(config, i)) {
|
|
8306
|
+
prop = config[i];
|
|
8307
|
+
if (isFunction(prop)) {
|
|
8308
|
+
this[i] = prop;
|
|
8309
|
+
} else {
|
|
8310
|
+
this["_" + i] = prop;
|
|
8311
|
+
}
|
|
8312
|
+
}
|
|
8313
|
+
}
|
|
8314
|
+
this._config = config;
|
|
8315
|
+
this._dayOfMonthOrdinalParseLenient = new RegExp(
|
|
8316
|
+
(this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
|
|
8317
|
+
);
|
|
8318
|
+
}
|
|
8319
|
+
function mergeConfigs(parentConfig, childConfig) {
|
|
8320
|
+
var res = extend({}, parentConfig), prop;
|
|
8321
|
+
for (prop in childConfig) {
|
|
8322
|
+
if (hasOwnProp(childConfig, prop)) {
|
|
8323
|
+
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
|
|
8324
|
+
res[prop] = {};
|
|
8325
|
+
extend(res[prop], parentConfig[prop]);
|
|
8326
|
+
extend(res[prop], childConfig[prop]);
|
|
8327
|
+
} else if (childConfig[prop] != null) {
|
|
8328
|
+
res[prop] = childConfig[prop];
|
|
8329
|
+
} else {
|
|
8330
|
+
delete res[prop];
|
|
8331
|
+
}
|
|
8332
|
+
}
|
|
8333
|
+
}
|
|
8334
|
+
for (prop in parentConfig) {
|
|
8335
|
+
if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
|
|
8336
|
+
res[prop] = extend({}, res[prop]);
|
|
8337
|
+
}
|
|
8338
|
+
}
|
|
8339
|
+
return res;
|
|
8340
|
+
}
|
|
8341
|
+
function Locale(config) {
|
|
8342
|
+
if (config != null) {
|
|
8343
|
+
this.set(config);
|
|
8344
|
+
}
|
|
8345
|
+
}
|
|
8346
|
+
var keys;
|
|
8347
|
+
if (Object.keys) {
|
|
8348
|
+
keys = Object.keys;
|
|
8349
|
+
} else {
|
|
8350
|
+
keys = function(obj) {
|
|
8351
|
+
var i, res = [];
|
|
8352
|
+
for (i in obj) {
|
|
8353
|
+
if (hasOwnProp(obj, i)) {
|
|
8354
|
+
res.push(i);
|
|
8355
|
+
}
|
|
8356
|
+
}
|
|
8357
|
+
return res;
|
|
8358
|
+
};
|
|
8359
|
+
}
|
|
8360
|
+
var defaultCalendar = {
|
|
8361
|
+
sameDay: "[Today at] LT",
|
|
8362
|
+
nextDay: "[Tomorrow at] LT",
|
|
8363
|
+
nextWeek: "dddd [at] LT",
|
|
8364
|
+
lastDay: "[Yesterday at] LT",
|
|
8365
|
+
lastWeek: "[Last] dddd [at] LT",
|
|
8366
|
+
sameElse: "L"
|
|
8367
|
+
};
|
|
8368
|
+
function calendar(key, mom, now2) {
|
|
8369
|
+
var output = this._calendar[key] || this._calendar["sameElse"];
|
|
8370
|
+
return isFunction(output) ? output.call(mom, now2) : output;
|
|
8371
|
+
}
|
|
8372
|
+
function zeroFill(number2, targetLength, forceSign) {
|
|
8373
|
+
var absNumber = "" + Math.abs(number2), zerosToFill = targetLength - absNumber.length, sign2 = number2 >= 0;
|
|
8374
|
+
return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
|
|
8375
|
+
}
|
|
8376
|
+
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
|
|
8377
|
+
function addFormatToken(token2, padded, ordinal2, callback) {
|
|
8378
|
+
var func = callback;
|
|
8379
|
+
if (typeof callback === "string") {
|
|
8380
|
+
func = function() {
|
|
8381
|
+
return this[callback]();
|
|
8382
|
+
};
|
|
8383
|
+
}
|
|
8384
|
+
if (token2) {
|
|
8385
|
+
formatTokenFunctions[token2] = func;
|
|
8386
|
+
}
|
|
8387
|
+
if (padded) {
|
|
8388
|
+
formatTokenFunctions[padded[0]] = function() {
|
|
8389
|
+
return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
|
|
8390
|
+
};
|
|
8391
|
+
}
|
|
8392
|
+
if (ordinal2) {
|
|
8393
|
+
formatTokenFunctions[ordinal2] = function() {
|
|
8394
|
+
return this.localeData().ordinal(
|
|
8395
|
+
func.apply(this, arguments),
|
|
8396
|
+
token2
|
|
8397
|
+
);
|
|
8398
|
+
};
|
|
8399
|
+
}
|
|
8400
|
+
}
|
|
8401
|
+
function removeFormattingTokens(input) {
|
|
8402
|
+
if (input.match(/\[[\s\S]/)) {
|
|
8403
|
+
return input.replace(/^\[|\]$/g, "");
|
|
8404
|
+
}
|
|
8405
|
+
return input.replace(/\\/g, "");
|
|
8406
|
+
}
|
|
8407
|
+
function makeFormatFunction(format2) {
|
|
8408
|
+
var array = format2.match(formattingTokens), i, length;
|
|
8409
|
+
for (i = 0, length = array.length; i < length; i++) {
|
|
8410
|
+
if (formatTokenFunctions[array[i]]) {
|
|
8411
|
+
array[i] = formatTokenFunctions[array[i]];
|
|
8412
|
+
} else {
|
|
8413
|
+
array[i] = removeFormattingTokens(array[i]);
|
|
8414
|
+
}
|
|
8415
|
+
}
|
|
8416
|
+
return function(mom) {
|
|
8417
|
+
var output = "", i2;
|
|
8418
|
+
for (i2 = 0; i2 < length; i2++) {
|
|
8419
|
+
output += isFunction(array[i2]) ? array[i2].call(mom, format2) : array[i2];
|
|
8420
|
+
}
|
|
8421
|
+
return output;
|
|
8422
|
+
};
|
|
8423
|
+
}
|
|
8424
|
+
function formatMoment(m, format2) {
|
|
8425
|
+
if (!m.isValid()) {
|
|
8426
|
+
return m.localeData().invalidDate();
|
|
8427
|
+
}
|
|
8428
|
+
format2 = expandFormat(format2, m.localeData());
|
|
8429
|
+
formatFunctions[format2] = formatFunctions[format2] || makeFormatFunction(format2);
|
|
8430
|
+
return formatFunctions[format2](m);
|
|
8431
|
+
}
|
|
8432
|
+
function expandFormat(format2, locale2) {
|
|
8433
|
+
var i = 5;
|
|
8434
|
+
function replaceLongDateFormatTokens(input) {
|
|
8435
|
+
return locale2.longDateFormat(input) || input;
|
|
8436
|
+
}
|
|
8437
|
+
localFormattingTokens.lastIndex = 0;
|
|
8438
|
+
while (i >= 0 && localFormattingTokens.test(format2)) {
|
|
8439
|
+
format2 = format2.replace(
|
|
8440
|
+
localFormattingTokens,
|
|
8441
|
+
replaceLongDateFormatTokens
|
|
8442
|
+
);
|
|
8443
|
+
localFormattingTokens.lastIndex = 0;
|
|
8444
|
+
i -= 1;
|
|
8445
|
+
}
|
|
8446
|
+
return format2;
|
|
8447
|
+
}
|
|
8448
|
+
var defaultLongDateFormat = {
|
|
8449
|
+
LTS: "h:mm:ss A",
|
|
8450
|
+
LT: "h:mm A",
|
|
8451
|
+
L: "MM/DD/YYYY",
|
|
8452
|
+
LL: "MMMM D, YYYY",
|
|
8453
|
+
LLL: "MMMM D, YYYY h:mm A",
|
|
8454
|
+
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
8455
|
+
};
|
|
8456
|
+
function longDateFormat(key) {
|
|
8457
|
+
var format2 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()];
|
|
8458
|
+
if (format2 || !formatUpper) {
|
|
8459
|
+
return format2;
|
|
8460
|
+
}
|
|
8461
|
+
this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) {
|
|
8462
|
+
if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
|
|
8463
|
+
return tok.slice(1);
|
|
8464
|
+
}
|
|
8465
|
+
return tok;
|
|
8466
|
+
}).join("");
|
|
8467
|
+
return this._longDateFormat[key];
|
|
8468
|
+
}
|
|
8469
|
+
var defaultInvalidDate = "Invalid date";
|
|
8470
|
+
function invalidDate() {
|
|
8471
|
+
return this._invalidDate;
|
|
8472
|
+
}
|
|
8473
|
+
var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/;
|
|
8474
|
+
function ordinal(number2) {
|
|
8475
|
+
return this._ordinal.replace("%d", number2);
|
|
8476
|
+
}
|
|
8477
|
+
var defaultRelativeTime = {
|
|
8478
|
+
future: "in %s",
|
|
8479
|
+
past: "%s ago",
|
|
8480
|
+
s: "a few seconds",
|
|
8481
|
+
ss: "%d seconds",
|
|
8482
|
+
m: "a minute",
|
|
8483
|
+
mm: "%d minutes",
|
|
8484
|
+
h: "an hour",
|
|
8485
|
+
hh: "%d hours",
|
|
8486
|
+
d: "a day",
|
|
8487
|
+
dd: "%d days",
|
|
8488
|
+
w: "a week",
|
|
8489
|
+
ww: "%d weeks",
|
|
8490
|
+
M: "a month",
|
|
8491
|
+
MM: "%d months",
|
|
8492
|
+
y: "a year",
|
|
8493
|
+
yy: "%d years"
|
|
8494
|
+
};
|
|
8495
|
+
function relativeTime(number2, withoutSuffix, string, isFuture) {
|
|
8496
|
+
var output = this._relativeTime[string];
|
|
8497
|
+
return isFunction(output) ? output(number2, withoutSuffix, string, isFuture) : output.replace(/%d/i, number2);
|
|
8498
|
+
}
|
|
8499
|
+
function pastFuture(diff2, output) {
|
|
8500
|
+
var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"];
|
|
8501
|
+
return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output);
|
|
8502
|
+
}
|
|
8503
|
+
var aliases = {
|
|
8504
|
+
D: "date",
|
|
8505
|
+
dates: "date",
|
|
8506
|
+
date: "date",
|
|
8507
|
+
d: "day",
|
|
8508
|
+
days: "day",
|
|
8509
|
+
day: "day",
|
|
8510
|
+
e: "weekday",
|
|
8511
|
+
weekdays: "weekday",
|
|
8512
|
+
weekday: "weekday",
|
|
8513
|
+
E: "isoWeekday",
|
|
8514
|
+
isoweekdays: "isoWeekday",
|
|
8515
|
+
isoweekday: "isoWeekday",
|
|
8516
|
+
DDD: "dayOfYear",
|
|
8517
|
+
dayofyears: "dayOfYear",
|
|
8518
|
+
dayofyear: "dayOfYear",
|
|
8519
|
+
h: "hour",
|
|
8520
|
+
hours: "hour",
|
|
8521
|
+
hour: "hour",
|
|
8522
|
+
ms: "millisecond",
|
|
8523
|
+
milliseconds: "millisecond",
|
|
8524
|
+
millisecond: "millisecond",
|
|
8525
|
+
m: "minute",
|
|
8526
|
+
minutes: "minute",
|
|
8527
|
+
minute: "minute",
|
|
8528
|
+
M: "month",
|
|
8529
|
+
months: "month",
|
|
8530
|
+
month: "month",
|
|
8531
|
+
Q: "quarter",
|
|
8532
|
+
quarters: "quarter",
|
|
8533
|
+
quarter: "quarter",
|
|
8534
|
+
s: "second",
|
|
8535
|
+
seconds: "second",
|
|
8536
|
+
second: "second",
|
|
8537
|
+
gg: "weekYear",
|
|
8538
|
+
weekyears: "weekYear",
|
|
8539
|
+
weekyear: "weekYear",
|
|
8540
|
+
GG: "isoWeekYear",
|
|
8541
|
+
isoweekyears: "isoWeekYear",
|
|
8542
|
+
isoweekyear: "isoWeekYear",
|
|
8543
|
+
w: "week",
|
|
8544
|
+
weeks: "week",
|
|
8545
|
+
week: "week",
|
|
8546
|
+
W: "isoWeek",
|
|
8547
|
+
isoweeks: "isoWeek",
|
|
8548
|
+
isoweek: "isoWeek",
|
|
8549
|
+
y: "year",
|
|
8550
|
+
years: "year",
|
|
8551
|
+
year: "year"
|
|
8552
|
+
};
|
|
8553
|
+
function normalizeUnits(units) {
|
|
8554
|
+
return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
|
|
8555
|
+
}
|
|
8556
|
+
function normalizeObjectUnits(inputObject) {
|
|
8557
|
+
var normalizedInput = {}, normalizedProp, prop;
|
|
8558
|
+
for (prop in inputObject) {
|
|
8559
|
+
if (hasOwnProp(inputObject, prop)) {
|
|
8560
|
+
normalizedProp = normalizeUnits(prop);
|
|
8561
|
+
if (normalizedProp) {
|
|
8562
|
+
normalizedInput[normalizedProp] = inputObject[prop];
|
|
8563
|
+
}
|
|
8564
|
+
}
|
|
8565
|
+
}
|
|
8566
|
+
return normalizedInput;
|
|
8567
|
+
}
|
|
8568
|
+
var priorities = {
|
|
8569
|
+
date: 9,
|
|
8570
|
+
day: 11,
|
|
8571
|
+
weekday: 11,
|
|
8572
|
+
isoWeekday: 11,
|
|
8573
|
+
dayOfYear: 4,
|
|
8574
|
+
hour: 13,
|
|
8575
|
+
millisecond: 16,
|
|
8576
|
+
minute: 14,
|
|
8577
|
+
month: 8,
|
|
8578
|
+
quarter: 7,
|
|
8579
|
+
second: 15,
|
|
8580
|
+
weekYear: 1,
|
|
8581
|
+
isoWeekYear: 1,
|
|
8582
|
+
week: 5,
|
|
8583
|
+
isoWeek: 5,
|
|
8584
|
+
year: 1
|
|
8585
|
+
};
|
|
8586
|
+
function getPrioritizedUnits(unitsObj) {
|
|
8587
|
+
var units = [], u;
|
|
8588
|
+
for (u in unitsObj) {
|
|
8589
|
+
if (hasOwnProp(unitsObj, u)) {
|
|
8590
|
+
units.push({ unit: u, priority: priorities[u] });
|
|
8591
|
+
}
|
|
8592
|
+
}
|
|
8593
|
+
units.sort(function(a, b) {
|
|
8594
|
+
return a.priority - b.priority;
|
|
8595
|
+
});
|
|
8596
|
+
return units;
|
|
8597
|
+
}
|
|
8598
|
+
var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, match1to2HasZero = /^([1-9]\d|\d)/, regexes;
|
|
8599
|
+
regexes = {};
|
|
8600
|
+
function addRegexToken(token2, regex, strictRegex) {
|
|
8601
|
+
regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) {
|
|
8602
|
+
return isStrict && strictRegex ? strictRegex : regex;
|
|
8603
|
+
};
|
|
8604
|
+
}
|
|
8605
|
+
function getParseRegexForToken(token2, config) {
|
|
8606
|
+
if (!hasOwnProp(regexes, token2)) {
|
|
8607
|
+
return new RegExp(unescapeFormat(token2));
|
|
8608
|
+
}
|
|
8609
|
+
return regexes[token2](config._strict, config._locale);
|
|
8610
|
+
}
|
|
8611
|
+
function unescapeFormat(s) {
|
|
8612
|
+
return regexEscape(
|
|
8613
|
+
s.replace("\\", "").replace(
|
|
8614
|
+
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
|
8615
|
+
function(matched, p1, p2, p3, p4) {
|
|
8616
|
+
return p1 || p2 || p3 || p4;
|
|
8617
|
+
}
|
|
8618
|
+
)
|
|
8619
|
+
);
|
|
8620
|
+
}
|
|
8621
|
+
function regexEscape(s) {
|
|
8622
|
+
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
8623
|
+
}
|
|
8624
|
+
function absFloor(number2) {
|
|
8625
|
+
if (number2 < 0) {
|
|
8626
|
+
return Math.ceil(number2) || 0;
|
|
8627
|
+
} else {
|
|
8628
|
+
return Math.floor(number2);
|
|
8629
|
+
}
|
|
8630
|
+
}
|
|
8631
|
+
function toInt(argumentForCoercion) {
|
|
8632
|
+
var coercedNumber = +argumentForCoercion, value = 0;
|
|
8633
|
+
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
|
8634
|
+
value = absFloor(coercedNumber);
|
|
8635
|
+
}
|
|
8636
|
+
return value;
|
|
8637
|
+
}
|
|
8638
|
+
var tokens = {};
|
|
8639
|
+
function addParseToken(token2, callback) {
|
|
8640
|
+
var i, func = callback, tokenLen;
|
|
8641
|
+
if (typeof token2 === "string") {
|
|
8642
|
+
token2 = [token2];
|
|
8643
|
+
}
|
|
8644
|
+
if (isNumber(callback)) {
|
|
8645
|
+
func = function(input, array) {
|
|
8646
|
+
array[callback] = toInt(input);
|
|
8647
|
+
};
|
|
8648
|
+
}
|
|
8649
|
+
tokenLen = token2.length;
|
|
8650
|
+
for (i = 0; i < tokenLen; i++) {
|
|
8651
|
+
tokens[token2[i]] = func;
|
|
8652
|
+
}
|
|
8653
|
+
}
|
|
8654
|
+
function addWeekParseToken(token2, callback) {
|
|
8655
|
+
addParseToken(token2, function(input, array, config, token3) {
|
|
8656
|
+
config._w = config._w || {};
|
|
8657
|
+
callback(input, config._w, config, token3);
|
|
8658
|
+
});
|
|
8659
|
+
}
|
|
8660
|
+
function addTimeToArrayFromToken(token2, input, config) {
|
|
8661
|
+
if (input != null && hasOwnProp(tokens, token2)) {
|
|
8662
|
+
tokens[token2](input, config._a, config, token2);
|
|
8663
|
+
}
|
|
8664
|
+
}
|
|
8665
|
+
function isLeapYear(year) {
|
|
8666
|
+
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
8667
|
+
}
|
|
8668
|
+
var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
|
|
8669
|
+
addFormatToken("Y", 0, 0, function() {
|
|
8670
|
+
var y = this.year();
|
|
8671
|
+
return y <= 9999 ? zeroFill(y, 4) : "+" + y;
|
|
8672
|
+
});
|
|
8673
|
+
addFormatToken(0, ["YY", 2], 0, function() {
|
|
8674
|
+
return this.year() % 100;
|
|
8675
|
+
});
|
|
8676
|
+
addFormatToken(0, ["YYYY", 4], 0, "year");
|
|
8677
|
+
addFormatToken(0, ["YYYYY", 5], 0, "year");
|
|
8678
|
+
addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
|
|
8679
|
+
addRegexToken("Y", matchSigned);
|
|
8680
|
+
addRegexToken("YY", match1to2, match2);
|
|
8681
|
+
addRegexToken("YYYY", match1to4, match4);
|
|
8682
|
+
addRegexToken("YYYYY", match1to6, match6);
|
|
8683
|
+
addRegexToken("YYYYYY", match1to6, match6);
|
|
8684
|
+
addParseToken(["YYYYY", "YYYYYY"], YEAR);
|
|
8685
|
+
addParseToken("YYYY", function(input, array) {
|
|
8686
|
+
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
|
8687
|
+
});
|
|
8688
|
+
addParseToken("YY", function(input, array) {
|
|
8689
|
+
array[YEAR] = hooks.parseTwoDigitYear(input);
|
|
8690
|
+
});
|
|
8691
|
+
addParseToken("Y", function(input, array) {
|
|
8692
|
+
array[YEAR] = parseInt(input, 10);
|
|
8693
|
+
});
|
|
8694
|
+
function daysInYear(year) {
|
|
8695
|
+
return isLeapYear(year) ? 366 : 365;
|
|
8696
|
+
}
|
|
8697
|
+
hooks.parseTwoDigitYear = function(input) {
|
|
8698
|
+
return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
|
|
8699
|
+
};
|
|
8700
|
+
var getSetYear = makeGetSet("FullYear", true);
|
|
8701
|
+
function getIsLeapYear() {
|
|
8702
|
+
return isLeapYear(this.year());
|
|
8703
|
+
}
|
|
8704
|
+
function makeGetSet(unit, keepTime) {
|
|
8705
|
+
return function(value) {
|
|
8706
|
+
if (value != null) {
|
|
8707
|
+
set$1(this, unit, value);
|
|
8708
|
+
hooks.updateOffset(this, keepTime);
|
|
8709
|
+
return this;
|
|
8710
|
+
} else {
|
|
8711
|
+
return get(this, unit);
|
|
8712
|
+
}
|
|
8713
|
+
};
|
|
8714
|
+
}
|
|
8715
|
+
function get(mom, unit) {
|
|
8716
|
+
if (!mom.isValid()) {
|
|
8717
|
+
return NaN;
|
|
8718
|
+
}
|
|
8719
|
+
var d = mom._d, isUTC = mom._isUTC;
|
|
8720
|
+
switch (unit) {
|
|
8721
|
+
case "Milliseconds":
|
|
8722
|
+
return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
|
|
8723
|
+
case "Seconds":
|
|
8724
|
+
return isUTC ? d.getUTCSeconds() : d.getSeconds();
|
|
8725
|
+
case "Minutes":
|
|
8726
|
+
return isUTC ? d.getUTCMinutes() : d.getMinutes();
|
|
8727
|
+
case "Hours":
|
|
8728
|
+
return isUTC ? d.getUTCHours() : d.getHours();
|
|
8729
|
+
case "Date":
|
|
8730
|
+
return isUTC ? d.getUTCDate() : d.getDate();
|
|
8731
|
+
case "Day":
|
|
8732
|
+
return isUTC ? d.getUTCDay() : d.getDay();
|
|
8733
|
+
case "Month":
|
|
8734
|
+
return isUTC ? d.getUTCMonth() : d.getMonth();
|
|
8735
|
+
case "FullYear":
|
|
8736
|
+
return isUTC ? d.getUTCFullYear() : d.getFullYear();
|
|
8737
|
+
default:
|
|
8738
|
+
return NaN;
|
|
8739
|
+
}
|
|
8740
|
+
}
|
|
8741
|
+
function set$1(mom, unit, value) {
|
|
8742
|
+
var d, isUTC, year, month, date;
|
|
8743
|
+
if (!mom.isValid() || isNaN(value)) {
|
|
8744
|
+
return;
|
|
8745
|
+
}
|
|
8746
|
+
d = mom._d;
|
|
8747
|
+
isUTC = mom._isUTC;
|
|
8748
|
+
switch (unit) {
|
|
8749
|
+
case "Milliseconds":
|
|
8750
|
+
return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
|
|
8751
|
+
case "Seconds":
|
|
8752
|
+
return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
|
|
8753
|
+
case "Minutes":
|
|
8754
|
+
return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
|
|
8755
|
+
case "Hours":
|
|
8756
|
+
return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
|
|
8757
|
+
case "Date":
|
|
8758
|
+
return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
|
|
8759
|
+
// case 'Day': // Not real
|
|
8760
|
+
// return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
|
|
8761
|
+
// case 'Month': // Not used because we need to pass two variables
|
|
8762
|
+
// return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
|
|
8763
|
+
case "FullYear":
|
|
8764
|
+
break;
|
|
8765
|
+
// See below ...
|
|
8766
|
+
default:
|
|
8767
|
+
return;
|
|
8768
|
+
}
|
|
8769
|
+
year = value;
|
|
8770
|
+
month = mom.month();
|
|
8771
|
+
date = mom.date();
|
|
8772
|
+
date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
|
|
8773
|
+
void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));
|
|
8774
|
+
}
|
|
8775
|
+
function stringGet(units) {
|
|
8776
|
+
units = normalizeUnits(units);
|
|
8777
|
+
if (isFunction(this[units])) {
|
|
8778
|
+
return this[units]();
|
|
8779
|
+
}
|
|
8780
|
+
return this;
|
|
8781
|
+
}
|
|
8782
|
+
function stringSet(units, value) {
|
|
8783
|
+
if (typeof units === "object") {
|
|
8784
|
+
units = normalizeObjectUnits(units);
|
|
8785
|
+
var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length;
|
|
8786
|
+
for (i = 0; i < prioritizedLen; i++) {
|
|
8787
|
+
this[prioritized[i].unit](units[prioritized[i].unit]);
|
|
8788
|
+
}
|
|
8789
|
+
} else {
|
|
8790
|
+
units = normalizeUnits(units);
|
|
8791
|
+
if (isFunction(this[units])) {
|
|
8792
|
+
return this[units](value);
|
|
8793
|
+
}
|
|
8794
|
+
}
|
|
8795
|
+
return this;
|
|
8796
|
+
}
|
|
8797
|
+
function mod(n, x) {
|
|
8798
|
+
return (n % x + x) % x;
|
|
8799
|
+
}
|
|
8800
|
+
var indexOf;
|
|
8801
|
+
if (Array.prototype.indexOf) {
|
|
8802
|
+
indexOf = Array.prototype.indexOf;
|
|
8803
|
+
} else {
|
|
8804
|
+
indexOf = function(o) {
|
|
8805
|
+
var i;
|
|
8806
|
+
for (i = 0; i < this.length; ++i) {
|
|
8807
|
+
if (this[i] === o) {
|
|
8808
|
+
return i;
|
|
8809
|
+
}
|
|
8810
|
+
}
|
|
8811
|
+
return -1;
|
|
8812
|
+
};
|
|
8813
|
+
}
|
|
8814
|
+
function daysInMonth(year, month) {
|
|
8815
|
+
if (isNaN(year) || isNaN(month)) {
|
|
8816
|
+
return NaN;
|
|
8817
|
+
}
|
|
8818
|
+
var modMonth = mod(month, 12);
|
|
8819
|
+
year += (month - modMonth) / 12;
|
|
8820
|
+
return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
|
|
8821
|
+
}
|
|
8822
|
+
addFormatToken("M", ["MM", 2], "Mo", function() {
|
|
8823
|
+
return this.month() + 1;
|
|
8824
|
+
});
|
|
8825
|
+
addFormatToken("MMM", 0, 0, function(format2) {
|
|
8826
|
+
return this.localeData().monthsShort(this, format2);
|
|
8827
|
+
});
|
|
8828
|
+
addFormatToken("MMMM", 0, 0, function(format2) {
|
|
8829
|
+
return this.localeData().months(this, format2);
|
|
8830
|
+
});
|
|
8831
|
+
addRegexToken("M", match1to2, match1to2NoLeadingZero);
|
|
8832
|
+
addRegexToken("MM", match1to2, match2);
|
|
8833
|
+
addRegexToken("MMM", function(isStrict, locale2) {
|
|
8834
|
+
return locale2.monthsShortRegex(isStrict);
|
|
8835
|
+
});
|
|
8836
|
+
addRegexToken("MMMM", function(isStrict, locale2) {
|
|
8837
|
+
return locale2.monthsRegex(isStrict);
|
|
8838
|
+
});
|
|
8839
|
+
addParseToken(["M", "MM"], function(input, array) {
|
|
8840
|
+
array[MONTH] = toInt(input) - 1;
|
|
8841
|
+
});
|
|
8842
|
+
addParseToken(["MMM", "MMMM"], function(input, array, config, token2) {
|
|
8843
|
+
var month = config._locale.monthsParse(input, token2, config._strict);
|
|
8844
|
+
if (month != null) {
|
|
8845
|
+
array[MONTH] = month;
|
|
8846
|
+
} else {
|
|
8847
|
+
getParsingFlags(config).invalidMonth = input;
|
|
8848
|
+
}
|
|
8849
|
+
});
|
|
8850
|
+
var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
|
|
8851
|
+
"_"
|
|
8852
|
+
), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord;
|
|
8853
|
+
function localeMonths(m, format2) {
|
|
8854
|
+
if (!m) {
|
|
8855
|
+
return isArray(this._months) ? this._months : this._months["standalone"];
|
|
8856
|
+
}
|
|
8857
|
+
return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format2) ? "format" : "standalone"][m.month()];
|
|
8858
|
+
}
|
|
8859
|
+
function localeMonthsShort(m, format2) {
|
|
8860
|
+
if (!m) {
|
|
8861
|
+
return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"];
|
|
8862
|
+
}
|
|
8863
|
+
return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m.month()];
|
|
8864
|
+
}
|
|
8865
|
+
function handleStrictParse(monthName, format2, strict) {
|
|
8866
|
+
var i, ii, mom, llc = monthName.toLocaleLowerCase();
|
|
8867
|
+
if (!this._monthsParse) {
|
|
8868
|
+
this._monthsParse = [];
|
|
8869
|
+
this._longMonthsParse = [];
|
|
8870
|
+
this._shortMonthsParse = [];
|
|
8871
|
+
for (i = 0; i < 12; ++i) {
|
|
8872
|
+
mom = createUTC([2e3, i]);
|
|
8873
|
+
this._shortMonthsParse[i] = this.monthsShort(
|
|
8874
|
+
mom,
|
|
8875
|
+
""
|
|
8876
|
+
).toLocaleLowerCase();
|
|
8877
|
+
this._longMonthsParse[i] = this.months(mom, "").toLocaleLowerCase();
|
|
8878
|
+
}
|
|
8879
|
+
}
|
|
8880
|
+
if (strict) {
|
|
8881
|
+
if (format2 === "MMM") {
|
|
8882
|
+
ii = indexOf.call(this._shortMonthsParse, llc);
|
|
8883
|
+
return ii !== -1 ? ii : null;
|
|
8884
|
+
} else {
|
|
8885
|
+
ii = indexOf.call(this._longMonthsParse, llc);
|
|
8886
|
+
return ii !== -1 ? ii : null;
|
|
8887
|
+
}
|
|
8888
|
+
} else {
|
|
8889
|
+
if (format2 === "MMM") {
|
|
8890
|
+
ii = indexOf.call(this._shortMonthsParse, llc);
|
|
8891
|
+
if (ii !== -1) {
|
|
8892
|
+
return ii;
|
|
8893
|
+
}
|
|
8894
|
+
ii = indexOf.call(this._longMonthsParse, llc);
|
|
8895
|
+
return ii !== -1 ? ii : null;
|
|
8896
|
+
} else {
|
|
8897
|
+
ii = indexOf.call(this._longMonthsParse, llc);
|
|
8898
|
+
if (ii !== -1) {
|
|
8899
|
+
return ii;
|
|
8900
|
+
}
|
|
8901
|
+
ii = indexOf.call(this._shortMonthsParse, llc);
|
|
8902
|
+
return ii !== -1 ? ii : null;
|
|
8903
|
+
}
|
|
8904
|
+
}
|
|
8905
|
+
}
|
|
8906
|
+
function localeMonthsParse(monthName, format2, strict) {
|
|
8907
|
+
var i, mom, regex;
|
|
8908
|
+
if (this._monthsParseExact) {
|
|
8909
|
+
return handleStrictParse.call(this, monthName, format2, strict);
|
|
8910
|
+
}
|
|
8911
|
+
if (!this._monthsParse) {
|
|
8912
|
+
this._monthsParse = [];
|
|
8913
|
+
this._longMonthsParse = [];
|
|
8914
|
+
this._shortMonthsParse = [];
|
|
8915
|
+
}
|
|
8916
|
+
for (i = 0; i < 12; i++) {
|
|
8917
|
+
mom = createUTC([2e3, i]);
|
|
8918
|
+
if (strict && !this._longMonthsParse[i]) {
|
|
8919
|
+
this._longMonthsParse[i] = new RegExp(
|
|
8920
|
+
"^" + this.months(mom, "").replace(".", "") + "$",
|
|
8921
|
+
"i"
|
|
8922
|
+
);
|
|
8923
|
+
this._shortMonthsParse[i] = new RegExp(
|
|
8924
|
+
"^" + this.monthsShort(mom, "").replace(".", "") + "$",
|
|
8925
|
+
"i"
|
|
8926
|
+
);
|
|
8927
|
+
}
|
|
8928
|
+
if (!strict && !this._monthsParse[i]) {
|
|
8929
|
+
regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
|
|
8930
|
+
this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i");
|
|
8931
|
+
}
|
|
8932
|
+
if (strict && format2 === "MMMM" && this._longMonthsParse[i].test(monthName)) {
|
|
8933
|
+
return i;
|
|
8934
|
+
} else if (strict && format2 === "MMM" && this._shortMonthsParse[i].test(monthName)) {
|
|
8935
|
+
return i;
|
|
8936
|
+
} else if (!strict && this._monthsParse[i].test(monthName)) {
|
|
8937
|
+
return i;
|
|
8938
|
+
}
|
|
8939
|
+
}
|
|
8940
|
+
}
|
|
8941
|
+
function setMonth(mom, value) {
|
|
8942
|
+
if (!mom.isValid()) {
|
|
8943
|
+
return mom;
|
|
8944
|
+
}
|
|
8945
|
+
if (typeof value === "string") {
|
|
8946
|
+
if (/^\d+$/.test(value)) {
|
|
8947
|
+
value = toInt(value);
|
|
8948
|
+
} else {
|
|
8949
|
+
value = mom.localeData().monthsParse(value);
|
|
8950
|
+
if (!isNumber(value)) {
|
|
8951
|
+
return mom;
|
|
8952
|
+
}
|
|
8953
|
+
}
|
|
8954
|
+
}
|
|
8955
|
+
var month = value, date = mom.date();
|
|
8956
|
+
date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
|
|
8957
|
+
void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
|
|
8958
|
+
return mom;
|
|
8959
|
+
}
|
|
8960
|
+
function getSetMonth(value) {
|
|
8961
|
+
if (value != null) {
|
|
8962
|
+
setMonth(this, value);
|
|
8963
|
+
hooks.updateOffset(this, true);
|
|
8964
|
+
return this;
|
|
8965
|
+
} else {
|
|
8966
|
+
return get(this, "Month");
|
|
8967
|
+
}
|
|
8968
|
+
}
|
|
8969
|
+
function getDaysInMonth() {
|
|
8970
|
+
return daysInMonth(this.year(), this.month());
|
|
8971
|
+
}
|
|
8972
|
+
function monthsShortRegex(isStrict) {
|
|
8973
|
+
if (this._monthsParseExact) {
|
|
8974
|
+
if (!hasOwnProp(this, "_monthsRegex")) {
|
|
8975
|
+
computeMonthsParse.call(this);
|
|
8976
|
+
}
|
|
8977
|
+
if (isStrict) {
|
|
8978
|
+
return this._monthsShortStrictRegex;
|
|
8979
|
+
} else {
|
|
8980
|
+
return this._monthsShortRegex;
|
|
8981
|
+
}
|
|
8982
|
+
} else {
|
|
8983
|
+
if (!hasOwnProp(this, "_monthsShortRegex")) {
|
|
8984
|
+
this._monthsShortRegex = defaultMonthsShortRegex;
|
|
8985
|
+
}
|
|
8986
|
+
return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
|
|
8987
|
+
}
|
|
8988
|
+
}
|
|
8989
|
+
function monthsRegex$1(isStrict) {
|
|
8990
|
+
if (this._monthsParseExact) {
|
|
8991
|
+
if (!hasOwnProp(this, "_monthsRegex")) {
|
|
8992
|
+
computeMonthsParse.call(this);
|
|
8993
|
+
}
|
|
8994
|
+
if (isStrict) {
|
|
8995
|
+
return this._monthsStrictRegex;
|
|
8996
|
+
} else {
|
|
8997
|
+
return this._monthsRegex;
|
|
8998
|
+
}
|
|
8999
|
+
} else {
|
|
9000
|
+
if (!hasOwnProp(this, "_monthsRegex")) {
|
|
9001
|
+
this._monthsRegex = defaultMonthsRegex;
|
|
9002
|
+
}
|
|
9003
|
+
return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
|
|
9004
|
+
}
|
|
9005
|
+
}
|
|
9006
|
+
function computeMonthsParse() {
|
|
9007
|
+
function cmpLenRev(a, b) {
|
|
9008
|
+
return b.length - a.length;
|
|
9009
|
+
}
|
|
9010
|
+
var shortPieces = [], longPieces = [], mixedPieces = [], i, mom, shortP, longP;
|
|
9011
|
+
for (i = 0; i < 12; i++) {
|
|
9012
|
+
mom = createUTC([2e3, i]);
|
|
9013
|
+
shortP = regexEscape(this.monthsShort(mom, ""));
|
|
9014
|
+
longP = regexEscape(this.months(mom, ""));
|
|
9015
|
+
shortPieces.push(shortP);
|
|
9016
|
+
longPieces.push(longP);
|
|
9017
|
+
mixedPieces.push(longP);
|
|
9018
|
+
mixedPieces.push(shortP);
|
|
9019
|
+
}
|
|
9020
|
+
shortPieces.sort(cmpLenRev);
|
|
9021
|
+
longPieces.sort(cmpLenRev);
|
|
9022
|
+
mixedPieces.sort(cmpLenRev);
|
|
9023
|
+
this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
|
|
9024
|
+
this._monthsShortRegex = this._monthsRegex;
|
|
9025
|
+
this._monthsStrictRegex = new RegExp(
|
|
9026
|
+
"^(" + longPieces.join("|") + ")",
|
|
9027
|
+
"i"
|
|
9028
|
+
);
|
|
9029
|
+
this._monthsShortStrictRegex = new RegExp(
|
|
9030
|
+
"^(" + shortPieces.join("|") + ")",
|
|
9031
|
+
"i"
|
|
9032
|
+
);
|
|
9033
|
+
}
|
|
9034
|
+
function createDate(y, m, d, h, M, s, ms) {
|
|
9035
|
+
var date;
|
|
9036
|
+
if (y < 100 && y >= 0) {
|
|
9037
|
+
date = new Date(y + 400, m, d, h, M, s, ms);
|
|
9038
|
+
if (isFinite(date.getFullYear())) {
|
|
9039
|
+
date.setFullYear(y);
|
|
9040
|
+
}
|
|
9041
|
+
} else {
|
|
9042
|
+
date = new Date(y, m, d, h, M, s, ms);
|
|
9043
|
+
}
|
|
9044
|
+
return date;
|
|
9045
|
+
}
|
|
9046
|
+
function createUTCDate(y) {
|
|
9047
|
+
var date, args;
|
|
9048
|
+
if (y < 100 && y >= 0) {
|
|
9049
|
+
args = Array.prototype.slice.call(arguments);
|
|
9050
|
+
args[0] = y + 400;
|
|
9051
|
+
date = new Date(Date.UTC.apply(null, args));
|
|
9052
|
+
if (isFinite(date.getUTCFullYear())) {
|
|
9053
|
+
date.setUTCFullYear(y);
|
|
9054
|
+
}
|
|
9055
|
+
} else {
|
|
9056
|
+
date = new Date(Date.UTC.apply(null, arguments));
|
|
9057
|
+
}
|
|
9058
|
+
return date;
|
|
9059
|
+
}
|
|
9060
|
+
function firstWeekOffset(year, dow, doy) {
|
|
9061
|
+
var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
|
|
9062
|
+
return -fwdlw + fwd - 1;
|
|
9063
|
+
}
|
|
9064
|
+
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
|
|
9065
|
+
var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
|
|
9066
|
+
if (dayOfYear <= 0) {
|
|
9067
|
+
resYear = year - 1;
|
|
9068
|
+
resDayOfYear = daysInYear(resYear) + dayOfYear;
|
|
9069
|
+
} else if (dayOfYear > daysInYear(year)) {
|
|
9070
|
+
resYear = year + 1;
|
|
9071
|
+
resDayOfYear = dayOfYear - daysInYear(year);
|
|
9072
|
+
} else {
|
|
9073
|
+
resYear = year;
|
|
9074
|
+
resDayOfYear = dayOfYear;
|
|
9075
|
+
}
|
|
9076
|
+
return {
|
|
9077
|
+
year: resYear,
|
|
9078
|
+
dayOfYear: resDayOfYear
|
|
9079
|
+
};
|
|
9080
|
+
}
|
|
9081
|
+
function weekOfYear(mom, dow, doy) {
|
|
9082
|
+
var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
|
|
9083
|
+
if (week < 1) {
|
|
9084
|
+
resYear = mom.year() - 1;
|
|
9085
|
+
resWeek = week + weeksInYear(resYear, dow, doy);
|
|
9086
|
+
} else if (week > weeksInYear(mom.year(), dow, doy)) {
|
|
9087
|
+
resWeek = week - weeksInYear(mom.year(), dow, doy);
|
|
9088
|
+
resYear = mom.year() + 1;
|
|
9089
|
+
} else {
|
|
9090
|
+
resYear = mom.year();
|
|
9091
|
+
resWeek = week;
|
|
9092
|
+
}
|
|
9093
|
+
return {
|
|
9094
|
+
week: resWeek,
|
|
9095
|
+
year: resYear
|
|
9096
|
+
};
|
|
9097
|
+
}
|
|
9098
|
+
function weeksInYear(year, dow, doy) {
|
|
9099
|
+
var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
|
|
9100
|
+
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
|
|
9101
|
+
}
|
|
9102
|
+
addFormatToken("w", ["ww", 2], "wo", "week");
|
|
9103
|
+
addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
|
|
9104
|
+
addRegexToken("w", match1to2, match1to2NoLeadingZero);
|
|
9105
|
+
addRegexToken("ww", match1to2, match2);
|
|
9106
|
+
addRegexToken("W", match1to2, match1to2NoLeadingZero);
|
|
9107
|
+
addRegexToken("WW", match1to2, match2);
|
|
9108
|
+
addWeekParseToken(
|
|
9109
|
+
["w", "ww", "W", "WW"],
|
|
9110
|
+
function(input, week, config, token2) {
|
|
9111
|
+
week[token2.substr(0, 1)] = toInt(input);
|
|
9112
|
+
}
|
|
9113
|
+
);
|
|
9114
|
+
function localeWeek(mom) {
|
|
9115
|
+
return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
|
9116
|
+
}
|
|
9117
|
+
var defaultLocaleWeek = {
|
|
9118
|
+
dow: 0,
|
|
9119
|
+
// Sunday is the first day of the week.
|
|
9120
|
+
doy: 6
|
|
9121
|
+
// The week that contains Jan 6th is the first week of the year.
|
|
9122
|
+
};
|
|
9123
|
+
function localeFirstDayOfWeek() {
|
|
9124
|
+
return this._week.dow;
|
|
9125
|
+
}
|
|
9126
|
+
function localeFirstDayOfYear() {
|
|
9127
|
+
return this._week.doy;
|
|
9128
|
+
}
|
|
9129
|
+
function getSetWeek(input) {
|
|
9130
|
+
var week = this.localeData().week(this);
|
|
9131
|
+
return input == null ? week : this.add((input - week) * 7, "d");
|
|
9132
|
+
}
|
|
9133
|
+
function getSetISOWeek(input) {
|
|
9134
|
+
var week = weekOfYear(this, 1, 4).week;
|
|
9135
|
+
return input == null ? week : this.add((input - week) * 7, "d");
|
|
9136
|
+
}
|
|
9137
|
+
addFormatToken("d", 0, "do", "day");
|
|
9138
|
+
addFormatToken("dd", 0, 0, function(format2) {
|
|
9139
|
+
return this.localeData().weekdaysMin(this, format2);
|
|
9140
|
+
});
|
|
9141
|
+
addFormatToken("ddd", 0, 0, function(format2) {
|
|
9142
|
+
return this.localeData().weekdaysShort(this, format2);
|
|
9143
|
+
});
|
|
9144
|
+
addFormatToken("dddd", 0, 0, function(format2) {
|
|
9145
|
+
return this.localeData().weekdays(this, format2);
|
|
9146
|
+
});
|
|
9147
|
+
addFormatToken("e", 0, 0, "weekday");
|
|
9148
|
+
addFormatToken("E", 0, 0, "isoWeekday");
|
|
9149
|
+
addRegexToken("d", match1to2);
|
|
9150
|
+
addRegexToken("e", match1to2);
|
|
9151
|
+
addRegexToken("E", match1to2);
|
|
9152
|
+
addRegexToken("dd", function(isStrict, locale2) {
|
|
9153
|
+
return locale2.weekdaysMinRegex(isStrict);
|
|
9154
|
+
});
|
|
9155
|
+
addRegexToken("ddd", function(isStrict, locale2) {
|
|
9156
|
+
return locale2.weekdaysShortRegex(isStrict);
|
|
9157
|
+
});
|
|
9158
|
+
addRegexToken("dddd", function(isStrict, locale2) {
|
|
9159
|
+
return locale2.weekdaysRegex(isStrict);
|
|
9160
|
+
});
|
|
9161
|
+
addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config, token2) {
|
|
9162
|
+
var weekday = config._locale.weekdaysParse(input, token2, config._strict);
|
|
9163
|
+
if (weekday != null) {
|
|
9164
|
+
week.d = weekday;
|
|
9165
|
+
} else {
|
|
9166
|
+
getParsingFlags(config).invalidWeekday = input;
|
|
9167
|
+
}
|
|
9168
|
+
});
|
|
9169
|
+
addWeekParseToken(["d", "e", "E"], function(input, week, config, token2) {
|
|
9170
|
+
week[token2] = toInt(input);
|
|
9171
|
+
});
|
|
9172
|
+
function parseWeekday(input, locale2) {
|
|
9173
|
+
if (typeof input !== "string") {
|
|
9174
|
+
return input;
|
|
9175
|
+
}
|
|
9176
|
+
if (!isNaN(input)) {
|
|
9177
|
+
return parseInt(input, 10);
|
|
9178
|
+
}
|
|
9179
|
+
input = locale2.weekdaysParse(input);
|
|
9180
|
+
if (typeof input === "number") {
|
|
9181
|
+
return input;
|
|
9182
|
+
}
|
|
9183
|
+
return null;
|
|
9184
|
+
}
|
|
9185
|
+
function parseIsoWeekday(input, locale2) {
|
|
9186
|
+
if (typeof input === "string") {
|
|
9187
|
+
return locale2.weekdaysParse(input) % 7 || 7;
|
|
9188
|
+
}
|
|
9189
|
+
return isNaN(input) ? null : input;
|
|
9190
|
+
}
|
|
9191
|
+
function shiftWeekdays(ws, n) {
|
|
9192
|
+
return ws.slice(n, 7).concat(ws.slice(0, n));
|
|
9193
|
+
}
|
|
9194
|
+
var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord;
|
|
9195
|
+
function localeWeekdays(m, format2) {
|
|
9196
|
+
var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"];
|
|
9197
|
+
return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
|
|
9198
|
+
}
|
|
9199
|
+
function localeWeekdaysShort(m) {
|
|
9200
|
+
return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
|
|
9201
|
+
}
|
|
9202
|
+
function localeWeekdaysMin(m) {
|
|
9203
|
+
return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
|
|
9204
|
+
}
|
|
9205
|
+
function handleStrictParse$1(weekdayName, format2, strict) {
|
|
9206
|
+
var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
|
|
9207
|
+
if (!this._weekdaysParse) {
|
|
9208
|
+
this._weekdaysParse = [];
|
|
9209
|
+
this._shortWeekdaysParse = [];
|
|
9210
|
+
this._minWeekdaysParse = [];
|
|
9211
|
+
for (i = 0; i < 7; ++i) {
|
|
9212
|
+
mom = createUTC([2e3, 1]).day(i);
|
|
9213
|
+
this._minWeekdaysParse[i] = this.weekdaysMin(
|
|
9214
|
+
mom,
|
|
9215
|
+
""
|
|
9216
|
+
).toLocaleLowerCase();
|
|
9217
|
+
this._shortWeekdaysParse[i] = this.weekdaysShort(
|
|
9218
|
+
mom,
|
|
9219
|
+
""
|
|
9220
|
+
).toLocaleLowerCase();
|
|
9221
|
+
this._weekdaysParse[i] = this.weekdays(mom, "").toLocaleLowerCase();
|
|
9222
|
+
}
|
|
9223
|
+
}
|
|
9224
|
+
if (strict) {
|
|
9225
|
+
if (format2 === "dddd") {
|
|
9226
|
+
ii = indexOf.call(this._weekdaysParse, llc);
|
|
9227
|
+
return ii !== -1 ? ii : null;
|
|
9228
|
+
} else if (format2 === "ddd") {
|
|
9229
|
+
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
9230
|
+
return ii !== -1 ? ii : null;
|
|
9231
|
+
} else {
|
|
9232
|
+
ii = indexOf.call(this._minWeekdaysParse, llc);
|
|
9233
|
+
return ii !== -1 ? ii : null;
|
|
9234
|
+
}
|
|
9235
|
+
} else {
|
|
9236
|
+
if (format2 === "dddd") {
|
|
9237
|
+
ii = indexOf.call(this._weekdaysParse, llc);
|
|
9238
|
+
if (ii !== -1) {
|
|
9239
|
+
return ii;
|
|
9240
|
+
}
|
|
9241
|
+
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
9242
|
+
if (ii !== -1) {
|
|
9243
|
+
return ii;
|
|
9244
|
+
}
|
|
9245
|
+
ii = indexOf.call(this._minWeekdaysParse, llc);
|
|
9246
|
+
return ii !== -1 ? ii : null;
|
|
9247
|
+
} else if (format2 === "ddd") {
|
|
9248
|
+
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
9249
|
+
if (ii !== -1) {
|
|
9250
|
+
return ii;
|
|
9251
|
+
}
|
|
9252
|
+
ii = indexOf.call(this._weekdaysParse, llc);
|
|
9253
|
+
if (ii !== -1) {
|
|
9254
|
+
return ii;
|
|
9255
|
+
}
|
|
9256
|
+
ii = indexOf.call(this._minWeekdaysParse, llc);
|
|
9257
|
+
return ii !== -1 ? ii : null;
|
|
9258
|
+
} else {
|
|
9259
|
+
ii = indexOf.call(this._minWeekdaysParse, llc);
|
|
9260
|
+
if (ii !== -1) {
|
|
9261
|
+
return ii;
|
|
9262
|
+
}
|
|
9263
|
+
ii = indexOf.call(this._weekdaysParse, llc);
|
|
9264
|
+
if (ii !== -1) {
|
|
9265
|
+
return ii;
|
|
9266
|
+
}
|
|
9267
|
+
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
9268
|
+
return ii !== -1 ? ii : null;
|
|
9269
|
+
}
|
|
9270
|
+
}
|
|
9271
|
+
}
|
|
9272
|
+
function localeWeekdaysParse(weekdayName, format2, strict) {
|
|
9273
|
+
var i, mom, regex;
|
|
9274
|
+
if (this._weekdaysParseExact) {
|
|
9275
|
+
return handleStrictParse$1.call(this, weekdayName, format2, strict);
|
|
9276
|
+
}
|
|
9277
|
+
if (!this._weekdaysParse) {
|
|
9278
|
+
this._weekdaysParse = [];
|
|
9279
|
+
this._minWeekdaysParse = [];
|
|
9280
|
+
this._shortWeekdaysParse = [];
|
|
9281
|
+
this._fullWeekdaysParse = [];
|
|
9282
|
+
}
|
|
9283
|
+
for (i = 0; i < 7; i++) {
|
|
9284
|
+
mom = createUTC([2e3, 1]).day(i);
|
|
9285
|
+
if (strict && !this._fullWeekdaysParse[i]) {
|
|
9286
|
+
this._fullWeekdaysParse[i] = new RegExp(
|
|
9287
|
+
"^" + this.weekdays(mom, "").replace(".", "\\.?") + "$",
|
|
9288
|
+
"i"
|
|
9289
|
+
);
|
|
9290
|
+
this._shortWeekdaysParse[i] = new RegExp(
|
|
9291
|
+
"^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$",
|
|
9292
|
+
"i"
|
|
9293
|
+
);
|
|
9294
|
+
this._minWeekdaysParse[i] = new RegExp(
|
|
9295
|
+
"^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$",
|
|
9296
|
+
"i"
|
|
9297
|
+
);
|
|
9298
|
+
}
|
|
9299
|
+
if (!this._weekdaysParse[i]) {
|
|
9300
|
+
regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
|
|
9301
|
+
this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i");
|
|
9302
|
+
}
|
|
9303
|
+
if (strict && format2 === "dddd" && this._fullWeekdaysParse[i].test(weekdayName)) {
|
|
9304
|
+
return i;
|
|
9305
|
+
} else if (strict && format2 === "ddd" && this._shortWeekdaysParse[i].test(weekdayName)) {
|
|
9306
|
+
return i;
|
|
9307
|
+
} else if (strict && format2 === "dd" && this._minWeekdaysParse[i].test(weekdayName)) {
|
|
9308
|
+
return i;
|
|
9309
|
+
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
|
|
9310
|
+
return i;
|
|
9311
|
+
}
|
|
9312
|
+
}
|
|
9313
|
+
}
|
|
9314
|
+
function getSetDayOfWeek(input) {
|
|
9315
|
+
if (!this.isValid()) {
|
|
9316
|
+
return input != null ? this : NaN;
|
|
9317
|
+
}
|
|
9318
|
+
var day = get(this, "Day");
|
|
9319
|
+
if (input != null) {
|
|
9320
|
+
input = parseWeekday(input, this.localeData());
|
|
9321
|
+
return this.add(input - day, "d");
|
|
9322
|
+
} else {
|
|
9323
|
+
return day;
|
|
9324
|
+
}
|
|
9325
|
+
}
|
|
9326
|
+
function getSetLocaleDayOfWeek(input) {
|
|
9327
|
+
if (!this.isValid()) {
|
|
9328
|
+
return input != null ? this : NaN;
|
|
9329
|
+
}
|
|
9330
|
+
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
|
|
9331
|
+
return input == null ? weekday : this.add(input - weekday, "d");
|
|
9332
|
+
}
|
|
9333
|
+
function getSetISODayOfWeek(input) {
|
|
9334
|
+
if (!this.isValid()) {
|
|
9335
|
+
return input != null ? this : NaN;
|
|
9336
|
+
}
|
|
9337
|
+
if (input != null) {
|
|
9338
|
+
var weekday = parseIsoWeekday(input, this.localeData());
|
|
9339
|
+
return this.day(this.day() % 7 ? weekday : weekday - 7);
|
|
9340
|
+
} else {
|
|
9341
|
+
return this.day() || 7;
|
|
9342
|
+
}
|
|
9343
|
+
}
|
|
9344
|
+
function weekdaysRegex(isStrict) {
|
|
9345
|
+
if (this._weekdaysParseExact) {
|
|
9346
|
+
if (!hasOwnProp(this, "_weekdaysRegex")) {
|
|
9347
|
+
computeWeekdaysParse.call(this);
|
|
9348
|
+
}
|
|
9349
|
+
if (isStrict) {
|
|
9350
|
+
return this._weekdaysStrictRegex;
|
|
9351
|
+
} else {
|
|
9352
|
+
return this._weekdaysRegex;
|
|
9353
|
+
}
|
|
9354
|
+
} else {
|
|
9355
|
+
if (!hasOwnProp(this, "_weekdaysRegex")) {
|
|
9356
|
+
this._weekdaysRegex = defaultWeekdaysRegex;
|
|
9357
|
+
}
|
|
9358
|
+
return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
|
|
9359
|
+
}
|
|
9360
|
+
}
|
|
9361
|
+
function weekdaysShortRegex(isStrict) {
|
|
9362
|
+
if (this._weekdaysParseExact) {
|
|
9363
|
+
if (!hasOwnProp(this, "_weekdaysRegex")) {
|
|
9364
|
+
computeWeekdaysParse.call(this);
|
|
9365
|
+
}
|
|
9366
|
+
if (isStrict) {
|
|
9367
|
+
return this._weekdaysShortStrictRegex;
|
|
9368
|
+
} else {
|
|
9369
|
+
return this._weekdaysShortRegex;
|
|
9370
|
+
}
|
|
9371
|
+
} else {
|
|
9372
|
+
if (!hasOwnProp(this, "_weekdaysShortRegex")) {
|
|
9373
|
+
this._weekdaysShortRegex = defaultWeekdaysShortRegex;
|
|
9374
|
+
}
|
|
9375
|
+
return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
|
|
9376
|
+
}
|
|
9377
|
+
}
|
|
9378
|
+
function weekdaysMinRegex(isStrict) {
|
|
9379
|
+
if (this._weekdaysParseExact) {
|
|
9380
|
+
if (!hasOwnProp(this, "_weekdaysRegex")) {
|
|
9381
|
+
computeWeekdaysParse.call(this);
|
|
9382
|
+
}
|
|
9383
|
+
if (isStrict) {
|
|
9384
|
+
return this._weekdaysMinStrictRegex;
|
|
9385
|
+
} else {
|
|
9386
|
+
return this._weekdaysMinRegex;
|
|
9387
|
+
}
|
|
9388
|
+
} else {
|
|
9389
|
+
if (!hasOwnProp(this, "_weekdaysMinRegex")) {
|
|
9390
|
+
this._weekdaysMinRegex = defaultWeekdaysMinRegex;
|
|
9391
|
+
}
|
|
9392
|
+
return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
|
|
9393
|
+
}
|
|
9394
|
+
}
|
|
9395
|
+
function computeWeekdaysParse() {
|
|
9396
|
+
function cmpLenRev(a, b) {
|
|
9397
|
+
return b.length - a.length;
|
|
9398
|
+
}
|
|
9399
|
+
var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp;
|
|
9400
|
+
for (i = 0; i < 7; i++) {
|
|
9401
|
+
mom = createUTC([2e3, 1]).day(i);
|
|
9402
|
+
minp = regexEscape(this.weekdaysMin(mom, ""));
|
|
9403
|
+
shortp = regexEscape(this.weekdaysShort(mom, ""));
|
|
9404
|
+
longp = regexEscape(this.weekdays(mom, ""));
|
|
9405
|
+
minPieces.push(minp);
|
|
9406
|
+
shortPieces.push(shortp);
|
|
9407
|
+
longPieces.push(longp);
|
|
9408
|
+
mixedPieces.push(minp);
|
|
9409
|
+
mixedPieces.push(shortp);
|
|
9410
|
+
mixedPieces.push(longp);
|
|
9411
|
+
}
|
|
9412
|
+
minPieces.sort(cmpLenRev);
|
|
9413
|
+
shortPieces.sort(cmpLenRev);
|
|
9414
|
+
longPieces.sort(cmpLenRev);
|
|
9415
|
+
mixedPieces.sort(cmpLenRev);
|
|
9416
|
+
this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
|
|
9417
|
+
this._weekdaysShortRegex = this._weekdaysRegex;
|
|
9418
|
+
this._weekdaysMinRegex = this._weekdaysRegex;
|
|
9419
|
+
this._weekdaysStrictRegex = new RegExp(
|
|
9420
|
+
"^(" + longPieces.join("|") + ")",
|
|
9421
|
+
"i"
|
|
9422
|
+
);
|
|
9423
|
+
this._weekdaysShortStrictRegex = new RegExp(
|
|
9424
|
+
"^(" + shortPieces.join("|") + ")",
|
|
9425
|
+
"i"
|
|
9426
|
+
);
|
|
9427
|
+
this._weekdaysMinStrictRegex = new RegExp(
|
|
9428
|
+
"^(" + minPieces.join("|") + ")",
|
|
9429
|
+
"i"
|
|
9430
|
+
);
|
|
9431
|
+
}
|
|
9432
|
+
function hFormat() {
|
|
9433
|
+
return this.hours() % 12 || 12;
|
|
9434
|
+
}
|
|
9435
|
+
function kFormat() {
|
|
9436
|
+
return this.hours() || 24;
|
|
9437
|
+
}
|
|
9438
|
+
addFormatToken("H", ["HH", 2], 0, "hour");
|
|
9439
|
+
addFormatToken("h", ["hh", 2], 0, hFormat);
|
|
9440
|
+
addFormatToken("k", ["kk", 2], 0, kFormat);
|
|
9441
|
+
addFormatToken("hmm", 0, 0, function() {
|
|
9442
|
+
return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2);
|
|
9443
|
+
});
|
|
9444
|
+
addFormatToken("hmmss", 0, 0, function() {
|
|
9445
|
+
return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
|
|
9446
|
+
});
|
|
9447
|
+
addFormatToken("Hmm", 0, 0, function() {
|
|
9448
|
+
return "" + this.hours() + zeroFill(this.minutes(), 2);
|
|
9449
|
+
});
|
|
9450
|
+
addFormatToken("Hmmss", 0, 0, function() {
|
|
9451
|
+
return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
|
|
9452
|
+
});
|
|
9453
|
+
function meridiem(token2, lowercase) {
|
|
9454
|
+
addFormatToken(token2, 0, 0, function() {
|
|
9455
|
+
return this.localeData().meridiem(
|
|
9456
|
+
this.hours(),
|
|
9457
|
+
this.minutes(),
|
|
9458
|
+
lowercase
|
|
9459
|
+
);
|
|
9460
|
+
});
|
|
9461
|
+
}
|
|
9462
|
+
meridiem("a", true);
|
|
9463
|
+
meridiem("A", false);
|
|
9464
|
+
function matchMeridiem(isStrict, locale2) {
|
|
9465
|
+
return locale2._meridiemParse;
|
|
9466
|
+
}
|
|
9467
|
+
addRegexToken("a", matchMeridiem);
|
|
9468
|
+
addRegexToken("A", matchMeridiem);
|
|
9469
|
+
addRegexToken("H", match1to2, match1to2HasZero);
|
|
9470
|
+
addRegexToken("h", match1to2, match1to2NoLeadingZero);
|
|
9471
|
+
addRegexToken("k", match1to2, match1to2NoLeadingZero);
|
|
9472
|
+
addRegexToken("HH", match1to2, match2);
|
|
9473
|
+
addRegexToken("hh", match1to2, match2);
|
|
9474
|
+
addRegexToken("kk", match1to2, match2);
|
|
9475
|
+
addRegexToken("hmm", match3to4);
|
|
9476
|
+
addRegexToken("hmmss", match5to6);
|
|
9477
|
+
addRegexToken("Hmm", match3to4);
|
|
9478
|
+
addRegexToken("Hmmss", match5to6);
|
|
9479
|
+
addParseToken(["H", "HH"], HOUR);
|
|
9480
|
+
addParseToken(["k", "kk"], function(input, array, config) {
|
|
9481
|
+
var kInput = toInt(input);
|
|
9482
|
+
array[HOUR] = kInput === 24 ? 0 : kInput;
|
|
9483
|
+
});
|
|
9484
|
+
addParseToken(["a", "A"], function(input, array, config) {
|
|
9485
|
+
config._isPm = config._locale.isPM(input);
|
|
9486
|
+
config._meridiem = input;
|
|
9487
|
+
});
|
|
9488
|
+
addParseToken(["h", "hh"], function(input, array, config) {
|
|
9489
|
+
array[HOUR] = toInt(input);
|
|
9490
|
+
getParsingFlags(config).bigHour = true;
|
|
9491
|
+
});
|
|
9492
|
+
addParseToken("hmm", function(input, array, config) {
|
|
9493
|
+
var pos = input.length - 2;
|
|
9494
|
+
array[HOUR] = toInt(input.substr(0, pos));
|
|
9495
|
+
array[MINUTE] = toInt(input.substr(pos));
|
|
9496
|
+
getParsingFlags(config).bigHour = true;
|
|
9497
|
+
});
|
|
9498
|
+
addParseToken("hmmss", function(input, array, config) {
|
|
9499
|
+
var pos1 = input.length - 4, pos2 = input.length - 2;
|
|
9500
|
+
array[HOUR] = toInt(input.substr(0, pos1));
|
|
9501
|
+
array[MINUTE] = toInt(input.substr(pos1, 2));
|
|
9502
|
+
array[SECOND] = toInt(input.substr(pos2));
|
|
9503
|
+
getParsingFlags(config).bigHour = true;
|
|
9504
|
+
});
|
|
9505
|
+
addParseToken("Hmm", function(input, array, config) {
|
|
9506
|
+
var pos = input.length - 2;
|
|
9507
|
+
array[HOUR] = toInt(input.substr(0, pos));
|
|
9508
|
+
array[MINUTE] = toInt(input.substr(pos));
|
|
9509
|
+
});
|
|
9510
|
+
addParseToken("Hmmss", function(input, array, config) {
|
|
9511
|
+
var pos1 = input.length - 4, pos2 = input.length - 2;
|
|
9512
|
+
array[HOUR] = toInt(input.substr(0, pos1));
|
|
9513
|
+
array[MINUTE] = toInt(input.substr(pos1, 2));
|
|
9514
|
+
array[SECOND] = toInt(input.substr(pos2));
|
|
9515
|
+
});
|
|
9516
|
+
function localeIsPM(input) {
|
|
9517
|
+
return (input + "").toLowerCase().charAt(0) === "p";
|
|
9518
|
+
}
|
|
9519
|
+
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true);
|
|
9520
|
+
function localeMeridiem(hours2, minutes2, isLower) {
|
|
9521
|
+
if (hours2 > 11) {
|
|
9522
|
+
return isLower ? "pm" : "PM";
|
|
9523
|
+
} else {
|
|
9524
|
+
return isLower ? "am" : "AM";
|
|
9525
|
+
}
|
|
9526
|
+
}
|
|
9527
|
+
var baseConfig = {
|
|
9528
|
+
calendar: defaultCalendar,
|
|
9529
|
+
longDateFormat: defaultLongDateFormat,
|
|
9530
|
+
invalidDate: defaultInvalidDate,
|
|
9531
|
+
ordinal: defaultOrdinal,
|
|
9532
|
+
dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
|
|
9533
|
+
relativeTime: defaultRelativeTime,
|
|
9534
|
+
months: defaultLocaleMonths,
|
|
9535
|
+
monthsShort: defaultLocaleMonthsShort,
|
|
9536
|
+
week: defaultLocaleWeek,
|
|
9537
|
+
weekdays: defaultLocaleWeekdays,
|
|
9538
|
+
weekdaysMin: defaultLocaleWeekdaysMin,
|
|
9539
|
+
weekdaysShort: defaultLocaleWeekdaysShort,
|
|
9540
|
+
meridiemParse: defaultLocaleMeridiemParse
|
|
9541
|
+
};
|
|
9542
|
+
var locales = {}, localeFamilies = {}, globalLocale;
|
|
9543
|
+
function commonPrefix(arr1, arr2) {
|
|
9544
|
+
var i, minl = Math.min(arr1.length, arr2.length);
|
|
9545
|
+
for (i = 0; i < minl; i += 1) {
|
|
9546
|
+
if (arr1[i] !== arr2[i]) {
|
|
9547
|
+
return i;
|
|
9548
|
+
}
|
|
9549
|
+
}
|
|
9550
|
+
return minl;
|
|
9551
|
+
}
|
|
9552
|
+
function normalizeLocale(key) {
|
|
9553
|
+
return key ? key.toLowerCase().replace("_", "-") : key;
|
|
9554
|
+
}
|
|
9555
|
+
function chooseLocale(names) {
|
|
9556
|
+
var i = 0, j, next, locale2, split;
|
|
9557
|
+
while (i < names.length) {
|
|
9558
|
+
split = normalizeLocale(names[i]).split("-");
|
|
9559
|
+
j = split.length;
|
|
9560
|
+
next = normalizeLocale(names[i + 1]);
|
|
9561
|
+
next = next ? next.split("-") : null;
|
|
9562
|
+
while (j > 0) {
|
|
9563
|
+
locale2 = loadLocale(split.slice(0, j).join("-"));
|
|
9564
|
+
if (locale2) {
|
|
9565
|
+
return locale2;
|
|
9566
|
+
}
|
|
9567
|
+
if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {
|
|
9568
|
+
break;
|
|
9569
|
+
}
|
|
9570
|
+
j--;
|
|
9571
|
+
}
|
|
9572
|
+
i++;
|
|
9573
|
+
}
|
|
9574
|
+
return globalLocale;
|
|
9575
|
+
}
|
|
9576
|
+
function isLocaleNameSane(name) {
|
|
9577
|
+
return !!(name && name.match("^[^/\\\\]*$"));
|
|
9578
|
+
}
|
|
9579
|
+
function loadLocale(name) {
|
|
9580
|
+
var oldLocale = null, aliasedRequire;
|
|
9581
|
+
if (locales[name] === void 0 && typeof module !== "undefined" && module && module.exports && isLocaleNameSane(name)) {
|
|
9582
|
+
try {
|
|
9583
|
+
oldLocale = globalLocale._abbr;
|
|
9584
|
+
aliasedRequire = require;
|
|
9585
|
+
aliasedRequire("./locale/" + name);
|
|
9586
|
+
getSetGlobalLocale(oldLocale);
|
|
9587
|
+
} catch (e) {
|
|
9588
|
+
locales[name] = null;
|
|
9589
|
+
}
|
|
9590
|
+
}
|
|
9591
|
+
return locales[name];
|
|
9592
|
+
}
|
|
9593
|
+
function getSetGlobalLocale(key, values) {
|
|
9594
|
+
var data;
|
|
9595
|
+
if (key) {
|
|
9596
|
+
if (isUndefined(values)) {
|
|
9597
|
+
data = getLocale(key);
|
|
9598
|
+
} else {
|
|
9599
|
+
data = defineLocale(key, values);
|
|
9600
|
+
}
|
|
9601
|
+
if (data) {
|
|
9602
|
+
globalLocale = data;
|
|
9603
|
+
} else {
|
|
9604
|
+
if (typeof console !== "undefined" && console.warn) {
|
|
9605
|
+
console.warn(
|
|
9606
|
+
"Locale " + key + " not found. Did you forget to load it?"
|
|
9607
|
+
);
|
|
9608
|
+
}
|
|
9609
|
+
}
|
|
9610
|
+
}
|
|
9611
|
+
return globalLocale._abbr;
|
|
9612
|
+
}
|
|
9613
|
+
function defineLocale(name, config) {
|
|
9614
|
+
if (config !== null) {
|
|
9615
|
+
var locale2, parentConfig = baseConfig;
|
|
9616
|
+
config.abbr = name;
|
|
9617
|
+
if (locales[name] != null) {
|
|
9618
|
+
deprecateSimple(
|
|
9619
|
+
"defineLocaleOverride",
|
|
9620
|
+
"use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
|
|
9621
|
+
);
|
|
9622
|
+
parentConfig = locales[name]._config;
|
|
9623
|
+
} else if (config.parentLocale != null) {
|
|
9624
|
+
if (locales[config.parentLocale] != null) {
|
|
9625
|
+
parentConfig = locales[config.parentLocale]._config;
|
|
9626
|
+
} else {
|
|
9627
|
+
locale2 = loadLocale(config.parentLocale);
|
|
9628
|
+
if (locale2 != null) {
|
|
9629
|
+
parentConfig = locale2._config;
|
|
9630
|
+
} else {
|
|
9631
|
+
if (!localeFamilies[config.parentLocale]) {
|
|
9632
|
+
localeFamilies[config.parentLocale] = [];
|
|
9633
|
+
}
|
|
9634
|
+
localeFamilies[config.parentLocale].push({
|
|
9635
|
+
name,
|
|
9636
|
+
config
|
|
9637
|
+
});
|
|
9638
|
+
return null;
|
|
9639
|
+
}
|
|
9640
|
+
}
|
|
9641
|
+
}
|
|
9642
|
+
locales[name] = new Locale(mergeConfigs(parentConfig, config));
|
|
9643
|
+
if (localeFamilies[name]) {
|
|
9644
|
+
localeFamilies[name].forEach(function(x) {
|
|
9645
|
+
defineLocale(x.name, x.config);
|
|
9646
|
+
});
|
|
9647
|
+
}
|
|
9648
|
+
getSetGlobalLocale(name);
|
|
9649
|
+
return locales[name];
|
|
9650
|
+
} else {
|
|
9651
|
+
delete locales[name];
|
|
9652
|
+
return null;
|
|
9653
|
+
}
|
|
9654
|
+
}
|
|
9655
|
+
function updateLocale(name, config) {
|
|
9656
|
+
if (config != null) {
|
|
9657
|
+
var locale2, tmpLocale, parentConfig = baseConfig;
|
|
9658
|
+
if (locales[name] != null && locales[name].parentLocale != null) {
|
|
9659
|
+
locales[name].set(mergeConfigs(locales[name]._config, config));
|
|
9660
|
+
} else {
|
|
9661
|
+
tmpLocale = loadLocale(name);
|
|
9662
|
+
if (tmpLocale != null) {
|
|
9663
|
+
parentConfig = tmpLocale._config;
|
|
9664
|
+
}
|
|
9665
|
+
config = mergeConfigs(parentConfig, config);
|
|
9666
|
+
if (tmpLocale == null) {
|
|
9667
|
+
config.abbr = name;
|
|
9668
|
+
}
|
|
9669
|
+
locale2 = new Locale(config);
|
|
9670
|
+
locale2.parentLocale = locales[name];
|
|
9671
|
+
locales[name] = locale2;
|
|
9672
|
+
}
|
|
9673
|
+
getSetGlobalLocale(name);
|
|
9674
|
+
} else {
|
|
9675
|
+
if (locales[name] != null) {
|
|
9676
|
+
if (locales[name].parentLocale != null) {
|
|
9677
|
+
locales[name] = locales[name].parentLocale;
|
|
9678
|
+
if (name === getSetGlobalLocale()) {
|
|
9679
|
+
getSetGlobalLocale(name);
|
|
9680
|
+
}
|
|
9681
|
+
} else if (locales[name] != null) {
|
|
9682
|
+
delete locales[name];
|
|
9683
|
+
}
|
|
9684
|
+
}
|
|
9685
|
+
}
|
|
9686
|
+
return locales[name];
|
|
9687
|
+
}
|
|
9688
|
+
function getLocale(key) {
|
|
9689
|
+
var locale2;
|
|
9690
|
+
if (key && key._locale && key._locale._abbr) {
|
|
9691
|
+
key = key._locale._abbr;
|
|
9692
|
+
}
|
|
9693
|
+
if (!key) {
|
|
9694
|
+
return globalLocale;
|
|
9695
|
+
}
|
|
9696
|
+
if (!isArray(key)) {
|
|
9697
|
+
locale2 = loadLocale(key);
|
|
9698
|
+
if (locale2) {
|
|
9699
|
+
return locale2;
|
|
9700
|
+
}
|
|
9701
|
+
key = [key];
|
|
9702
|
+
}
|
|
9703
|
+
return chooseLocale(key);
|
|
9704
|
+
}
|
|
9705
|
+
function listLocales() {
|
|
9706
|
+
return keys(locales);
|
|
9707
|
+
}
|
|
9708
|
+
function checkOverflow(m) {
|
|
9709
|
+
var overflow, a = m._a;
|
|
9710
|
+
if (a && getParsingFlags(m).overflow === -2) {
|
|
9711
|
+
overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
|
|
9712
|
+
if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
|
|
9713
|
+
overflow = DATE;
|
|
9714
|
+
}
|
|
9715
|
+
if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
|
|
9716
|
+
overflow = WEEK;
|
|
9717
|
+
}
|
|
9718
|
+
if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
|
|
9719
|
+
overflow = WEEKDAY;
|
|
9720
|
+
}
|
|
9721
|
+
getParsingFlags(m).overflow = overflow;
|
|
9722
|
+
}
|
|
9723
|
+
return m;
|
|
9724
|
+
}
|
|
9725
|
+
var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [
|
|
9726
|
+
["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
|
|
9727
|
+
["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
|
|
9728
|
+
["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
|
|
9729
|
+
["GGGG-[W]WW", /\d{4}-W\d\d/, false],
|
|
9730
|
+
["YYYY-DDD", /\d{4}-\d{3}/],
|
|
9731
|
+
["YYYY-MM", /\d{4}-\d\d/, false],
|
|
9732
|
+
["YYYYYYMMDD", /[+-]\d{10}/],
|
|
9733
|
+
["YYYYMMDD", /\d{8}/],
|
|
9734
|
+
["GGGG[W]WWE", /\d{4}W\d{3}/],
|
|
9735
|
+
["GGGG[W]WW", /\d{4}W\d{2}/, false],
|
|
9736
|
+
["YYYYDDD", /\d{7}/],
|
|
9737
|
+
["YYYYMM", /\d{6}/, false],
|
|
9738
|
+
["YYYY", /\d{4}/, false]
|
|
9739
|
+
], isoTimes = [
|
|
9740
|
+
["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
|
|
9741
|
+
["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
|
|
9742
|
+
["HH:mm:ss", /\d\d:\d\d:\d\d/],
|
|
9743
|
+
["HH:mm", /\d\d:\d\d/],
|
|
9744
|
+
["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
|
|
9745
|
+
["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
|
|
9746
|
+
["HHmmss", /\d\d\d\d\d\d/],
|
|
9747
|
+
["HHmm", /\d\d\d\d/],
|
|
9748
|
+
["HH", /\d\d/]
|
|
9749
|
+
], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = {
|
|
9750
|
+
UT: 0,
|
|
9751
|
+
GMT: 0,
|
|
9752
|
+
EDT: -4 * 60,
|
|
9753
|
+
EST: -5 * 60,
|
|
9754
|
+
CDT: -5 * 60,
|
|
9755
|
+
CST: -6 * 60,
|
|
9756
|
+
MDT: -6 * 60,
|
|
9757
|
+
MST: -7 * 60,
|
|
9758
|
+
PDT: -7 * 60,
|
|
9759
|
+
PST: -8 * 60
|
|
9760
|
+
};
|
|
9761
|
+
function configFromISO(config) {
|
|
9762
|
+
var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
|
|
9763
|
+
if (match) {
|
|
9764
|
+
getParsingFlags(config).iso = true;
|
|
9765
|
+
for (i = 0, l = isoDatesLen; i < l; i++) {
|
|
9766
|
+
if (isoDates[i][1].exec(match[1])) {
|
|
9767
|
+
dateFormat = isoDates[i][0];
|
|
9768
|
+
allowTime = isoDates[i][2] !== false;
|
|
9769
|
+
break;
|
|
9770
|
+
}
|
|
9771
|
+
}
|
|
9772
|
+
if (dateFormat == null) {
|
|
9773
|
+
config._isValid = false;
|
|
9774
|
+
return;
|
|
9775
|
+
}
|
|
9776
|
+
if (match[3]) {
|
|
9777
|
+
for (i = 0, l = isoTimesLen; i < l; i++) {
|
|
9778
|
+
if (isoTimes[i][1].exec(match[3])) {
|
|
9779
|
+
timeFormat = (match[2] || " ") + isoTimes[i][0];
|
|
9780
|
+
break;
|
|
9781
|
+
}
|
|
9782
|
+
}
|
|
9783
|
+
if (timeFormat == null) {
|
|
9784
|
+
config._isValid = false;
|
|
9785
|
+
return;
|
|
9786
|
+
}
|
|
9787
|
+
}
|
|
9788
|
+
if (!allowTime && timeFormat != null) {
|
|
9789
|
+
config._isValid = false;
|
|
9790
|
+
return;
|
|
9791
|
+
}
|
|
9792
|
+
if (match[4]) {
|
|
9793
|
+
if (tzRegex.exec(match[4])) {
|
|
9794
|
+
tzFormat = "Z";
|
|
9795
|
+
} else {
|
|
9796
|
+
config._isValid = false;
|
|
9797
|
+
return;
|
|
9798
|
+
}
|
|
9799
|
+
}
|
|
9800
|
+
config._f = dateFormat + (timeFormat || "") + (tzFormat || "");
|
|
9801
|
+
configFromStringAndFormat(config);
|
|
9802
|
+
} else {
|
|
9803
|
+
config._isValid = false;
|
|
9804
|
+
}
|
|
9805
|
+
}
|
|
9806
|
+
function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
|
|
9807
|
+
var result = [
|
|
9808
|
+
untruncateYear(yearStr),
|
|
9809
|
+
defaultLocaleMonthsShort.indexOf(monthStr),
|
|
9810
|
+
parseInt(dayStr, 10),
|
|
9811
|
+
parseInt(hourStr, 10),
|
|
9812
|
+
parseInt(minuteStr, 10)
|
|
9813
|
+
];
|
|
9814
|
+
if (secondStr) {
|
|
9815
|
+
result.push(parseInt(secondStr, 10));
|
|
9816
|
+
}
|
|
9817
|
+
return result;
|
|
9818
|
+
}
|
|
9819
|
+
function untruncateYear(yearStr) {
|
|
9820
|
+
var year = parseInt(yearStr, 10);
|
|
9821
|
+
if (year <= 49) {
|
|
9822
|
+
return 2e3 + year;
|
|
9823
|
+
} else if (year <= 999) {
|
|
9824
|
+
return 1900 + year;
|
|
9825
|
+
}
|
|
9826
|
+
return year;
|
|
9827
|
+
}
|
|
9828
|
+
function preprocessRFC2822(s) {
|
|
9829
|
+
return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
|
|
9830
|
+
}
|
|
9831
|
+
function checkWeekday(weekdayStr, parsedInput, config) {
|
|
9832
|
+
if (weekdayStr) {
|
|
9833
|
+
var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(
|
|
9834
|
+
parsedInput[0],
|
|
9835
|
+
parsedInput[1],
|
|
9836
|
+
parsedInput[2]
|
|
9837
|
+
).getDay();
|
|
9838
|
+
if (weekdayProvided !== weekdayActual) {
|
|
9839
|
+
getParsingFlags(config).weekdayMismatch = true;
|
|
9840
|
+
config._isValid = false;
|
|
9841
|
+
return false;
|
|
9842
|
+
}
|
|
9843
|
+
}
|
|
9844
|
+
return true;
|
|
9845
|
+
}
|
|
9846
|
+
function calculateOffset(obsOffset, militaryOffset, numOffset) {
|
|
9847
|
+
if (obsOffset) {
|
|
9848
|
+
return obsOffsets[obsOffset];
|
|
9849
|
+
} else if (militaryOffset) {
|
|
9850
|
+
return 0;
|
|
9851
|
+
} else {
|
|
9852
|
+
var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100;
|
|
9853
|
+
return h * 60 + m;
|
|
9854
|
+
}
|
|
9855
|
+
}
|
|
9856
|
+
function configFromRFC2822(config) {
|
|
9857
|
+
var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray;
|
|
9858
|
+
if (match) {
|
|
9859
|
+
parsedArray = extractFromRFC2822Strings(
|
|
9860
|
+
match[4],
|
|
9861
|
+
match[3],
|
|
9862
|
+
match[2],
|
|
9863
|
+
match[5],
|
|
9864
|
+
match[6],
|
|
9865
|
+
match[7]
|
|
9866
|
+
);
|
|
9867
|
+
if (!checkWeekday(match[1], parsedArray, config)) {
|
|
9868
|
+
return;
|
|
9869
|
+
}
|
|
9870
|
+
config._a = parsedArray;
|
|
9871
|
+
config._tzm = calculateOffset(match[8], match[9], match[10]);
|
|
9872
|
+
config._d = createUTCDate.apply(null, config._a);
|
|
9873
|
+
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
|
9874
|
+
getParsingFlags(config).rfc2822 = true;
|
|
9875
|
+
} else {
|
|
9876
|
+
config._isValid = false;
|
|
9877
|
+
}
|
|
9878
|
+
}
|
|
9879
|
+
function configFromString(config) {
|
|
9880
|
+
var matched = aspNetJsonRegex.exec(config._i);
|
|
9881
|
+
if (matched !== null) {
|
|
9882
|
+
config._d = /* @__PURE__ */ new Date(+matched[1]);
|
|
9883
|
+
return;
|
|
9884
|
+
}
|
|
9885
|
+
configFromISO(config);
|
|
9886
|
+
if (config._isValid === false) {
|
|
9887
|
+
delete config._isValid;
|
|
9888
|
+
} else {
|
|
9889
|
+
return;
|
|
9890
|
+
}
|
|
9891
|
+
configFromRFC2822(config);
|
|
9892
|
+
if (config._isValid === false) {
|
|
9893
|
+
delete config._isValid;
|
|
9894
|
+
} else {
|
|
9895
|
+
return;
|
|
9896
|
+
}
|
|
9897
|
+
if (config._strict) {
|
|
9898
|
+
config._isValid = false;
|
|
9899
|
+
} else {
|
|
9900
|
+
hooks.createFromInputFallback(config);
|
|
9901
|
+
}
|
|
9902
|
+
}
|
|
9903
|
+
hooks.createFromInputFallback = deprecate(
|
|
9904
|
+
"value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
|
|
9905
|
+
function(config) {
|
|
9906
|
+
config._d = /* @__PURE__ */ new Date(config._i + (config._useUTC ? " UTC" : ""));
|
|
9907
|
+
}
|
|
9908
|
+
);
|
|
9909
|
+
function defaults(a, b, c) {
|
|
9910
|
+
if (a != null) {
|
|
9911
|
+
return a;
|
|
9912
|
+
}
|
|
9913
|
+
if (b != null) {
|
|
9914
|
+
return b;
|
|
9915
|
+
}
|
|
9916
|
+
return c;
|
|
9917
|
+
}
|
|
9918
|
+
function currentDateArray(config) {
|
|
9919
|
+
var nowValue = new Date(hooks.now());
|
|
9920
|
+
if (config._useUTC) {
|
|
9921
|
+
return [
|
|
9922
|
+
nowValue.getUTCFullYear(),
|
|
9923
|
+
nowValue.getUTCMonth(),
|
|
9924
|
+
nowValue.getUTCDate()
|
|
9925
|
+
];
|
|
9926
|
+
}
|
|
9927
|
+
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
|
|
9928
|
+
}
|
|
9929
|
+
function configFromArray(config) {
|
|
9930
|
+
var i, date, input = [], currentDate, expectedWeekday, yearToUse;
|
|
9931
|
+
if (config._d) {
|
|
9932
|
+
return;
|
|
9933
|
+
}
|
|
9934
|
+
currentDate = currentDateArray(config);
|
|
9935
|
+
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
|
|
9936
|
+
dayOfYearFromWeekInfo(config);
|
|
9937
|
+
}
|
|
9938
|
+
if (config._dayOfYear != null) {
|
|
9939
|
+
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
|
|
9940
|
+
if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
|
|
9941
|
+
getParsingFlags(config)._overflowDayOfYear = true;
|
|
9942
|
+
}
|
|
9943
|
+
date = createUTCDate(yearToUse, 0, config._dayOfYear);
|
|
9944
|
+
config._a[MONTH] = date.getUTCMonth();
|
|
9945
|
+
config._a[DATE] = date.getUTCDate();
|
|
9946
|
+
}
|
|
9947
|
+
for (i = 0; i < 3 && config._a[i] == null; ++i) {
|
|
9948
|
+
config._a[i] = input[i] = currentDate[i];
|
|
9949
|
+
}
|
|
9950
|
+
for (; i < 7; i++) {
|
|
9951
|
+
config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];
|
|
9952
|
+
}
|
|
9953
|
+
if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
|
|
9954
|
+
config._nextDay = true;
|
|
9955
|
+
config._a[HOUR] = 0;
|
|
9956
|
+
}
|
|
9957
|
+
config._d = (config._useUTC ? createUTCDate : createDate).apply(
|
|
9958
|
+
null,
|
|
9959
|
+
input
|
|
9960
|
+
);
|
|
9961
|
+
expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
|
|
9962
|
+
if (config._tzm != null) {
|
|
9963
|
+
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
|
9964
|
+
}
|
|
9965
|
+
if (config._nextDay) {
|
|
9966
|
+
config._a[HOUR] = 24;
|
|
9967
|
+
}
|
|
9968
|
+
if (config._w && typeof config._w.d !== "undefined" && config._w.d !== expectedWeekday) {
|
|
9969
|
+
getParsingFlags(config).weekdayMismatch = true;
|
|
9970
|
+
}
|
|
9971
|
+
}
|
|
9972
|
+
function dayOfYearFromWeekInfo(config) {
|
|
9973
|
+
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
|
|
9974
|
+
w = config._w;
|
|
9975
|
+
if (w.GG != null || w.W != null || w.E != null) {
|
|
9976
|
+
dow = 1;
|
|
9977
|
+
doy = 4;
|
|
9978
|
+
weekYear = defaults(
|
|
9979
|
+
w.GG,
|
|
9980
|
+
config._a[YEAR],
|
|
9981
|
+
weekOfYear(createLocal(), 1, 4).year
|
|
9982
|
+
);
|
|
9983
|
+
week = defaults(w.W, 1);
|
|
9984
|
+
weekday = defaults(w.E, 1);
|
|
9985
|
+
if (weekday < 1 || weekday > 7) {
|
|
9986
|
+
weekdayOverflow = true;
|
|
9987
|
+
}
|
|
9988
|
+
} else {
|
|
9989
|
+
dow = config._locale._week.dow;
|
|
9990
|
+
doy = config._locale._week.doy;
|
|
9991
|
+
curWeek = weekOfYear(createLocal(), dow, doy);
|
|
9992
|
+
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
|
|
9993
|
+
week = defaults(w.w, curWeek.week);
|
|
9994
|
+
if (w.d != null) {
|
|
9995
|
+
weekday = w.d;
|
|
9996
|
+
if (weekday < 0 || weekday > 6) {
|
|
9997
|
+
weekdayOverflow = true;
|
|
9998
|
+
}
|
|
9999
|
+
} else if (w.e != null) {
|
|
10000
|
+
weekday = w.e + dow;
|
|
10001
|
+
if (w.e < 0 || w.e > 6) {
|
|
10002
|
+
weekdayOverflow = true;
|
|
10003
|
+
}
|
|
10004
|
+
} else {
|
|
10005
|
+
weekday = dow;
|
|
10006
|
+
}
|
|
10007
|
+
}
|
|
10008
|
+
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
|
|
10009
|
+
getParsingFlags(config)._overflowWeeks = true;
|
|
10010
|
+
} else if (weekdayOverflow != null) {
|
|
10011
|
+
getParsingFlags(config)._overflowWeekday = true;
|
|
10012
|
+
} else {
|
|
10013
|
+
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
|
|
10014
|
+
config._a[YEAR] = temp.year;
|
|
10015
|
+
config._dayOfYear = temp.dayOfYear;
|
|
10016
|
+
}
|
|
10017
|
+
}
|
|
10018
|
+
hooks.ISO_8601 = function() {
|
|
10019
|
+
};
|
|
10020
|
+
hooks.RFC_2822 = function() {
|
|
10021
|
+
};
|
|
10022
|
+
function configFromStringAndFormat(config) {
|
|
10023
|
+
if (config._f === hooks.ISO_8601) {
|
|
10024
|
+
configFromISO(config);
|
|
10025
|
+
return;
|
|
10026
|
+
}
|
|
10027
|
+
if (config._f === hooks.RFC_2822) {
|
|
10028
|
+
configFromRFC2822(config);
|
|
10029
|
+
return;
|
|
10030
|
+
}
|
|
10031
|
+
config._a = [];
|
|
10032
|
+
getParsingFlags(config).empty = true;
|
|
10033
|
+
var string = "" + config._i, i, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
|
|
10034
|
+
tokens2 = expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
|
10035
|
+
tokenLen = tokens2.length;
|
|
10036
|
+
for (i = 0; i < tokenLen; i++) {
|
|
10037
|
+
token2 = tokens2[i];
|
|
10038
|
+
parsedInput = (string.match(getParseRegexForToken(token2, config)) || [])[0];
|
|
10039
|
+
if (parsedInput) {
|
|
10040
|
+
skipped = string.substr(0, string.indexOf(parsedInput));
|
|
10041
|
+
if (skipped.length > 0) {
|
|
10042
|
+
getParsingFlags(config).unusedInput.push(skipped);
|
|
10043
|
+
}
|
|
10044
|
+
string = string.slice(
|
|
10045
|
+
string.indexOf(parsedInput) + parsedInput.length
|
|
10046
|
+
);
|
|
10047
|
+
totalParsedInputLength += parsedInput.length;
|
|
10048
|
+
}
|
|
10049
|
+
if (formatTokenFunctions[token2]) {
|
|
10050
|
+
if (parsedInput) {
|
|
10051
|
+
getParsingFlags(config).empty = false;
|
|
10052
|
+
} else {
|
|
10053
|
+
getParsingFlags(config).unusedTokens.push(token2);
|
|
10054
|
+
}
|
|
10055
|
+
addTimeToArrayFromToken(token2, parsedInput, config);
|
|
10056
|
+
} else if (config._strict && !parsedInput) {
|
|
10057
|
+
getParsingFlags(config).unusedTokens.push(token2);
|
|
10058
|
+
}
|
|
10059
|
+
}
|
|
10060
|
+
getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
|
|
10061
|
+
if (string.length > 0) {
|
|
10062
|
+
getParsingFlags(config).unusedInput.push(string);
|
|
10063
|
+
}
|
|
10064
|
+
if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
|
|
10065
|
+
getParsingFlags(config).bigHour = void 0;
|
|
10066
|
+
}
|
|
10067
|
+
getParsingFlags(config).parsedDateParts = config._a.slice(0);
|
|
10068
|
+
getParsingFlags(config).meridiem = config._meridiem;
|
|
10069
|
+
config._a[HOUR] = meridiemFixWrap(
|
|
10070
|
+
config._locale,
|
|
10071
|
+
config._a[HOUR],
|
|
10072
|
+
config._meridiem
|
|
10073
|
+
);
|
|
10074
|
+
era = getParsingFlags(config).era;
|
|
10075
|
+
if (era !== null) {
|
|
10076
|
+
config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
|
|
10077
|
+
}
|
|
10078
|
+
configFromArray(config);
|
|
10079
|
+
checkOverflow(config);
|
|
10080
|
+
}
|
|
10081
|
+
function meridiemFixWrap(locale2, hour, meridiem2) {
|
|
10082
|
+
var isPm;
|
|
10083
|
+
if (meridiem2 == null) {
|
|
10084
|
+
return hour;
|
|
10085
|
+
}
|
|
10086
|
+
if (locale2.meridiemHour != null) {
|
|
10087
|
+
return locale2.meridiemHour(hour, meridiem2);
|
|
10088
|
+
} else if (locale2.isPM != null) {
|
|
10089
|
+
isPm = locale2.isPM(meridiem2);
|
|
10090
|
+
if (isPm && hour < 12) {
|
|
10091
|
+
hour += 12;
|
|
10092
|
+
}
|
|
10093
|
+
if (!isPm && hour === 12) {
|
|
10094
|
+
hour = 0;
|
|
10095
|
+
}
|
|
10096
|
+
return hour;
|
|
10097
|
+
} else {
|
|
10098
|
+
return hour;
|
|
10099
|
+
}
|
|
10100
|
+
}
|
|
10101
|
+
function configFromStringAndArray(config) {
|
|
10102
|
+
var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length;
|
|
10103
|
+
if (configfLen === 0) {
|
|
10104
|
+
getParsingFlags(config).invalidFormat = true;
|
|
10105
|
+
config._d = /* @__PURE__ */ new Date(NaN);
|
|
10106
|
+
return;
|
|
10107
|
+
}
|
|
10108
|
+
for (i = 0; i < configfLen; i++) {
|
|
10109
|
+
currentScore = 0;
|
|
10110
|
+
validFormatFound = false;
|
|
10111
|
+
tempConfig = copyConfig({}, config);
|
|
10112
|
+
if (config._useUTC != null) {
|
|
10113
|
+
tempConfig._useUTC = config._useUTC;
|
|
10114
|
+
}
|
|
10115
|
+
tempConfig._f = config._f[i];
|
|
10116
|
+
configFromStringAndFormat(tempConfig);
|
|
10117
|
+
if (isValid(tempConfig)) {
|
|
10118
|
+
validFormatFound = true;
|
|
10119
|
+
}
|
|
10120
|
+
currentScore += getParsingFlags(tempConfig).charsLeftOver;
|
|
10121
|
+
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
|
|
10122
|
+
getParsingFlags(tempConfig).score = currentScore;
|
|
10123
|
+
if (!bestFormatIsValid) {
|
|
10124
|
+
if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {
|
|
10125
|
+
scoreToBeat = currentScore;
|
|
10126
|
+
bestMoment = tempConfig;
|
|
10127
|
+
if (validFormatFound) {
|
|
10128
|
+
bestFormatIsValid = true;
|
|
10129
|
+
}
|
|
10130
|
+
}
|
|
10131
|
+
} else {
|
|
10132
|
+
if (currentScore < scoreToBeat) {
|
|
10133
|
+
scoreToBeat = currentScore;
|
|
10134
|
+
bestMoment = tempConfig;
|
|
10135
|
+
}
|
|
10136
|
+
}
|
|
10137
|
+
}
|
|
10138
|
+
extend(config, bestMoment || tempConfig);
|
|
10139
|
+
}
|
|
10140
|
+
function configFromObject(config) {
|
|
10141
|
+
if (config._d) {
|
|
10142
|
+
return;
|
|
10143
|
+
}
|
|
10144
|
+
var i = normalizeObjectUnits(config._i), dayOrDate = i.day === void 0 ? i.date : i.day;
|
|
10145
|
+
config._a = map(
|
|
10146
|
+
[i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
|
|
10147
|
+
function(obj) {
|
|
10148
|
+
return obj && parseInt(obj, 10);
|
|
10149
|
+
}
|
|
10150
|
+
);
|
|
10151
|
+
configFromArray(config);
|
|
10152
|
+
}
|
|
10153
|
+
function createFromConfig(config) {
|
|
10154
|
+
var res = new Moment(checkOverflow(prepareConfig(config)));
|
|
10155
|
+
if (res._nextDay) {
|
|
10156
|
+
res.add(1, "d");
|
|
10157
|
+
res._nextDay = void 0;
|
|
10158
|
+
}
|
|
10159
|
+
return res;
|
|
10160
|
+
}
|
|
10161
|
+
function prepareConfig(config) {
|
|
10162
|
+
var input = config._i, format2 = config._f;
|
|
10163
|
+
config._locale = config._locale || getLocale(config._l);
|
|
10164
|
+
if (input === null || format2 === void 0 && input === "") {
|
|
10165
|
+
return createInvalid({ nullInput: true });
|
|
10166
|
+
}
|
|
10167
|
+
if (typeof input === "string") {
|
|
10168
|
+
config._i = input = config._locale.preparse(input);
|
|
10169
|
+
}
|
|
10170
|
+
if (isMoment(input)) {
|
|
10171
|
+
return new Moment(checkOverflow(input));
|
|
10172
|
+
} else if (isDate(input)) {
|
|
10173
|
+
config._d = input;
|
|
10174
|
+
} else if (isArray(format2)) {
|
|
10175
|
+
configFromStringAndArray(config);
|
|
10176
|
+
} else if (format2) {
|
|
10177
|
+
configFromStringAndFormat(config);
|
|
10178
|
+
} else {
|
|
10179
|
+
configFromInput(config);
|
|
10180
|
+
}
|
|
10181
|
+
if (!isValid(config)) {
|
|
10182
|
+
config._d = null;
|
|
10183
|
+
}
|
|
10184
|
+
return config;
|
|
10185
|
+
}
|
|
10186
|
+
function configFromInput(config) {
|
|
10187
|
+
var input = config._i;
|
|
10188
|
+
if (isUndefined(input)) {
|
|
10189
|
+
config._d = new Date(hooks.now());
|
|
10190
|
+
} else if (isDate(input)) {
|
|
10191
|
+
config._d = new Date(input.valueOf());
|
|
10192
|
+
} else if (typeof input === "string") {
|
|
10193
|
+
configFromString(config);
|
|
10194
|
+
} else if (isArray(input)) {
|
|
10195
|
+
config._a = map(input.slice(0), function(obj) {
|
|
10196
|
+
return parseInt(obj, 10);
|
|
10197
|
+
});
|
|
10198
|
+
configFromArray(config);
|
|
10199
|
+
} else if (isObject(input)) {
|
|
10200
|
+
configFromObject(config);
|
|
10201
|
+
} else if (isNumber(input)) {
|
|
10202
|
+
config._d = new Date(input);
|
|
10203
|
+
} else {
|
|
10204
|
+
hooks.createFromInputFallback(config);
|
|
10205
|
+
}
|
|
10206
|
+
}
|
|
10207
|
+
function createLocalOrUTC(input, format2, locale2, strict, isUTC) {
|
|
10208
|
+
var c = {};
|
|
10209
|
+
if (format2 === true || format2 === false) {
|
|
10210
|
+
strict = format2;
|
|
10211
|
+
format2 = void 0;
|
|
10212
|
+
}
|
|
10213
|
+
if (locale2 === true || locale2 === false) {
|
|
10214
|
+
strict = locale2;
|
|
10215
|
+
locale2 = void 0;
|
|
10216
|
+
}
|
|
10217
|
+
if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
|
|
10218
|
+
input = void 0;
|
|
10219
|
+
}
|
|
10220
|
+
c._isAMomentObject = true;
|
|
10221
|
+
c._useUTC = c._isUTC = isUTC;
|
|
10222
|
+
c._l = locale2;
|
|
10223
|
+
c._i = input;
|
|
10224
|
+
c._f = format2;
|
|
10225
|
+
c._strict = strict;
|
|
10226
|
+
return createFromConfig(c);
|
|
10227
|
+
}
|
|
10228
|
+
function createLocal(input, format2, locale2, strict) {
|
|
10229
|
+
return createLocalOrUTC(input, format2, locale2, strict, false);
|
|
10230
|
+
}
|
|
10231
|
+
var prototypeMin = deprecate(
|
|
10232
|
+
"moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
|
|
10233
|
+
function() {
|
|
10234
|
+
var other = createLocal.apply(null, arguments);
|
|
10235
|
+
if (this.isValid() && other.isValid()) {
|
|
10236
|
+
return other < this ? this : other;
|
|
10237
|
+
} else {
|
|
10238
|
+
return createInvalid();
|
|
10239
|
+
}
|
|
10240
|
+
}
|
|
10241
|
+
), prototypeMax = deprecate(
|
|
10242
|
+
"moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
|
|
10243
|
+
function() {
|
|
10244
|
+
var other = createLocal.apply(null, arguments);
|
|
10245
|
+
if (this.isValid() && other.isValid()) {
|
|
10246
|
+
return other > this ? this : other;
|
|
10247
|
+
} else {
|
|
10248
|
+
return createInvalid();
|
|
10249
|
+
}
|
|
10250
|
+
}
|
|
10251
|
+
);
|
|
10252
|
+
function pickBy(fn, moments) {
|
|
10253
|
+
var res, i;
|
|
10254
|
+
if (moments.length === 1 && isArray(moments[0])) {
|
|
10255
|
+
moments = moments[0];
|
|
10256
|
+
}
|
|
10257
|
+
if (!moments.length) {
|
|
10258
|
+
return createLocal();
|
|
10259
|
+
}
|
|
10260
|
+
res = moments[0];
|
|
10261
|
+
for (i = 1; i < moments.length; ++i) {
|
|
10262
|
+
if (!moments[i].isValid() || moments[i][fn](res)) {
|
|
10263
|
+
res = moments[i];
|
|
10264
|
+
}
|
|
10265
|
+
}
|
|
10266
|
+
return res;
|
|
10267
|
+
}
|
|
10268
|
+
function min() {
|
|
10269
|
+
var args = [].slice.call(arguments, 0);
|
|
10270
|
+
return pickBy("isBefore", args);
|
|
10271
|
+
}
|
|
10272
|
+
function max() {
|
|
10273
|
+
var args = [].slice.call(arguments, 0);
|
|
10274
|
+
return pickBy("isAfter", args);
|
|
10275
|
+
}
|
|
10276
|
+
var now = function() {
|
|
10277
|
+
return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
|
|
10278
|
+
};
|
|
10279
|
+
var ordering = [
|
|
10280
|
+
"year",
|
|
10281
|
+
"quarter",
|
|
10282
|
+
"month",
|
|
10283
|
+
"week",
|
|
10284
|
+
"day",
|
|
10285
|
+
"hour",
|
|
10286
|
+
"minute",
|
|
10287
|
+
"second",
|
|
10288
|
+
"millisecond"
|
|
10289
|
+
];
|
|
10290
|
+
function isDurationValid(m) {
|
|
10291
|
+
var key, unitHasDecimal = false, i, orderLen = ordering.length;
|
|
10292
|
+
for (key in m) {
|
|
10293
|
+
if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
|
|
10294
|
+
return false;
|
|
10295
|
+
}
|
|
10296
|
+
}
|
|
10297
|
+
for (i = 0; i < orderLen; ++i) {
|
|
10298
|
+
if (m[ordering[i]]) {
|
|
10299
|
+
if (unitHasDecimal) {
|
|
10300
|
+
return false;
|
|
10301
|
+
}
|
|
10302
|
+
if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
|
|
10303
|
+
unitHasDecimal = true;
|
|
10304
|
+
}
|
|
10305
|
+
}
|
|
10306
|
+
}
|
|
10307
|
+
return true;
|
|
10308
|
+
}
|
|
10309
|
+
function isValid$1() {
|
|
10310
|
+
return this._isValid;
|
|
10311
|
+
}
|
|
10312
|
+
function createInvalid$1() {
|
|
10313
|
+
return createDuration(NaN);
|
|
10314
|
+
}
|
|
10315
|
+
function Duration(duration) {
|
|
10316
|
+
var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0;
|
|
10317
|
+
this._isValid = isDurationValid(normalizedInput);
|
|
10318
|
+
this._milliseconds = +milliseconds2 + seconds2 * 1e3 + // 1000
|
|
10319
|
+
minutes2 * 6e4 + // 1000 * 60
|
|
10320
|
+
hours2 * 1e3 * 60 * 60;
|
|
10321
|
+
this._days = +days2 + weeks2 * 7;
|
|
10322
|
+
this._months = +months2 + quarters * 3 + years2 * 12;
|
|
10323
|
+
this._data = {};
|
|
10324
|
+
this._locale = getLocale();
|
|
10325
|
+
this._bubble();
|
|
10326
|
+
}
|
|
10327
|
+
function isDuration(obj) {
|
|
10328
|
+
return obj instanceof Duration;
|
|
10329
|
+
}
|
|
10330
|
+
function absRound(number2) {
|
|
10331
|
+
if (number2 < 0) {
|
|
10332
|
+
return Math.round(-1 * number2) * -1;
|
|
10333
|
+
} else {
|
|
10334
|
+
return Math.round(number2);
|
|
10335
|
+
}
|
|
10336
|
+
}
|
|
10337
|
+
function compareArrays(array1, array2, dontConvert) {
|
|
10338
|
+
var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i;
|
|
10339
|
+
for (i = 0; i < len; i++) {
|
|
10340
|
+
if (toInt(array1[i]) !== toInt(array2[i])) {
|
|
10341
|
+
diffs++;
|
|
10342
|
+
}
|
|
10343
|
+
}
|
|
10344
|
+
return diffs + lengthDiff;
|
|
10345
|
+
}
|
|
10346
|
+
function offset(token2, separator) {
|
|
10347
|
+
addFormatToken(token2, 0, 0, function() {
|
|
10348
|
+
var offset2 = this.utcOffset(), sign2 = "+";
|
|
10349
|
+
if (offset2 < 0) {
|
|
10350
|
+
offset2 = -offset2;
|
|
10351
|
+
sign2 = "-";
|
|
10352
|
+
}
|
|
10353
|
+
return sign2 + zeroFill(~~(offset2 / 60), 2) + separator + zeroFill(~~offset2 % 60, 2);
|
|
10354
|
+
});
|
|
10355
|
+
}
|
|
10356
|
+
offset("Z", ":");
|
|
10357
|
+
offset("ZZ", "");
|
|
10358
|
+
addRegexToken("Z", matchShortOffset);
|
|
10359
|
+
addRegexToken("ZZ", matchShortOffset);
|
|
10360
|
+
addParseToken(["Z", "ZZ"], function(input, array, config) {
|
|
10361
|
+
config._useUTC = true;
|
|
10362
|
+
config._tzm = offsetFromString(matchShortOffset, input);
|
|
10363
|
+
});
|
|
10364
|
+
var chunkOffset = /([\+\-]|\d\d)/gi;
|
|
10365
|
+
function offsetFromString(matcher, string) {
|
|
10366
|
+
var matches = (string || "").match(matcher), chunk, parts, minutes2;
|
|
10367
|
+
if (matches === null) {
|
|
10368
|
+
return null;
|
|
10369
|
+
}
|
|
10370
|
+
chunk = matches[matches.length - 1] || [];
|
|
10371
|
+
parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
|
|
10372
|
+
minutes2 = +(parts[1] * 60) + toInt(parts[2]);
|
|
10373
|
+
return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2;
|
|
10374
|
+
}
|
|
10375
|
+
function cloneWithOffset(input, model) {
|
|
10376
|
+
var res, diff2;
|
|
10377
|
+
if (model._isUTC) {
|
|
10378
|
+
res = model.clone();
|
|
10379
|
+
diff2 = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
|
|
10380
|
+
res._d.setTime(res._d.valueOf() + diff2);
|
|
10381
|
+
hooks.updateOffset(res, false);
|
|
10382
|
+
return res;
|
|
10383
|
+
} else {
|
|
10384
|
+
return createLocal(input).local();
|
|
10385
|
+
}
|
|
10386
|
+
}
|
|
10387
|
+
function getDateOffset(m) {
|
|
10388
|
+
return -Math.round(m._d.getTimezoneOffset());
|
|
10389
|
+
}
|
|
10390
|
+
hooks.updateOffset = function() {
|
|
10391
|
+
};
|
|
10392
|
+
function getSetOffset(input, keepLocalTime, keepMinutes) {
|
|
10393
|
+
var offset2 = this._offset || 0, localAdjust;
|
|
10394
|
+
if (!this.isValid()) {
|
|
10395
|
+
return input != null ? this : NaN;
|
|
10396
|
+
}
|
|
10397
|
+
if (input != null) {
|
|
10398
|
+
if (typeof input === "string") {
|
|
10399
|
+
input = offsetFromString(matchShortOffset, input);
|
|
10400
|
+
if (input === null) {
|
|
10401
|
+
return this;
|
|
10402
|
+
}
|
|
10403
|
+
} else if (Math.abs(input) < 16 && !keepMinutes) {
|
|
10404
|
+
input = input * 60;
|
|
10405
|
+
}
|
|
10406
|
+
if (!this._isUTC && keepLocalTime) {
|
|
10407
|
+
localAdjust = getDateOffset(this);
|
|
10408
|
+
}
|
|
10409
|
+
this._offset = input;
|
|
10410
|
+
this._isUTC = true;
|
|
10411
|
+
if (localAdjust != null) {
|
|
10412
|
+
this.add(localAdjust, "m");
|
|
10413
|
+
}
|
|
10414
|
+
if (offset2 !== input) {
|
|
10415
|
+
if (!keepLocalTime || this._changeInProgress) {
|
|
10416
|
+
addSubtract(
|
|
10417
|
+
this,
|
|
10418
|
+
createDuration(input - offset2, "m"),
|
|
10419
|
+
1,
|
|
10420
|
+
false
|
|
10421
|
+
);
|
|
10422
|
+
} else if (!this._changeInProgress) {
|
|
10423
|
+
this._changeInProgress = true;
|
|
10424
|
+
hooks.updateOffset(this, true);
|
|
10425
|
+
this._changeInProgress = null;
|
|
10426
|
+
}
|
|
10427
|
+
}
|
|
10428
|
+
return this;
|
|
10429
|
+
} else {
|
|
10430
|
+
return this._isUTC ? offset2 : getDateOffset(this);
|
|
10431
|
+
}
|
|
10432
|
+
}
|
|
10433
|
+
function getSetZone(input, keepLocalTime) {
|
|
10434
|
+
if (input != null) {
|
|
10435
|
+
if (typeof input !== "string") {
|
|
10436
|
+
input = -input;
|
|
10437
|
+
}
|
|
10438
|
+
this.utcOffset(input, keepLocalTime);
|
|
10439
|
+
return this;
|
|
10440
|
+
} else {
|
|
10441
|
+
return -this.utcOffset();
|
|
10442
|
+
}
|
|
10443
|
+
}
|
|
10444
|
+
function setOffsetToUTC(keepLocalTime) {
|
|
10445
|
+
return this.utcOffset(0, keepLocalTime);
|
|
10446
|
+
}
|
|
10447
|
+
function setOffsetToLocal(keepLocalTime) {
|
|
10448
|
+
if (this._isUTC) {
|
|
10449
|
+
this.utcOffset(0, keepLocalTime);
|
|
10450
|
+
this._isUTC = false;
|
|
10451
|
+
if (keepLocalTime) {
|
|
10452
|
+
this.subtract(getDateOffset(this), "m");
|
|
10453
|
+
}
|
|
10454
|
+
}
|
|
10455
|
+
return this;
|
|
10456
|
+
}
|
|
10457
|
+
function setOffsetToParsedOffset() {
|
|
10458
|
+
if (this._tzm != null) {
|
|
10459
|
+
this.utcOffset(this._tzm, false, true);
|
|
10460
|
+
} else if (typeof this._i === "string") {
|
|
10461
|
+
var tZone = offsetFromString(matchOffset, this._i);
|
|
10462
|
+
if (tZone != null) {
|
|
10463
|
+
this.utcOffset(tZone);
|
|
10464
|
+
} else {
|
|
10465
|
+
this.utcOffset(0, true);
|
|
10466
|
+
}
|
|
10467
|
+
}
|
|
10468
|
+
return this;
|
|
10469
|
+
}
|
|
10470
|
+
function hasAlignedHourOffset(input) {
|
|
10471
|
+
if (!this.isValid()) {
|
|
10472
|
+
return false;
|
|
10473
|
+
}
|
|
10474
|
+
input = input ? createLocal(input).utcOffset() : 0;
|
|
10475
|
+
return (this.utcOffset() - input) % 60 === 0;
|
|
10476
|
+
}
|
|
10477
|
+
function isDaylightSavingTime() {
|
|
10478
|
+
return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
|
|
10479
|
+
}
|
|
10480
|
+
function isDaylightSavingTimeShifted() {
|
|
10481
|
+
if (!isUndefined(this._isDSTShifted)) {
|
|
10482
|
+
return this._isDSTShifted;
|
|
10483
|
+
}
|
|
10484
|
+
var c = {}, other;
|
|
10485
|
+
copyConfig(c, this);
|
|
10486
|
+
c = prepareConfig(c);
|
|
10487
|
+
if (c._a) {
|
|
10488
|
+
other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
|
|
10489
|
+
this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
|
|
10490
|
+
} else {
|
|
10491
|
+
this._isDSTShifted = false;
|
|
10492
|
+
}
|
|
10493
|
+
return this._isDSTShifted;
|
|
10494
|
+
}
|
|
10495
|
+
function isLocal() {
|
|
10496
|
+
return this.isValid() ? !this._isUTC : false;
|
|
10497
|
+
}
|
|
10498
|
+
function isUtcOffset() {
|
|
10499
|
+
return this.isValid() ? this._isUTC : false;
|
|
10500
|
+
}
|
|
10501
|
+
function isUtc() {
|
|
10502
|
+
return this.isValid() ? this._isUTC && this._offset === 0 : false;
|
|
10503
|
+
}
|
|
10504
|
+
var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
|
10505
|
+
function createDuration(input, key) {
|
|
10506
|
+
var duration = input, match = null, sign2, ret, diffRes;
|
|
10507
|
+
if (isDuration(input)) {
|
|
10508
|
+
duration = {
|
|
10509
|
+
ms: input._milliseconds,
|
|
10510
|
+
d: input._days,
|
|
10511
|
+
M: input._months
|
|
10512
|
+
};
|
|
10513
|
+
} else if (isNumber(input) || !isNaN(+input)) {
|
|
10514
|
+
duration = {};
|
|
10515
|
+
if (key) {
|
|
10516
|
+
duration[key] = +input;
|
|
10517
|
+
} else {
|
|
10518
|
+
duration.milliseconds = +input;
|
|
10519
|
+
}
|
|
10520
|
+
} else if (match = aspNetRegex.exec(input)) {
|
|
10521
|
+
sign2 = match[1] === "-" ? -1 : 1;
|
|
10522
|
+
duration = {
|
|
10523
|
+
y: 0,
|
|
10524
|
+
d: toInt(match[DATE]) * sign2,
|
|
10525
|
+
h: toInt(match[HOUR]) * sign2,
|
|
10526
|
+
m: toInt(match[MINUTE]) * sign2,
|
|
10527
|
+
s: toInt(match[SECOND]) * sign2,
|
|
10528
|
+
ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2
|
|
10529
|
+
// the millisecond decimal point is included in the match
|
|
10530
|
+
};
|
|
10531
|
+
} else if (match = isoRegex.exec(input)) {
|
|
10532
|
+
sign2 = match[1] === "-" ? -1 : 1;
|
|
10533
|
+
duration = {
|
|
10534
|
+
y: parseIso(match[2], sign2),
|
|
10535
|
+
M: parseIso(match[3], sign2),
|
|
10536
|
+
w: parseIso(match[4], sign2),
|
|
10537
|
+
d: parseIso(match[5], sign2),
|
|
10538
|
+
h: parseIso(match[6], sign2),
|
|
10539
|
+
m: parseIso(match[7], sign2),
|
|
10540
|
+
s: parseIso(match[8], sign2)
|
|
10541
|
+
};
|
|
10542
|
+
} else if (duration == null) {
|
|
10543
|
+
duration = {};
|
|
10544
|
+
} else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
|
|
10545
|
+
diffRes = momentsDifference(
|
|
10546
|
+
createLocal(duration.from),
|
|
10547
|
+
createLocal(duration.to)
|
|
10548
|
+
);
|
|
10549
|
+
duration = {};
|
|
10550
|
+
duration.ms = diffRes.milliseconds;
|
|
10551
|
+
duration.M = diffRes.months;
|
|
10552
|
+
}
|
|
10553
|
+
ret = new Duration(duration);
|
|
10554
|
+
if (isDuration(input) && hasOwnProp(input, "_locale")) {
|
|
10555
|
+
ret._locale = input._locale;
|
|
10556
|
+
}
|
|
10557
|
+
if (isDuration(input) && hasOwnProp(input, "_isValid")) {
|
|
10558
|
+
ret._isValid = input._isValid;
|
|
10559
|
+
}
|
|
10560
|
+
return ret;
|
|
10561
|
+
}
|
|
10562
|
+
createDuration.fn = Duration.prototype;
|
|
10563
|
+
createDuration.invalid = createInvalid$1;
|
|
10564
|
+
function parseIso(inp, sign2) {
|
|
10565
|
+
var res = inp && parseFloat(inp.replace(",", "."));
|
|
10566
|
+
return (isNaN(res) ? 0 : res) * sign2;
|
|
10567
|
+
}
|
|
10568
|
+
function positiveMomentsDifference(base, other) {
|
|
10569
|
+
var res = {};
|
|
10570
|
+
res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
|
|
10571
|
+
if (base.clone().add(res.months, "M").isAfter(other)) {
|
|
10572
|
+
--res.months;
|
|
10573
|
+
}
|
|
10574
|
+
res.milliseconds = +other - +base.clone().add(res.months, "M");
|
|
10575
|
+
return res;
|
|
10576
|
+
}
|
|
10577
|
+
function momentsDifference(base, other) {
|
|
10578
|
+
var res;
|
|
10579
|
+
if (!(base.isValid() && other.isValid())) {
|
|
10580
|
+
return { milliseconds: 0, months: 0 };
|
|
10581
|
+
}
|
|
10582
|
+
other = cloneWithOffset(other, base);
|
|
10583
|
+
if (base.isBefore(other)) {
|
|
10584
|
+
res = positiveMomentsDifference(base, other);
|
|
10585
|
+
} else {
|
|
10586
|
+
res = positiveMomentsDifference(other, base);
|
|
10587
|
+
res.milliseconds = -res.milliseconds;
|
|
10588
|
+
res.months = -res.months;
|
|
10589
|
+
}
|
|
10590
|
+
return res;
|
|
10591
|
+
}
|
|
10592
|
+
function createAdder(direction, name) {
|
|
10593
|
+
return function(val, period) {
|
|
10594
|
+
var dur, tmp;
|
|
10595
|
+
if (period !== null && !isNaN(+period)) {
|
|
10596
|
+
deprecateSimple(
|
|
10597
|
+
name,
|
|
10598
|
+
"moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
|
|
10599
|
+
);
|
|
10600
|
+
tmp = val;
|
|
10601
|
+
val = period;
|
|
10602
|
+
period = tmp;
|
|
10603
|
+
}
|
|
10604
|
+
dur = createDuration(val, period);
|
|
10605
|
+
addSubtract(this, dur, direction);
|
|
10606
|
+
return this;
|
|
10607
|
+
};
|
|
10608
|
+
}
|
|
10609
|
+
function addSubtract(mom, duration, isAdding, updateOffset) {
|
|
10610
|
+
var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months);
|
|
10611
|
+
if (!mom.isValid()) {
|
|
10612
|
+
return;
|
|
10613
|
+
}
|
|
10614
|
+
updateOffset = updateOffset == null ? true : updateOffset;
|
|
10615
|
+
if (months2) {
|
|
10616
|
+
setMonth(mom, get(mom, "Month") + months2 * isAdding);
|
|
10617
|
+
}
|
|
10618
|
+
if (days2) {
|
|
10619
|
+
set$1(mom, "Date", get(mom, "Date") + days2 * isAdding);
|
|
10620
|
+
}
|
|
10621
|
+
if (milliseconds2) {
|
|
10622
|
+
mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding);
|
|
10623
|
+
}
|
|
10624
|
+
if (updateOffset) {
|
|
10625
|
+
hooks.updateOffset(mom, days2 || months2);
|
|
10626
|
+
}
|
|
10627
|
+
}
|
|
10628
|
+
var add = createAdder(1, "add"), subtract = createAdder(-1, "subtract");
|
|
10629
|
+
function isString(input) {
|
|
10630
|
+
return typeof input === "string" || input instanceof String;
|
|
10631
|
+
}
|
|
10632
|
+
function isMomentInput(input) {
|
|
10633
|
+
return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === void 0;
|
|
10634
|
+
}
|
|
10635
|
+
function isMomentInputObject(input) {
|
|
10636
|
+
var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
|
|
10637
|
+
"years",
|
|
10638
|
+
"year",
|
|
10639
|
+
"y",
|
|
10640
|
+
"months",
|
|
10641
|
+
"month",
|
|
10642
|
+
"M",
|
|
10643
|
+
"days",
|
|
10644
|
+
"day",
|
|
10645
|
+
"d",
|
|
10646
|
+
"dates",
|
|
10647
|
+
"date",
|
|
10648
|
+
"D",
|
|
10649
|
+
"hours",
|
|
10650
|
+
"hour",
|
|
10651
|
+
"h",
|
|
10652
|
+
"minutes",
|
|
10653
|
+
"minute",
|
|
10654
|
+
"m",
|
|
10655
|
+
"seconds",
|
|
10656
|
+
"second",
|
|
10657
|
+
"s",
|
|
10658
|
+
"milliseconds",
|
|
10659
|
+
"millisecond",
|
|
10660
|
+
"ms"
|
|
10661
|
+
], i, property, propertyLen = properties.length;
|
|
10662
|
+
for (i = 0; i < propertyLen; i += 1) {
|
|
10663
|
+
property = properties[i];
|
|
10664
|
+
propertyTest = propertyTest || hasOwnProp(input, property);
|
|
10665
|
+
}
|
|
10666
|
+
return objectTest && propertyTest;
|
|
10667
|
+
}
|
|
10668
|
+
function isNumberOrStringArray(input) {
|
|
10669
|
+
var arrayTest = isArray(input), dataTypeTest = false;
|
|
10670
|
+
if (arrayTest) {
|
|
10671
|
+
dataTypeTest = input.filter(function(item) {
|
|
10672
|
+
return !isNumber(item) && isString(input);
|
|
10673
|
+
}).length === 0;
|
|
10674
|
+
}
|
|
10675
|
+
return arrayTest && dataTypeTest;
|
|
10676
|
+
}
|
|
10677
|
+
function isCalendarSpec(input) {
|
|
10678
|
+
var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
|
|
10679
|
+
"sameDay",
|
|
10680
|
+
"nextDay",
|
|
10681
|
+
"lastDay",
|
|
10682
|
+
"nextWeek",
|
|
10683
|
+
"lastWeek",
|
|
10684
|
+
"sameElse"
|
|
10685
|
+
], i, property;
|
|
10686
|
+
for (i = 0; i < properties.length; i += 1) {
|
|
10687
|
+
property = properties[i];
|
|
10688
|
+
propertyTest = propertyTest || hasOwnProp(input, property);
|
|
10689
|
+
}
|
|
10690
|
+
return objectTest && propertyTest;
|
|
10691
|
+
}
|
|
10692
|
+
function getCalendarFormat(myMoment, now2) {
|
|
10693
|
+
var diff2 = myMoment.diff(now2, "days", true);
|
|
10694
|
+
return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
|
|
10695
|
+
}
|
|
10696
|
+
function calendar$1(time2, formats) {
|
|
10697
|
+
if (arguments.length === 1) {
|
|
10698
|
+
if (!arguments[0]) {
|
|
10699
|
+
time2 = void 0;
|
|
10700
|
+
formats = void 0;
|
|
10701
|
+
} else if (isMomentInput(arguments[0])) {
|
|
10702
|
+
time2 = arguments[0];
|
|
10703
|
+
formats = void 0;
|
|
10704
|
+
} else if (isCalendarSpec(arguments[0])) {
|
|
10705
|
+
formats = arguments[0];
|
|
10706
|
+
time2 = void 0;
|
|
10707
|
+
}
|
|
10708
|
+
}
|
|
10709
|
+
var now2 = time2 || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format2]) ? formats[format2].call(this, now2) : formats[format2]);
|
|
10710
|
+
return this.format(
|
|
10711
|
+
output || this.localeData().calendar(format2, this, createLocal(now2))
|
|
10712
|
+
);
|
|
10713
|
+
}
|
|
10714
|
+
function clone() {
|
|
10715
|
+
return new Moment(this);
|
|
10716
|
+
}
|
|
10717
|
+
function isAfter(input, units) {
|
|
10718
|
+
var localInput = isMoment(input) ? input : createLocal(input);
|
|
10719
|
+
if (!(this.isValid() && localInput.isValid())) {
|
|
10720
|
+
return false;
|
|
10721
|
+
}
|
|
10722
|
+
units = normalizeUnits(units) || "millisecond";
|
|
10723
|
+
if (units === "millisecond") {
|
|
10724
|
+
return this.valueOf() > localInput.valueOf();
|
|
10725
|
+
} else {
|
|
10726
|
+
return localInput.valueOf() < this.clone().startOf(units).valueOf();
|
|
10727
|
+
}
|
|
10728
|
+
}
|
|
10729
|
+
function isBefore(input, units) {
|
|
10730
|
+
var localInput = isMoment(input) ? input : createLocal(input);
|
|
10731
|
+
if (!(this.isValid() && localInput.isValid())) {
|
|
10732
|
+
return false;
|
|
10733
|
+
}
|
|
10734
|
+
units = normalizeUnits(units) || "millisecond";
|
|
10735
|
+
if (units === "millisecond") {
|
|
10736
|
+
return this.valueOf() < localInput.valueOf();
|
|
10737
|
+
} else {
|
|
10738
|
+
return this.clone().endOf(units).valueOf() < localInput.valueOf();
|
|
10739
|
+
}
|
|
10740
|
+
}
|
|
10741
|
+
function isBetween(from2, to2, units, inclusivity) {
|
|
10742
|
+
var localFrom = isMoment(from2) ? from2 : createLocal(from2), localTo = isMoment(to2) ? to2 : createLocal(to2);
|
|
10743
|
+
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
|
|
10744
|
+
return false;
|
|
10745
|
+
}
|
|
10746
|
+
inclusivity = inclusivity || "()";
|
|
10747
|
+
return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
|
|
10748
|
+
}
|
|
10749
|
+
function isSame(input, units) {
|
|
10750
|
+
var localInput = isMoment(input) ? input : createLocal(input), inputMs;
|
|
10751
|
+
if (!(this.isValid() && localInput.isValid())) {
|
|
10752
|
+
return false;
|
|
10753
|
+
}
|
|
10754
|
+
units = normalizeUnits(units) || "millisecond";
|
|
10755
|
+
if (units === "millisecond") {
|
|
10756
|
+
return this.valueOf() === localInput.valueOf();
|
|
10757
|
+
} else {
|
|
10758
|
+
inputMs = localInput.valueOf();
|
|
10759
|
+
return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
|
|
10760
|
+
}
|
|
10761
|
+
}
|
|
10762
|
+
function isSameOrAfter(input, units) {
|
|
10763
|
+
return this.isSame(input, units) || this.isAfter(input, units);
|
|
10764
|
+
}
|
|
10765
|
+
function isSameOrBefore(input, units) {
|
|
10766
|
+
return this.isSame(input, units) || this.isBefore(input, units);
|
|
10767
|
+
}
|
|
10768
|
+
function diff(input, units, asFloat) {
|
|
10769
|
+
var that, zoneDelta, output;
|
|
10770
|
+
if (!this.isValid()) {
|
|
10771
|
+
return NaN;
|
|
10772
|
+
}
|
|
10773
|
+
that = cloneWithOffset(input, this);
|
|
10774
|
+
if (!that.isValid()) {
|
|
10775
|
+
return NaN;
|
|
10776
|
+
}
|
|
10777
|
+
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
|
|
10778
|
+
units = normalizeUnits(units);
|
|
10779
|
+
switch (units) {
|
|
10780
|
+
case "year":
|
|
10781
|
+
output = monthDiff(this, that) / 12;
|
|
10782
|
+
break;
|
|
10783
|
+
case "month":
|
|
10784
|
+
output = monthDiff(this, that);
|
|
10785
|
+
break;
|
|
10786
|
+
case "quarter":
|
|
10787
|
+
output = monthDiff(this, that) / 3;
|
|
10788
|
+
break;
|
|
10789
|
+
case "second":
|
|
10790
|
+
output = (this - that) / 1e3;
|
|
10791
|
+
break;
|
|
10792
|
+
// 1000
|
|
10793
|
+
case "minute":
|
|
10794
|
+
output = (this - that) / 6e4;
|
|
10795
|
+
break;
|
|
10796
|
+
// 1000 * 60
|
|
10797
|
+
case "hour":
|
|
10798
|
+
output = (this - that) / 36e5;
|
|
10799
|
+
break;
|
|
10800
|
+
// 1000 * 60 * 60
|
|
10801
|
+
case "day":
|
|
10802
|
+
output = (this - that - zoneDelta) / 864e5;
|
|
10803
|
+
break;
|
|
10804
|
+
// 1000 * 60 * 60 * 24, negate dst
|
|
10805
|
+
case "week":
|
|
10806
|
+
output = (this - that - zoneDelta) / 6048e5;
|
|
10807
|
+
break;
|
|
10808
|
+
// 1000 * 60 * 60 * 24 * 7, negate dst
|
|
10809
|
+
default:
|
|
10810
|
+
output = this - that;
|
|
10811
|
+
}
|
|
10812
|
+
return asFloat ? output : absFloor(output);
|
|
10813
|
+
}
|
|
10814
|
+
function monthDiff(a, b) {
|
|
10815
|
+
if (a.date() < b.date()) {
|
|
10816
|
+
return -monthDiff(b, a);
|
|
10817
|
+
}
|
|
10818
|
+
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, "months"), anchor2, adjust;
|
|
10819
|
+
if (b - anchor < 0) {
|
|
10820
|
+
anchor2 = a.clone().add(wholeMonthDiff - 1, "months");
|
|
10821
|
+
adjust = (b - anchor) / (anchor - anchor2);
|
|
10822
|
+
} else {
|
|
10823
|
+
anchor2 = a.clone().add(wholeMonthDiff + 1, "months");
|
|
10824
|
+
adjust = (b - anchor) / (anchor2 - anchor);
|
|
10825
|
+
}
|
|
10826
|
+
return -(wholeMonthDiff + adjust) || 0;
|
|
10827
|
+
}
|
|
10828
|
+
hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
|
|
10829
|
+
hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
|
|
10830
|
+
function toString() {
|
|
10831
|
+
return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
|
|
10832
|
+
}
|
|
10833
|
+
function toISOString(keepOffset) {
|
|
10834
|
+
if (!this.isValid()) {
|
|
10835
|
+
return null;
|
|
10836
|
+
}
|
|
10837
|
+
var utc = keepOffset !== true, m = utc ? this.clone().utc() : this;
|
|
10838
|
+
if (m.year() < 0 || m.year() > 9999) {
|
|
10839
|
+
return formatMoment(
|
|
10840
|
+
m,
|
|
10841
|
+
utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
|
|
10842
|
+
);
|
|
10843
|
+
}
|
|
10844
|
+
if (isFunction(Date.prototype.toISOString)) {
|
|
10845
|
+
if (utc) {
|
|
10846
|
+
return this.toDate().toISOString();
|
|
10847
|
+
} else {
|
|
10848
|
+
return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m, "Z"));
|
|
10849
|
+
}
|
|
10850
|
+
}
|
|
10851
|
+
return formatMoment(
|
|
10852
|
+
m,
|
|
10853
|
+
utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
|
|
10854
|
+
);
|
|
10855
|
+
}
|
|
10856
|
+
function inspect() {
|
|
10857
|
+
if (!this.isValid()) {
|
|
10858
|
+
return "moment.invalid(/* " + this._i + " */)";
|
|
10859
|
+
}
|
|
10860
|
+
var func = "moment", zone = "", prefix, year, datetime, suffix;
|
|
10861
|
+
if (!this.isLocal()) {
|
|
10862
|
+
func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
|
|
10863
|
+
zone = "Z";
|
|
10864
|
+
}
|
|
10865
|
+
prefix = "[" + func + '("]';
|
|
10866
|
+
year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
|
|
10867
|
+
datetime = "-MM-DD[T]HH:mm:ss.SSS";
|
|
10868
|
+
suffix = zone + '[")]';
|
|
10869
|
+
return this.format(prefix + year + datetime + suffix);
|
|
10870
|
+
}
|
|
10871
|
+
function format(inputString) {
|
|
10872
|
+
if (!inputString) {
|
|
10873
|
+
inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
|
|
10874
|
+
}
|
|
10875
|
+
var output = formatMoment(this, inputString);
|
|
10876
|
+
return this.localeData().postformat(output);
|
|
10877
|
+
}
|
|
10878
|
+
function from(time2, withoutSuffix) {
|
|
10879
|
+
if (this.isValid() && (isMoment(time2) && time2.isValid() || createLocal(time2).isValid())) {
|
|
10880
|
+
return createDuration({ to: this, from: time2 }).locale(this.locale()).humanize(!withoutSuffix);
|
|
10881
|
+
} else {
|
|
10882
|
+
return this.localeData().invalidDate();
|
|
10883
|
+
}
|
|
10884
|
+
}
|
|
10885
|
+
function fromNow(withoutSuffix) {
|
|
10886
|
+
return this.from(createLocal(), withoutSuffix);
|
|
10887
|
+
}
|
|
10888
|
+
function to(time2, withoutSuffix) {
|
|
10889
|
+
if (this.isValid() && (isMoment(time2) && time2.isValid() || createLocal(time2).isValid())) {
|
|
10890
|
+
return createDuration({ from: this, to: time2 }).locale(this.locale()).humanize(!withoutSuffix);
|
|
10891
|
+
} else {
|
|
10892
|
+
return this.localeData().invalidDate();
|
|
10893
|
+
}
|
|
10894
|
+
}
|
|
10895
|
+
function toNow(withoutSuffix) {
|
|
10896
|
+
return this.to(createLocal(), withoutSuffix);
|
|
10897
|
+
}
|
|
10898
|
+
function locale(key) {
|
|
10899
|
+
var newLocaleData;
|
|
10900
|
+
if (key === void 0) {
|
|
10901
|
+
return this._locale._abbr;
|
|
10902
|
+
} else {
|
|
10903
|
+
newLocaleData = getLocale(key);
|
|
10904
|
+
if (newLocaleData != null) {
|
|
10905
|
+
this._locale = newLocaleData;
|
|
10906
|
+
}
|
|
10907
|
+
return this;
|
|
10908
|
+
}
|
|
10909
|
+
}
|
|
10910
|
+
var lang = deprecate(
|
|
10911
|
+
"moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
|
|
10912
|
+
function(key) {
|
|
10913
|
+
if (key === void 0) {
|
|
10914
|
+
return this.localeData();
|
|
10915
|
+
} else {
|
|
10916
|
+
return this.locale(key);
|
|
10917
|
+
}
|
|
10918
|
+
}
|
|
10919
|
+
);
|
|
10920
|
+
function localeData() {
|
|
10921
|
+
return this._locale;
|
|
10922
|
+
}
|
|
10923
|
+
var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
|
|
10924
|
+
function mod$1(dividend, divisor) {
|
|
10925
|
+
return (dividend % divisor + divisor) % divisor;
|
|
10926
|
+
}
|
|
10927
|
+
function localStartOfDate(y, m, d) {
|
|
10928
|
+
if (y < 100 && y >= 0) {
|
|
10929
|
+
return new Date(y + 400, m, d) - MS_PER_400_YEARS;
|
|
10930
|
+
} else {
|
|
10931
|
+
return new Date(y, m, d).valueOf();
|
|
10932
|
+
}
|
|
10933
|
+
}
|
|
10934
|
+
function utcStartOfDate(y, m, d) {
|
|
10935
|
+
if (y < 100 && y >= 0) {
|
|
10936
|
+
return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
|
|
10937
|
+
} else {
|
|
10938
|
+
return Date.UTC(y, m, d);
|
|
10939
|
+
}
|
|
10940
|
+
}
|
|
10941
|
+
function startOf(units) {
|
|
10942
|
+
var time2, startOfDate;
|
|
10943
|
+
units = normalizeUnits(units);
|
|
10944
|
+
if (units === void 0 || units === "millisecond" || !this.isValid()) {
|
|
10945
|
+
return this;
|
|
10946
|
+
}
|
|
10947
|
+
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
|
10948
|
+
switch (units) {
|
|
10949
|
+
case "year":
|
|
10950
|
+
time2 = startOfDate(this.year(), 0, 1);
|
|
10951
|
+
break;
|
|
10952
|
+
case "quarter":
|
|
10953
|
+
time2 = startOfDate(
|
|
10954
|
+
this.year(),
|
|
10955
|
+
this.month() - this.month() % 3,
|
|
10956
|
+
1
|
|
10957
|
+
);
|
|
10958
|
+
break;
|
|
10959
|
+
case "month":
|
|
10960
|
+
time2 = startOfDate(this.year(), this.month(), 1);
|
|
10961
|
+
break;
|
|
10962
|
+
case "week":
|
|
10963
|
+
time2 = startOfDate(
|
|
10964
|
+
this.year(),
|
|
10965
|
+
this.month(),
|
|
10966
|
+
this.date() - this.weekday()
|
|
10967
|
+
);
|
|
10968
|
+
break;
|
|
10969
|
+
case "isoWeek":
|
|
10970
|
+
time2 = startOfDate(
|
|
10971
|
+
this.year(),
|
|
10972
|
+
this.month(),
|
|
10973
|
+
this.date() - (this.isoWeekday() - 1)
|
|
10974
|
+
);
|
|
10975
|
+
break;
|
|
10976
|
+
case "day":
|
|
10977
|
+
case "date":
|
|
10978
|
+
time2 = startOfDate(this.year(), this.month(), this.date());
|
|
10979
|
+
break;
|
|
10980
|
+
case "hour":
|
|
10981
|
+
time2 = this._d.valueOf();
|
|
10982
|
+
time2 -= mod$1(
|
|
10983
|
+
time2 + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
|
10984
|
+
MS_PER_HOUR
|
|
10985
|
+
);
|
|
10986
|
+
break;
|
|
10987
|
+
case "minute":
|
|
10988
|
+
time2 = this._d.valueOf();
|
|
10989
|
+
time2 -= mod$1(time2, MS_PER_MINUTE);
|
|
10990
|
+
break;
|
|
10991
|
+
case "second":
|
|
10992
|
+
time2 = this._d.valueOf();
|
|
10993
|
+
time2 -= mod$1(time2, MS_PER_SECOND);
|
|
10994
|
+
break;
|
|
10995
|
+
}
|
|
10996
|
+
this._d.setTime(time2);
|
|
10997
|
+
hooks.updateOffset(this, true);
|
|
10998
|
+
return this;
|
|
10999
|
+
}
|
|
11000
|
+
function endOf(units) {
|
|
11001
|
+
var time2, startOfDate;
|
|
11002
|
+
units = normalizeUnits(units);
|
|
11003
|
+
if (units === void 0 || units === "millisecond" || !this.isValid()) {
|
|
11004
|
+
return this;
|
|
11005
|
+
}
|
|
11006
|
+
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
|
11007
|
+
switch (units) {
|
|
11008
|
+
case "year":
|
|
11009
|
+
time2 = startOfDate(this.year() + 1, 0, 1) - 1;
|
|
11010
|
+
break;
|
|
11011
|
+
case "quarter":
|
|
11012
|
+
time2 = startOfDate(
|
|
11013
|
+
this.year(),
|
|
11014
|
+
this.month() - this.month() % 3 + 3,
|
|
11015
|
+
1
|
|
11016
|
+
) - 1;
|
|
11017
|
+
break;
|
|
11018
|
+
case "month":
|
|
11019
|
+
time2 = startOfDate(this.year(), this.month() + 1, 1) - 1;
|
|
11020
|
+
break;
|
|
11021
|
+
case "week":
|
|
11022
|
+
time2 = startOfDate(
|
|
11023
|
+
this.year(),
|
|
11024
|
+
this.month(),
|
|
11025
|
+
this.date() - this.weekday() + 7
|
|
11026
|
+
) - 1;
|
|
11027
|
+
break;
|
|
11028
|
+
case "isoWeek":
|
|
11029
|
+
time2 = startOfDate(
|
|
11030
|
+
this.year(),
|
|
11031
|
+
this.month(),
|
|
11032
|
+
this.date() - (this.isoWeekday() - 1) + 7
|
|
11033
|
+
) - 1;
|
|
11034
|
+
break;
|
|
11035
|
+
case "day":
|
|
11036
|
+
case "date":
|
|
11037
|
+
time2 = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
|
|
11038
|
+
break;
|
|
11039
|
+
case "hour":
|
|
11040
|
+
time2 = this._d.valueOf();
|
|
11041
|
+
time2 += MS_PER_HOUR - mod$1(
|
|
11042
|
+
time2 + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
|
11043
|
+
MS_PER_HOUR
|
|
11044
|
+
) - 1;
|
|
11045
|
+
break;
|
|
11046
|
+
case "minute":
|
|
11047
|
+
time2 = this._d.valueOf();
|
|
11048
|
+
time2 += MS_PER_MINUTE - mod$1(time2, MS_PER_MINUTE) - 1;
|
|
11049
|
+
break;
|
|
11050
|
+
case "second":
|
|
11051
|
+
time2 = this._d.valueOf();
|
|
11052
|
+
time2 += MS_PER_SECOND - mod$1(time2, MS_PER_SECOND) - 1;
|
|
11053
|
+
break;
|
|
11054
|
+
}
|
|
11055
|
+
this._d.setTime(time2);
|
|
11056
|
+
hooks.updateOffset(this, true);
|
|
11057
|
+
return this;
|
|
11058
|
+
}
|
|
11059
|
+
function valueOf() {
|
|
11060
|
+
return this._d.valueOf() - (this._offset || 0) * 6e4;
|
|
11061
|
+
}
|
|
11062
|
+
function unix() {
|
|
11063
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
11064
|
+
}
|
|
11065
|
+
function toDate() {
|
|
11066
|
+
return new Date(this.valueOf());
|
|
11067
|
+
}
|
|
11068
|
+
function toArray() {
|
|
11069
|
+
var m = this;
|
|
11070
|
+
return [
|
|
11071
|
+
m.year(),
|
|
11072
|
+
m.month(),
|
|
11073
|
+
m.date(),
|
|
11074
|
+
m.hour(),
|
|
11075
|
+
m.minute(),
|
|
11076
|
+
m.second(),
|
|
11077
|
+
m.millisecond()
|
|
11078
|
+
];
|
|
11079
|
+
}
|
|
11080
|
+
function toObject() {
|
|
11081
|
+
var m = this;
|
|
11082
|
+
return {
|
|
11083
|
+
years: m.year(),
|
|
11084
|
+
months: m.month(),
|
|
11085
|
+
date: m.date(),
|
|
11086
|
+
hours: m.hours(),
|
|
11087
|
+
minutes: m.minutes(),
|
|
11088
|
+
seconds: m.seconds(),
|
|
11089
|
+
milliseconds: m.milliseconds()
|
|
11090
|
+
};
|
|
11091
|
+
}
|
|
11092
|
+
function toJSON() {
|
|
11093
|
+
return this.isValid() ? this.toISOString() : null;
|
|
11094
|
+
}
|
|
11095
|
+
function isValid$2() {
|
|
11096
|
+
return isValid(this);
|
|
11097
|
+
}
|
|
11098
|
+
function parsingFlags() {
|
|
11099
|
+
return extend({}, getParsingFlags(this));
|
|
11100
|
+
}
|
|
11101
|
+
function invalidAt() {
|
|
11102
|
+
return getParsingFlags(this).overflow;
|
|
11103
|
+
}
|
|
11104
|
+
function creationData() {
|
|
11105
|
+
return {
|
|
11106
|
+
input: this._i,
|
|
11107
|
+
format: this._f,
|
|
11108
|
+
locale: this._locale,
|
|
11109
|
+
isUTC: this._isUTC,
|
|
11110
|
+
strict: this._strict
|
|
11111
|
+
};
|
|
11112
|
+
}
|
|
11113
|
+
addFormatToken("N", 0, 0, "eraAbbr");
|
|
11114
|
+
addFormatToken("NN", 0, 0, "eraAbbr");
|
|
11115
|
+
addFormatToken("NNN", 0, 0, "eraAbbr");
|
|
11116
|
+
addFormatToken("NNNN", 0, 0, "eraName");
|
|
11117
|
+
addFormatToken("NNNNN", 0, 0, "eraNarrow");
|
|
11118
|
+
addFormatToken("y", ["y", 1], "yo", "eraYear");
|
|
11119
|
+
addFormatToken("y", ["yy", 2], 0, "eraYear");
|
|
11120
|
+
addFormatToken("y", ["yyy", 3], 0, "eraYear");
|
|
11121
|
+
addFormatToken("y", ["yyyy", 4], 0, "eraYear");
|
|
11122
|
+
addRegexToken("N", matchEraAbbr);
|
|
11123
|
+
addRegexToken("NN", matchEraAbbr);
|
|
11124
|
+
addRegexToken("NNN", matchEraAbbr);
|
|
11125
|
+
addRegexToken("NNNN", matchEraName);
|
|
11126
|
+
addRegexToken("NNNNN", matchEraNarrow);
|
|
11127
|
+
addParseToken(
|
|
11128
|
+
["N", "NN", "NNN", "NNNN", "NNNNN"],
|
|
11129
|
+
function(input, array, config, token2) {
|
|
11130
|
+
var era = config._locale.erasParse(input, token2, config._strict);
|
|
11131
|
+
if (era) {
|
|
11132
|
+
getParsingFlags(config).era = era;
|
|
11133
|
+
} else {
|
|
11134
|
+
getParsingFlags(config).invalidEra = input;
|
|
11135
|
+
}
|
|
11136
|
+
}
|
|
11137
|
+
);
|
|
11138
|
+
addRegexToken("y", matchUnsigned);
|
|
11139
|
+
addRegexToken("yy", matchUnsigned);
|
|
11140
|
+
addRegexToken("yyy", matchUnsigned);
|
|
11141
|
+
addRegexToken("yyyy", matchUnsigned);
|
|
11142
|
+
addRegexToken("yo", matchEraYearOrdinal);
|
|
11143
|
+
addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
|
|
11144
|
+
addParseToken(["yo"], function(input, array, config, token2) {
|
|
11145
|
+
var match;
|
|
11146
|
+
if (config._locale._eraYearOrdinalRegex) {
|
|
11147
|
+
match = input.match(config._locale._eraYearOrdinalRegex);
|
|
11148
|
+
}
|
|
11149
|
+
if (config._locale.eraYearOrdinalParse) {
|
|
11150
|
+
array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
|
|
11151
|
+
} else {
|
|
11152
|
+
array[YEAR] = parseInt(input, 10);
|
|
11153
|
+
}
|
|
11154
|
+
});
|
|
11155
|
+
function localeEras(m, format2) {
|
|
11156
|
+
var i, l, date, eras = this._eras || getLocale("en")._eras;
|
|
11157
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11158
|
+
switch (typeof eras[i].since) {
|
|
11159
|
+
case "string":
|
|
11160
|
+
date = hooks(eras[i].since).startOf("day");
|
|
11161
|
+
eras[i].since = date.valueOf();
|
|
11162
|
+
break;
|
|
11163
|
+
}
|
|
11164
|
+
switch (typeof eras[i].until) {
|
|
11165
|
+
case "undefined":
|
|
11166
|
+
eras[i].until = Infinity;
|
|
11167
|
+
break;
|
|
11168
|
+
case "string":
|
|
11169
|
+
date = hooks(eras[i].until).startOf("day").valueOf();
|
|
11170
|
+
eras[i].until = date.valueOf();
|
|
11171
|
+
break;
|
|
11172
|
+
}
|
|
11173
|
+
}
|
|
11174
|
+
return eras;
|
|
11175
|
+
}
|
|
11176
|
+
function localeErasParse(eraName, format2, strict) {
|
|
11177
|
+
var i, l, eras = this.eras(), name, abbr, narrow;
|
|
11178
|
+
eraName = eraName.toUpperCase();
|
|
11179
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11180
|
+
name = eras[i].name.toUpperCase();
|
|
11181
|
+
abbr = eras[i].abbr.toUpperCase();
|
|
11182
|
+
narrow = eras[i].narrow.toUpperCase();
|
|
11183
|
+
if (strict) {
|
|
11184
|
+
switch (format2) {
|
|
11185
|
+
case "N":
|
|
11186
|
+
case "NN":
|
|
11187
|
+
case "NNN":
|
|
11188
|
+
if (abbr === eraName) {
|
|
11189
|
+
return eras[i];
|
|
11190
|
+
}
|
|
11191
|
+
break;
|
|
11192
|
+
case "NNNN":
|
|
11193
|
+
if (name === eraName) {
|
|
11194
|
+
return eras[i];
|
|
11195
|
+
}
|
|
11196
|
+
break;
|
|
11197
|
+
case "NNNNN":
|
|
11198
|
+
if (narrow === eraName) {
|
|
11199
|
+
return eras[i];
|
|
11200
|
+
}
|
|
11201
|
+
break;
|
|
11202
|
+
}
|
|
11203
|
+
} else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
|
|
11204
|
+
return eras[i];
|
|
11205
|
+
}
|
|
11206
|
+
}
|
|
11207
|
+
}
|
|
11208
|
+
function localeErasConvertYear(era, year) {
|
|
11209
|
+
var dir = era.since <= era.until ? 1 : -1;
|
|
11210
|
+
if (year === void 0) {
|
|
11211
|
+
return hooks(era.since).year();
|
|
11212
|
+
} else {
|
|
11213
|
+
return hooks(era.since).year() + (year - era.offset) * dir;
|
|
11214
|
+
}
|
|
11215
|
+
}
|
|
11216
|
+
function getEraName() {
|
|
11217
|
+
var i, l, val, eras = this.localeData().eras();
|
|
11218
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11219
|
+
val = this.clone().startOf("day").valueOf();
|
|
11220
|
+
if (eras[i].since <= val && val <= eras[i].until) {
|
|
11221
|
+
return eras[i].name;
|
|
11222
|
+
}
|
|
11223
|
+
if (eras[i].until <= val && val <= eras[i].since) {
|
|
11224
|
+
return eras[i].name;
|
|
11225
|
+
}
|
|
11226
|
+
}
|
|
11227
|
+
return "";
|
|
11228
|
+
}
|
|
11229
|
+
function getEraNarrow() {
|
|
11230
|
+
var i, l, val, eras = this.localeData().eras();
|
|
11231
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11232
|
+
val = this.clone().startOf("day").valueOf();
|
|
11233
|
+
if (eras[i].since <= val && val <= eras[i].until) {
|
|
11234
|
+
return eras[i].narrow;
|
|
11235
|
+
}
|
|
11236
|
+
if (eras[i].until <= val && val <= eras[i].since) {
|
|
11237
|
+
return eras[i].narrow;
|
|
11238
|
+
}
|
|
11239
|
+
}
|
|
11240
|
+
return "";
|
|
11241
|
+
}
|
|
11242
|
+
function getEraAbbr() {
|
|
11243
|
+
var i, l, val, eras = this.localeData().eras();
|
|
11244
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11245
|
+
val = this.clone().startOf("day").valueOf();
|
|
11246
|
+
if (eras[i].since <= val && val <= eras[i].until) {
|
|
11247
|
+
return eras[i].abbr;
|
|
11248
|
+
}
|
|
11249
|
+
if (eras[i].until <= val && val <= eras[i].since) {
|
|
11250
|
+
return eras[i].abbr;
|
|
11251
|
+
}
|
|
11252
|
+
}
|
|
11253
|
+
return "";
|
|
11254
|
+
}
|
|
11255
|
+
function getEraYear() {
|
|
11256
|
+
var i, l, dir, val, eras = this.localeData().eras();
|
|
11257
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11258
|
+
dir = eras[i].since <= eras[i].until ? 1 : -1;
|
|
11259
|
+
val = this.clone().startOf("day").valueOf();
|
|
11260
|
+
if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) {
|
|
11261
|
+
return (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset;
|
|
11262
|
+
}
|
|
11263
|
+
}
|
|
11264
|
+
return this.year();
|
|
11265
|
+
}
|
|
11266
|
+
function erasNameRegex(isStrict) {
|
|
11267
|
+
if (!hasOwnProp(this, "_erasNameRegex")) {
|
|
11268
|
+
computeErasParse.call(this);
|
|
11269
|
+
}
|
|
11270
|
+
return isStrict ? this._erasNameRegex : this._erasRegex;
|
|
11271
|
+
}
|
|
11272
|
+
function erasAbbrRegex(isStrict) {
|
|
11273
|
+
if (!hasOwnProp(this, "_erasAbbrRegex")) {
|
|
11274
|
+
computeErasParse.call(this);
|
|
11275
|
+
}
|
|
11276
|
+
return isStrict ? this._erasAbbrRegex : this._erasRegex;
|
|
11277
|
+
}
|
|
11278
|
+
function erasNarrowRegex(isStrict) {
|
|
11279
|
+
if (!hasOwnProp(this, "_erasNarrowRegex")) {
|
|
11280
|
+
computeErasParse.call(this);
|
|
11281
|
+
}
|
|
11282
|
+
return isStrict ? this._erasNarrowRegex : this._erasRegex;
|
|
11283
|
+
}
|
|
11284
|
+
function matchEraAbbr(isStrict, locale2) {
|
|
11285
|
+
return locale2.erasAbbrRegex(isStrict);
|
|
11286
|
+
}
|
|
11287
|
+
function matchEraName(isStrict, locale2) {
|
|
11288
|
+
return locale2.erasNameRegex(isStrict);
|
|
11289
|
+
}
|
|
11290
|
+
function matchEraNarrow(isStrict, locale2) {
|
|
11291
|
+
return locale2.erasNarrowRegex(isStrict);
|
|
11292
|
+
}
|
|
11293
|
+
function matchEraYearOrdinal(isStrict, locale2) {
|
|
11294
|
+
return locale2._eraYearOrdinalRegex || matchUnsigned;
|
|
11295
|
+
}
|
|
11296
|
+
function computeErasParse() {
|
|
11297
|
+
var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, erasName, erasAbbr, erasNarrow, eras = this.eras();
|
|
11298
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11299
|
+
erasName = regexEscape(eras[i].name);
|
|
11300
|
+
erasAbbr = regexEscape(eras[i].abbr);
|
|
11301
|
+
erasNarrow = regexEscape(eras[i].narrow);
|
|
11302
|
+
namePieces.push(erasName);
|
|
11303
|
+
abbrPieces.push(erasAbbr);
|
|
11304
|
+
narrowPieces.push(erasNarrow);
|
|
11305
|
+
mixedPieces.push(erasName);
|
|
11306
|
+
mixedPieces.push(erasAbbr);
|
|
11307
|
+
mixedPieces.push(erasNarrow);
|
|
11308
|
+
}
|
|
11309
|
+
this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
|
|
11310
|
+
this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i");
|
|
11311
|
+
this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i");
|
|
11312
|
+
this._erasNarrowRegex = new RegExp(
|
|
11313
|
+
"^(" + narrowPieces.join("|") + ")",
|
|
11314
|
+
"i"
|
|
11315
|
+
);
|
|
11316
|
+
}
|
|
11317
|
+
addFormatToken(0, ["gg", 2], 0, function() {
|
|
11318
|
+
return this.weekYear() % 100;
|
|
11319
|
+
});
|
|
11320
|
+
addFormatToken(0, ["GG", 2], 0, function() {
|
|
11321
|
+
return this.isoWeekYear() % 100;
|
|
11322
|
+
});
|
|
11323
|
+
function addWeekYearFormatToken(token2, getter) {
|
|
11324
|
+
addFormatToken(0, [token2, token2.length], 0, getter);
|
|
11325
|
+
}
|
|
11326
|
+
addWeekYearFormatToken("gggg", "weekYear");
|
|
11327
|
+
addWeekYearFormatToken("ggggg", "weekYear");
|
|
11328
|
+
addWeekYearFormatToken("GGGG", "isoWeekYear");
|
|
11329
|
+
addWeekYearFormatToken("GGGGG", "isoWeekYear");
|
|
11330
|
+
addRegexToken("G", matchSigned);
|
|
11331
|
+
addRegexToken("g", matchSigned);
|
|
11332
|
+
addRegexToken("GG", match1to2, match2);
|
|
11333
|
+
addRegexToken("gg", match1to2, match2);
|
|
11334
|
+
addRegexToken("GGGG", match1to4, match4);
|
|
11335
|
+
addRegexToken("gggg", match1to4, match4);
|
|
11336
|
+
addRegexToken("GGGGG", match1to6, match6);
|
|
11337
|
+
addRegexToken("ggggg", match1to6, match6);
|
|
11338
|
+
addWeekParseToken(
|
|
11339
|
+
["gggg", "ggggg", "GGGG", "GGGGG"],
|
|
11340
|
+
function(input, week, config, token2) {
|
|
11341
|
+
week[token2.substr(0, 2)] = toInt(input);
|
|
11342
|
+
}
|
|
11343
|
+
);
|
|
11344
|
+
addWeekParseToken(["gg", "GG"], function(input, week, config, token2) {
|
|
11345
|
+
week[token2] = hooks.parseTwoDigitYear(input);
|
|
11346
|
+
});
|
|
11347
|
+
function getSetWeekYear(input) {
|
|
11348
|
+
return getSetWeekYearHelper.call(
|
|
11349
|
+
this,
|
|
11350
|
+
input,
|
|
11351
|
+
this.week(),
|
|
11352
|
+
this.weekday() + this.localeData()._week.dow,
|
|
11353
|
+
this.localeData()._week.dow,
|
|
11354
|
+
this.localeData()._week.doy
|
|
11355
|
+
);
|
|
11356
|
+
}
|
|
11357
|
+
function getSetISOWeekYear(input) {
|
|
11358
|
+
return getSetWeekYearHelper.call(
|
|
11359
|
+
this,
|
|
11360
|
+
input,
|
|
11361
|
+
this.isoWeek(),
|
|
11362
|
+
this.isoWeekday(),
|
|
11363
|
+
1,
|
|
11364
|
+
4
|
|
11365
|
+
);
|
|
11366
|
+
}
|
|
11367
|
+
function getISOWeeksInYear() {
|
|
11368
|
+
return weeksInYear(this.year(), 1, 4);
|
|
11369
|
+
}
|
|
11370
|
+
function getISOWeeksInISOWeekYear() {
|
|
11371
|
+
return weeksInYear(this.isoWeekYear(), 1, 4);
|
|
11372
|
+
}
|
|
11373
|
+
function getWeeksInYear() {
|
|
11374
|
+
var weekInfo = this.localeData()._week;
|
|
11375
|
+
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
|
|
11376
|
+
}
|
|
11377
|
+
function getWeeksInWeekYear() {
|
|
11378
|
+
var weekInfo = this.localeData()._week;
|
|
11379
|
+
return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
|
|
11380
|
+
}
|
|
11381
|
+
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
|
|
11382
|
+
var weeksTarget;
|
|
11383
|
+
if (input == null) {
|
|
11384
|
+
return weekOfYear(this, dow, doy).year;
|
|
11385
|
+
} else {
|
|
11386
|
+
weeksTarget = weeksInYear(input, dow, doy);
|
|
11387
|
+
if (week > weeksTarget) {
|
|
11388
|
+
week = weeksTarget;
|
|
11389
|
+
}
|
|
11390
|
+
return setWeekAll.call(this, input, week, weekday, dow, doy);
|
|
11391
|
+
}
|
|
11392
|
+
}
|
|
11393
|
+
function setWeekAll(weekYear, week, weekday, dow, doy) {
|
|
11394
|
+
var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
|
|
11395
|
+
this.year(date.getUTCFullYear());
|
|
11396
|
+
this.month(date.getUTCMonth());
|
|
11397
|
+
this.date(date.getUTCDate());
|
|
11398
|
+
return this;
|
|
11399
|
+
}
|
|
11400
|
+
addFormatToken("Q", 0, "Qo", "quarter");
|
|
11401
|
+
addRegexToken("Q", match1);
|
|
11402
|
+
addParseToken("Q", function(input, array) {
|
|
11403
|
+
array[MONTH] = (toInt(input) - 1) * 3;
|
|
11404
|
+
});
|
|
11405
|
+
function getSetQuarter(input) {
|
|
11406
|
+
return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
|
|
11407
|
+
}
|
|
11408
|
+
addFormatToken("D", ["DD", 2], "Do", "date");
|
|
11409
|
+
addRegexToken("D", match1to2, match1to2NoLeadingZero);
|
|
11410
|
+
addRegexToken("DD", match1to2, match2);
|
|
11411
|
+
addRegexToken("Do", function(isStrict, locale2) {
|
|
11412
|
+
return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient;
|
|
11413
|
+
});
|
|
11414
|
+
addParseToken(["D", "DD"], DATE);
|
|
11415
|
+
addParseToken("Do", function(input, array) {
|
|
11416
|
+
array[DATE] = toInt(input.match(match1to2)[0]);
|
|
11417
|
+
});
|
|
11418
|
+
var getSetDayOfMonth = makeGetSet("Date", true);
|
|
11419
|
+
addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
|
|
11420
|
+
addRegexToken("DDD", match1to3);
|
|
11421
|
+
addRegexToken("DDDD", match3);
|
|
11422
|
+
addParseToken(["DDD", "DDDD"], function(input, array, config) {
|
|
11423
|
+
config._dayOfYear = toInt(input);
|
|
11424
|
+
});
|
|
11425
|
+
function getSetDayOfYear(input) {
|
|
11426
|
+
var dayOfYear = Math.round(
|
|
11427
|
+
(this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
|
|
11428
|
+
) + 1;
|
|
11429
|
+
return input == null ? dayOfYear : this.add(input - dayOfYear, "d");
|
|
11430
|
+
}
|
|
11431
|
+
addFormatToken("m", ["mm", 2], 0, "minute");
|
|
11432
|
+
addRegexToken("m", match1to2, match1to2HasZero);
|
|
11433
|
+
addRegexToken("mm", match1to2, match2);
|
|
11434
|
+
addParseToken(["m", "mm"], MINUTE);
|
|
11435
|
+
var getSetMinute = makeGetSet("Minutes", false);
|
|
11436
|
+
addFormatToken("s", ["ss", 2], 0, "second");
|
|
11437
|
+
addRegexToken("s", match1to2, match1to2HasZero);
|
|
11438
|
+
addRegexToken("ss", match1to2, match2);
|
|
11439
|
+
addParseToken(["s", "ss"], SECOND);
|
|
11440
|
+
var getSetSecond = makeGetSet("Seconds", false);
|
|
11441
|
+
addFormatToken("S", 0, 0, function() {
|
|
11442
|
+
return ~~(this.millisecond() / 100);
|
|
11443
|
+
});
|
|
11444
|
+
addFormatToken(0, ["SS", 2], 0, function() {
|
|
11445
|
+
return ~~(this.millisecond() / 10);
|
|
11446
|
+
});
|
|
11447
|
+
addFormatToken(0, ["SSS", 3], 0, "millisecond");
|
|
11448
|
+
addFormatToken(0, ["SSSS", 4], 0, function() {
|
|
11449
|
+
return this.millisecond() * 10;
|
|
11450
|
+
});
|
|
11451
|
+
addFormatToken(0, ["SSSSS", 5], 0, function() {
|
|
11452
|
+
return this.millisecond() * 100;
|
|
11453
|
+
});
|
|
11454
|
+
addFormatToken(0, ["SSSSSS", 6], 0, function() {
|
|
11455
|
+
return this.millisecond() * 1e3;
|
|
11456
|
+
});
|
|
11457
|
+
addFormatToken(0, ["SSSSSSS", 7], 0, function() {
|
|
11458
|
+
return this.millisecond() * 1e4;
|
|
11459
|
+
});
|
|
11460
|
+
addFormatToken(0, ["SSSSSSSS", 8], 0, function() {
|
|
11461
|
+
return this.millisecond() * 1e5;
|
|
11462
|
+
});
|
|
11463
|
+
addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
|
|
11464
|
+
return this.millisecond() * 1e6;
|
|
11465
|
+
});
|
|
11466
|
+
addRegexToken("S", match1to3, match1);
|
|
11467
|
+
addRegexToken("SS", match1to3, match2);
|
|
11468
|
+
addRegexToken("SSS", match1to3, match3);
|
|
11469
|
+
var token, getSetMillisecond;
|
|
11470
|
+
for (token = "SSSS"; token.length <= 9; token += "S") {
|
|
11471
|
+
addRegexToken(token, matchUnsigned);
|
|
11472
|
+
}
|
|
11473
|
+
function parseMs(input, array) {
|
|
11474
|
+
array[MILLISECOND] = toInt(("0." + input) * 1e3);
|
|
11475
|
+
}
|
|
11476
|
+
for (token = "S"; token.length <= 9; token += "S") {
|
|
11477
|
+
addParseToken(token, parseMs);
|
|
11478
|
+
}
|
|
11479
|
+
getSetMillisecond = makeGetSet("Milliseconds", false);
|
|
11480
|
+
addFormatToken("z", 0, 0, "zoneAbbr");
|
|
11481
|
+
addFormatToken("zz", 0, 0, "zoneName");
|
|
11482
|
+
function getZoneAbbr() {
|
|
11483
|
+
return this._isUTC ? "UTC" : "";
|
|
11484
|
+
}
|
|
11485
|
+
function getZoneName() {
|
|
11486
|
+
return this._isUTC ? "Coordinated Universal Time" : "";
|
|
11487
|
+
}
|
|
11488
|
+
var proto = Moment.prototype;
|
|
11489
|
+
proto.add = add;
|
|
11490
|
+
proto.calendar = calendar$1;
|
|
11491
|
+
proto.clone = clone;
|
|
11492
|
+
proto.diff = diff;
|
|
11493
|
+
proto.endOf = endOf;
|
|
11494
|
+
proto.format = format;
|
|
11495
|
+
proto.from = from;
|
|
11496
|
+
proto.fromNow = fromNow;
|
|
11497
|
+
proto.to = to;
|
|
11498
|
+
proto.toNow = toNow;
|
|
11499
|
+
proto.get = stringGet;
|
|
11500
|
+
proto.invalidAt = invalidAt;
|
|
11501
|
+
proto.isAfter = isAfter;
|
|
11502
|
+
proto.isBefore = isBefore;
|
|
11503
|
+
proto.isBetween = isBetween;
|
|
11504
|
+
proto.isSame = isSame;
|
|
11505
|
+
proto.isSameOrAfter = isSameOrAfter;
|
|
11506
|
+
proto.isSameOrBefore = isSameOrBefore;
|
|
11507
|
+
proto.isValid = isValid$2;
|
|
11508
|
+
proto.lang = lang;
|
|
11509
|
+
proto.locale = locale;
|
|
11510
|
+
proto.localeData = localeData;
|
|
11511
|
+
proto.max = prototypeMax;
|
|
11512
|
+
proto.min = prototypeMin;
|
|
11513
|
+
proto.parsingFlags = parsingFlags;
|
|
11514
|
+
proto.set = stringSet;
|
|
11515
|
+
proto.startOf = startOf;
|
|
11516
|
+
proto.subtract = subtract;
|
|
11517
|
+
proto.toArray = toArray;
|
|
11518
|
+
proto.toObject = toObject;
|
|
11519
|
+
proto.toDate = toDate;
|
|
11520
|
+
proto.toISOString = toISOString;
|
|
11521
|
+
proto.inspect = inspect;
|
|
11522
|
+
if (typeof Symbol !== "undefined" && Symbol.for != null) {
|
|
11523
|
+
proto[Symbol.for("nodejs.util.inspect.custom")] = function() {
|
|
11524
|
+
return "Moment<" + this.format() + ">";
|
|
11525
|
+
};
|
|
11526
|
+
}
|
|
11527
|
+
proto.toJSON = toJSON;
|
|
11528
|
+
proto.toString = toString;
|
|
11529
|
+
proto.unix = unix;
|
|
11530
|
+
proto.valueOf = valueOf;
|
|
11531
|
+
proto.creationData = creationData;
|
|
11532
|
+
proto.eraName = getEraName;
|
|
11533
|
+
proto.eraNarrow = getEraNarrow;
|
|
11534
|
+
proto.eraAbbr = getEraAbbr;
|
|
11535
|
+
proto.eraYear = getEraYear;
|
|
11536
|
+
proto.year = getSetYear;
|
|
11537
|
+
proto.isLeapYear = getIsLeapYear;
|
|
11538
|
+
proto.weekYear = getSetWeekYear;
|
|
11539
|
+
proto.isoWeekYear = getSetISOWeekYear;
|
|
11540
|
+
proto.quarter = proto.quarters = getSetQuarter;
|
|
11541
|
+
proto.month = getSetMonth;
|
|
11542
|
+
proto.daysInMonth = getDaysInMonth;
|
|
11543
|
+
proto.week = proto.weeks = getSetWeek;
|
|
11544
|
+
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
|
|
11545
|
+
proto.weeksInYear = getWeeksInYear;
|
|
11546
|
+
proto.weeksInWeekYear = getWeeksInWeekYear;
|
|
11547
|
+
proto.isoWeeksInYear = getISOWeeksInYear;
|
|
11548
|
+
proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
|
|
11549
|
+
proto.date = getSetDayOfMonth;
|
|
11550
|
+
proto.day = proto.days = getSetDayOfWeek;
|
|
11551
|
+
proto.weekday = getSetLocaleDayOfWeek;
|
|
11552
|
+
proto.isoWeekday = getSetISODayOfWeek;
|
|
11553
|
+
proto.dayOfYear = getSetDayOfYear;
|
|
11554
|
+
proto.hour = proto.hours = getSetHour;
|
|
11555
|
+
proto.minute = proto.minutes = getSetMinute;
|
|
11556
|
+
proto.second = proto.seconds = getSetSecond;
|
|
11557
|
+
proto.millisecond = proto.milliseconds = getSetMillisecond;
|
|
11558
|
+
proto.utcOffset = getSetOffset;
|
|
11559
|
+
proto.utc = setOffsetToUTC;
|
|
11560
|
+
proto.local = setOffsetToLocal;
|
|
11561
|
+
proto.parseZone = setOffsetToParsedOffset;
|
|
11562
|
+
proto.hasAlignedHourOffset = hasAlignedHourOffset;
|
|
11563
|
+
proto.isDST = isDaylightSavingTime;
|
|
11564
|
+
proto.isLocal = isLocal;
|
|
11565
|
+
proto.isUtcOffset = isUtcOffset;
|
|
11566
|
+
proto.isUtc = isUtc;
|
|
11567
|
+
proto.isUTC = isUtc;
|
|
11568
|
+
proto.zoneAbbr = getZoneAbbr;
|
|
11569
|
+
proto.zoneName = getZoneName;
|
|
11570
|
+
proto.dates = deprecate(
|
|
11571
|
+
"dates accessor is deprecated. Use date instead.",
|
|
11572
|
+
getSetDayOfMonth
|
|
11573
|
+
);
|
|
11574
|
+
proto.months = deprecate(
|
|
11575
|
+
"months accessor is deprecated. Use month instead",
|
|
11576
|
+
getSetMonth
|
|
11577
|
+
);
|
|
11578
|
+
proto.years = deprecate(
|
|
11579
|
+
"years accessor is deprecated. Use year instead",
|
|
11580
|
+
getSetYear
|
|
11581
|
+
);
|
|
11582
|
+
proto.zone = deprecate(
|
|
11583
|
+
"moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
|
|
11584
|
+
getSetZone
|
|
11585
|
+
);
|
|
11586
|
+
proto.isDSTShifted = deprecate(
|
|
11587
|
+
"isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
|
|
11588
|
+
isDaylightSavingTimeShifted
|
|
11589
|
+
);
|
|
11590
|
+
function createUnix(input) {
|
|
11591
|
+
return createLocal(input * 1e3);
|
|
11592
|
+
}
|
|
11593
|
+
function createInZone() {
|
|
11594
|
+
return createLocal.apply(null, arguments).parseZone();
|
|
11595
|
+
}
|
|
11596
|
+
function preParsePostFormat(string) {
|
|
11597
|
+
return string;
|
|
11598
|
+
}
|
|
11599
|
+
var proto$1 = Locale.prototype;
|
|
11600
|
+
proto$1.calendar = calendar;
|
|
11601
|
+
proto$1.longDateFormat = longDateFormat;
|
|
11602
|
+
proto$1.invalidDate = invalidDate;
|
|
11603
|
+
proto$1.ordinal = ordinal;
|
|
11604
|
+
proto$1.preparse = preParsePostFormat;
|
|
11605
|
+
proto$1.postformat = preParsePostFormat;
|
|
11606
|
+
proto$1.relativeTime = relativeTime;
|
|
11607
|
+
proto$1.pastFuture = pastFuture;
|
|
11608
|
+
proto$1.set = set;
|
|
11609
|
+
proto$1.eras = localeEras;
|
|
11610
|
+
proto$1.erasParse = localeErasParse;
|
|
11611
|
+
proto$1.erasConvertYear = localeErasConvertYear;
|
|
11612
|
+
proto$1.erasAbbrRegex = erasAbbrRegex;
|
|
11613
|
+
proto$1.erasNameRegex = erasNameRegex;
|
|
11614
|
+
proto$1.erasNarrowRegex = erasNarrowRegex;
|
|
11615
|
+
proto$1.months = localeMonths;
|
|
11616
|
+
proto$1.monthsShort = localeMonthsShort;
|
|
11617
|
+
proto$1.monthsParse = localeMonthsParse;
|
|
11618
|
+
proto$1.monthsRegex = monthsRegex$1;
|
|
11619
|
+
proto$1.monthsShortRegex = monthsShortRegex;
|
|
11620
|
+
proto$1.week = localeWeek;
|
|
11621
|
+
proto$1.firstDayOfYear = localeFirstDayOfYear;
|
|
11622
|
+
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
|
|
11623
|
+
proto$1.weekdays = localeWeekdays;
|
|
11624
|
+
proto$1.weekdaysMin = localeWeekdaysMin;
|
|
11625
|
+
proto$1.weekdaysShort = localeWeekdaysShort;
|
|
11626
|
+
proto$1.weekdaysParse = localeWeekdaysParse;
|
|
11627
|
+
proto$1.weekdaysRegex = weekdaysRegex;
|
|
11628
|
+
proto$1.weekdaysShortRegex = weekdaysShortRegex;
|
|
11629
|
+
proto$1.weekdaysMinRegex = weekdaysMinRegex;
|
|
11630
|
+
proto$1.isPM = localeIsPM;
|
|
11631
|
+
proto$1.meridiem = localeMeridiem;
|
|
11632
|
+
function get$1(format2, index, field, setter) {
|
|
11633
|
+
var locale2 = getLocale(), utc = createUTC().set(setter, index);
|
|
11634
|
+
return locale2[field](utc, format2);
|
|
11635
|
+
}
|
|
11636
|
+
function listMonthsImpl(format2, index, field) {
|
|
11637
|
+
if (isNumber(format2)) {
|
|
11638
|
+
index = format2;
|
|
11639
|
+
format2 = void 0;
|
|
11640
|
+
}
|
|
11641
|
+
format2 = format2 || "";
|
|
11642
|
+
if (index != null) {
|
|
11643
|
+
return get$1(format2, index, field, "month");
|
|
11644
|
+
}
|
|
11645
|
+
var i, out = [];
|
|
11646
|
+
for (i = 0; i < 12; i++) {
|
|
11647
|
+
out[i] = get$1(format2, i, field, "month");
|
|
11648
|
+
}
|
|
11649
|
+
return out;
|
|
11650
|
+
}
|
|
11651
|
+
function listWeekdaysImpl(localeSorted, format2, index, field) {
|
|
11652
|
+
if (typeof localeSorted === "boolean") {
|
|
11653
|
+
if (isNumber(format2)) {
|
|
11654
|
+
index = format2;
|
|
11655
|
+
format2 = void 0;
|
|
11656
|
+
}
|
|
11657
|
+
format2 = format2 || "";
|
|
11658
|
+
} else {
|
|
11659
|
+
format2 = localeSorted;
|
|
11660
|
+
index = format2;
|
|
11661
|
+
localeSorted = false;
|
|
11662
|
+
if (isNumber(format2)) {
|
|
11663
|
+
index = format2;
|
|
11664
|
+
format2 = void 0;
|
|
11665
|
+
}
|
|
11666
|
+
format2 = format2 || "";
|
|
11667
|
+
}
|
|
11668
|
+
var locale2 = getLocale(), shift = localeSorted ? locale2._week.dow : 0, i, out = [];
|
|
11669
|
+
if (index != null) {
|
|
11670
|
+
return get$1(format2, (index + shift) % 7, field, "day");
|
|
11671
|
+
}
|
|
11672
|
+
for (i = 0; i < 7; i++) {
|
|
11673
|
+
out[i] = get$1(format2, (i + shift) % 7, field, "day");
|
|
11674
|
+
}
|
|
11675
|
+
return out;
|
|
11676
|
+
}
|
|
11677
|
+
function listMonths(format2, index) {
|
|
11678
|
+
return listMonthsImpl(format2, index, "months");
|
|
11679
|
+
}
|
|
11680
|
+
function listMonthsShort(format2, index) {
|
|
11681
|
+
return listMonthsImpl(format2, index, "monthsShort");
|
|
11682
|
+
}
|
|
11683
|
+
function listWeekdays(localeSorted, format2, index) {
|
|
11684
|
+
return listWeekdaysImpl(localeSorted, format2, index, "weekdays");
|
|
11685
|
+
}
|
|
11686
|
+
function listWeekdaysShort(localeSorted, format2, index) {
|
|
11687
|
+
return listWeekdaysImpl(localeSorted, format2, index, "weekdaysShort");
|
|
11688
|
+
}
|
|
11689
|
+
function listWeekdaysMin(localeSorted, format2, index) {
|
|
11690
|
+
return listWeekdaysImpl(localeSorted, format2, index, "weekdaysMin");
|
|
11691
|
+
}
|
|
11692
|
+
getSetGlobalLocale("en", {
|
|
11693
|
+
eras: [
|
|
11694
|
+
{
|
|
11695
|
+
since: "0001-01-01",
|
|
11696
|
+
until: Infinity,
|
|
11697
|
+
offset: 1,
|
|
11698
|
+
name: "Anno Domini",
|
|
11699
|
+
narrow: "AD",
|
|
11700
|
+
abbr: "AD"
|
|
11701
|
+
},
|
|
11702
|
+
{
|
|
11703
|
+
since: "0000-12-31",
|
|
11704
|
+
until: -Infinity,
|
|
11705
|
+
offset: 1,
|
|
11706
|
+
name: "Before Christ",
|
|
11707
|
+
narrow: "BC",
|
|
11708
|
+
abbr: "BC"
|
|
11709
|
+
}
|
|
11710
|
+
],
|
|
11711
|
+
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
|
|
11712
|
+
ordinal: function(number2) {
|
|
11713
|
+
var b = number2 % 10, output = toInt(number2 % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th";
|
|
11714
|
+
return number2 + output;
|
|
11715
|
+
}
|
|
11716
|
+
});
|
|
11717
|
+
hooks.lang = deprecate(
|
|
11718
|
+
"moment.lang is deprecated. Use moment.locale instead.",
|
|
11719
|
+
getSetGlobalLocale
|
|
11720
|
+
);
|
|
11721
|
+
hooks.langData = deprecate(
|
|
11722
|
+
"moment.langData is deprecated. Use moment.localeData instead.",
|
|
11723
|
+
getLocale
|
|
11724
|
+
);
|
|
11725
|
+
var mathAbs = Math.abs;
|
|
11726
|
+
function abs() {
|
|
11727
|
+
var data = this._data;
|
|
11728
|
+
this._milliseconds = mathAbs(this._milliseconds);
|
|
11729
|
+
this._days = mathAbs(this._days);
|
|
11730
|
+
this._months = mathAbs(this._months);
|
|
11731
|
+
data.milliseconds = mathAbs(data.milliseconds);
|
|
11732
|
+
data.seconds = mathAbs(data.seconds);
|
|
11733
|
+
data.minutes = mathAbs(data.minutes);
|
|
11734
|
+
data.hours = mathAbs(data.hours);
|
|
11735
|
+
data.months = mathAbs(data.months);
|
|
11736
|
+
data.years = mathAbs(data.years);
|
|
11737
|
+
return this;
|
|
11738
|
+
}
|
|
11739
|
+
function addSubtract$1(duration, input, value, direction) {
|
|
11740
|
+
var other = createDuration(input, value);
|
|
11741
|
+
duration._milliseconds += direction * other._milliseconds;
|
|
11742
|
+
duration._days += direction * other._days;
|
|
11743
|
+
duration._months += direction * other._months;
|
|
11744
|
+
return duration._bubble();
|
|
11745
|
+
}
|
|
11746
|
+
function add$1(input, value) {
|
|
11747
|
+
return addSubtract$1(this, input, value, 1);
|
|
11748
|
+
}
|
|
11749
|
+
function subtract$1(input, value) {
|
|
11750
|
+
return addSubtract$1(this, input, value, -1);
|
|
11751
|
+
}
|
|
11752
|
+
function absCeil(number2) {
|
|
11753
|
+
if (number2 < 0) {
|
|
11754
|
+
return Math.floor(number2);
|
|
11755
|
+
} else {
|
|
11756
|
+
return Math.ceil(number2);
|
|
11757
|
+
}
|
|
11758
|
+
}
|
|
11759
|
+
function bubble() {
|
|
11760
|
+
var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays;
|
|
11761
|
+
if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) {
|
|
11762
|
+
milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5;
|
|
11763
|
+
days2 = 0;
|
|
11764
|
+
months2 = 0;
|
|
11765
|
+
}
|
|
11766
|
+
data.milliseconds = milliseconds2 % 1e3;
|
|
11767
|
+
seconds2 = absFloor(milliseconds2 / 1e3);
|
|
11768
|
+
data.seconds = seconds2 % 60;
|
|
11769
|
+
minutes2 = absFloor(seconds2 / 60);
|
|
11770
|
+
data.minutes = minutes2 % 60;
|
|
11771
|
+
hours2 = absFloor(minutes2 / 60);
|
|
11772
|
+
data.hours = hours2 % 24;
|
|
11773
|
+
days2 += absFloor(hours2 / 24);
|
|
11774
|
+
monthsFromDays = absFloor(daysToMonths(days2));
|
|
11775
|
+
months2 += monthsFromDays;
|
|
11776
|
+
days2 -= absCeil(monthsToDays(monthsFromDays));
|
|
11777
|
+
years2 = absFloor(months2 / 12);
|
|
11778
|
+
months2 %= 12;
|
|
11779
|
+
data.days = days2;
|
|
11780
|
+
data.months = months2;
|
|
11781
|
+
data.years = years2;
|
|
11782
|
+
return this;
|
|
11783
|
+
}
|
|
11784
|
+
function daysToMonths(days2) {
|
|
11785
|
+
return days2 * 4800 / 146097;
|
|
11786
|
+
}
|
|
11787
|
+
function monthsToDays(months2) {
|
|
11788
|
+
return months2 * 146097 / 4800;
|
|
11789
|
+
}
|
|
11790
|
+
function as(units) {
|
|
11791
|
+
if (!this.isValid()) {
|
|
11792
|
+
return NaN;
|
|
11793
|
+
}
|
|
11794
|
+
var days2, months2, milliseconds2 = this._milliseconds;
|
|
11795
|
+
units = normalizeUnits(units);
|
|
11796
|
+
if (units === "month" || units === "quarter" || units === "year") {
|
|
11797
|
+
days2 = this._days + milliseconds2 / 864e5;
|
|
11798
|
+
months2 = this._months + daysToMonths(days2);
|
|
11799
|
+
switch (units) {
|
|
11800
|
+
case "month":
|
|
11801
|
+
return months2;
|
|
11802
|
+
case "quarter":
|
|
11803
|
+
return months2 / 3;
|
|
11804
|
+
case "year":
|
|
11805
|
+
return months2 / 12;
|
|
11806
|
+
}
|
|
11807
|
+
} else {
|
|
11808
|
+
days2 = this._days + Math.round(monthsToDays(this._months));
|
|
11809
|
+
switch (units) {
|
|
11810
|
+
case "week":
|
|
11811
|
+
return days2 / 7 + milliseconds2 / 6048e5;
|
|
11812
|
+
case "day":
|
|
11813
|
+
return days2 + milliseconds2 / 864e5;
|
|
11814
|
+
case "hour":
|
|
11815
|
+
return days2 * 24 + milliseconds2 / 36e5;
|
|
11816
|
+
case "minute":
|
|
11817
|
+
return days2 * 1440 + milliseconds2 / 6e4;
|
|
11818
|
+
case "second":
|
|
11819
|
+
return days2 * 86400 + milliseconds2 / 1e3;
|
|
11820
|
+
// Math.floor prevents floating point math errors here
|
|
11821
|
+
case "millisecond":
|
|
11822
|
+
return Math.floor(days2 * 864e5) + milliseconds2;
|
|
11823
|
+
default:
|
|
11824
|
+
throw new Error("Unknown unit " + units);
|
|
11825
|
+
}
|
|
11826
|
+
}
|
|
11827
|
+
}
|
|
11828
|
+
function makeAs(alias) {
|
|
11829
|
+
return function() {
|
|
11830
|
+
return this.as(alias);
|
|
11831
|
+
};
|
|
11832
|
+
}
|
|
11833
|
+
var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y"), valueOf$1 = asMilliseconds;
|
|
11834
|
+
function clone$1() {
|
|
11835
|
+
return createDuration(this);
|
|
11836
|
+
}
|
|
11837
|
+
function get$2(units) {
|
|
11838
|
+
units = normalizeUnits(units);
|
|
11839
|
+
return this.isValid() ? this[units + "s"]() : NaN;
|
|
11840
|
+
}
|
|
11841
|
+
function makeGetter(name) {
|
|
11842
|
+
return function() {
|
|
11843
|
+
return this.isValid() ? this._data[name] : NaN;
|
|
11844
|
+
};
|
|
11845
|
+
}
|
|
11846
|
+
var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years");
|
|
11847
|
+
function weeks() {
|
|
11848
|
+
return absFloor(this.days() / 7);
|
|
11849
|
+
}
|
|
11850
|
+
var round = Math.round, thresholds = {
|
|
11851
|
+
ss: 44,
|
|
11852
|
+
// a few seconds to seconds
|
|
11853
|
+
s: 45,
|
|
11854
|
+
// seconds to minute
|
|
11855
|
+
m: 45,
|
|
11856
|
+
// minutes to hour
|
|
11857
|
+
h: 22,
|
|
11858
|
+
// hours to day
|
|
11859
|
+
d: 26,
|
|
11860
|
+
// days to month/week
|
|
11861
|
+
w: null,
|
|
11862
|
+
// weeks to month
|
|
11863
|
+
M: 11
|
|
11864
|
+
// months to year
|
|
11865
|
+
};
|
|
11866
|
+
function substituteTimeAgo(string, number2, withoutSuffix, isFuture, locale2) {
|
|
11867
|
+
return locale2.relativeTime(number2 || 1, !!withoutSuffix, string, isFuture);
|
|
11868
|
+
}
|
|
11869
|
+
function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale2) {
|
|
11870
|
+
var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2];
|
|
11871
|
+
if (thresholds2.w != null) {
|
|
11872
|
+
a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2];
|
|
11873
|
+
}
|
|
11874
|
+
a = a || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2];
|
|
11875
|
+
a[2] = withoutSuffix;
|
|
11876
|
+
a[3] = +posNegDuration > 0;
|
|
11877
|
+
a[4] = locale2;
|
|
11878
|
+
return substituteTimeAgo.apply(null, a);
|
|
11879
|
+
}
|
|
11880
|
+
function getSetRelativeTimeRounding(roundingFunction) {
|
|
11881
|
+
if (roundingFunction === void 0) {
|
|
11882
|
+
return round;
|
|
11883
|
+
}
|
|
11884
|
+
if (typeof roundingFunction === "function") {
|
|
11885
|
+
round = roundingFunction;
|
|
11886
|
+
return true;
|
|
11887
|
+
}
|
|
11888
|
+
return false;
|
|
11889
|
+
}
|
|
11890
|
+
function getSetRelativeTimeThreshold(threshold, limit) {
|
|
11891
|
+
if (thresholds[threshold] === void 0) {
|
|
11892
|
+
return false;
|
|
11893
|
+
}
|
|
11894
|
+
if (limit === void 0) {
|
|
11895
|
+
return thresholds[threshold];
|
|
11896
|
+
}
|
|
11897
|
+
thresholds[threshold] = limit;
|
|
11898
|
+
if (threshold === "s") {
|
|
11899
|
+
thresholds.ss = limit - 1;
|
|
11900
|
+
}
|
|
11901
|
+
return true;
|
|
11902
|
+
}
|
|
11903
|
+
function humanize(argWithSuffix, argThresholds) {
|
|
11904
|
+
if (!this.isValid()) {
|
|
11905
|
+
return this.localeData().invalidDate();
|
|
11906
|
+
}
|
|
11907
|
+
var withSuffix = false, th = thresholds, locale2, output;
|
|
11908
|
+
if (typeof argWithSuffix === "object") {
|
|
11909
|
+
argThresholds = argWithSuffix;
|
|
11910
|
+
argWithSuffix = false;
|
|
11911
|
+
}
|
|
11912
|
+
if (typeof argWithSuffix === "boolean") {
|
|
11913
|
+
withSuffix = argWithSuffix;
|
|
11914
|
+
}
|
|
11915
|
+
if (typeof argThresholds === "object") {
|
|
11916
|
+
th = Object.assign({}, thresholds, argThresholds);
|
|
11917
|
+
if (argThresholds.s != null && argThresholds.ss == null) {
|
|
11918
|
+
th.ss = argThresholds.s - 1;
|
|
11919
|
+
}
|
|
11920
|
+
}
|
|
11921
|
+
locale2 = this.localeData();
|
|
11922
|
+
output = relativeTime$1(this, !withSuffix, th, locale2);
|
|
11923
|
+
if (withSuffix) {
|
|
11924
|
+
output = locale2.pastFuture(+this, output);
|
|
11925
|
+
}
|
|
11926
|
+
return locale2.postformat(output);
|
|
11927
|
+
}
|
|
11928
|
+
var abs$1 = Math.abs;
|
|
11929
|
+
function sign(x) {
|
|
11930
|
+
return (x > 0) - (x < 0) || +x;
|
|
11931
|
+
}
|
|
11932
|
+
function toISOString$1() {
|
|
11933
|
+
if (!this.isValid()) {
|
|
11934
|
+
return this.localeData().invalidDate();
|
|
11935
|
+
}
|
|
11936
|
+
var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
|
|
11937
|
+
if (!total) {
|
|
11938
|
+
return "P0D";
|
|
11939
|
+
}
|
|
11940
|
+
minutes2 = absFloor(seconds2 / 60);
|
|
11941
|
+
hours2 = absFloor(minutes2 / 60);
|
|
11942
|
+
seconds2 %= 60;
|
|
11943
|
+
minutes2 %= 60;
|
|
11944
|
+
years2 = absFloor(months2 / 12);
|
|
11945
|
+
months2 %= 12;
|
|
11946
|
+
s = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : "";
|
|
11947
|
+
totalSign = total < 0 ? "-" : "";
|
|
11948
|
+
ymSign = sign(this._months) !== sign(total) ? "-" : "";
|
|
11949
|
+
daysSign = sign(this._days) !== sign(total) ? "-" : "";
|
|
11950
|
+
hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
|
|
11951
|
+
return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s + "S" : "");
|
|
11952
|
+
}
|
|
11953
|
+
var proto$2 = Duration.prototype;
|
|
11954
|
+
proto$2.isValid = isValid$1;
|
|
11955
|
+
proto$2.abs = abs;
|
|
11956
|
+
proto$2.add = add$1;
|
|
11957
|
+
proto$2.subtract = subtract$1;
|
|
11958
|
+
proto$2.as = as;
|
|
11959
|
+
proto$2.asMilliseconds = asMilliseconds;
|
|
11960
|
+
proto$2.asSeconds = asSeconds;
|
|
11961
|
+
proto$2.asMinutes = asMinutes;
|
|
11962
|
+
proto$2.asHours = asHours;
|
|
11963
|
+
proto$2.asDays = asDays;
|
|
11964
|
+
proto$2.asWeeks = asWeeks;
|
|
11965
|
+
proto$2.asMonths = asMonths;
|
|
11966
|
+
proto$2.asQuarters = asQuarters;
|
|
11967
|
+
proto$2.asYears = asYears;
|
|
11968
|
+
proto$2.valueOf = valueOf$1;
|
|
11969
|
+
proto$2._bubble = bubble;
|
|
11970
|
+
proto$2.clone = clone$1;
|
|
11971
|
+
proto$2.get = get$2;
|
|
11972
|
+
proto$2.milliseconds = milliseconds;
|
|
11973
|
+
proto$2.seconds = seconds;
|
|
11974
|
+
proto$2.minutes = minutes;
|
|
11975
|
+
proto$2.hours = hours;
|
|
11976
|
+
proto$2.days = days;
|
|
11977
|
+
proto$2.weeks = weeks;
|
|
11978
|
+
proto$2.months = months;
|
|
11979
|
+
proto$2.years = years;
|
|
11980
|
+
proto$2.humanize = humanize;
|
|
11981
|
+
proto$2.toISOString = toISOString$1;
|
|
11982
|
+
proto$2.toString = toISOString$1;
|
|
11983
|
+
proto$2.toJSON = toISOString$1;
|
|
11984
|
+
proto$2.locale = locale;
|
|
11985
|
+
proto$2.localeData = localeData;
|
|
11986
|
+
proto$2.toIsoString = deprecate(
|
|
11987
|
+
"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
|
|
11988
|
+
toISOString$1
|
|
11989
|
+
);
|
|
11990
|
+
proto$2.lang = lang;
|
|
11991
|
+
addFormatToken("X", 0, 0, "unix");
|
|
11992
|
+
addFormatToken("x", 0, 0, "valueOf");
|
|
11993
|
+
addRegexToken("x", matchSigned);
|
|
11994
|
+
addRegexToken("X", matchTimestamp);
|
|
11995
|
+
addParseToken("X", function(input, array, config) {
|
|
11996
|
+
config._d = new Date(parseFloat(input) * 1e3);
|
|
11997
|
+
});
|
|
11998
|
+
addParseToken("x", function(input, array, config) {
|
|
11999
|
+
config._d = new Date(toInt(input));
|
|
12000
|
+
});
|
|
12001
|
+
//! moment.js
|
|
12002
|
+
hooks.version = "2.30.1";
|
|
12003
|
+
setHookCallback(createLocal);
|
|
12004
|
+
hooks.fn = proto;
|
|
12005
|
+
hooks.min = min;
|
|
12006
|
+
hooks.max = max;
|
|
12007
|
+
hooks.now = now;
|
|
12008
|
+
hooks.utc = createUTC;
|
|
12009
|
+
hooks.unix = createUnix;
|
|
12010
|
+
hooks.months = listMonths;
|
|
12011
|
+
hooks.isDate = isDate;
|
|
12012
|
+
hooks.locale = getSetGlobalLocale;
|
|
12013
|
+
hooks.invalid = createInvalid;
|
|
12014
|
+
hooks.duration = createDuration;
|
|
12015
|
+
hooks.isMoment = isMoment;
|
|
12016
|
+
hooks.weekdays = listWeekdays;
|
|
12017
|
+
hooks.parseZone = createInZone;
|
|
12018
|
+
hooks.localeData = getLocale;
|
|
12019
|
+
hooks.isDuration = isDuration;
|
|
12020
|
+
hooks.monthsShort = listMonthsShort;
|
|
12021
|
+
hooks.weekdaysMin = listWeekdaysMin;
|
|
12022
|
+
hooks.defineLocale = defineLocale;
|
|
12023
|
+
hooks.updateLocale = updateLocale;
|
|
12024
|
+
hooks.locales = listLocales;
|
|
12025
|
+
hooks.weekdaysShort = listWeekdaysShort;
|
|
12026
|
+
hooks.normalizeUnits = normalizeUnits;
|
|
12027
|
+
hooks.relativeTimeRounding = getSetRelativeTimeRounding;
|
|
12028
|
+
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
|
|
12029
|
+
hooks.calendarFormat = getCalendarFormat;
|
|
12030
|
+
hooks.prototype = proto;
|
|
12031
|
+
hooks.HTML5_FMT = {
|
|
12032
|
+
DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
|
|
12033
|
+
// <input type="datetime-local" />
|
|
12034
|
+
DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
|
|
12035
|
+
// <input type="datetime-local" step="1" />
|
|
12036
|
+
DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
|
|
12037
|
+
// <input type="datetime-local" step="0.001" />
|
|
12038
|
+
DATE: "YYYY-MM-DD",
|
|
12039
|
+
// <input type="date" />
|
|
12040
|
+
TIME: "HH:mm",
|
|
12041
|
+
// <input type="time" />
|
|
12042
|
+
TIME_SECONDS: "HH:mm:ss",
|
|
12043
|
+
// <input type="time" step="1" />
|
|
12044
|
+
TIME_MS: "HH:mm:ss.SSS",
|
|
12045
|
+
// <input type="time" step="0.001" />
|
|
12046
|
+
WEEK: "GGGG-[W]WW",
|
|
12047
|
+
// <input type="week" />
|
|
12048
|
+
MONTH: "YYYY-MM"
|
|
12049
|
+
// <input type="month" />
|
|
12050
|
+
};
|
|
12051
|
+
//! moment.js locale configuration
|
|
12052
|
+
//! locale : French [fr]
|
|
12053
|
+
//! author : John Fischer : https://github.com/jfroffice
|
|
12054
|
+
var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, monthsShortStrictRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i, monthsRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, monthsParse = [
|
|
12055
|
+
/^janv/i,
|
|
12056
|
+
/^févr/i,
|
|
12057
|
+
/^mars/i,
|
|
12058
|
+
/^avr/i,
|
|
12059
|
+
/^mai/i,
|
|
12060
|
+
/^juin/i,
|
|
12061
|
+
/^juil/i,
|
|
12062
|
+
/^août/i,
|
|
12063
|
+
/^sept/i,
|
|
12064
|
+
/^oct/i,
|
|
12065
|
+
/^nov/i,
|
|
12066
|
+
/^déc/i
|
|
12067
|
+
];
|
|
12068
|
+
hooks.defineLocale("fr", {
|
|
12069
|
+
months: "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split(
|
|
12070
|
+
"_"
|
|
12071
|
+
),
|
|
12072
|
+
monthsShort: "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split(
|
|
12073
|
+
"_"
|
|
12074
|
+
),
|
|
12075
|
+
monthsRegex,
|
|
12076
|
+
monthsShortRegex: monthsRegex,
|
|
12077
|
+
monthsStrictRegex,
|
|
12078
|
+
monthsShortStrictRegex,
|
|
12079
|
+
monthsParse,
|
|
12080
|
+
longMonthsParse: monthsParse,
|
|
12081
|
+
shortMonthsParse: monthsParse,
|
|
12082
|
+
weekdays: "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),
|
|
12083
|
+
weekdaysShort: "dim._lun._mar._mer._jeu._ven._sam.".split("_"),
|
|
12084
|
+
weekdaysMin: "di_lu_ma_me_je_ve_sa".split("_"),
|
|
12085
|
+
weekdaysParseExact: true,
|
|
12086
|
+
longDateFormat: {
|
|
12087
|
+
LT: "HH:mm",
|
|
12088
|
+
LTS: "HH:mm:ss",
|
|
12089
|
+
L: "DD/MM/YYYY",
|
|
12090
|
+
LL: "D MMMM YYYY",
|
|
12091
|
+
LLL: "D MMMM YYYY HH:mm",
|
|
12092
|
+
LLLL: "dddd D MMMM YYYY HH:mm"
|
|
12093
|
+
},
|
|
12094
|
+
calendar: {
|
|
12095
|
+
sameDay: "[Aujourd’hui à] LT",
|
|
12096
|
+
nextDay: "[Demain à] LT",
|
|
12097
|
+
nextWeek: "dddd [à] LT",
|
|
12098
|
+
lastDay: "[Hier à] LT",
|
|
12099
|
+
lastWeek: "dddd [dernier à] LT",
|
|
12100
|
+
sameElse: "L"
|
|
12101
|
+
},
|
|
12102
|
+
relativeTime: {
|
|
12103
|
+
future: "dans %s",
|
|
12104
|
+
past: "il y a %s",
|
|
12105
|
+
s: "quelques secondes",
|
|
12106
|
+
ss: "%d secondes",
|
|
12107
|
+
m: "une minute",
|
|
12108
|
+
mm: "%d minutes",
|
|
12109
|
+
h: "une heure",
|
|
12110
|
+
hh: "%d heures",
|
|
12111
|
+
d: "un jour",
|
|
12112
|
+
dd: "%d jours",
|
|
12113
|
+
w: "une semaine",
|
|
12114
|
+
ww: "%d semaines",
|
|
12115
|
+
M: "un mois",
|
|
12116
|
+
MM: "%d mois",
|
|
12117
|
+
y: "un an",
|
|
12118
|
+
yy: "%d ans"
|
|
12119
|
+
},
|
|
12120
|
+
dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
|
|
12121
|
+
ordinal: function(number2, period) {
|
|
12122
|
+
switch (period) {
|
|
12123
|
+
// TODO: Return 'e' when day of month > 1. Move this case inside
|
|
12124
|
+
// block for masculine words below.
|
|
12125
|
+
// See https://github.com/moment/moment/issues/3375
|
|
12126
|
+
case "D":
|
|
12127
|
+
return number2 + (number2 === 1 ? "er" : "");
|
|
12128
|
+
// Words with masculine grammatical gender: mois, trimestre, jour
|
|
12129
|
+
default:
|
|
12130
|
+
case "M":
|
|
12131
|
+
case "Q":
|
|
12132
|
+
case "DDD":
|
|
12133
|
+
case "d":
|
|
12134
|
+
return number2 + (number2 === 1 ? "er" : "e");
|
|
12135
|
+
// Words with feminine grammatical gender: semaine
|
|
12136
|
+
case "w":
|
|
12137
|
+
case "W":
|
|
12138
|
+
return number2 + (number2 === 1 ? "re" : "e");
|
|
12139
|
+
}
|
|
12140
|
+
},
|
|
12141
|
+
week: {
|
|
12142
|
+
dow: 1,
|
|
12143
|
+
// Monday is the first day of the week.
|
|
12144
|
+
doy: 4
|
|
12145
|
+
// The week that contains Jan 4th is the first week of the year.
|
|
12146
|
+
}
|
|
12147
|
+
});
|
|
12148
|
+
var AccountStatus;
|
|
12149
|
+
(function(AccountStatus2) {
|
|
12150
|
+
AccountStatus2[AccountStatus2["DISABLED"] = 0] = "DISABLED";
|
|
12151
|
+
AccountStatus2[AccountStatus2["ENABLED"] = 1] = "ENABLED";
|
|
12152
|
+
})(AccountStatus || (AccountStatus = {}));
|
|
12153
|
+
var AdContentType;
|
|
12154
|
+
(function(AdContentType2) {
|
|
12155
|
+
AdContentType2["IMAGE"] = "image";
|
|
12156
|
+
AdContentType2["VIDEO"] = "video";
|
|
12157
|
+
})(AdContentType || (AdContentType = {}));
|
|
12158
|
+
var AuthType;
|
|
12159
|
+
(function(AuthType2) {
|
|
12160
|
+
AuthType2[AuthType2["UNDEFINED"] = 0] = "UNDEFINED";
|
|
12161
|
+
AuthType2[AuthType2["EMAIL_PASSWORD"] = 1] = "EMAIL_PASSWORD";
|
|
12162
|
+
AuthType2[AuthType2["PHONE"] = 2] = "PHONE";
|
|
12163
|
+
AuthType2[AuthType2["GOOGLE"] = 3] = "GOOGLE";
|
|
12164
|
+
AuthType2[AuthType2["FACEBOOK"] = 4] = "FACEBOOK";
|
|
12165
|
+
AuthType2[AuthType2["TWITTER"] = 5] = "TWITTER";
|
|
12166
|
+
})(AuthType || (AuthType = {}));
|
|
12167
|
+
var Bool;
|
|
12168
|
+
(function(Bool2) {
|
|
12169
|
+
Bool2[Bool2["FALSE"] = 0] = "FALSE";
|
|
12170
|
+
Bool2[Bool2["TRUE"] = 1] = "TRUE";
|
|
12171
|
+
})(Bool || (Bool = {}));
|
|
12172
|
+
var ContentType;
|
|
12173
|
+
(function(ContentType2) {
|
|
12174
|
+
ContentType2["NEWS_TAG"] = "news-tag";
|
|
12175
|
+
ContentType2["NEWS_CATEGORY"] = "news-category";
|
|
12176
|
+
ContentType2["NEWS_ARTICLE"] = "news-article";
|
|
12177
|
+
ContentType2["CONTENT_MODEL"] = "content-model";
|
|
12178
|
+
})(ContentType || (ContentType = {}));
|
|
12179
|
+
var MenuItemTargetType;
|
|
12180
|
+
(function(MenuItemTargetType2) {
|
|
12181
|
+
MenuItemTargetType2["EXTERNAL_LINK"] = "external-link";
|
|
12182
|
+
MenuItemTargetType2["PAGE_LINK"] = "page-link";
|
|
12183
|
+
MenuItemTargetType2["CONTENT_LINK"] = "content-link";
|
|
12184
|
+
})(MenuItemTargetType || (MenuItemTargetType = {}));
|
|
12185
|
+
var NotificationSource;
|
|
12186
|
+
(function(NotificationSource2) {
|
|
12187
|
+
NotificationSource2[NotificationSource2["SYSTEM"] = 1] = "SYSTEM";
|
|
12188
|
+
NotificationSource2[NotificationSource2["USER"] = 2] = "USER";
|
|
12189
|
+
})(NotificationSource || (NotificationSource = {}));
|
|
12190
|
+
var NotificationType;
|
|
12191
|
+
(function(NotificationType2) {
|
|
12192
|
+
NotificationType2["WELCOME_USER"] = "App\\Notifications\\WelcomeUser";
|
|
12193
|
+
})(NotificationType || (NotificationType = {}));
|
|
12194
|
+
var PermalinkContentType;
|
|
12195
|
+
(function(PermalinkContentType2) {
|
|
12196
|
+
PermalinkContentType2["NEWS_TAG"] = "news-tag";
|
|
12197
|
+
PermalinkContentType2["NEWS_CATEGORY"] = "news-category";
|
|
12198
|
+
PermalinkContentType2["NEWS_ARTICLE"] = "news-article";
|
|
12199
|
+
PermalinkContentType2["CONTENT_MODEL"] = "content-model";
|
|
12200
|
+
})(PermalinkContentType || (PermalinkContentType = {}));
|
|
12201
|
+
var ProfileType;
|
|
12202
|
+
(function(ProfileType2) {
|
|
12203
|
+
ProfileType2["SUBSCRIBER"] = "App\\Models\\SubscriberProfile";
|
|
12204
|
+
})(ProfileType || (ProfileType = {}));
|
|
12205
|
+
var ResponseErrorCode;
|
|
12206
|
+
(function(ResponseErrorCode2) {
|
|
12207
|
+
ResponseErrorCode2["FORM_INVALID_DATA"] = "form/invalid_data";
|
|
12208
|
+
ResponseErrorCode2["AUTH_LOGIN_FAILED"] = "auth/login_failed";
|
|
12209
|
+
ResponseErrorCode2["AUTH_REGISTRATION_FAILED"] = "auth/registration_failed";
|
|
12210
|
+
ResponseErrorCode2["AUTH_MISSING_DATA"] = "auth/missing_data";
|
|
12211
|
+
ResponseErrorCode2["AUTH_WRONG_PASSWORD"] = "auth/wrong_password";
|
|
12212
|
+
ResponseErrorCode2["AUTH_USER_DISABLED"] = "auth/user_disabled";
|
|
12213
|
+
ResponseErrorCode2["AUTH_USER_NOT_FOUND"] = "auth/user_not_found";
|
|
12214
|
+
ResponseErrorCode2["AUTH_PROFILE_TYPE_NOT_FOUND"] = "auth/profile_type_not_found";
|
|
12215
|
+
ResponseErrorCode2["AUTH_EMAIL_ALREADY_USED"] = "auth/email_already_used";
|
|
12216
|
+
ResponseErrorCode2["AUTH_EMAIL_ALREADY_VERIFIED"] = "auth/email_already_verified";
|
|
12217
|
+
ResponseErrorCode2["AUTH_PROFILE_ALREADY_EXISTS"] = "auth/profile_already_exists";
|
|
12218
|
+
ResponseErrorCode2["AUTH_PROFILE_NOT_FOUND"] = "auth/profile_not_found";
|
|
12219
|
+
ResponseErrorCode2["AUTH_INVALID_TOKEN"] = "auth/invalid_token";
|
|
12220
|
+
ResponseErrorCode2["AUTH_CODE_SENDING_FAILED"] = "auth/code_sending_failed";
|
|
12221
|
+
ResponseErrorCode2["AUTH_CODE_VERIFICATION_FAILED"] = "auth/code_verification_failed";
|
|
12222
|
+
ResponseErrorCode2["AUTH_CODE_EXPIRED"] = "auth/code_expired";
|
|
12223
|
+
})(ResponseErrorCode || (ResponseErrorCode = {}));
|
|
12224
|
+
var UserRole;
|
|
12225
|
+
(function(UserRole2) {
|
|
12226
|
+
UserRole2["SUPER_ADMIN"] = "super-admin";
|
|
12227
|
+
UserRole2["ADMIN"] = "admin";
|
|
12228
|
+
UserRole2["USER"] = "user";
|
|
12229
|
+
})(UserRole || (UserRole = {}));
|
|
12230
|
+
const RootContainer = ({
|
|
12231
|
+
page,
|
|
12232
|
+
sections = [],
|
|
12233
|
+
components = {}
|
|
12234
|
+
}) => {
|
|
12235
|
+
React2.useEffect(() => {
|
|
12236
|
+
const timeout = setTimeout(() => {
|
|
12237
|
+
const sectionData = page.props?.sectionData;
|
|
12238
|
+
if (sectionData && sections.find(
|
|
12239
|
+
(section) => section.slug === sectionData.slug && section.pivot?.linkId === sectionData.pivot?.linkId
|
|
12240
|
+
)) {
|
|
12241
|
+
slideToId(`${sectionData.slug}__${sectionData.pivot?.linkId}-container`);
|
|
12242
|
+
}
|
|
12243
|
+
}, 1e3);
|
|
12244
|
+
return () => clearTimeout(timeout);
|
|
12245
|
+
}, [page, sections]);
|
|
12246
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: sections.map((section, i) => {
|
|
12247
|
+
const Component = components[section.name];
|
|
12248
|
+
if (!Component) return null;
|
|
12249
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12250
|
+
"section",
|
|
12251
|
+
{
|
|
12252
|
+
id: `${section.slug}__${section.pivot?.linkId}-container`,
|
|
12253
|
+
className: "reset-styles",
|
|
12254
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12255
|
+
Component,
|
|
12256
|
+
{
|
|
12257
|
+
data: section.pivot?.data,
|
|
12258
|
+
settings: section.pivot?.settings,
|
|
12259
|
+
sectionKey: `${section.slug}__${section.pivot?.linkId}`,
|
|
12260
|
+
metadata: {
|
|
12261
|
+
slug: section.slug,
|
|
12262
|
+
name: section.name,
|
|
12263
|
+
title: section.title,
|
|
12264
|
+
linkId: section.pivot?.linkId,
|
|
12265
|
+
createdAt: section.createdAt,
|
|
12266
|
+
updatedAt: section.updatedAt
|
|
12267
|
+
}
|
|
12268
|
+
}
|
|
12269
|
+
)
|
|
12270
|
+
},
|
|
12271
|
+
`section-${i}`
|
|
12272
|
+
);
|
|
12273
|
+
}) });
|
|
12274
|
+
};
|
|
7783
12275
|
exports.AsyncImg = AsyncImg;
|
|
7784
12276
|
exports.CustomTransition = CustomTransition;
|
|
12277
|
+
exports.MountedTeleport = MountedTeleport;
|
|
12278
|
+
exports.ReadMore = ReadMore;
|
|
12279
|
+
exports.RootContainer = RootContainer;
|
|
12280
|
+
exports.StickyBottom = StickyBottom;
|
|
12281
|
+
exports.StickyTop = StickyTop;
|
|
7785
12282
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7786
12283
|
return exports;
|
|
7787
|
-
}({}, React);
|
|
12284
|
+
}({}, React, ReactDOM);
|