@planningcenter/tapestry 3.2.2-rc.8 → 3.2.2
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/components/NumberStepper/NumberStepper.d.ts +8 -16
- package/dist/components/NumberStepper/NumberStepper.d.ts.map +1 -1
- package/dist/components/NumberStepper/NumberStepper.js +2 -2
- package/dist/components/NumberStepper/NumberStepper.js.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +7 -5
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +130 -6
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/select/Select.d.ts +2 -2
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +4 -1
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/SelectNative.d.ts +2 -2
- package/dist/components/select/SelectNative.d.ts.map +1 -1
- package/dist/components/select/SelectNative.js.map +1 -1
- package/dist/components/select/SelectPopover.d.ts +2 -1
- package/dist/components/select/SelectPopover.d.ts.map +1 -1
- package/dist/components/select/SelectPopover.js.map +1 -1
- package/dist/ext/@internationalized/date/dist/CalendarDate.js +62 -4
- package/dist/ext/@internationalized/date/dist/CalendarDate.js.map +1 -1
- package/dist/ext/@internationalized/date/dist/conversion.js +33 -2
- package/dist/ext/@internationalized/date/dist/conversion.js.map +1 -1
- package/dist/ext/@internationalized/date/dist/manipulation.js +117 -1
- package/dist/ext/@internationalized/date/dist/manipulation.js.map +1 -1
- package/dist/ext/@internationalized/date/dist/queries.js +9 -1
- package/dist/ext/@internationalized/date/dist/queries.js.map +1 -1
- package/dist/ext/@internationalized/date/dist/string.js +14 -1
- package/dist/ext/@internationalized/date/dist/string.js.map +1 -1
- package/dist/ext/@react-aria/focus/dist/FocusScope.js +664 -0
- package/dist/ext/@react-aria/focus/dist/FocusScope.js.map +1 -0
- package/dist/ext/@react-aria/interactions/dist/focusSafely.js +38 -0
- package/dist/ext/@react-aria/interactions/dist/focusSafely.js.map +1 -0
- package/dist/ext/@react-aria/interactions/dist/useFocusVisible.js +165 -0
- package/dist/ext/@react-aria/interactions/dist/useFocusVisible.js.map +1 -0
- package/dist/ext/@react-aria/interactions/dist/utils.js +6 -0
- package/dist/ext/@react-aria/interactions/dist/utils.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/DOMFunctions.js +38 -0
- package/dist/ext/@react-aria/utils/dist/DOMFunctions.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/ShadowTreeWalker.js +193 -0
- package/dist/ext/@react-aria/utils/dist/ShadowTreeWalker.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/domHelpers.js +20 -0
- package/dist/ext/@react-aria/utils/dist/domHelpers.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/focusWithoutScrolling.js +66 -0
- package/dist/ext/@react-aria/utils/dist/focusWithoutScrolling.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/isElementVisible.js +39 -0
- package/dist/ext/@react-aria/utils/dist/isElementVisible.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/isFocusable.js +49 -0
- package/dist/ext/@react-aria/utils/dist/isFocusable.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/isVirtualEvent.js +25 -0
- package/dist/ext/@react-aria/utils/dist/isVirtualEvent.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/openLink.js +42 -0
- package/dist/ext/@react-aria/utils/dist/openLink.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/platform.js +59 -0
- package/dist/ext/@react-aria/utils/dist/platform.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/runAfterTransition.js +91 -0
- package/dist/ext/@react-aria/utils/dist/runAfterTransition.js.map +1 -0
- package/dist/ext/@react-aria/utils/dist/useLayoutEffect.js +17 -0
- package/dist/ext/@react-aria/utils/dist/useLayoutEffect.js.map +1 -0
- package/dist/ext/@react-stately/flags/dist/import.js +7 -0
- package/dist/ext/@react-stately/flags/dist/import.js.map +1 -0
- package/dist/reactRender.css +1118 -984
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +1118 -984
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/unstable.css +137 -3
- package/dist/unstable.css.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPopover.js","sources":["../../../src/components/select/SelectPopover.tsx"],"sourcesContent":["import {\n ComboboxAction,\n getComboboxActionFromKey,\n getUpdatedIndex,\n} from \"@utilities/keyboardUtils\"\nimport {\n getDataAttributes,\n getIndexByLetter,\n getSelectableOptionsFromSegments,\n normalizeOptions,\n type Segment,\n} from \"@utilities/selectUtils\"\nimport { useId } from \"@utilities/useId\"\nimport React, {\n forwardRef,\n type SelectHTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\n\nimport type { SelectItem, SelectOption } from \"./Select\"\nimport { SelectOptions } from \"./SelectOptions\"\n\ninterface ToggleEvent extends Event {\n newState: \"closed\" | \"open\"\n oldState: \"closed\" | \"open\"\n}\n\nexport interface SelectPopoverProps {\n \"aria-describedby\"?: string\n \"aria-label\"?: string\n \"aria-labelledby\"?: string\n defaultValue?: string\n disabled?: boolean\n id?: string\n invalid?: boolean\n /** A flat or mixed array of options and option groups. */\n options: SelectItem[]\n placeholder: string\n required?: boolean\n triggerRef?: React.RefObject<HTMLButtonElement>\n value?: string\n}\n\nexport type SelectPopoverElementProps = Omit<\n SelectHTMLAttributes<HTMLSelectElement>,\n keyof SelectPopoverProps | \"multiple\"\n> &\n SelectPopoverProps\n\nconst Group = ({\n children,\n disabled,\n id,\n label,\n}: {\n children: React.ReactNode\n disabled?: boolean\n id: string\n label: string\n}) => (\n <ul aria-disabled={disabled || undefined} aria-labelledby={id} role=\"group\">\n <li id={id} role=\"presentation\">\n <span>{label}</span>\n </li>\n {children}\n </ul>\n)\n\nfunction renderListSegments(\n segments: Segment[],\n baseId: string,\n renderItem: (option: SelectOption, index: number) => React.ReactNode\n) {\n let flatIndex = 0\n\n return segments.map((segment, segmentIndex) => {\n const startIndex = flatIndex\n flatIndex += segment.options.length\n\n if (segment.type === \"group\") {\n return (\n <Group\n key={`${segment.label}-${segmentIndex}`}\n disabled={segment.disabled}\n id={`${baseId}-group-${segmentIndex}`}\n label={segment.label}\n >\n {segment.options.map((opt, i) => renderItem(opt, startIndex + i))}\n </Group>\n )\n }\n\n return (\n <ul key={`options-${segmentIndex}`} role=\"presentation\">\n {segment.options.map((opt, i) => renderItem(opt, startIndex + i))}\n </ul>\n )\n })\n}\n\nexport const SelectPopover = forwardRef<\n HTMLSelectElement,\n SelectPopoverElementProps\n>(\n (\n {\n \"aria-describedby\": ariaDescribedBy,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n defaultValue,\n disabled,\n id,\n invalid,\n onBlur,\n onChange,\n onClick,\n onFocus,\n options,\n placeholder,\n required,\n triggerRef,\n value,\n ...props\n }: SelectPopoverElementProps,\n ref\n ) => {\n const stableId = useId()\n const baseId = id || `tds-select-popover-${stableId}`\n\n const [isOpen, setIsOpen] = useState(false)\n const [uncontrolledValue, setUncontrolledValue] = useState<string | null>(\n defaultValue ?? null\n )\n const [activeIndex, setActiveIndex] = useState(-1)\n\n const isControlled = value !== undefined\n const selectedValue = isControlled ? (value ?? null) : uncontrolledValue\n\n const { allOptions, segments } = useMemo(() => {\n const segments = normalizeOptions(options)\n const allOptions = getSelectableOptionsFromSegments(segments)\n return { allOptions, segments }\n }, [options])\n\n const selectedOption = allOptions.find((opt) => opt.value === selectedValue)\n\n const activeOption = activeIndex >= 0 ? allOptions[activeIndex] : undefined\n const activeOptionId = activeOption\n ? `${baseId}-option-${activeOption.value}`\n : undefined\n\n const popoverRef = useRef<HTMLDivElement>(null)\n const internalTriggerRef = useRef<HTMLButtonElement | null>(null)\n const resolvedTriggerRef = triggerRef ?? internalTriggerRef\n const hiddenSelectRef = useRef<HTMLSelectElement | null>(null)\n const pendingChangeValueRef = useRef<string | null>(null)\n const searchStringRef = useRef(\"\")\n const searchTimeoutRef = useRef<ReturnType<typeof setTimeout>>()\n\n const setHiddenSelectRef = useCallback(\n (element: HTMLSelectElement | null) => {\n hiddenSelectRef.current = element\n if (typeof ref === \"function\") {\n ref(element)\n } else if (ref) {\n ref.current = element\n }\n },\n [ref]\n )\n\n useEffect(() => {\n const popoverEl = popoverRef.current\n if (!popoverEl) return\n\n const handleToggle = (e: Event) => {\n const newIsOpen = (e as ToggleEvent).newState === \"open\"\n setIsOpen(newIsOpen)\n\n if (newIsOpen) {\n const index = allOptions.findIndex(\n (opt) => opt.value === selectedValue && !opt.disabled\n )\n if (index >= 0) {\n setActiveIndex(index)\n } else {\n // Find first non-disabled option\n const firstEnabledIndexOrFirstIndex = Math.max(\n allOptions.findIndex((opt) => !opt.disabled),\n 0\n )\n setActiveIndex(firstEnabledIndexOrFirstIndex)\n }\n } else {\n setActiveIndex(-1)\n }\n }\n\n popoverEl.addEventListener(\"toggle\", handleToggle)\n return () => popoverEl.removeEventListener(\"toggle\", handleToggle)\n }, [allOptions, selectedValue])\n\n useEffect(() => {\n if (activeOptionId) {\n document\n .getElementById(activeOptionId)\n ?.scrollIntoView({ block: \"nearest\" })\n }\n }, [activeOptionId])\n\n useEffect(\n () => () => {\n clearTimeout(searchTimeoutRef.current)\n },\n []\n )\n\n const openPopover = () =>\n popoverRef.current?.showPopover({ source: resolvedTriggerRef.current! })\n\n const closePopover = () => popoverRef.current?.hidePopover()\n\n const commitSelection = useCallback(\n (nextValue: string) => {\n if (nextValue === selectedValue) {\n closePopover()\n return\n }\n\n if (!isControlled) {\n setUncontrolledValue(nextValue)\n }\n\n const hiddenEl = hiddenSelectRef.current\n if (hiddenEl) {\n pendingChangeValueRef.current = nextValue\n hiddenEl.value = nextValue\n hiddenEl.dispatchEvent(new Event(\"change\", { bubbles: true }))\n if (isControlled) {\n hiddenEl.value = value ?? \"\"\n }\n }\n\n closePopover()\n },\n [isControlled, selectedValue, value]\n )\n\n const selectActiveOption = useCallback(() => {\n if (activeOption && !activeOption.disabled) {\n commitSelection(activeOption.value!)\n return true\n }\n return false\n }, [activeOption, commitSelection])\n\n const commitActiveOptionOrClose = useCallback(() => {\n if (!selectActiveOption()) {\n closePopover()\n }\n }, [selectActiveOption])\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled) return\n\n // Tab must not be prevented — allow native focus movement\n if (e.key === \"Tab\" && isOpen) {\n commitActiveOptionOrClose()\n return\n }\n\n const action = getComboboxActionFromKey(e, isOpen)\n if (!action) return\n\n e.preventDefault()\n\n switch (action) {\n case ComboboxAction.OpenPopup:\n openPopover()\n break\n case ComboboxAction.CommitAndClose:\n commitActiveOptionOrClose()\n break\n case ComboboxAction.MoveFirst:\n case ComboboxAction.MoveLast:\n if (!isOpen) openPopover()\n setActiveIndex(getUpdatedIndex(activeIndex, action, allOptions))\n break\n case ComboboxAction.MoveNext:\n case ComboboxAction.MovePrevious:\n setActiveIndex(getUpdatedIndex(activeIndex, action, allOptions))\n break\n case ComboboxAction.TypeCharacter: {\n if (!isOpen) openPopover()\n\n clearTimeout(searchTimeoutRef.current)\n searchStringRef.current += e.key\n searchTimeoutRef.current = setTimeout(() => {\n searchStringRef.current = \"\"\n }, 500)\n\n const searchIndex = getIndexByLetter(\n allOptions,\n searchStringRef.current,\n activeIndex\n )\n if (searchIndex >= 0) {\n setActiveIndex(searchIndex)\n }\n break\n }\n case ComboboxAction.ClosePopup:\n closePopover()\n break\n }\n }\n\n const createStableEventTarget = (\n target: HTMLSelectElement,\n valueSnapshot: string\n ) => {\n const proxy = Object.create(target)\n Object.defineProperties(proxy, {\n disabled: {\n configurable: true,\n enumerable: true,\n value: target.disabled,\n },\n form: { configurable: true, enumerable: true, value: target.form },\n name: { configurable: true, enumerable: true, value: target.name },\n type: { configurable: true, enumerable: true, value: target.type },\n value: { configurable: true, enumerable: true, value: valueSnapshot },\n })\n return proxy as HTMLSelectElement\n }\n\n const withSelectTarget = useCallback(\n <\n SourceEvent extends React.SyntheticEvent,\n TargetEvent extends React.SyntheticEvent<HTMLSelectElement>,\n >(\n event: SourceEvent,\n target: HTMLSelectElement,\n currentTarget: HTMLSelectElement = target\n ) => {\n return Object.defineProperties(Object.create(event), {\n currentTarget: { value: currentTarget },\n target: { value: target },\n }) as TargetEvent\n },\n []\n )\n\n const handleHiddenSelectChange = useCallback(\n (event: React.ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return\n\n const valueSnapshot =\n pendingChangeValueRef.current ?? event.currentTarget.value\n pendingChangeValueRef.current = null\n\n const stableEvent = withSelectTarget<\n React.ChangeEvent<HTMLSelectElement>,\n React.ChangeEvent<HTMLSelectElement>\n >(\n event,\n createStableEventTarget(\n event.target as HTMLSelectElement,\n valueSnapshot\n ),\n createStableEventTarget(event.currentTarget, valueSnapshot)\n )\n\n onChange(stableEvent)\n },\n [onChange, withSelectTarget]\n )\n\n const forwardEventToSelect = useCallback(\n <\n ButtonEvent extends React.SyntheticEvent<HTMLButtonElement>,\n SelectEvent extends React.SyntheticEvent<HTMLSelectElement>,\n >(\n event: ButtonEvent,\n handler?: (event: SelectEvent) => void\n ) => {\n if (!handler) return\n\n const hiddenEl = hiddenSelectRef.current\n if (!hiddenEl) return\n\n const stableEvent = withSelectTarget<ButtonEvent, SelectEvent>(\n event,\n hiddenEl\n )\n\n handler(stableEvent)\n },\n [withSelectTarget]\n )\n\n const handleButtonBlur = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.FocusEvent<HTMLButtonElement>,\n React.FocusEvent<HTMLSelectElement>\n >(event, onBlur)\n },\n [forwardEventToSelect, onBlur]\n )\n\n const handleButtonClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.MouseEvent<HTMLButtonElement>,\n React.MouseEvent<HTMLSelectElement>\n >(event, onClick)\n },\n [forwardEventToSelect, onClick]\n )\n\n const handleButtonFocus = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.FocusEvent<HTMLButtonElement>,\n React.FocusEvent<HTMLSelectElement>\n >(event, onFocus)\n },\n [forwardEventToSelect, onFocus]\n )\n\n const renderListOption = (option: SelectOption, index: number) => {\n const { disabled, divider, label, value } = option\n if (divider) return <li key={index} role=\"separator\" />\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keyboard events are handled on the combobox button\n <li\n key={value}\n {...getDataAttributes(option)}\n aria-disabled={disabled || undefined}\n aria-selected={value === selectedValue}\n className={\n value === activeOption?.value\n ? \"tds-select-option--active\"\n : undefined\n }\n id={`${baseId}-option-${value}`}\n onClick={disabled ? undefined : () => commitSelection(value!)}\n role=\"option\"\n >\n {label}\n </li>\n )\n }\n\n return (\n <>\n <button\n ref={resolvedTriggerRef}\n popovertarget={baseId}\n aria-activedescendant={activeOptionId}\n aria-controls={baseId}\n aria-describedby={ariaDescribedBy}\n aria-disabled={disabled ? \"true\" : undefined}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-invalid={invalid ? \"true\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-required={required ? \"true\" : undefined}\n disabled={disabled}\n onBlur={handleButtonBlur}\n onClick={handleButtonClick}\n onFocus={handleButtonFocus}\n onKeyDown={handleKeyDown}\n role=\"combobox\"\n type=\"button\"\n >\n {selectedOption ? selectedOption.label : placeholder}\n </button>\n <div\n ref={popoverRef}\n popover=\"\"\n id={baseId}\n role=\"listbox\"\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid ? \"true\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-required={required ? \"true\" : undefined}\n >\n {renderListSegments(segments, baseId, renderListOption)}\n </div>\n <select\n {...props}\n ref={setHiddenSelectRef}\n aria-hidden\n className=\"tds-select-hidden-select\"\n disabled={disabled}\n id={`${baseId}-control`}\n onChange={handleHiddenSelectChange}\n required={required}\n tabIndex={-1}\n value={selectedValue ?? \"\"}\n >\n <option value=\"\" />\n <SelectOptions items={options} />\n </select>\n </>\n )\n }\n)\n\nSelectPopover.displayName = \"SelectPopover\"\n"],"names":["React"],"mappings":";;;;;;AAqDA,MAAM,KAAK,GAAG,CAAC,EACb,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,KAAK,GAMN,MACCA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,eAAA,EAAmB,QAAQ,IAAI,SAAS,EAAA,iBAAA,EAAmB,EAAE,EAAE,IAAI,EAAC,OAAO,EAAA;AACzE,IAAAA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,cAAc,EAAA;QAC7BA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAO,KAAK,CAAQ,CACjB;IACJ,QAAQ,CACN,CACN;AAED,SAAS,kBAAkB,CACzB,QAAmB,EACnB,MAAc,EACd,UAAoE,EAAA;IAEpE,IAAI,SAAS,GAAG,CAAC;IAEjB,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAI;QAC5C,MAAM,UAAU,GAAG,SAAS;AAC5B,QAAA,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM;AAEnC,QAAA,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE;YAC5B,QACEA,cAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EACJ,GAAG,EAAE,CAAA,EAAG,OAAO,CAAC,KAAK,CAAA,CAAA,EAAI,YAAY,CAAA,CAAE,EACvC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,EAAE,EAAE,CAAA,EAAG,MAAM,CAAA,OAAA,EAAU,YAAY,CAAA,CAAE,EACrC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAA,EAEnB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC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AE,EAAA,CAAG;YACnBA,cAAA,CAAA,aAAA,CAAC,aAAa,IAAC,KAAK,EAAE,OAAO,EAAA,CAAI,CAC1B,CACR;AAEP,CAAC;AAGH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
|
|
1
|
+
{"version":3,"file":"SelectPopover.js","sources":["../../../src/components/select/SelectPopover.tsx"],"sourcesContent":["import {\n ComboboxAction,\n getComboboxActionFromKey,\n getUpdatedIndex,\n} from \"@utilities/keyboardUtils\"\nimport {\n getDataAttributes,\n getIndexByLetter,\n getSelectableOptionsFromSegments,\n normalizeOptions,\n type Segment,\n} from \"@utilities/selectUtils\"\nimport { useId } from \"@utilities/useId\"\nimport React, {\n forwardRef,\n type SelectHTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\n\nimport type { SelectItem, SelectOption } from \"./Select\"\nimport { SelectOptions } from \"./SelectOptions\"\n\ninterface ToggleEvent extends Event {\n newState: \"closed\" | \"open\"\n oldState: \"closed\" | \"open\"\n}\n\nexport interface SelectPopoverProps {\n \"aria-describedby\"?: string\n \"aria-label\"?: string\n \"aria-labelledby\"?: string\n defaultValue?: string\n disabled?: boolean\n id?: string\n invalid?: boolean\n /** A flat or mixed array of options and option groups. */\n options: SelectItem[]\n /** Placeholder text shown in the trigger button when no option is selected. `null` suppresses the placeholder. */\n placeholder: string | null\n required?: boolean\n triggerRef?: React.RefObject<HTMLButtonElement>\n value?: string\n}\n\nexport type SelectPopoverElementProps = Omit<\n SelectHTMLAttributes<HTMLSelectElement>,\n keyof SelectPopoverProps | \"multiple\"\n> &\n SelectPopoverProps\n\nconst Group = ({\n children,\n disabled,\n id,\n label,\n}: {\n children: React.ReactNode\n disabled?: boolean\n id: string\n label: string\n}) => (\n <ul aria-disabled={disabled || undefined} aria-labelledby={id} role=\"group\">\n <li id={id} role=\"presentation\">\n <span>{label}</span>\n </li>\n {children}\n </ul>\n)\n\nfunction renderListSegments(\n segments: Segment[],\n baseId: string,\n renderItem: (option: SelectOption, index: number) => React.ReactNode\n) {\n let flatIndex = 0\n\n return segments.map((segment, segmentIndex) => {\n const startIndex = flatIndex\n flatIndex += segment.options.length\n\n if (segment.type === \"group\") {\n return (\n <Group\n key={`${segment.label}-${segmentIndex}`}\n disabled={segment.disabled}\n id={`${baseId}-group-${segmentIndex}`}\n label={segment.label}\n >\n {segment.options.map((opt, i) => renderItem(opt, startIndex + i))}\n </Group>\n )\n }\n\n return (\n <ul key={`options-${segmentIndex}`} role=\"presentation\">\n {segment.options.map((opt, i) => renderItem(opt, startIndex + i))}\n </ul>\n )\n })\n}\n\nexport const SelectPopover = forwardRef<\n HTMLSelectElement,\n SelectPopoverElementProps\n>(\n (\n {\n \"aria-describedby\": ariaDescribedBy,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n defaultValue,\n disabled,\n id,\n invalid,\n onBlur,\n onChange,\n onClick,\n onFocus,\n options,\n placeholder,\n required,\n triggerRef,\n value,\n ...props\n }: SelectPopoverElementProps,\n ref\n ) => {\n const stableId = useId()\n const baseId = id || `tds-select-popover-${stableId}`\n\n const [isOpen, setIsOpen] = useState(false)\n const [uncontrolledValue, setUncontrolledValue] = useState<string | null>(\n defaultValue ?? null\n )\n const [activeIndex, setActiveIndex] = useState(-1)\n\n const isControlled = value !== undefined\n const selectedValue = isControlled ? (value ?? null) : uncontrolledValue\n\n const { allOptions, segments } = useMemo(() => {\n const segments = normalizeOptions(options)\n const allOptions = getSelectableOptionsFromSegments(segments)\n return { allOptions, segments }\n }, [options])\n\n const selectedOption = allOptions.find((opt) => opt.value === selectedValue)\n\n const activeOption = activeIndex >= 0 ? allOptions[activeIndex] : undefined\n const activeOptionId = activeOption\n ? `${baseId}-option-${activeOption.value}`\n : undefined\n\n const popoverRef = useRef<HTMLDivElement>(null)\n const internalTriggerRef = useRef<HTMLButtonElement | null>(null)\n const resolvedTriggerRef = triggerRef ?? internalTriggerRef\n const hiddenSelectRef = useRef<HTMLSelectElement | null>(null)\n const pendingChangeValueRef = useRef<string | null>(null)\n const searchStringRef = useRef(\"\")\n const searchTimeoutRef = useRef<ReturnType<typeof setTimeout>>()\n\n const setHiddenSelectRef = useCallback(\n (element: HTMLSelectElement | null) => {\n hiddenSelectRef.current = element\n if (typeof ref === \"function\") {\n ref(element)\n } else if (ref) {\n ref.current = element\n }\n },\n [ref]\n )\n\n useEffect(() => {\n const popoverEl = popoverRef.current\n if (!popoverEl) return\n\n const handleToggle = (e: Event) => {\n const newIsOpen = (e as ToggleEvent).newState === \"open\"\n setIsOpen(newIsOpen)\n\n if (newIsOpen) {\n const index = allOptions.findIndex(\n (opt) => opt.value === selectedValue && !opt.disabled\n )\n if (index >= 0) {\n setActiveIndex(index)\n } else {\n // Find first non-disabled option\n const firstEnabledIndexOrFirstIndex = Math.max(\n allOptions.findIndex((opt) => !opt.disabled),\n 0\n )\n setActiveIndex(firstEnabledIndexOrFirstIndex)\n }\n } else {\n setActiveIndex(-1)\n }\n }\n\n popoverEl.addEventListener(\"toggle\", handleToggle)\n return () => popoverEl.removeEventListener(\"toggle\", handleToggle)\n }, [allOptions, selectedValue])\n\n useEffect(() => {\n if (activeOptionId) {\n document\n .getElementById(activeOptionId)\n ?.scrollIntoView({ block: \"nearest\" })\n }\n }, [activeOptionId])\n\n useEffect(\n () => () => {\n clearTimeout(searchTimeoutRef.current)\n },\n []\n )\n\n const openPopover = () =>\n popoverRef.current?.showPopover({ source: resolvedTriggerRef.current! })\n\n const closePopover = () => popoverRef.current?.hidePopover()\n\n const commitSelection = useCallback(\n (nextValue: string) => {\n if (nextValue === selectedValue) {\n closePopover()\n return\n }\n\n if (!isControlled) {\n setUncontrolledValue(nextValue)\n }\n\n const hiddenEl = hiddenSelectRef.current\n if (hiddenEl) {\n pendingChangeValueRef.current = nextValue\n hiddenEl.value = nextValue\n hiddenEl.dispatchEvent(new Event(\"change\", { bubbles: true }))\n if (isControlled) {\n hiddenEl.value = value ?? \"\"\n }\n }\n\n closePopover()\n },\n [isControlled, selectedValue, value]\n )\n\n const selectActiveOption = useCallback(() => {\n if (activeOption && !activeOption.disabled) {\n commitSelection(activeOption.value!)\n return true\n }\n return false\n }, [activeOption, commitSelection])\n\n const commitActiveOptionOrClose = useCallback(() => {\n if (!selectActiveOption()) {\n closePopover()\n }\n }, [selectActiveOption])\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled) return\n\n // Tab must not be prevented — allow native focus movement\n if (e.key === \"Tab\" && isOpen) {\n commitActiveOptionOrClose()\n return\n }\n\n const action = getComboboxActionFromKey(e, isOpen)\n if (!action) return\n\n e.preventDefault()\n\n switch (action) {\n case ComboboxAction.OpenPopup:\n openPopover()\n break\n case ComboboxAction.CommitAndClose:\n commitActiveOptionOrClose()\n break\n case ComboboxAction.MoveFirst:\n case ComboboxAction.MoveLast:\n if (!isOpen) openPopover()\n setActiveIndex(getUpdatedIndex(activeIndex, action, allOptions))\n break\n case ComboboxAction.MoveNext:\n case ComboboxAction.MovePrevious:\n setActiveIndex(getUpdatedIndex(activeIndex, action, allOptions))\n break\n case ComboboxAction.TypeCharacter: {\n if (!isOpen) openPopover()\n\n clearTimeout(searchTimeoutRef.current)\n searchStringRef.current += e.key\n searchTimeoutRef.current = setTimeout(() => {\n searchStringRef.current = \"\"\n }, 500)\n\n const searchIndex = getIndexByLetter(\n allOptions,\n searchStringRef.current,\n activeIndex\n )\n if (searchIndex >= 0) {\n setActiveIndex(searchIndex)\n }\n break\n }\n case ComboboxAction.ClosePopup:\n closePopover()\n break\n }\n }\n\n const createStableEventTarget = (\n target: HTMLSelectElement,\n valueSnapshot: string\n ) => {\n const proxy = Object.create(target)\n Object.defineProperties(proxy, {\n disabled: {\n configurable: true,\n enumerable: true,\n value: target.disabled,\n },\n form: { configurable: true, enumerable: true, value: target.form },\n name: { configurable: true, enumerable: true, value: target.name },\n type: { configurable: true, enumerable: true, value: target.type },\n value: { configurable: true, enumerable: true, value: valueSnapshot },\n })\n return proxy as HTMLSelectElement\n }\n\n const withSelectTarget = useCallback(\n <\n SourceEvent extends React.SyntheticEvent,\n TargetEvent extends React.SyntheticEvent<HTMLSelectElement>,\n >(\n event: SourceEvent,\n target: HTMLSelectElement,\n currentTarget: HTMLSelectElement = target\n ) => {\n return Object.defineProperties(Object.create(event), {\n currentTarget: { value: currentTarget },\n target: { value: target },\n }) as TargetEvent\n },\n []\n )\n\n const handleHiddenSelectChange = useCallback(\n (event: React.ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return\n\n const valueSnapshot =\n pendingChangeValueRef.current ?? event.currentTarget.value\n pendingChangeValueRef.current = null\n\n const stableEvent = withSelectTarget<\n React.ChangeEvent<HTMLSelectElement>,\n React.ChangeEvent<HTMLSelectElement>\n >(\n event,\n createStableEventTarget(\n event.target as HTMLSelectElement,\n valueSnapshot\n ),\n createStableEventTarget(event.currentTarget, valueSnapshot)\n )\n\n onChange(stableEvent)\n },\n [onChange, withSelectTarget]\n )\n\n const forwardEventToSelect = useCallback(\n <\n ButtonEvent extends React.SyntheticEvent<HTMLButtonElement>,\n SelectEvent extends React.SyntheticEvent<HTMLSelectElement>,\n >(\n event: ButtonEvent,\n handler?: (event: SelectEvent) => void\n ) => {\n if (!handler) return\n\n const hiddenEl = hiddenSelectRef.current\n if (!hiddenEl) return\n\n const stableEvent = withSelectTarget<ButtonEvent, SelectEvent>(\n event,\n hiddenEl\n )\n\n handler(stableEvent)\n },\n [withSelectTarget]\n )\n\n const handleButtonBlur = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.FocusEvent<HTMLButtonElement>,\n React.FocusEvent<HTMLSelectElement>\n >(event, onBlur)\n },\n [forwardEventToSelect, onBlur]\n )\n\n const handleButtonClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.MouseEvent<HTMLButtonElement>,\n React.MouseEvent<HTMLSelectElement>\n >(event, onClick)\n },\n [forwardEventToSelect, onClick]\n )\n\n const handleButtonFocus = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.FocusEvent<HTMLButtonElement>,\n React.FocusEvent<HTMLSelectElement>\n >(event, onFocus)\n },\n [forwardEventToSelect, onFocus]\n )\n\n const renderListOption = (option: SelectOption, index: number) => {\n const { disabled, divider, label, value } = option\n if (divider) return <li key={index} role=\"separator\" />\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keyboard events are handled on the combobox button\n <li\n key={value}\n {...getDataAttributes(option)}\n aria-disabled={disabled || undefined}\n aria-selected={value === selectedValue}\n className={\n value === activeOption?.value\n ? \"tds-select-option--active\"\n : undefined\n }\n id={`${baseId}-option-${value}`}\n onClick={disabled ? undefined : () => commitSelection(value!)}\n role=\"option\"\n >\n {label}\n </li>\n )\n }\n\n return (\n <>\n <button\n ref={resolvedTriggerRef}\n popovertarget={baseId}\n aria-activedescendant={activeOptionId}\n aria-controls={baseId}\n aria-describedby={ariaDescribedBy}\n aria-disabled={disabled ? \"true\" : undefined}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-invalid={invalid ? \"true\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-required={required ? \"true\" : undefined}\n disabled={disabled}\n onBlur={handleButtonBlur}\n onClick={handleButtonClick}\n onFocus={handleButtonFocus}\n onKeyDown={handleKeyDown}\n role=\"combobox\"\n type=\"button\"\n >\n {selectedOption ? selectedOption.label : placeholder}\n </button>\n <div\n ref={popoverRef}\n popover=\"\"\n id={baseId}\n role=\"listbox\"\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid ? \"true\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-required={required ? \"true\" : undefined}\n >\n {renderListSegments(segments, baseId, renderListOption)}\n </div>\n <select\n {...props}\n ref={setHiddenSelectRef}\n aria-hidden\n className=\"tds-select-hidden-select\"\n disabled={disabled}\n id={`${baseId}-control`}\n onChange={handleHiddenSelectChange}\n required={required}\n tabIndex={-1}\n value={selectedValue ?? \"\"}\n >\n <option value=\"\" />\n <SelectOptions items={options} />\n </select>\n </>\n )\n }\n)\n\nSelectPopover.displayName = \"SelectPopover\"\n"],"names":["React"],"mappings":";;;;;;AAsDA,MAAM,KAAK,GAAG,CAAC,EACb,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,KAAK,GAMN,MACCA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,eAAA,EAAmB,QAAQ,IAAI,SAAS,EAAA,iBAAA,EAAmB,EAAE,EAAE,IAAI,EAAC,OAAO,EAAA;AACzE,IAAAA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,cAAc,EAAA;QAC7BA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAO,KAAK,CAAQ,CACjB;IACJ,QAAQ,CACN,CACN;AAED,SAAS,kBAAkB,CACzB,QAAmB,EACnB,MAAc,EACd,UAAoE,EAAA;IAEpE,IAAI,SAAS,GAAG,CAAC;IAEjB,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAI;QAC5C,MAAM,UAAU,GAAG,SAAS;AAC5B,QAAA,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM;AAEnC,QAAA,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE;YAC5B,QACEA,cAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EACJ,GAAG,EAAE,CAAA,EAAG,OAAO,CAAC,KAAK,CAAA,CAAA,EAAI,YAAY,CAAA,CAAE,EACvC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,EAAE,EAAE,CAAA,EAAG,MAAM,CAAA,OAAA,EAAU,YAAY,CAAA,CAAE,EACrC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAA,EAEnB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAA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AAC,EAAE,EAAA,CAAG;YACnBA,cAAA,CAAA,aAAA,CAAC,aAAa,IAAC,KAAK,EAAE,OAAO,EAAA,CAAI,CAC1B,CACR;AAEP,CAAC;AAGH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { add as $735220c2d4774dd3$export$e16d8520af44a096, subtract as $735220c2d4774dd3$export$4e2d2ead65e5f7e3, set as $735220c2d4774dd3$export$adaa4cf7ef1b65be, cycleDate as $735220c2d4774dd3$export$d52ced6badfb9a4c, constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2, setTime as $735220c2d4774dd3$export$e5d5e1c1822b6e56, cycleTime as $735220c2d4774dd3$export$dd02b3e0007dfe28 } from './manipulation.js';
|
|
1
|
+
import { add as $735220c2d4774dd3$export$e16d8520af44a096, subtract as $735220c2d4774dd3$export$4e2d2ead65e5f7e3, set as $735220c2d4774dd3$export$adaa4cf7ef1b65be, cycleDate as $735220c2d4774dd3$export$d52ced6badfb9a4c, constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2, addZoned as $735220c2d4774dd3$export$96b1d28349274637, subtractZoned as $735220c2d4774dd3$export$6814caac34ca03c7, setZoned as $735220c2d4774dd3$export$31b5430eb18be4f8, cycleZoned as $735220c2d4774dd3$export$9a297d111fc86b79, setTime as $735220c2d4774dd3$export$e5d5e1c1822b6e56, cycleTime as $735220c2d4774dd3$export$dd02b3e0007dfe28 } from './manipulation.js';
|
|
2
2
|
import { compareDate as $14e0f24ef4ac5c92$export$68781ddf31c0090f, compareTime as $14e0f24ef4ac5c92$export$c19a80a9721b80f6 } from './queries.js';
|
|
3
|
-
import { dateToString as $fae977aafc393c5c$export$60dfd74aa96791bd, dateTimeToString as $fae977aafc393c5c$export$4223de14708adc63 } from './string.js';
|
|
3
|
+
import { dateToString as $fae977aafc393c5c$export$60dfd74aa96791bd, zonedDateTimeToString as $fae977aafc393c5c$export$bf79f1ebf4b18792, dateTimeToString as $fae977aafc393c5c$export$4223de14708adc63 } from './string.js';
|
|
4
4
|
import { GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec } from './GregorianCalendar.js';
|
|
5
|
-
import { toDate as $11d87f3f76e88657$export$e67a095c620b86fe, toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484 } from './conversion.js';
|
|
5
|
+
import { toDate as $11d87f3f76e88657$export$e67a095c620b86fe, zonedToDate as $11d87f3f76e88657$export$83aac07b4c37b25, toZoned as $11d87f3f76e88657$export$84c95a83c799e074, toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484 } from './conversion.js';
|
|
6
6
|
import { _ as _class_private_field_init } from '../../../@swc/helpers/esm/_class_private_field_init.js';
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -148,6 +148,64 @@ class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
|
|
|
148
148
|
($735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
+
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
152
|
+
// @ts-ignore
|
|
153
|
+
$35ea8db9cb2ccb90$var$_type3 = /*#__PURE__*/ new WeakMap();
|
|
154
|
+
class $35ea8db9cb2ccb90$export$d3b7288e7994edea {
|
|
155
|
+
/** Returns a copy of this date. */ copy() {
|
|
156
|
+
if (this.era) return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
157
|
+
else return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
158
|
+
}
|
|
159
|
+
/** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {
|
|
160
|
+
return ($735220c2d4774dd3$export$96b1d28349274637)(this, duration);
|
|
161
|
+
}
|
|
162
|
+
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {
|
|
163
|
+
return ($735220c2d4774dd3$export$6814caac34ca03c7)(this, duration);
|
|
164
|
+
}
|
|
165
|
+
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {
|
|
166
|
+
return ($735220c2d4774dd3$export$31b5430eb18be4f8)(this, fields, disambiguation);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
170
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
171
|
+
*/ cycle(field, amount, options) {
|
|
172
|
+
return ($735220c2d4774dd3$export$9a297d111fc86b79)(this, field, amount, options);
|
|
173
|
+
}
|
|
174
|
+
/** Converts the date to a native JavaScript Date object. */ toDate() {
|
|
175
|
+
return ($11d87f3f76e88657$export$83aac07b4c37b25)(this);
|
|
176
|
+
}
|
|
177
|
+
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {
|
|
178
|
+
return ($fae977aafc393c5c$export$bf79f1ebf4b18792)(this);
|
|
179
|
+
}
|
|
180
|
+
/** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {
|
|
181
|
+
return this.toDate().toISOString();
|
|
182
|
+
}
|
|
183
|
+
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
|
|
184
|
+
// TODO: Is this a bad idea??
|
|
185
|
+
return this.toDate().getTime() - ($11d87f3f76e88657$export$84c95a83c799e074)(b, this.timeZone).toDate().getTime();
|
|
186
|
+
}
|
|
187
|
+
constructor(...args){
|
|
188
|
+
(_class_private_field_init)(this, $35ea8db9cb2ccb90$var$_type3, {
|
|
189
|
+
writable: true,
|
|
190
|
+
value: void 0
|
|
191
|
+
});
|
|
192
|
+
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
193
|
+
let timeZone = args.shift();
|
|
194
|
+
let offset = args.shift();
|
|
195
|
+
this.calendar = calendar;
|
|
196
|
+
this.era = era;
|
|
197
|
+
this.year = year;
|
|
198
|
+
this.month = month;
|
|
199
|
+
this.day = day;
|
|
200
|
+
this.timeZone = timeZone;
|
|
201
|
+
this.offset = offset;
|
|
202
|
+
this.hour = args.shift() || 0;
|
|
203
|
+
this.minute = args.shift() || 0;
|
|
204
|
+
this.second = args.shift() || 0;
|
|
205
|
+
this.millisecond = args.shift() || 0;
|
|
206
|
+
($735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
151
209
|
|
|
152
|
-
export { $35ea8db9cb2ccb90$export$99faa760c7908e4f as CalendarDate, $35ea8db9cb2ccb90$export$ca871e8dbb80966f as CalendarDateTime };
|
|
210
|
+
export { $35ea8db9cb2ccb90$export$99faa760c7908e4f as CalendarDate, $35ea8db9cb2ccb90$export$ca871e8dbb80966f as CalendarDateTime, $35ea8db9cb2ccb90$export$d3b7288e7994edea as ZonedDateTime };
|
|
153
211
|
//# sourceMappingURL=CalendarDate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarDate.js","sources":["../../../../../../../node_modules/@internationalized/date/dist/CalendarDate.mjs"],"sourcesContent":["import {add as $735220c2d4774dd3$export$e16d8520af44a096, addTime as $735220c2d4774dd3$export$7ed87b6bc2506470, addZoned as $735220c2d4774dd3$export$96b1d28349274637, constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2, constrainTime as $735220c2d4774dd3$export$7555de1e070510cb, cycleDate as $735220c2d4774dd3$export$d52ced6badfb9a4c, cycleTime as $735220c2d4774dd3$export$dd02b3e0007dfe28, cycleZoned as $735220c2d4774dd3$export$9a297d111fc86b79, set as $735220c2d4774dd3$export$adaa4cf7ef1b65be, setTime as $735220c2d4774dd3$export$e5d5e1c1822b6e56, setZoned as $735220c2d4774dd3$export$31b5430eb18be4f8, subtract as $735220c2d4774dd3$export$4e2d2ead65e5f7e3, subtractTime as $735220c2d4774dd3$export$fe34d3a381cd7501, subtractZoned as $735220c2d4774dd3$export$6814caac34ca03c7} from \"./manipulation.mjs\";\nimport {compareDate as $14e0f24ef4ac5c92$export$68781ddf31c0090f, compareTime as $14e0f24ef4ac5c92$export$c19a80a9721b80f6} from \"./queries.mjs\";\nimport {dateTimeToString as $fae977aafc393c5c$export$4223de14708adc63, dateToString as $fae977aafc393c5c$export$60dfd74aa96791bd, timeToString as $fae977aafc393c5c$export$f59dee82248f5ad4, zonedDateTimeToString as $fae977aafc393c5c$export$bf79f1ebf4b18792} from \"./string.mjs\";\nimport {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from \"./GregorianCalendar.mjs\";\nimport {toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, toDate as $11d87f3f76e88657$export$e67a095c620b86fe, toZoned as $11d87f3f76e88657$export$84c95a83c799e074, zonedToDate as $11d87f3f76e88657$export$83aac07b4c37b25} from \"./conversion.mjs\";\nimport {_ as $aksy1$_} from \"@swc/helpers/_/_class_private_field_init\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\nfunction $35ea8db9cb2ccb90$var$shiftArgs(args) {\n let calendar = typeof args[0] === 'object' ? args.shift() : new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)();\n let era;\n if (typeof args[0] === 'string') era = args.shift();\n else {\n let eras = calendar.getEras();\n era = eras[eras.length - 1];\n }\n let year = args.shift();\n let month = args.shift();\n let day = args.shift();\n return [\n calendar,\n era,\n year,\n month,\n day\n ];\n}\nvar // This prevents TypeScript from allowing other types with the same fields to match.\n// i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.\n// If that behavior is desired, use the AnyCalendarDate interface instead.\n// @ts-ignore\n$35ea8db9cb2ccb90$var$_type = /*#__PURE__*/ new WeakMap();\nclass $35ea8db9cb2ccb90$export$99faa760c7908e4f {\n /** Returns a copy of this date. */ copy() {\n if (this.era) return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);\n else return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);\n }\n /** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {\n return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);\n }\n /** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {\n return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);\n }\n /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {\n return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)(this, fields);\n }\n /**\n * Returns a new `CalendarDate` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);\n }\n /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {\n return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone);\n }\n /** Converts the date to an ISO 8601 formatted string. */ toString() {\n return (0, $fae977aafc393c5c$export$60dfd74aa96791bd)(this);\n }\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {\n return (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);\n }\n constructor(...args){\n (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type, {\n writable: true,\n value: void 0\n });\n let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);\n }\n}\nvar // This prevents TypeScript from allowing other types with the same fields to match.\n// @ts-ignore\n$35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();\nclass $35ea8db9cb2ccb90$export$680ea196effce5f {\n /** Returns a copy of this time. */ copy() {\n return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);\n }\n /** Returns a new `Time` with the given duration added to it. */ add(duration) {\n return (0, $735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);\n }\n /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {\n return (0, $735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);\n }\n /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {\n return (0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);\n }\n /**\n * Returns a new `Time` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);\n }\n /** Converts the time to an ISO 8601 formatted string. */ toString() {\n return (0, $fae977aafc393c5c$export$f59dee82248f5ad4)(this);\n }\n /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {\n return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);\n }\n constructor(hour = 0, minute = 0, second = 0, millisecond = 0){\n (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type1, {\n writable: true,\n value: void 0\n });\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond;\n (0, $735220c2d4774dd3$export$7555de1e070510cb)(this);\n }\n}\nvar // This prevents TypeScript from allowing other types with the same fields to match.\n// @ts-ignore\n$35ea8db9cb2ccb90$var$_type2 = /*#__PURE__*/ new WeakMap();\nclass $35ea8db9cb2ccb90$export$ca871e8dbb80966f {\n /** Returns a copy of this date. */ copy() {\n if (this.era) return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n else return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n }\n /** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {\n return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);\n }\n /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {\n return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);\n }\n /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {\n return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)((0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields), fields);\n }\n /**\n * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n switch(field){\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);\n default:\n return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);\n }\n }\n /** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {\n return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone, disambiguation);\n }\n /** Converts the date to an ISO 8601 formatted string. */ toString() {\n return (0, $fae977aafc393c5c$export$4223de14708adc63)(this);\n }\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {\n let res = (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);\n if (res === 0) return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, (0, $11d87f3f76e88657$export$b21e0b124e224484)(b));\n return res;\n }\n constructor(...args){\n (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type2, {\n writable: true,\n value: void 0\n });\n let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);\n }\n}\nvar // This prevents TypeScript from allowing other types with the same fields to match.\n// @ts-ignore\n$35ea8db9cb2ccb90$var$_type3 = /*#__PURE__*/ new WeakMap();\nclass $35ea8db9cb2ccb90$export$d3b7288e7994edea {\n /** Returns a copy of this date. */ copy() {\n if (this.era) return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n else return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n }\n /** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {\n return (0, $735220c2d4774dd3$export$96b1d28349274637)(this, duration);\n }\n /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {\n return (0, $735220c2d4774dd3$export$6814caac34ca03c7)(this, duration);\n }\n /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {\n return (0, $735220c2d4774dd3$export$31b5430eb18be4f8)(this, fields, disambiguation);\n }\n /**\n * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n return (0, $735220c2d4774dd3$export$9a297d111fc86b79)(this, field, amount, options);\n }\n /** Converts the date to a native JavaScript Date object. */ toDate() {\n return (0, $11d87f3f76e88657$export$83aac07b4c37b25)(this);\n }\n /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {\n return (0, $fae977aafc393c5c$export$bf79f1ebf4b18792)(this);\n }\n /** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {\n return this.toDate().toISOString();\n }\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {\n // TODO: Is this a bad idea??\n return this.toDate().getTime() - (0, $11d87f3f76e88657$export$84c95a83c799e074)(b, this.timeZone).toDate().getTime();\n }\n constructor(...args){\n (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type3, {\n writable: true,\n value: void 0\n });\n let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);\n let timeZone = args.shift();\n let offset = args.shift();\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.timeZone = timeZone;\n this.offset = offset;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);\n }\n}\n\n\nexport {$35ea8db9cb2ccb90$export$99faa760c7908e4f as CalendarDate, $35ea8db9cb2ccb90$export$680ea196effce5f as Time, $35ea8db9cb2ccb90$export$ca871e8dbb80966f as CalendarDateTime, $35ea8db9cb2ccb90$export$d3b7288e7994edea as ZonedDateTime};\n//# sourceMappingURL=CalendarDate.module.js.map\n"],"names":["$aksy1$_"],"mappings":";;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA,SAAS,+BAA+B,CAAC,IAAI,EAAE;AAC/C,IAAI,IAAI,QAAQ,GAAG,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,KAAQ,yCAAyC,GAAG;AACpH,IAAI,IAAI,GAAG;AACX,IAAI,IAAI,OAAO,IAAI,CAA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AAC;AACrC,QAAQ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;AACvC,QAAQ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;AACvC,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;AAC5C,QAAQ,CAAI,yCAAyC,EAAE,IAAI,CAAC;AAC5D,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"CalendarDate.js","sources":["../../../../../../../node_modules/@internationalized/date/dist/CalendarDate.mjs"],"sourcesContent":["import {add as $735220c2d4774dd3$export$e16d8520af44a096, addTime as $735220c2d4774dd3$export$7ed87b6bc2506470, addZoned as $735220c2d4774dd3$export$96b1d28349274637, constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2, constrainTime as $735220c2d4774dd3$export$7555de1e070510cb, cycleDate as $735220c2d4774dd3$export$d52ced6badfb9a4c, cycleTime as $735220c2d4774dd3$export$dd02b3e0007dfe28, cycleZoned as $735220c2d4774dd3$export$9a297d111fc86b79, set as $735220c2d4774dd3$export$adaa4cf7ef1b65be, setTime as $735220c2d4774dd3$export$e5d5e1c1822b6e56, setZoned as $735220c2d4774dd3$export$31b5430eb18be4f8, subtract as $735220c2d4774dd3$export$4e2d2ead65e5f7e3, subtractTime as $735220c2d4774dd3$export$fe34d3a381cd7501, subtractZoned as $735220c2d4774dd3$export$6814caac34ca03c7} from \"./manipulation.mjs\";\nimport {compareDate as $14e0f24ef4ac5c92$export$68781ddf31c0090f, compareTime as $14e0f24ef4ac5c92$export$c19a80a9721b80f6} from \"./queries.mjs\";\nimport {dateTimeToString as $fae977aafc393c5c$export$4223de14708adc63, dateToString as $fae977aafc393c5c$export$60dfd74aa96791bd, timeToString as $fae977aafc393c5c$export$f59dee82248f5ad4, zonedDateTimeToString as $fae977aafc393c5c$export$bf79f1ebf4b18792} from \"./string.mjs\";\nimport {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from \"./GregorianCalendar.mjs\";\nimport {toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, toDate as $11d87f3f76e88657$export$e67a095c620b86fe, toZoned as $11d87f3f76e88657$export$84c95a83c799e074, zonedToDate as $11d87f3f76e88657$export$83aac07b4c37b25} from \"./conversion.mjs\";\nimport {_ as $aksy1$_} from \"@swc/helpers/_/_class_private_field_init\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\nfunction $35ea8db9cb2ccb90$var$shiftArgs(args) {\n let calendar = typeof args[0] === 'object' ? args.shift() : new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)();\n let era;\n if (typeof args[0] === 'string') era = args.shift();\n else {\n let eras = calendar.getEras();\n era = eras[eras.length - 1];\n }\n let year = args.shift();\n let month = args.shift();\n let day = args.shift();\n return [\n calendar,\n era,\n year,\n month,\n day\n ];\n}\nvar // This prevents TypeScript from allowing other types with the same fields to match.\n// i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.\n// If that behavior is desired, use the AnyCalendarDate interface instead.\n// @ts-ignore\n$35ea8db9cb2ccb90$var$_type = /*#__PURE__*/ new WeakMap();\nclass $35ea8db9cb2ccb90$export$99faa760c7908e4f {\n /** Returns a copy of this date. */ copy() {\n if (this.era) return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);\n else return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);\n }\n /** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {\n return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);\n }\n /** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {\n return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);\n }\n /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {\n return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)(this, fields);\n }\n /**\n * Returns a new `CalendarDate` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);\n }\n /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {\n return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone);\n }\n /** Converts the date to an ISO 8601 formatted string. */ toString() {\n return (0, $fae977aafc393c5c$export$60dfd74aa96791bd)(this);\n }\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {\n return (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);\n }\n constructor(...args){\n (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type, {\n writable: true,\n value: void 0\n });\n let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);\n }\n}\nvar // This prevents TypeScript from allowing other types with the same fields to match.\n// @ts-ignore\n$35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();\nclass $35ea8db9cb2ccb90$export$680ea196effce5f {\n /** Returns a copy of this time. */ copy() {\n return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);\n }\n /** Returns a new `Time` with the given duration added to it. */ add(duration) {\n return (0, $735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);\n }\n /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {\n return (0, $735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);\n }\n /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {\n return (0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);\n }\n /**\n * Returns a new `Time` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);\n }\n /** Converts the time to an ISO 8601 formatted string. */ toString() {\n return (0, $fae977aafc393c5c$export$f59dee82248f5ad4)(this);\n }\n /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {\n return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);\n }\n constructor(hour = 0, minute = 0, second = 0, millisecond = 0){\n (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type1, {\n writable: true,\n value: void 0\n });\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond;\n (0, $735220c2d4774dd3$export$7555de1e070510cb)(this);\n }\n}\nvar // This prevents TypeScript from allowing other types with the same fields to match.\n// @ts-ignore\n$35ea8db9cb2ccb90$var$_type2 = /*#__PURE__*/ new WeakMap();\nclass $35ea8db9cb2ccb90$export$ca871e8dbb80966f {\n /** Returns a copy of this date. */ copy() {\n if (this.era) return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n else return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n }\n /** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {\n return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);\n }\n /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {\n return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);\n }\n /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {\n return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)((0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields), fields);\n }\n /**\n * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n switch(field){\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);\n default:\n return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);\n }\n }\n /** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {\n return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone, disambiguation);\n }\n /** Converts the date to an ISO 8601 formatted string. */ toString() {\n return (0, $fae977aafc393c5c$export$4223de14708adc63)(this);\n }\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {\n let res = (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);\n if (res === 0) return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, (0, $11d87f3f76e88657$export$b21e0b124e224484)(b));\n return res;\n }\n constructor(...args){\n (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type2, {\n writable: true,\n value: void 0\n });\n let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);\n }\n}\nvar // This prevents TypeScript from allowing other types with the same fields to match.\n// @ts-ignore\n$35ea8db9cb2ccb90$var$_type3 = /*#__PURE__*/ new WeakMap();\nclass $35ea8db9cb2ccb90$export$d3b7288e7994edea {\n /** Returns a copy of this date. */ copy() {\n if (this.era) return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n else return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n }\n /** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {\n return (0, $735220c2d4774dd3$export$96b1d28349274637)(this, duration);\n }\n /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {\n return (0, $735220c2d4774dd3$export$6814caac34ca03c7)(this, duration);\n }\n /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {\n return (0, $735220c2d4774dd3$export$31b5430eb18be4f8)(this, fields, disambiguation);\n }\n /**\n * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */ cycle(field, amount, options) {\n return (0, $735220c2d4774dd3$export$9a297d111fc86b79)(this, field, amount, options);\n }\n /** Converts the date to a native JavaScript Date object. */ toDate() {\n return (0, $11d87f3f76e88657$export$83aac07b4c37b25)(this);\n }\n /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {\n return (0, $fae977aafc393c5c$export$bf79f1ebf4b18792)(this);\n }\n /** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {\n return this.toDate().toISOString();\n }\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {\n // TODO: Is this a bad idea??\n return this.toDate().getTime() - (0, $11d87f3f76e88657$export$84c95a83c799e074)(b, this.timeZone).toDate().getTime();\n }\n constructor(...args){\n (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type3, {\n writable: true,\n value: void 0\n });\n let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);\n let timeZone = args.shift();\n let offset = args.shift();\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.timeZone = timeZone;\n this.offset = offset;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);\n }\n}\n\n\nexport {$35ea8db9cb2ccb90$export$99faa760c7908e4f as CalendarDate, $35ea8db9cb2ccb90$export$680ea196effce5f as Time, $35ea8db9cb2ccb90$export$ca871e8dbb80966f as CalendarDateTime, $35ea8db9cb2ccb90$export$d3b7288e7994edea as ZonedDateTime};\n//# sourceMappingURL=CalendarDate.module.js.map\n"],"names":["$aksy1$_"],"mappings":";;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA,SAAS,+BAA+B,CAAC,IAAI,EAAE;AAC/C,IAAI,IAAI,QAAQ,GAAG,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,KAAQ,yCAAyC,GAAG;AACpH,IAAI,IAAI,GAAG;AACX,IAAI,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE;AACvD,SAAS;AACT,QAAQ,IAAI,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE;AACrC,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;AACnC,IAAI;AACJ,IAAI,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE;AAC3B,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAC5B,IAAI,IAAI,GAAG,GAAG,IAAI,CA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,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;AACrC,QAAQ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;AACvC,QAAQ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;AACvC,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;AAC5C,QAAQ,CAAI,yCAAyC,EAAE,IAAI,CAAC;AAC5D,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f } from './CalendarDate.js';
|
|
1
|
+
import { CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f } from './CalendarDate.js';
|
|
2
2
|
import { constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2 } from './manipulation.js';
|
|
3
3
|
import { getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec } from './GregorianCalendar.js';
|
|
4
4
|
import { getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, isLocalTimeZoneOverridden as $14e0f24ef4ac5c92$export$6ab69b273755230b, isEqualCalendar as $14e0f24ef4ac5c92$export$dbc69fd56b53d5e } from './queries.js';
|
|
@@ -132,6 +132,21 @@ function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguatio
|
|
|
132
132
|
function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {
|
|
133
133
|
return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
|
|
134
134
|
}
|
|
135
|
+
function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
|
|
136
|
+
let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);
|
|
137
|
+
let date = new Date(ms + offset);
|
|
138
|
+
let year = date.getUTCFullYear();
|
|
139
|
+
let month = date.getUTCMonth() + 1;
|
|
140
|
+
let day = date.getUTCDate();
|
|
141
|
+
let hour = date.getUTCHours();
|
|
142
|
+
let minute = date.getUTCMinutes();
|
|
143
|
+
let second = date.getUTCSeconds();
|
|
144
|
+
let millisecond = date.getUTCMilliseconds();
|
|
145
|
+
return new ($35ea8db9cb2ccb90$export$d3b7288e7994edea)(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);
|
|
146
|
+
}
|
|
147
|
+
function $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {
|
|
148
|
+
return new ($35ea8db9cb2ccb90$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
|
|
149
|
+
}
|
|
135
150
|
function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
|
|
136
151
|
let hour = 0, minute = 0, second = 0, millisecond = 0;
|
|
137
152
|
if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
|
|
@@ -151,6 +166,22 @@ function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
|
|
|
151
166
|
($735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);
|
|
152
167
|
return copy;
|
|
153
168
|
}
|
|
169
|
+
function $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {
|
|
170
|
+
if (date instanceof ($35ea8db9cb2ccb90$export$d3b7288e7994edea)) {
|
|
171
|
+
if (date.timeZone === timeZone) return date;
|
|
172
|
+
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
173
|
+
}
|
|
174
|
+
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);
|
|
175
|
+
return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);
|
|
176
|
+
}
|
|
177
|
+
function $11d87f3f76e88657$export$83aac07b4c37b25(date) {
|
|
178
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
179
|
+
return new Date(ms);
|
|
180
|
+
}
|
|
181
|
+
function $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {
|
|
182
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
183
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
|
|
184
|
+
}
|
|
154
185
|
|
|
155
|
-
export { $11d87f3f76e88657$export$bd4fb2bc8bb06fb as epochFromDate, $11d87f3f76e88657$export$59c99f3515d3493f as getTimeZoneOffset, $11d87f3f76e88657$export$5107c82f94518f5c as toAbsolute, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$e67a095c620b86fe as toDate };
|
|
186
|
+
export { $11d87f3f76e88657$export$bd4fb2bc8bb06fb as epochFromDate, $11d87f3f76e88657$export$1b96692a1ba042ac as fromAbsolute, $11d87f3f76e88657$export$59c99f3515d3493f as getTimeZoneOffset, $11d87f3f76e88657$export$5107c82f94518f5c as toAbsolute, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$93522d1a439f3617 as toCalendarDate, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$e67a095c620b86fe as toDate, $11d87f3f76e88657$export$538b00033cc11c75 as toTimeZone, $11d87f3f76e88657$export$84c95a83c799e074 as toZoned, $11d87f3f76e88657$export$83aac07b4c37b25 as zonedToDate };
|
|
156
187
|
//# sourceMappingURL=conversion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversion.js","sources":["../../../../../../../node_modules/@internationalized/date/dist/conversion.mjs"],"sourcesContent":["import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from \"./CalendarDate.mjs\";\nimport {constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2} from \"./manipulation.mjs\";\nimport {getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from \"./GregorianCalendar.mjs\";\nimport {getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, isEqualCalendar as $14e0f24ef4ac5c92$export$dbc69fd56b53d5e, isLocalTimeZoneOverridden as $14e0f24ef4ac5c92$export$6ab69b273755230b} from \"./queries.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\n\n\n\nfunction $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {\n date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);\n return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n}\nfunction $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {\n // Note: Date.UTC() interprets one and two-digit years as being in the\n // 20th century, so don't use it\n let date = new Date();\n date.setUTCHours(hour, minute, second, millisecond);\n date.setUTCFullYear(year, month - 1, day);\n return date.getTime();\n}\nfunction $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {\n // Fast path for UTC.\n if (timeZone === 'UTC') return 0;\n // Fast path: for local timezone after 1970, use native Date.\n // Skip this fast path if the local timezone was explicitly overridden via setLocalTimeZone,\n // since native Date always uses the browser's timezone, not the overridden one.\n if (ms > 0 && timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && !(0, $14e0f24ef4ac5c92$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -60000;\n let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);\n let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);\n return utc - Math.floor(ms / 1000) * 1000;\n}\nconst $11d87f3f76e88657$var$formattersByTimeZone = new Map();\nfunction $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {\n let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-US', {\n timeZone: timeZone,\n hour12: false,\n era: 'short',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric'\n });\n $11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);\n }\n let parts = formatter.formatToParts(new Date(ms));\n let namedParts = {};\n for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;\n return {\n // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253\n year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,\n month: +namedParts.month,\n day: +namedParts.day,\n hour: namedParts.hour === '24' ? 0 : +namedParts.hour,\n minute: +namedParts.minute,\n second: +namedParts.second\n };\n}\nconst $11d87f3f76e88657$var$DAYMILLIS = 86400000;\nfunction $11d87f3f76e88657$export$136f38efe7caf549(date, timeZone) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date);\n let earlier = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let later = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n return $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later);\n}\nfunction $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {\n let found = earlier === later ? [\n earlier\n ] : [\n earlier,\n later\n ];\n return found.filter((absolute)=>$11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));\n}\nfunction $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {\n let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);\n return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;\n}\nfunction $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {\n let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);\n // Fast path: if the time zone is UTC, use native Date.\n if (timeZone === 'UTC') return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);\n // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.\n // Skip this fast path if the local timezone was explicitly overridden via setLocalTimeZone,\n // since native Date always uses the browser's timezone, not the overridden one.\n if (timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === 'compatible' && !(0, $14e0f24ef4ac5c92$export$6ab69b273755230b)()) {\n dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n // Don't use Date constructor here because two-digit years are interpreted in the 20th century.\n let date = new Date();\n let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);\n date.setFullYear(year, dateTime.month - 1, dateTime.day);\n date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n return date.getTime();\n }\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);\n let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);\n if (valid.length === 1) return valid[0];\n if (valid.length > 1) switch(disambiguation){\n // 'compatible' means 'earlier' for \"fall back\" transitions\n case 'compatible':\n case 'earlier':\n return valid[0];\n case 'later':\n return valid[valid.length - 1];\n case 'reject':\n throw new RangeError('Multiple possible absolute times found');\n }\n switch(disambiguation){\n case 'earlier':\n return Math.min(ms - offsetBefore, ms - offsetAfter);\n // 'compatible' means 'later' for \"spring forward\" transitions\n case 'compatible':\n case 'later':\n return Math.max(ms - offsetBefore, ms - offsetAfter);\n case 'reject':\n throw new RangeError('No such absolute time found');\n }\n}\nfunction $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {\n return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));\n}\nfunction $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {\n let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);\n let date = new Date(ms + offset);\n let year = date.getUTCFullYear();\n let month = date.getUTCMonth() + 1;\n let day = date.getUTCDate();\n let hour = date.getUTCHours();\n let minute = date.getUTCMinutes();\n let second = date.getUTCSeconds();\n let millisecond = date.getUTCMilliseconds();\n return new (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);\n}\nfunction $11d87f3f76e88657$export$e57ff100d91bd4b9(date, timeZone) {\n return $11d87f3f76e88657$export$1b96692a1ba042ac(date.getTime(), timeZone);\n}\nfunction $11d87f3f76e88657$export$d7f92bcd3596b086(date) {\n return $11d87f3f76e88657$export$e57ff100d91bd4b9(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());\n}\nfunction $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {\n return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);\n}\nfunction $11d87f3f76e88657$export$6f4d78149f3f53ac(date) {\n return {\n era: date.era,\n year: date.year,\n month: date.month,\n day: date.day\n };\n}\nfunction $11d87f3f76e88657$export$4d0393e732857be5(date) {\n return {\n hour: date.hour,\n minute: date.minute,\n second: date.second,\n millisecond: date.millisecond\n };\n}\nfunction $11d87f3f76e88657$export$b21e0b124e224484(date, time) {\n let hour = 0, minute = 0, second = 0, millisecond = 0;\n if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);\n else if ('hour' in date && !time) return date;\n if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);\n return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);\n}\nfunction $11d87f3f76e88657$export$d33f79e3ffc3dc83(dateTime) {\n return new (0, $35ea8db9cb2ccb90$export$680ea196effce5f)(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n}\nfunction $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {\n if ((0, $14e0f24ef4ac5c92$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;\n let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));\n let copy = date.copy();\n copy.calendar = calendar;\n copy.era = calendarDate.era;\n copy.year = calendarDate.year;\n copy.month = calendarDate.month;\n copy.day = calendarDate.day;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);\n return copy;\n}\nfunction $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {\n if (date instanceof (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)) {\n if (date.timeZone === timeZone) return date;\n return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);\n }\n let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);\n return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);\n}\nfunction $11d87f3f76e88657$export$83aac07b4c37b25(date) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;\n return new Date(ms);\n}\nfunction $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;\n return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);\n}\nfunction $11d87f3f76e88657$export$d9b67bc93c097491(date) {\n return $11d87f3f76e88657$export$538b00033cc11c75(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());\n}\n\n\nexport {$11d87f3f76e88657$export$bd4fb2bc8bb06fb as epochFromDate, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$59c99f3515d3493f as getTimeZoneOffset, $11d87f3f76e88657$export$136f38efe7caf549 as possibleAbsolutes, $11d87f3f76e88657$export$5107c82f94518f5c as toAbsolute, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$e67a095c620b86fe as toDate, $11d87f3f76e88657$export$1b96692a1ba042ac as fromAbsolute, $11d87f3f76e88657$export$e57ff100d91bd4b9 as fromDate, $11d87f3f76e88657$export$d7f92bcd3596b086 as fromDateToLocal, $11d87f3f76e88657$export$93522d1a439f3617 as toCalendarDate, $11d87f3f76e88657$export$6f4d78149f3f53ac as toDateFields, $11d87f3f76e88657$export$4d0393e732857be5 as toTimeFields, $11d87f3f76e88657$export$d33f79e3ffc3dc83 as toTime, $11d87f3f76e88657$export$84c95a83c799e074 as toZoned, $11d87f3f76e88657$export$538b00033cc11c75 as toTimeZone, $11d87f3f76e88657$export$83aac07b4c37b25 as zonedToDate, $11d87f3f76e88657$export$d9b67bc93c097491 as toLocalTimeZone};\n//# sourceMappingURL=conversion.module.js.map\n"],"names":[],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAKA,SAAS,wCAAwC,CAAC,IAAI,EAAE;AACxD,IAAI,IAAI,GAAG,yCAAyC,CAAC,IAAI,EAAE,KAAQ,yCAAyC,GAAG,CAAC;AAChH,IAAI,IAAI,IAAI,GAAG,CAAI,yCAAyC,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC;AAClF,IAAI,OAAO,oCAAoC,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC;AAClI;AACA,SAAS,oCAAoC,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE;AACnG;AACA;AACA,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE;AACzB,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC;AACvD,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC;AAC7C,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE;AACzB;AACA,SAAS,yCAAyC,CAAC,EAAE,EAAE,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I,CAAC,CAAC;AAC9E,IAAI,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;AAC1B,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ;AAC5B,IAAI,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC,GAAG;AAC/B,IAAI,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI;AACjC,IAAI,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK;AACnC,IAAI,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC,GAAG;AAC/B,IAAI,CAAI,yCAAyC,EAAE,IAAI,CAAC;AACxD,IAAI,OAAO,IAAI;AACf;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"conversion.js","sources":["../../../../../../../node_modules/@internationalized/date/dist/conversion.mjs"],"sourcesContent":["import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from \"./CalendarDate.mjs\";\nimport {constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2} from \"./manipulation.mjs\";\nimport {getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from \"./GregorianCalendar.mjs\";\nimport {getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, isEqualCalendar as $14e0f24ef4ac5c92$export$dbc69fd56b53d5e, isLocalTimeZoneOverridden as $14e0f24ef4ac5c92$export$6ab69b273755230b} from \"./queries.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\n\n\n\nfunction $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {\n date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);\n return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n}\nfunction $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {\n // Note: Date.UTC() interprets one and two-digit years as being in the\n // 20th century, so don't use it\n let date = new Date();\n date.setUTCHours(hour, minute, second, millisecond);\n date.setUTCFullYear(year, month - 1, day);\n return date.getTime();\n}\nfunction $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {\n // Fast path for UTC.\n if (timeZone === 'UTC') return 0;\n // Fast path: for local timezone after 1970, use native Date.\n // Skip this fast path if the local timezone was explicitly overridden via setLocalTimeZone,\n // since native Date always uses the browser's timezone, not the overridden one.\n if (ms > 0 && timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && !(0, $14e0f24ef4ac5c92$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -60000;\n let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);\n let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);\n return utc - Math.floor(ms / 1000) * 1000;\n}\nconst $11d87f3f76e88657$var$formattersByTimeZone = new Map();\nfunction $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {\n let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-US', {\n timeZone: timeZone,\n hour12: false,\n era: 'short',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric'\n });\n $11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);\n }\n let parts = formatter.formatToParts(new Date(ms));\n let namedParts = {};\n for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;\n return {\n // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253\n year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,\n month: +namedParts.month,\n day: +namedParts.day,\n hour: namedParts.hour === '24' ? 0 : +namedParts.hour,\n minute: +namedParts.minute,\n second: +namedParts.second\n };\n}\nconst $11d87f3f76e88657$var$DAYMILLIS = 86400000;\nfunction $11d87f3f76e88657$export$136f38efe7caf549(date, timeZone) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date);\n let earlier = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let later = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n return $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later);\n}\nfunction $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {\n let found = earlier === later ? [\n earlier\n ] : [\n earlier,\n later\n ];\n return found.filter((absolute)=>$11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));\n}\nfunction $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {\n let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);\n return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;\n}\nfunction $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {\n let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);\n // Fast path: if the time zone is UTC, use native Date.\n if (timeZone === 'UTC') return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);\n // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.\n // Skip this fast path if the local timezone was explicitly overridden via setLocalTimeZone,\n // since native Date always uses the browser's timezone, not the overridden one.\n if (timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === 'compatible' && !(0, $14e0f24ef4ac5c92$export$6ab69b273755230b)()) {\n dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n // Don't use Date constructor here because two-digit years are interpreted in the 20th century.\n let date = new Date();\n let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);\n date.setFullYear(year, dateTime.month - 1, dateTime.day);\n date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n return date.getTime();\n }\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);\n let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);\n if (valid.length === 1) return valid[0];\n if (valid.length > 1) switch(disambiguation){\n // 'compatible' means 'earlier' for \"fall back\" transitions\n case 'compatible':\n case 'earlier':\n return valid[0];\n case 'later':\n return valid[valid.length - 1];\n case 'reject':\n throw new RangeError('Multiple possible absolute times found');\n }\n switch(disambiguation){\n case 'earlier':\n return Math.min(ms - offsetBefore, ms - offsetAfter);\n // 'compatible' means 'later' for \"spring forward\" transitions\n case 'compatible':\n case 'later':\n return Math.max(ms - offsetBefore, ms - offsetAfter);\n case 'reject':\n throw new RangeError('No such absolute time found');\n }\n}\nfunction $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {\n return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));\n}\nfunction $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {\n let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);\n let date = new Date(ms + offset);\n let year = date.getUTCFullYear();\n let month = date.getUTCMonth() + 1;\n let day = date.getUTCDate();\n let hour = date.getUTCHours();\n let minute = date.getUTCMinutes();\n let second = date.getUTCSeconds();\n let millisecond = date.getUTCMilliseconds();\n return new (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);\n}\nfunction $11d87f3f76e88657$export$e57ff100d91bd4b9(date, timeZone) {\n return $11d87f3f76e88657$export$1b96692a1ba042ac(date.getTime(), timeZone);\n}\nfunction $11d87f3f76e88657$export$d7f92bcd3596b086(date) {\n return $11d87f3f76e88657$export$e57ff100d91bd4b9(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());\n}\nfunction $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {\n return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);\n}\nfunction $11d87f3f76e88657$export$6f4d78149f3f53ac(date) {\n return {\n era: date.era,\n year: date.year,\n month: date.month,\n day: date.day\n };\n}\nfunction $11d87f3f76e88657$export$4d0393e732857be5(date) {\n return {\n hour: date.hour,\n minute: date.minute,\n second: date.second,\n millisecond: date.millisecond\n };\n}\nfunction $11d87f3f76e88657$export$b21e0b124e224484(date, time) {\n let hour = 0, minute = 0, second = 0, millisecond = 0;\n if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);\n else if ('hour' in date && !time) return date;\n if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);\n return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);\n}\nfunction $11d87f3f76e88657$export$d33f79e3ffc3dc83(dateTime) {\n return new (0, $35ea8db9cb2ccb90$export$680ea196effce5f)(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n}\nfunction $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {\n if ((0, $14e0f24ef4ac5c92$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;\n let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));\n let copy = date.copy();\n copy.calendar = calendar;\n copy.era = calendarDate.era;\n copy.year = calendarDate.year;\n copy.month = calendarDate.month;\n copy.day = calendarDate.day;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);\n return copy;\n}\nfunction $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {\n if (date instanceof (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)) {\n if (date.timeZone === timeZone) return date;\n return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);\n }\n let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);\n return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);\n}\nfunction $11d87f3f76e88657$export$83aac07b4c37b25(date) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;\n return new Date(ms);\n}\nfunction $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;\n return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);\n}\nfunction $11d87f3f76e88657$export$d9b67bc93c097491(date) {\n return $11d87f3f76e88657$export$538b00033cc11c75(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());\n}\n\n\nexport {$11d87f3f76e88657$export$bd4fb2bc8bb06fb as epochFromDate, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$59c99f3515d3493f as getTimeZoneOffset, $11d87f3f76e88657$export$136f38efe7caf549 as possibleAbsolutes, $11d87f3f76e88657$export$5107c82f94518f5c as toAbsolute, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$e67a095c620b86fe as toDate, $11d87f3f76e88657$export$1b96692a1ba042ac as fromAbsolute, $11d87f3f76e88657$export$e57ff100d91bd4b9 as fromDate, $11d87f3f76e88657$export$d7f92bcd3596b086 as fromDateToLocal, $11d87f3f76e88657$export$93522d1a439f3617 as toCalendarDate, $11d87f3f76e88657$export$6f4d78149f3f53ac as toDateFields, $11d87f3f76e88657$export$4d0393e732857be5 as toTimeFields, $11d87f3f76e88657$export$d33f79e3ffc3dc83 as toTime, $11d87f3f76e88657$export$84c95a83c799e074 as toZoned, $11d87f3f76e88657$export$538b00033cc11c75 as toTimeZone, $11d87f3f76e88657$export$83aac07b4c37b25 as zonedToDate, $11d87f3f76e88657$export$d9b67bc93c097491 as toLocalTimeZone};\n//# sourceMappingURL=conversion.module.js.map\n"],"names":[],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAKA,SAAS,wCAAwC,CAAC,IAAI,EAAE;AACxD,IAAI,IAAI,GAAG,yCAAyC,CAAC,IAAI,EAAE,KAAQ,yCAAyC,GAAG,CAAC;AAChH,IAAI,IAAI,IAAI,GAAG,CAAI,yCAAyC,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC;AAClF,IAAI,OAAO,oCAAoC,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAA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AO,IAAI,IAAI,CAAC,EAAE,CAAC;AACvB;AACA,SAAS,yCAAyC,CAAC,IAAI,EAAE,QAAQ,EAAE;AACnE,IAAI,IAAI,EAAE,GAAG,wCAAwC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM;AACzE,IAAI,OAAO,yCAAyC,CAAC,yCAAyC,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;AAC5H;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import { toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, toAbsolute as $11d87f3f76e88657$export$5107c82f94518f5c, epochFromDate as $11d87f3f76e88657$export$bd4fb2bc8bb06fb, fromAbsolute as $11d87f3f76e88657$export$1b96692a1ba042ac, toCalendar as $11d87f3f76e88657$export$b4a036af3fc0b032 } from './conversion.js';
|
|
2
|
+
import { GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec } from './GregorianCalendar.js';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const $735220c2d4774dd3$var$ONE_HOUR = 3600000;
|
|
1
17
|
function $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {
|
|
2
18
|
let mutableDate = date.copy();
|
|
3
19
|
let days = 'hour' in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
|
|
@@ -214,6 +230,106 @@ function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false
|
|
|
214
230
|
}
|
|
215
231
|
return value;
|
|
216
232
|
}
|
|
233
|
+
function $735220c2d4774dd3$export$96b1d28349274637(dateTime, duration) {
|
|
234
|
+
let ms;
|
|
235
|
+
if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) {
|
|
236
|
+
let res = $735220c2d4774dd3$export$e16d8520af44a096(($11d87f3f76e88657$export$b21e0b124e224484)(dateTime), {
|
|
237
|
+
years: duration.years,
|
|
238
|
+
months: duration.months,
|
|
239
|
+
weeks: duration.weeks,
|
|
240
|
+
days: duration.days
|
|
241
|
+
});
|
|
242
|
+
// Changing the date may change the timezone offset, so we need to recompute
|
|
243
|
+
// using the 'compatible' disambiguation.
|
|
244
|
+
ms = ($11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);
|
|
245
|
+
} else // Otherwise, preserve the offset of the original date.
|
|
246
|
+
ms = ($11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
|
|
247
|
+
// Perform time manipulation in milliseconds rather than on the original time fields to account for DST.
|
|
248
|
+
// For example, adding one hour during a DST transition may result in the hour field staying the same or
|
|
249
|
+
// skipping an hour. This results in the offset field changing value instead of the specified field.
|
|
250
|
+
ms += duration.milliseconds || 0;
|
|
251
|
+
ms += (duration.seconds || 0) * 1000;
|
|
252
|
+
ms += (duration.minutes || 0) * 60000;
|
|
253
|
+
ms += (duration.hours || 0) * 3600000;
|
|
254
|
+
let res = ($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone);
|
|
255
|
+
return ($11d87f3f76e88657$export$b4a036af3fc0b032)(res, dateTime.calendar);
|
|
256
|
+
}
|
|
257
|
+
function $735220c2d4774dd3$export$6814caac34ca03c7(dateTime, duration) {
|
|
258
|
+
return $735220c2d4774dd3$export$96b1d28349274637(dateTime, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
|
|
259
|
+
}
|
|
260
|
+
function $735220c2d4774dd3$export$9a297d111fc86b79(dateTime, field, amount, options) {
|
|
261
|
+
// For date fields, we want the time to remain consistent and the UTC offset to potentially change to account for DST changes.
|
|
262
|
+
// For time fields, we want the time to change by the amount given. This may result in the hour field staying the same, but the UTC
|
|
263
|
+
// offset changing in the case of a backward DST transition, or skipping an hour in the case of a forward DST transition.
|
|
264
|
+
switch(field){
|
|
265
|
+
case 'hour':
|
|
266
|
+
{
|
|
267
|
+
let min = 0;
|
|
268
|
+
let max = 23;
|
|
269
|
+
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
270
|
+
let isPM = dateTime.hour >= 12;
|
|
271
|
+
min = isPM ? 12 : 0;
|
|
272
|
+
max = isPM ? 23 : 11;
|
|
273
|
+
}
|
|
274
|
+
// The minimum and maximum hour may be affected by daylight saving time.
|
|
275
|
+
// For example, it might jump forward at midnight, and skip 1am.
|
|
276
|
+
// Or it might end at midnight and repeat the 11pm hour. To handle this, we get
|
|
277
|
+
// the possible absolute times for the min and max, and find the maximum range
|
|
278
|
+
// that is within the current day.
|
|
279
|
+
let plainDateTime = ($11d87f3f76e88657$export$b21e0b124e224484)(dateTime);
|
|
280
|
+
let minDate = ($11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
281
|
+
hour: min
|
|
282
|
+
}), new ($3b62074eb05584b2$export$80ee6245ec4f29ec)());
|
|
283
|
+
let minAbsolute = [
|
|
284
|
+
($11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, 'earlier'),
|
|
285
|
+
($11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, 'later')
|
|
286
|
+
].filter((ms)=>($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === minDate.day)[0];
|
|
287
|
+
let maxDate = ($11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
288
|
+
hour: max
|
|
289
|
+
}), new ($3b62074eb05584b2$export$80ee6245ec4f29ec)());
|
|
290
|
+
let maxAbsolute = [
|
|
291
|
+
($11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, 'earlier'),
|
|
292
|
+
($11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, 'later')
|
|
293
|
+
].filter((ms)=>($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === maxDate.day).pop();
|
|
294
|
+
// Since hours may repeat, we need to operate on the absolute time in milliseconds.
|
|
295
|
+
// This is done in hours from the Unix epoch so that cycleValue works correctly,
|
|
296
|
+
// and then converted back to milliseconds.
|
|
297
|
+
let ms = ($11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
|
|
298
|
+
let hours = Math.floor(ms / $735220c2d4774dd3$var$ONE_HOUR);
|
|
299
|
+
let remainder = ms % $735220c2d4774dd3$var$ONE_HOUR;
|
|
300
|
+
ms = $735220c2d4774dd3$var$cycleValue(hours, amount, Math.floor(minAbsolute / $735220c2d4774dd3$var$ONE_HOUR), Math.floor(maxAbsolute / $735220c2d4774dd3$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $735220c2d4774dd3$var$ONE_HOUR + remainder;
|
|
301
|
+
// Now compute the new timezone offset, and convert the absolute time back to local time.
|
|
302
|
+
return ($11d87f3f76e88657$export$b4a036af3fc0b032)(($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
|
|
303
|
+
}
|
|
304
|
+
case 'minute':
|
|
305
|
+
case 'second':
|
|
306
|
+
case 'millisecond':
|
|
307
|
+
// @ts-ignore
|
|
308
|
+
return $735220c2d4774dd3$export$dd02b3e0007dfe28(dateTime, field, amount, options);
|
|
309
|
+
case 'era':
|
|
310
|
+
case 'year':
|
|
311
|
+
case 'month':
|
|
312
|
+
case 'day':
|
|
313
|
+
{
|
|
314
|
+
let res = $735220c2d4774dd3$export$d52ced6badfb9a4c(($11d87f3f76e88657$export$b21e0b124e224484)(dateTime), field, amount, options);
|
|
315
|
+
let ms = ($11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);
|
|
316
|
+
return ($11d87f3f76e88657$export$b4a036af3fc0b032)(($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
|
|
317
|
+
}
|
|
318
|
+
default:
|
|
319
|
+
throw new Error('Unsupported field ' + field);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
function $735220c2d4774dd3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
|
|
323
|
+
// Set the date/time fields, and recompute the UTC offset to account for DST changes.
|
|
324
|
+
// We also need to validate by converting back to a local time in case hours are skipped during forward DST transitions.
|
|
325
|
+
let plainDateTime = ($11d87f3f76e88657$export$b21e0b124e224484)(dateTime);
|
|
326
|
+
let res = $735220c2d4774dd3$export$e5d5e1c1822b6e56($735220c2d4774dd3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
|
|
327
|
+
// If the resulting plain date time values are equal, return the original time.
|
|
328
|
+
// We don't want to change the offset when setting the time to the same value.
|
|
329
|
+
if (res.compare(plainDateTime) === 0) return dateTime;
|
|
330
|
+
let ms = ($11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone, disambiguation);
|
|
331
|
+
return ($11d87f3f76e88657$export$b4a036af3fc0b032)(($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
|
|
332
|
+
}
|
|
217
333
|
|
|
218
|
-
export { $735220c2d4774dd3$export$e16d8520af44a096 as add, $735220c2d4774dd3$export$c4e2ecac49351ef2 as constrain, $735220c2d4774dd3$export$7555de1e070510cb as constrainTime, $735220c2d4774dd3$export$d52ced6badfb9a4c as cycleDate, $735220c2d4774dd3$export$dd02b3e0007dfe28 as cycleTime, $735220c2d4774dd3$export$3e2544e88a25bff8 as invertDuration, $735220c2d4774dd3$export$adaa4cf7ef1b65be as set, $735220c2d4774dd3$export$e5d5e1c1822b6e56 as setTime, $735220c2d4774dd3$export$4e2d2ead65e5f7e3 as subtract };
|
|
334
|
+
export { $735220c2d4774dd3$export$e16d8520af44a096 as add, $735220c2d4774dd3$export$96b1d28349274637 as addZoned, $735220c2d4774dd3$export$c4e2ecac49351ef2 as constrain, $735220c2d4774dd3$export$7555de1e070510cb as constrainTime, $735220c2d4774dd3$export$d52ced6badfb9a4c as cycleDate, $735220c2d4774dd3$export$dd02b3e0007dfe28 as cycleTime, $735220c2d4774dd3$export$9a297d111fc86b79 as cycleZoned, $735220c2d4774dd3$export$3e2544e88a25bff8 as invertDuration, $735220c2d4774dd3$export$adaa4cf7ef1b65be as set, $735220c2d4774dd3$export$e5d5e1c1822b6e56 as setTime, $735220c2d4774dd3$export$31b5430eb18be4f8 as setZoned, $735220c2d4774dd3$export$4e2d2ead65e5f7e3 as subtract, $735220c2d4774dd3$export$6814caac34ca03c7 as subtractZoned };
|
|
219
335
|
//# sourceMappingURL=manipulation.js.map
|