quasar-ui-danx 0.2.12 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/danx.es.js +201 -201
- package/dist/danx.es.js.map +1 -0
- package/dist/danx.umd.js +3 -2
- package/dist/danx.umd.js.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/ActionTable/Filters/FilterToolbarLayout.vue +0 -1
- package/src/components/PanelsDrawer/PanelsDrawerTabs.vue +2 -7
- package/src/helpers/actions.ts +22 -16
- package/src/vue-plugin.js +0 -2
- package/vite.config.js +1 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"danx.umd.js","sources":["../src/config/index.ts","../src/helpers/array.ts","../node_modules/@vueuse/shared/index.mjs","../node_modules/@vueuse/core/index.mjs","../src/helpers/utils.ts","../src/helpers/compatibility.ts","../node_modules/luxon/src/errors.js","../node_modules/luxon/src/impl/formats.js","../node_modules/luxon/src/zone.js","../node_modules/luxon/src/zones/systemZone.js","../node_modules/luxon/src/zones/IANAZone.js","../node_modules/luxon/src/impl/locale.js","../node_modules/luxon/src/zones/fixedOffsetZone.js","../node_modules/luxon/src/zones/invalidZone.js","../node_modules/luxon/src/impl/zoneUtil.js","../node_modules/luxon/src/settings.js","../node_modules/luxon/src/impl/invalid.js","../node_modules/luxon/src/impl/conversions.js","../node_modules/luxon/src/impl/util.js","../node_modules/luxon/src/impl/english.js","../node_modules/luxon/src/impl/formatter.js","../node_modules/luxon/src/impl/regexParser.js","../node_modules/luxon/src/duration.js","../node_modules/luxon/src/interval.js","../node_modules/luxon/src/info.js","../node_modules/luxon/src/impl/diff.js","../node_modules/luxon/src/impl/digits.js","../node_modules/luxon/src/impl/tokenParser.js","../node_modules/luxon/src/datetime.js","../src/helpers/formats.ts","../src/helpers/date.ts","../src/helpers/download.ts","../src/helpers/downloadPdf.ts","../node_modules/exifreader/src/dataview.js","../node_modules/exifreader/src/utils.js","../node_modules/exifreader/src/constants.js","../node_modules/exifreader/src/tag-names-utils.js","../node_modules/exifreader/src/byte-order.js","../node_modules/exifreader/src/image-header-tiff.js","../node_modules/exifreader/src/image-header-jpeg.js","../node_modules/exifreader/src/image-header-png.js","../node_modules/exifreader/src/image-header-iso-bmff-utils.js","../node_modules/exifreader/src/image-header-iso-bmff-iloc.js","../node_modules/exifreader/src/image-header-iso-bmff.js","../node_modules/exifreader/src/image-header-heic.js","../node_modules/exifreader/src/image-header-avif.js","../node_modules/exifreader/src/image-header-webp.js","../node_modules/exifreader/src/image-header-gif.js","../node_modules/exifreader/src/image-header.js","../node_modules/exifreader/src/tag-names-common.js","../node_modules/exifreader/src/tag-names-0th-ifd.js","../node_modules/exifreader/src/tag-names-exif-ifd.js","../node_modules/exifreader/src/tag-names-gps-ifd.js","../node_modules/exifreader/src/tag-names-interoperability-ifd.js","../node_modules/exifreader/src/tag-names-mpf-ifd.js","../node_modules/exifreader/src/tag-names.js","../node_modules/exifreader/src/types.js","../node_modules/exifreader/src/tags-helpers.js","../node_modules/exifreader/src/tags.js","../node_modules/exifreader/src/mpf-tags.js","../node_modules/exifreader/src/file-tags.js","../node_modules/exifreader/src/jfif-tags.js","../node_modules/exifreader/src/iptc-tag-names.js","../node_modules/exifreader/src/text-decoder.js","../node_modules/exifreader/src/tag-decoder.js","../node_modules/exifreader/src/iptc-tags.js","../node_modules/exifreader/src/xmp-tag-names.js","../node_modules/exifreader/src/dom-parser.js","../node_modules/exifreader/src/xmp-tags.js","../node_modules/exifreader/src/photoshop-tag-names.js","../node_modules/exifreader/src/photoshop-tags.js","../node_modules/exifreader/src/icc-tag-names.js","../node_modules/exifreader/src/icc-tags.js","../node_modules/exifreader/src/png-file-tags.js","../node_modules/exifreader/src/png-text-tags.js","../node_modules/exifreader/src/png-tags.js","../node_modules/exifreader/src/vp8x-tags.js","../node_modules/exifreader/src/gif-file-tags.js","../node_modules/exifreader/src/thumbnail.js","../node_modules/exifreader/src/errors.js","../node_modules/exifreader/src/exif-reader.js","../src/helpers/FlashMessages.ts","../src/helpers/files.ts","../src/helpers/FileUpload.ts","../src/helpers/http.ts","../src/helpers/multiFileUpload.ts","../src/helpers/actions.ts","../src/helpers/singleFileUpload.ts","../src/helpers/storage.ts","../node_modules/@heroicons/vue/outline/esm/CalendarIcon.js","../node_modules/@heroicons/vue/outline/esm/ChevronDownIcon.js","../node_modules/@heroicons/vue/outline/esm/ChevronLeftIcon.js","../node_modules/@heroicons/vue/outline/esm/CurrencyDollarIcon.js","../node_modules/@heroicons/vue/outline/esm/DocumentTextIcon.js","../node_modules/@heroicons/vue/outline/esm/DotsVerticalIcon.js","../node_modules/@heroicons/vue/outline/esm/DownloadIcon.js","../node_modules/@heroicons/vue/outline/esm/EyeOffIcon.js","../node_modules/@heroicons/vue/outline/esm/EyeIcon.js","../node_modules/@heroicons/vue/outline/esm/HashtagIcon.js","../node_modules/@heroicons/vue/outline/esm/LockClosedIcon.js","../node_modules/@heroicons/vue/outline/esm/PlayIcon.js","../node_modules/@heroicons/vue/outline/esm/PlusIcon.js","../node_modules/@heroicons/vue/outline/esm/XIcon.js","../node_modules/@heroicons/vue/solid/esm/DownloadIcon.js","../node_modules/@heroicons/vue/solid/esm/ExclamationCircleIcon.js","../node_modules/@heroicons/vue/solid/esm/LocationMarkerIcon.js","../node_modules/@heroicons/vue/solid/esm/PencilIcon.js","../node_modules/@heroicons/vue/solid/esm/RefreshIcon.js","../node_modules/@heroicons/vue/solid/esm/StarIcon.js","../node_modules/@heroicons/vue/solid/esm/XCircleIcon.js","../src/components/DragAndDrop/dragAndDrop.ts","../src/components/DragAndDrop/HandleDraggable.vue","../src/svg/CaretDownIcon.svg","../src/svg/DragHandleDotsIcon.svg","../src/svg/DragHandleIcon.svg","../src/svg/FilterIcon.svg","../src/svg/ImageIcon.svg","../src/svg/PdfIcon.svg","../src/svg/PercentIcon.svg","../src/svg/SkipNextIcon.svg","../src/svg/SkipPreviousIcon.svg","../src/svg/TrashIcon.svg","../src/svg/WarningIcon.svg","../src/svg/XIcon.svg","../src/components/Utility/Buttons/ExportButton.vue","../src/components/Utility/Dialogs/ConfirmDialog.vue","../src/components/Utility/Dialogs/FullscreenCarouselDialog.vue","../src/components/Utility/Dialogs/FullScreenDialog.vue","../src/components/Utility/Dialogs/InfoDialog.vue","../src/components/Utility/Dialogs/InputDialog.vue","../src/components/Utility/Files/FilePreview.vue","../src/components/Utility/Files/SvgImg.vue","../src/components/Utility/Layouts/CollapsableSidebar.vue","../src/components/Utility/Layouts/ContentDrawer.vue","../src/components/Utility/Tools/RenderVnode.vue","../src/components/Utility/Tools/ActionVnode.vue","../src/components/Utility/Tools/RenderComponent.vue","../src/components/Utility/Popovers/PopoverMenu.vue","../src/components/Utility/Popovers/InteractiveTooltip.vue","../node_modules/gsap/gsap-core.js","../node_modules/gsap/CSSPlugin.js","../node_modules/gsap/index.js","../src/components/Utility/Transitions/StaggeredListTransition.vue","../src/components/DragAndDrop/listDragAndDrop.ts","../src/components/DragAndDrop/ListItemDraggable.vue","../src/components/ActionTable/Columns/ColumnSettingsDialog.vue","../src/components/ActionTable/Columns/TitleColumnFormat.vue","../src/components/ActionTable/Columns/VisibleColumnsToggleButtons.vue","../src/components/ActionTable/Form/Fields/FieldLabel.vue","../src/components/ActionTable/Form/Fields/ConfirmPasswordField.vue","../src/components/ActionTable/Form/Fields/DateField.vue","../src/components/ActionTable/Form/Fields/DateRangeField.vue","../src/components/ActionTable/Form/Fields/DateTimePicker.vue","../src/components/ActionTable/Form/Fields/DateTimeField.vue","../src/components/ActionTable/Form/Fields/EditableDiv.vue","../src/components/ActionTable/Form/Fields/FileUploadButton.vue","../src/components/ActionTable/Form/Fields/InlineDateTimeField.vue","../src/components/ActionTable/Form/Fields/NumberField.vue","../src/components/ActionTable/Form/Fields/MultiFileField.vue","../src/components/ActionTable/Form/Fields/SelectField.vue","../src/components/ActionTable/Form/Fields/MultiKeywordField.vue","../src/components/ActionTable/Form/Fields/NewPasswordField.vue","../src/components/ActionTable/Form/Fields/NumberRangeField.vue","../src/components/ActionTable/Form/Fields/SelectDrawer.vue","../src/components/ActionTable/Form/Fields/SelectWithChildrenField.vue","../src/components/ActionTable/Form/Fields/SingleFileField.vue","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js","../src/vendor/tinymce-config.ts","../src/components/ActionTable/Filters/FilterableField.vue","../src/components/ActionTable/Filters/FilterFieldList.vue","../src/components/ActionTable/Filters/FilterListToggle.vue","../src/components/ActionTable/Form/RenderedForm.vue","../src/components/ActionTable/Layouts/ActionTableLayout.vue","../src/components/ActionTable/listHelpers.ts","../src/components/ActionTable/listControls.ts","../src/components/ActionTable/tableColumns.ts","../src/components/ActionTable/ActionMenu.vue","../src/components/ActionTable/ActionTableColumn.vue","../src/components/ActionTable/TableSummaryRow.vue","../src/components/ActionTable/ActionTable.vue","../src/components/AuditHistory/AuditHistoryItemValue.vue","../src/components/AuditHistory/AuditHistoryItem.vue","../src/components/PanelsDrawer/PanelsDrawer.vue","../src/vue-plugin.js"],"sourcesContent":["export let danxOptions = {\n fileUpload: {\n directory: \"file-upload\",\n presignedUploadUrl: null,\n uploadCompletedUrl: null\n }\n};\n\nexport function configure(options) {\n danxOptions = {\n ...danxOptions,\n ...options\n };\n}\n","/**\n *\n * @param array\n * @param item\n * @param newItem\n * @returns {*[]}\n */\nexport function replace(array, item, newItem = undefined) {\n const index =\n typeof item === \"function\" ? array.findIndex(item) : array.indexOf(item);\n if (index === false) {\n console.error(\"Item not found in array\", item, array);\n throw new Error(\"Item not found in array\");\n }\n const newArray = [...array];\n newItem !== undefined\n ? newArray.splice(index, 1, newItem)\n : newArray.splice(index, 1);\n return newArray;\n}\n\nexport function remove(array, item) {\n return replace(array, item);\n}\n\n/**\n * Remove duplicate items from an array using a callback to compare 2 elements\n * @param array\n * @param cb\n * @returns {*}\n */\nexport function uniqueBy(array, cb) {\n return array.filter((a, index, self) => {\n // Check if the current element 'a' is the first occurrence in the array\n return index === self.findIndex((b) => cb(a, b));\n });\n}\n","import { shallowRef, watchEffect, readonly, ref, watch, customRef, getCurrentScope, onScopeDispose, effectScope, getCurrentInstance, provide, inject, isVue3, version, isRef, unref, computed, reactive, toRefs as toRefs$1, toRef as toRef$1, isVue2, set as set$1, onBeforeMount, nextTick, onBeforeUnmount, onMounted, onUnmounted, isReactive } from 'vue-demi';\n\nfunction computedEager(fn, options) {\n var _a;\n const result = shallowRef();\n watchEffect(() => {\n result.value = fn();\n }, {\n ...options,\n flush: (_a = options == null ? void 0 : options.flush) != null ? _a : \"sync\"\n });\n return readonly(result);\n}\n\nfunction computedWithControl(source, fn) {\n let v = void 0;\n let track;\n let trigger;\n const dirty = ref(true);\n const update = () => {\n dirty.value = true;\n trigger();\n };\n watch(source, update, { flush: \"sync\" });\n const get = typeof fn === \"function\" ? fn : fn.get;\n const set = typeof fn === \"function\" ? void 0 : fn.set;\n const result = customRef((_track, _trigger) => {\n track = _track;\n trigger = _trigger;\n return {\n get() {\n if (dirty.value) {\n v = get();\n dirty.value = false;\n }\n track();\n return v;\n },\n set(v2) {\n set == null ? void 0 : set(v2);\n }\n };\n });\n if (Object.isExtensible(result))\n result.trigger = update;\n return result;\n}\n\nfunction tryOnScopeDispose(fn) {\n if (getCurrentScope()) {\n onScopeDispose(fn);\n return true;\n }\n return false;\n}\n\nfunction createEventHook() {\n const fns = /* @__PURE__ */ new Set();\n const off = (fn) => {\n fns.delete(fn);\n };\n const on = (fn) => {\n fns.add(fn);\n const offFn = () => off(fn);\n tryOnScopeDispose(offFn);\n return {\n off: offFn\n };\n };\n const trigger = (...args) => {\n return Promise.all(Array.from(fns).map((fn) => fn(...args)));\n };\n return {\n on,\n off,\n trigger\n };\n}\n\nfunction createGlobalState(stateFactory) {\n let initialized = false;\n let state;\n const scope = effectScope(true);\n return (...args) => {\n if (!initialized) {\n state = scope.run(() => stateFactory(...args));\n initialized = true;\n }\n return state;\n };\n}\n\nconst localProvidedStateMap = /* @__PURE__ */ new WeakMap();\n\nconst provideLocal = (key, value) => {\n var _a;\n const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;\n if (instance == null)\n throw new Error(\"provideLocal must be called in setup\");\n if (!localProvidedStateMap.has(instance))\n localProvidedStateMap.set(instance, /* @__PURE__ */ Object.create(null));\n const localProvidedState = localProvidedStateMap.get(instance);\n localProvidedState[key] = value;\n provide(key, value);\n};\n\nconst injectLocal = (...args) => {\n var _a;\n const key = args[0];\n const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;\n if (instance == null)\n throw new Error(\"injectLocal must be called in setup\");\n if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))\n return localProvidedStateMap.get(instance)[key];\n return inject(...args);\n};\n\nfunction createInjectionState(composable, options) {\n const key = (options == null ? void 0 : options.injectionKey) || Symbol(composable.name || \"InjectionState\");\n const useProvidingState = (...args) => {\n const state = composable(...args);\n provideLocal(key, state);\n return state;\n };\n const useInjectedState = () => injectLocal(key);\n return [useProvidingState, useInjectedState];\n}\n\nfunction createSharedComposable(composable) {\n let subscribers = 0;\n let state;\n let scope;\n const dispose = () => {\n subscribers -= 1;\n if (scope && subscribers <= 0) {\n scope.stop();\n state = void 0;\n scope = void 0;\n }\n };\n return (...args) => {\n subscribers += 1;\n if (!state) {\n scope = effectScope(true);\n state = scope.run(() => composable(...args));\n }\n tryOnScopeDispose(dispose);\n return state;\n };\n}\n\nfunction extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {\n if (!isVue3 && !version.startsWith(\"2.7.\")) {\n if (process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] extendRef only works in Vue 2.7 or above.\");\n return;\n }\n for (const [key, value] of Object.entries(extend)) {\n if (key === \"value\")\n continue;\n if (isRef(value) && unwrap) {\n Object.defineProperty(ref, key, {\n get() {\n return value.value;\n },\n set(v) {\n value.value = v;\n },\n enumerable\n });\n } else {\n Object.defineProperty(ref, key, { value, enumerable });\n }\n }\n return ref;\n}\n\nfunction get(obj, key) {\n if (key == null)\n return unref(obj);\n return unref(obj)[key];\n}\n\nfunction isDefined(v) {\n return unref(v) != null;\n}\n\nfunction makeDestructurable(obj, arr) {\n if (typeof Symbol !== \"undefined\") {\n const clone = { ...obj };\n Object.defineProperty(clone, Symbol.iterator, {\n enumerable: false,\n value() {\n let index = 0;\n return {\n next: () => ({\n value: arr[index++],\n done: index > arr.length\n })\n };\n }\n });\n return clone;\n } else {\n return Object.assign([...arr], obj);\n }\n}\n\nfunction toValue(r) {\n return typeof r === \"function\" ? r() : unref(r);\n}\nconst resolveUnref = toValue;\n\nfunction reactify(fn, options) {\n const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? unref : toValue;\n return function(...args) {\n return computed(() => fn.apply(this, args.map((i) => unrefFn(i))));\n };\n}\n\nfunction reactifyObject(obj, optionsOrKeys = {}) {\n let keys = [];\n let options;\n if (Array.isArray(optionsOrKeys)) {\n keys = optionsOrKeys;\n } else {\n options = optionsOrKeys;\n const { includeOwnProperties = true } = optionsOrKeys;\n keys.push(...Object.keys(obj));\n if (includeOwnProperties)\n keys.push(...Object.getOwnPropertyNames(obj));\n }\n return Object.fromEntries(\n keys.map((key) => {\n const value = obj[key];\n return [\n key,\n typeof value === \"function\" ? reactify(value.bind(obj), options) : value\n ];\n })\n );\n}\n\nfunction toReactive(objectRef) {\n if (!isRef(objectRef))\n return reactive(objectRef);\n const proxy = new Proxy({}, {\n get(_, p, receiver) {\n return unref(Reflect.get(objectRef.value, p, receiver));\n },\n set(_, p, value) {\n if (isRef(objectRef.value[p]) && !isRef(value))\n objectRef.value[p].value = value;\n else\n objectRef.value[p] = value;\n return true;\n },\n deleteProperty(_, p) {\n return Reflect.deleteProperty(objectRef.value, p);\n },\n has(_, p) {\n return Reflect.has(objectRef.value, p);\n },\n ownKeys() {\n return Object.keys(objectRef.value);\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n }\n });\n return reactive(proxy);\n}\n\nfunction reactiveComputed(fn) {\n return toReactive(computed(fn));\n}\n\nfunction reactiveOmit(obj, ...keys) {\n const flatKeys = keys.flat();\n const predicate = flatKeys[0];\n return reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e) => !flatKeys.includes(e[0]))));\n}\n\nconst isClient = typeof window !== \"undefined\" && typeof document !== \"undefined\";\nconst isWorker = typeof WorkerGlobalScope !== \"undefined\" && globalThis instanceof WorkerGlobalScope;\nconst isDef = (val) => typeof val !== \"undefined\";\nconst notNullish = (val) => val != null;\nconst assert = (condition, ...infos) => {\n if (!condition)\n console.warn(...infos);\n};\nconst toString = Object.prototype.toString;\nconst isObject = (val) => toString.call(val) === \"[object Object]\";\nconst now = () => Date.now();\nconst timestamp = () => +Date.now();\nconst clamp = (n, min, max) => Math.min(max, Math.max(min, n));\nconst noop = () => {\n};\nconst rand = (min, max) => {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n};\nconst hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);\nconst isIOS = /* @__PURE__ */ getIsIOS();\nfunction getIsIOS() {\n var _a, _b;\n return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));\n}\n\nfunction createFilterWrapper(filter, fn) {\n function wrapper(...args) {\n return new Promise((resolve, reject) => {\n Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);\n });\n }\n return wrapper;\n}\nconst bypassFilter = (invoke) => {\n return invoke();\n};\nfunction debounceFilter(ms, options = {}) {\n let timer;\n let maxTimer;\n let lastRejector = noop;\n const _clearTimeout = (timer2) => {\n clearTimeout(timer2);\n lastRejector();\n lastRejector = noop;\n };\n const filter = (invoke) => {\n const duration = toValue(ms);\n const maxDuration = toValue(options.maxWait);\n if (timer)\n _clearTimeout(timer);\n if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {\n if (maxTimer) {\n _clearTimeout(maxTimer);\n maxTimer = null;\n }\n return Promise.resolve(invoke());\n }\n return new Promise((resolve, reject) => {\n lastRejector = options.rejectOnCancel ? reject : resolve;\n if (maxDuration && !maxTimer) {\n maxTimer = setTimeout(() => {\n if (timer)\n _clearTimeout(timer);\n maxTimer = null;\n resolve(invoke());\n }, maxDuration);\n }\n timer = setTimeout(() => {\n if (maxTimer)\n _clearTimeout(maxTimer);\n maxTimer = null;\n resolve(invoke());\n }, duration);\n });\n };\n return filter;\n}\nfunction throttleFilter(...args) {\n let lastExec = 0;\n let timer;\n let isLeading = true;\n let lastRejector = noop;\n let lastValue;\n let ms;\n let trailing;\n let leading;\n let rejectOnCancel;\n if (!isRef(args[0]) && typeof args[0] === \"object\")\n ({ delay: ms, trailing = true, leading = true, rejectOnCancel = false } = args[0]);\n else\n [ms, trailing = true, leading = true, rejectOnCancel = false] = args;\n const clear = () => {\n if (timer) {\n clearTimeout(timer);\n timer = void 0;\n lastRejector();\n lastRejector = noop;\n }\n };\n const filter = (_invoke) => {\n const duration = toValue(ms);\n const elapsed = Date.now() - lastExec;\n const invoke = () => {\n return lastValue = _invoke();\n };\n clear();\n if (duration <= 0) {\n lastExec = Date.now();\n return invoke();\n }\n if (elapsed > duration && (leading || !isLeading)) {\n lastExec = Date.now();\n invoke();\n } else if (trailing) {\n lastValue = new Promise((resolve, reject) => {\n lastRejector = rejectOnCancel ? reject : resolve;\n timer = setTimeout(() => {\n lastExec = Date.now();\n isLeading = true;\n resolve(invoke());\n clear();\n }, Math.max(0, duration - elapsed));\n });\n }\n if (!leading && !timer)\n timer = setTimeout(() => isLeading = true, duration);\n isLeading = false;\n return lastValue;\n };\n return filter;\n}\nfunction pausableFilter(extendFilter = bypassFilter) {\n const isActive = ref(true);\n function pause() {\n isActive.value = false;\n }\n function resume() {\n isActive.value = true;\n }\n const eventFilter = (...args) => {\n if (isActive.value)\n extendFilter(...args);\n };\n return { isActive: readonly(isActive), pause, resume, eventFilter };\n}\n\nconst directiveHooks = {\n mounted: isVue3 ? \"mounted\" : \"inserted\",\n updated: isVue3 ? \"updated\" : \"componentUpdated\",\n unmounted: isVue3 ? \"unmounted\" : \"unbind\"\n};\n\nfunction cacheStringFunction(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n}\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction((str) => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\n\nfunction promiseTimeout(ms, throwOnTimeout = false, reason = \"Timeout\") {\n return new Promise((resolve, reject) => {\n if (throwOnTimeout)\n setTimeout(() => reject(reason), ms);\n else\n setTimeout(resolve, ms);\n });\n}\nfunction identity(arg) {\n return arg;\n}\nfunction createSingletonPromise(fn) {\n let _promise;\n function wrapper() {\n if (!_promise)\n _promise = fn();\n return _promise;\n }\n wrapper.reset = async () => {\n const _prev = _promise;\n _promise = void 0;\n if (_prev)\n await _prev;\n };\n return wrapper;\n}\nfunction invoke(fn) {\n return fn();\n}\nfunction containsProp(obj, ...props) {\n return props.some((k) => k in obj);\n}\nfunction increaseWithUnit(target, delta) {\n var _a;\n if (typeof target === \"number\")\n return target + delta;\n const value = ((_a = target.match(/^-?[0-9]+\\.?[0-9]*/)) == null ? void 0 : _a[0]) || \"\";\n const unit = target.slice(value.length);\n const result = Number.parseFloat(value) + delta;\n if (Number.isNaN(result))\n return target;\n return result + unit;\n}\nfunction objectPick(obj, keys, omitUndefined = false) {\n return keys.reduce((n, k) => {\n if (k in obj) {\n if (!omitUndefined || obj[k] !== void 0)\n n[k] = obj[k];\n }\n return n;\n }, {});\n}\nfunction objectOmit(obj, keys, omitUndefined = false) {\n return Object.fromEntries(Object.entries(obj).filter(([key, value]) => {\n return (!omitUndefined || value !== void 0) && !keys.includes(key);\n }));\n}\nfunction objectEntries(obj) {\n return Object.entries(obj);\n}\nfunction getLifeCycleTarget(target) {\n return target || getCurrentInstance();\n}\n\nfunction toRef(...args) {\n if (args.length !== 1)\n return toRef$1(...args);\n const r = args[0];\n return typeof r === \"function\" ? readonly(customRef(() => ({ get: r, set: noop }))) : ref(r);\n}\nconst resolveRef = toRef;\n\nfunction reactivePick(obj, ...keys) {\n const flatKeys = keys.flat();\n const predicate = flatKeys[0];\n return reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));\n}\n\nfunction refAutoReset(defaultValue, afterMs = 1e4) {\n return customRef((track, trigger) => {\n let value = toValue(defaultValue);\n let timer;\n const resetAfter = () => setTimeout(() => {\n value = toValue(defaultValue);\n trigger();\n }, toValue(afterMs));\n tryOnScopeDispose(() => {\n clearTimeout(timer);\n });\n return {\n get() {\n track();\n return value;\n },\n set(newValue) {\n value = newValue;\n trigger();\n clearTimeout(timer);\n timer = resetAfter();\n }\n };\n });\n}\n\nfunction useDebounceFn(fn, ms = 200, options = {}) {\n return createFilterWrapper(\n debounceFilter(ms, options),\n fn\n );\n}\n\nfunction refDebounced(value, ms = 200, options = {}) {\n const debounced = ref(value.value);\n const updater = useDebounceFn(() => {\n debounced.value = value.value;\n }, ms, options);\n watch(value, () => updater());\n return debounced;\n}\n\nfunction refDefault(source, defaultValue) {\n return computed({\n get() {\n var _a;\n return (_a = source.value) != null ? _a : defaultValue;\n },\n set(value) {\n source.value = value;\n }\n });\n}\n\nfunction useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {\n return createFilterWrapper(\n throttleFilter(ms, trailing, leading, rejectOnCancel),\n fn\n );\n}\n\nfunction refThrottled(value, delay = 200, trailing = true, leading = true) {\n if (delay <= 0)\n return value;\n const throttled = ref(value.value);\n const updater = useThrottleFn(() => {\n throttled.value = value.value;\n }, delay, trailing, leading);\n watch(value, () => updater());\n return throttled;\n}\n\nfunction refWithControl(initial, options = {}) {\n let source = initial;\n let track;\n let trigger;\n const ref = customRef((_track, _trigger) => {\n track = _track;\n trigger = _trigger;\n return {\n get() {\n return get();\n },\n set(v) {\n set(v);\n }\n };\n });\n function get(tracking = true) {\n if (tracking)\n track();\n return source;\n }\n function set(value, triggering = true) {\n var _a, _b;\n if (value === source)\n return;\n const old = source;\n if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)\n return;\n source = value;\n (_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);\n if (triggering)\n trigger();\n }\n const untrackedGet = () => get(false);\n const silentSet = (v) => set(v, false);\n const peek = () => get(false);\n const lay = (v) => set(v, false);\n return extendRef(\n ref,\n {\n get,\n set,\n untrackedGet,\n silentSet,\n peek,\n lay\n },\n { enumerable: true }\n );\n}\nconst controlledRef = refWithControl;\n\nfunction set(...args) {\n if (args.length === 2) {\n const [ref, value] = args;\n ref.value = value;\n }\n if (args.length === 3) {\n if (isVue2) {\n set$1(...args);\n } else {\n const [target, key, value] = args;\n target[key] = value;\n }\n }\n}\n\nfunction watchWithFilter(source, cb, options = {}) {\n const {\n eventFilter = bypassFilter,\n ...watchOptions\n } = options;\n return watch(\n source,\n createFilterWrapper(\n eventFilter,\n cb\n ),\n watchOptions\n );\n}\n\nfunction watchPausable(source, cb, options = {}) {\n const {\n eventFilter: filter,\n ...watchOptions\n } = options;\n const { eventFilter, pause, resume, isActive } = pausableFilter(filter);\n const stop = watchWithFilter(\n source,\n cb,\n {\n ...watchOptions,\n eventFilter\n }\n );\n return { stop, pause, resume, isActive };\n}\n\nfunction syncRef(left, right, ...[options]) {\n const {\n flush = \"sync\",\n deep = false,\n immediate = true,\n direction = \"both\",\n transform = {}\n } = options || {};\n const watchers = [];\n const transformLTR = \"ltr\" in transform && transform.ltr || ((v) => v);\n const transformRTL = \"rtl\" in transform && transform.rtl || ((v) => v);\n if (direction === \"both\" || direction === \"ltr\") {\n watchers.push(watchPausable(\n left,\n (newValue) => {\n watchers.forEach((w) => w.pause());\n right.value = transformLTR(newValue);\n watchers.forEach((w) => w.resume());\n },\n { flush, deep, immediate }\n ));\n }\n if (direction === \"both\" || direction === \"rtl\") {\n watchers.push(watchPausable(\n right,\n (newValue) => {\n watchers.forEach((w) => w.pause());\n left.value = transformRTL(newValue);\n watchers.forEach((w) => w.resume());\n },\n { flush, deep, immediate }\n ));\n }\n const stop = () => {\n watchers.forEach((w) => w.stop());\n };\n return stop;\n}\n\nfunction syncRefs(source, targets, options = {}) {\n const {\n flush = \"sync\",\n deep = false,\n immediate = true\n } = options;\n if (!Array.isArray(targets))\n targets = [targets];\n return watch(\n source,\n (newValue) => targets.forEach((target) => target.value = newValue),\n { flush, deep, immediate }\n );\n}\n\nfunction toRefs(objectRef, options = {}) {\n if (!isRef(objectRef))\n return toRefs$1(objectRef);\n const result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};\n for (const key in objectRef.value) {\n result[key] = customRef(() => ({\n get() {\n return objectRef.value[key];\n },\n set(v) {\n var _a;\n const replaceRef = (_a = toValue(options.replaceRef)) != null ? _a : true;\n if (replaceRef) {\n if (Array.isArray(objectRef.value)) {\n const copy = [...objectRef.value];\n copy[key] = v;\n objectRef.value = copy;\n } else {\n const newObject = { ...objectRef.value, [key]: v };\n Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));\n objectRef.value = newObject;\n }\n } else {\n objectRef.value[key] = v;\n }\n }\n }));\n }\n return result;\n}\n\nfunction tryOnBeforeMount(fn, sync = true, target) {\n const instance = getLifeCycleTarget(target);\n if (instance)\n onBeforeMount(fn, target);\n else if (sync)\n fn();\n else\n nextTick(fn);\n}\n\nfunction tryOnBeforeUnmount(fn, target) {\n const instance = getLifeCycleTarget(target);\n if (instance)\n onBeforeUnmount(fn, target);\n}\n\nfunction tryOnMounted(fn, sync = true, target) {\n const instance = getLifeCycleTarget();\n if (instance)\n onMounted(fn, target);\n else if (sync)\n fn();\n else\n nextTick(fn);\n}\n\nfunction tryOnUnmounted(fn, target) {\n const instance = getLifeCycleTarget(target);\n if (instance)\n onUnmounted(fn, target);\n}\n\nfunction createUntil(r, isNot = false) {\n function toMatch(condition, { flush = \"sync\", deep = false, timeout, throwOnTimeout } = {}) {\n let stop = null;\n const watcher = new Promise((resolve) => {\n stop = watch(\n r,\n (v) => {\n if (condition(v) !== isNot) {\n stop == null ? void 0 : stop();\n resolve(v);\n }\n },\n {\n flush,\n deep,\n immediate: true\n }\n );\n });\n const promises = [watcher];\n if (timeout != null) {\n promises.push(\n promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop == null ? void 0 : stop())\n );\n }\n return Promise.race(promises);\n }\n function toBe(value, options) {\n if (!isRef(value))\n return toMatch((v) => v === value, options);\n const { flush = \"sync\", deep = false, timeout, throwOnTimeout } = options != null ? options : {};\n let stop = null;\n const watcher = new Promise((resolve) => {\n stop = watch(\n [r, value],\n ([v1, v2]) => {\n if (isNot !== (v1 === v2)) {\n stop == null ? void 0 : stop();\n resolve(v1);\n }\n },\n {\n flush,\n deep,\n immediate: true\n }\n );\n });\n const promises = [watcher];\n if (timeout != null) {\n promises.push(\n promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {\n stop == null ? void 0 : stop();\n return toValue(r);\n })\n );\n }\n return Promise.race(promises);\n }\n function toBeTruthy(options) {\n return toMatch((v) => Boolean(v), options);\n }\n function toBeNull(options) {\n return toBe(null, options);\n }\n function toBeUndefined(options) {\n return toBe(void 0, options);\n }\n function toBeNaN(options) {\n return toMatch(Number.isNaN, options);\n }\n function toContains(value, options) {\n return toMatch((v) => {\n const array = Array.from(v);\n return array.includes(value) || array.includes(toValue(value));\n }, options);\n }\n function changed(options) {\n return changedTimes(1, options);\n }\n function changedTimes(n = 1, options) {\n let count = -1;\n return toMatch(() => {\n count += 1;\n return count >= n;\n }, options);\n }\n if (Array.isArray(toValue(r))) {\n const instance = {\n toMatch,\n toContains,\n changed,\n changedTimes,\n get not() {\n return createUntil(r, !isNot);\n }\n };\n return instance;\n } else {\n const instance = {\n toMatch,\n toBe,\n toBeTruthy,\n toBeNull,\n toBeNaN,\n toBeUndefined,\n changed,\n changedTimes,\n get not() {\n return createUntil(r, !isNot);\n }\n };\n return instance;\n }\n}\nfunction until(r) {\n return createUntil(r);\n}\n\nfunction defaultComparator(value, othVal) {\n return value === othVal;\n}\nfunction useArrayDifference(...args) {\n var _a;\n const list = args[0];\n const values = args[1];\n let compareFn = (_a = args[2]) != null ? _a : defaultComparator;\n if (typeof compareFn === \"string\") {\n const key = compareFn;\n compareFn = (value, othVal) => value[key] === othVal[key];\n }\n return computed(() => toValue(list).filter((x) => toValue(values).findIndex((y) => compareFn(x, y)) === -1));\n}\n\nfunction useArrayEvery(list, fn) {\n return computed(() => toValue(list).every((element, index, array) => fn(toValue(element), index, array)));\n}\n\nfunction useArrayFilter(list, fn) {\n return computed(() => toValue(list).map((i) => toValue(i)).filter(fn));\n}\n\nfunction useArrayFind(list, fn) {\n return computed(() => toValue(\n toValue(list).find((element, index, array) => fn(toValue(element), index, array))\n ));\n}\n\nfunction useArrayFindIndex(list, fn) {\n return computed(() => toValue(list).findIndex((element, index, array) => fn(toValue(element), index, array)));\n}\n\nfunction findLast(arr, cb) {\n let index = arr.length;\n while (index-- > 0) {\n if (cb(arr[index], index, arr))\n return arr[index];\n }\n return void 0;\n}\nfunction useArrayFindLast(list, fn) {\n return computed(() => toValue(\n !Array.prototype.findLast ? findLast(toValue(list), (element, index, array) => fn(toValue(element), index, array)) : toValue(list).findLast((element, index, array) => fn(toValue(element), index, array))\n ));\n}\n\nfunction isArrayIncludesOptions(obj) {\n return isObject(obj) && containsProp(obj, \"formIndex\", \"comparator\");\n}\nfunction useArrayIncludes(...args) {\n var _a;\n const list = args[0];\n const value = args[1];\n let comparator = args[2];\n let formIndex = 0;\n if (isArrayIncludesOptions(comparator)) {\n formIndex = (_a = comparator.fromIndex) != null ? _a : 0;\n comparator = comparator.comparator;\n }\n if (typeof comparator === \"string\") {\n const key = comparator;\n comparator = (element, value2) => element[key] === toValue(value2);\n }\n comparator = comparator != null ? comparator : (element, value2) => element === toValue(value2);\n return computed(() => toValue(list).slice(formIndex).some((element, index, array) => comparator(\n toValue(element),\n toValue(value),\n index,\n toValue(array)\n )));\n}\n\nfunction useArrayJoin(list, separator) {\n return computed(() => toValue(list).map((i) => toValue(i)).join(toValue(separator)));\n}\n\nfunction useArrayMap(list, fn) {\n return computed(() => toValue(list).map((i) => toValue(i)).map(fn));\n}\n\nfunction useArrayReduce(list, reducer, ...args) {\n const reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);\n return computed(() => {\n const resolved = toValue(list);\n return args.length ? resolved.reduce(reduceCallback, toValue(args[0])) : resolved.reduce(reduceCallback);\n });\n}\n\nfunction useArraySome(list, fn) {\n return computed(() => toValue(list).some((element, index, array) => fn(toValue(element), index, array)));\n}\n\nfunction uniq(array) {\n return Array.from(new Set(array));\n}\nfunction uniqueElementsBy(array, fn) {\n return array.reduce((acc, v) => {\n if (!acc.some((x) => fn(v, x, array)))\n acc.push(v);\n return acc;\n }, []);\n}\nfunction useArrayUnique(list, compareFn) {\n return computed(() => {\n const resolvedList = toValue(list).map((element) => toValue(element));\n return compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);\n });\n}\n\nfunction useCounter(initialValue = 0, options = {}) {\n let _initialValue = unref(initialValue);\n const count = ref(initialValue);\n const {\n max = Number.POSITIVE_INFINITY,\n min = Number.NEGATIVE_INFINITY\n } = options;\n const inc = (delta = 1) => count.value = Math.max(Math.min(max, count.value + delta), min);\n const dec = (delta = 1) => count.value = Math.min(Math.max(min, count.value - delta), max);\n const get = () => count.value;\n const set = (val) => count.value = Math.max(min, Math.min(max, val));\n const reset = (val = _initialValue) => {\n _initialValue = val;\n return set(val);\n };\n return { count, inc, dec, get, set, reset };\n}\n\nconst REGEX_PARSE = /^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/;\nconst REGEX_FORMAT = /[YMDHhms]o|\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;\nfunction defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {\n let m = hours < 12 ? \"AM\" : \"PM\";\n if (hasPeriod)\n m = m.split(\"\").reduce((acc, curr) => acc += `${curr}.`, \"\");\n return isLowercase ? m.toLowerCase() : m;\n}\nfunction formatOrdinal(num) {\n const suffixes = [\"th\", \"st\", \"nd\", \"rd\"];\n const v = num % 100;\n return num + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);\n}\nfunction formatDate(date, formatStr, options = {}) {\n var _a;\n const years = date.getFullYear();\n const month = date.getMonth();\n const days = date.getDate();\n const hours = date.getHours();\n const minutes = date.getMinutes();\n const seconds = date.getSeconds();\n const milliseconds = date.getMilliseconds();\n const day = date.getDay();\n const meridiem = (_a = options.customMeridiem) != null ? _a : defaultMeridiem;\n const matches = {\n Yo: () => formatOrdinal(years),\n YY: () => String(years).slice(-2),\n YYYY: () => years,\n M: () => month + 1,\n Mo: () => formatOrdinal(month + 1),\n MM: () => `${month + 1}`.padStart(2, \"0\"),\n MMM: () => date.toLocaleDateString(options.locales, { month: \"short\" }),\n MMMM: () => date.toLocaleDateString(options.locales, { month: \"long\" }),\n D: () => String(days),\n Do: () => formatOrdinal(days),\n DD: () => `${days}`.padStart(2, \"0\"),\n H: () => String(hours),\n Ho: () => formatOrdinal(hours),\n HH: () => `${hours}`.padStart(2, \"0\"),\n h: () => `${hours % 12 || 12}`.padStart(1, \"0\"),\n ho: () => formatOrdinal(hours % 12 || 12),\n hh: () => `${hours % 12 || 12}`.padStart(2, \"0\"),\n m: () => String(minutes),\n mo: () => formatOrdinal(minutes),\n mm: () => `${minutes}`.padStart(2, \"0\"),\n s: () => String(seconds),\n so: () => formatOrdinal(seconds),\n ss: () => `${seconds}`.padStart(2, \"0\"),\n SSS: () => `${milliseconds}`.padStart(3, \"0\"),\n d: () => day,\n dd: () => date.toLocaleDateString(options.locales, { weekday: \"narrow\" }),\n ddd: () => date.toLocaleDateString(options.locales, { weekday: \"short\" }),\n dddd: () => date.toLocaleDateString(options.locales, { weekday: \"long\" }),\n A: () => meridiem(hours, minutes),\n AA: () => meridiem(hours, minutes, false, true),\n a: () => meridiem(hours, minutes, true),\n aa: () => meridiem(hours, minutes, true, true)\n };\n return formatStr.replace(REGEX_FORMAT, (match, $1) => {\n var _a2, _b;\n return (_b = $1 != null ? $1 : (_a2 = matches[match]) == null ? void 0 : _a2.call(matches)) != null ? _b : match;\n });\n}\nfunction normalizeDate(date) {\n if (date === null)\n return new Date(Number.NaN);\n if (date === void 0)\n return /* @__PURE__ */ new Date();\n if (date instanceof Date)\n return new Date(date);\n if (typeof date === \"string\" && !/Z$/i.test(date)) {\n const d = date.match(REGEX_PARSE);\n if (d) {\n const m = d[2] - 1 || 0;\n const ms = (d[7] || \"0\").substring(0, 3);\n return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);\n }\n }\n return new Date(date);\n}\nfunction useDateFormat(date, formatStr = \"HH:mm:ss\", options = {}) {\n return computed(() => formatDate(normalizeDate(toValue(date)), toValue(formatStr), options));\n}\n\nfunction useIntervalFn(cb, interval = 1e3, options = {}) {\n const {\n immediate = true,\n immediateCallback = false\n } = options;\n let timer = null;\n const isActive = ref(false);\n function clean() {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n }\n function pause() {\n isActive.value = false;\n clean();\n }\n function resume() {\n const intervalValue = toValue(interval);\n if (intervalValue <= 0)\n return;\n isActive.value = true;\n if (immediateCallback)\n cb();\n clean();\n timer = setInterval(cb, intervalValue);\n }\n if (immediate && isClient)\n resume();\n if (isRef(interval) || typeof interval === \"function\") {\n const stopWatch = watch(interval, () => {\n if (isActive.value && isClient)\n resume();\n });\n tryOnScopeDispose(stopWatch);\n }\n tryOnScopeDispose(pause);\n return {\n isActive,\n pause,\n resume\n };\n}\n\nfunction useInterval(interval = 1e3, options = {}) {\n const {\n controls: exposeControls = false,\n immediate = true,\n callback\n } = options;\n const counter = ref(0);\n const update = () => counter.value += 1;\n const reset = () => {\n counter.value = 0;\n };\n const controls = useIntervalFn(\n callback ? () => {\n update();\n callback(counter.value);\n } : update,\n interval,\n { immediate }\n );\n if (exposeControls) {\n return {\n counter,\n reset,\n ...controls\n };\n } else {\n return counter;\n }\n}\n\nfunction useLastChanged(source, options = {}) {\n var _a;\n const ms = ref((_a = options.initialValue) != null ? _a : null);\n watch(\n source,\n () => ms.value = timestamp(),\n options\n );\n return ms;\n}\n\nfunction useTimeoutFn(cb, interval, options = {}) {\n const {\n immediate = true\n } = options;\n const isPending = ref(false);\n let timer = null;\n function clear() {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n }\n function stop() {\n isPending.value = false;\n clear();\n }\n function start(...args) {\n clear();\n isPending.value = true;\n timer = setTimeout(() => {\n isPending.value = false;\n timer = null;\n cb(...args);\n }, toValue(interval));\n }\n if (immediate) {\n isPending.value = true;\n if (isClient)\n start();\n }\n tryOnScopeDispose(stop);\n return {\n isPending: readonly(isPending),\n start,\n stop\n };\n}\n\nfunction useTimeout(interval = 1e3, options = {}) {\n const {\n controls: exposeControls = false,\n callback\n } = options;\n const controls = useTimeoutFn(\n callback != null ? callback : noop,\n interval,\n options\n );\n const ready = computed(() => !controls.isPending.value);\n if (exposeControls) {\n return {\n ready,\n ...controls\n };\n } else {\n return ready;\n }\n}\n\nfunction useToNumber(value, options = {}) {\n const {\n method = \"parseFloat\",\n radix,\n nanToZero\n } = options;\n return computed(() => {\n let resolved = toValue(value);\n if (typeof resolved === \"string\")\n resolved = Number[method](resolved, radix);\n if (nanToZero && Number.isNaN(resolved))\n resolved = 0;\n return resolved;\n });\n}\n\nfunction useToString(value) {\n return computed(() => `${toValue(value)}`);\n}\n\nfunction useToggle(initialValue = false, options = {}) {\n const {\n truthyValue = true,\n falsyValue = false\n } = options;\n const valueIsRef = isRef(initialValue);\n const _value = ref(initialValue);\n function toggle(value) {\n if (arguments.length) {\n _value.value = value;\n return _value.value;\n } else {\n const truthy = toValue(truthyValue);\n _value.value = _value.value === truthy ? toValue(falsyValue) : truthy;\n return _value.value;\n }\n }\n if (valueIsRef)\n return toggle;\n else\n return [_value, toggle];\n}\n\nfunction watchArray(source, cb, options) {\n let oldList = (options == null ? void 0 : options.immediate) ? [] : [...source instanceof Function ? source() : Array.isArray(source) ? source : toValue(source)];\n return watch(source, (newList, _, onCleanup) => {\n const oldListRemains = Array.from({ length: oldList.length });\n const added = [];\n for (const obj of newList) {\n let found = false;\n for (let i = 0; i < oldList.length; i++) {\n if (!oldListRemains[i] && obj === oldList[i]) {\n oldListRemains[i] = true;\n found = true;\n break;\n }\n }\n if (!found)\n added.push(obj);\n }\n const removed = oldList.filter((_2, i) => !oldListRemains[i]);\n cb(newList, oldList, added, removed, onCleanup);\n oldList = [...newList];\n }, options);\n}\n\nfunction watchAtMost(source, cb, options) {\n const {\n count,\n ...watchOptions\n } = options;\n const current = ref(0);\n const stop = watchWithFilter(\n source,\n (...args) => {\n current.value += 1;\n if (current.value >= toValue(count))\n nextTick(() => stop());\n cb(...args);\n },\n watchOptions\n );\n return { count: current, stop };\n}\n\nfunction watchDebounced(source, cb, options = {}) {\n const {\n debounce = 0,\n maxWait = void 0,\n ...watchOptions\n } = options;\n return watchWithFilter(\n source,\n cb,\n {\n ...watchOptions,\n eventFilter: debounceFilter(debounce, { maxWait })\n }\n );\n}\n\nfunction watchDeep(source, cb, options) {\n return watch(\n source,\n cb,\n {\n ...options,\n deep: true\n }\n );\n}\n\nfunction watchIgnorable(source, cb, options = {}) {\n const {\n eventFilter = bypassFilter,\n ...watchOptions\n } = options;\n const filteredCb = createFilterWrapper(\n eventFilter,\n cb\n );\n let ignoreUpdates;\n let ignorePrevAsyncUpdates;\n let stop;\n if (watchOptions.flush === \"sync\") {\n const ignore = ref(false);\n ignorePrevAsyncUpdates = () => {\n };\n ignoreUpdates = (updater) => {\n ignore.value = true;\n updater();\n ignore.value = false;\n };\n stop = watch(\n source,\n (...args) => {\n if (!ignore.value)\n filteredCb(...args);\n },\n watchOptions\n );\n } else {\n const disposables = [];\n const ignoreCounter = ref(0);\n const syncCounter = ref(0);\n ignorePrevAsyncUpdates = () => {\n ignoreCounter.value = syncCounter.value;\n };\n disposables.push(\n watch(\n source,\n () => {\n syncCounter.value++;\n },\n { ...watchOptions, flush: \"sync\" }\n )\n );\n ignoreUpdates = (updater) => {\n const syncCounterPrev = syncCounter.value;\n updater();\n ignoreCounter.value += syncCounter.value - syncCounterPrev;\n };\n disposables.push(\n watch(\n source,\n (...args) => {\n const ignore = ignoreCounter.value > 0 && ignoreCounter.value === syncCounter.value;\n ignoreCounter.value = 0;\n syncCounter.value = 0;\n if (ignore)\n return;\n filteredCb(...args);\n },\n watchOptions\n )\n );\n stop = () => {\n disposables.forEach((fn) => fn());\n };\n }\n return { stop, ignoreUpdates, ignorePrevAsyncUpdates };\n}\n\nfunction watchImmediate(source, cb, options) {\n return watch(\n source,\n cb,\n {\n ...options,\n immediate: true\n }\n );\n}\n\nfunction watchOnce(source, cb, options) {\n const stop = watch(source, (...args) => {\n nextTick(() => stop());\n return cb(...args);\n }, options);\n return stop;\n}\n\nfunction watchThrottled(source, cb, options = {}) {\n const {\n throttle = 0,\n trailing = true,\n leading = true,\n ...watchOptions\n } = options;\n return watchWithFilter(\n source,\n cb,\n {\n ...watchOptions,\n eventFilter: throttleFilter(throttle, trailing, leading)\n }\n );\n}\n\nfunction watchTriggerable(source, cb, options = {}) {\n let cleanupFn;\n function onEffect() {\n if (!cleanupFn)\n return;\n const fn = cleanupFn;\n cleanupFn = void 0;\n fn();\n }\n function onCleanup(callback) {\n cleanupFn = callback;\n }\n const _cb = (value, oldValue) => {\n onEffect();\n return cb(value, oldValue, onCleanup);\n };\n const res = watchIgnorable(source, _cb, options);\n const { ignoreUpdates } = res;\n const trigger = () => {\n let res2;\n ignoreUpdates(() => {\n res2 = _cb(getWatchSources(source), getOldValue(source));\n });\n return res2;\n };\n return {\n ...res,\n trigger\n };\n}\nfunction getWatchSources(sources) {\n if (isReactive(sources))\n return sources;\n if (Array.isArray(sources))\n return sources.map((item) => toValue(item));\n return toValue(sources);\n}\nfunction getOldValue(source) {\n return Array.isArray(source) ? source.map(() => void 0) : void 0;\n}\n\nfunction whenever(source, cb, options) {\n const stop = watch(\n source,\n (v, ov, onInvalidate) => {\n if (v) {\n if (options == null ? void 0 : options.once)\n nextTick(() => stop());\n cb(v, ov, onInvalidate);\n }\n },\n {\n ...options,\n once: false\n }\n );\n return stop;\n}\n\nexport { assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, directiveHooks, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };\n","import { noop, makeDestructurable, camelize, toValue, isClient, isObject, tryOnScopeDispose, isIOS, tryOnMounted, objectOmit, promiseTimeout, until, increaseWithUnit, objectEntries, createSingletonPromise, useTimeoutFn, pausableWatch, toRef, createEventHook, notNullish, computedWithControl, timestamp, pausableFilter, watchIgnorable, debounceFilter, createFilterWrapper, bypassFilter, toRefs, useIntervalFn, containsProp, hasOwn, throttleFilter, useDebounceFn, useThrottleFn, clamp, syncRef, objectPick, tryOnUnmounted, watchWithFilter, tryOnBeforeUnmount, identity, isDef, isWorker } from '@vueuse/shared';\nexport * from '@vueuse/shared';\nimport { isRef, ref, shallowRef, watchEffect, computed, inject, isVue3, version, defineComponent, h, TransitionGroup, shallowReactive, Fragment, watch, getCurrentInstance, customRef, onUpdated, onMounted, isVue2, readonly, nextTick, reactive, markRaw, unref, getCurrentScope, set, del, isReadonly, onBeforeUpdate } from 'vue-demi';\n\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n let options;\n if (isRef(optionsOrRef)) {\n options = {\n evaluating: optionsOrRef\n };\n } else {\n options = optionsOrRef || {};\n }\n const {\n lazy = false,\n evaluating = void 0,\n shallow = true,\n onError = noop\n } = options;\n const started = ref(!lazy);\n const current = shallow ? shallowRef(initialState) : ref(initialState);\n let counter = 0;\n watchEffect(async (onInvalidate) => {\n if (!started.value)\n return;\n counter++;\n const counterAtBeginning = counter;\n let hasFinished = false;\n if (evaluating) {\n Promise.resolve().then(() => {\n evaluating.value = true;\n });\n }\n try {\n const result = await evaluationCallback((cancelCallback) => {\n onInvalidate(() => {\n if (evaluating)\n evaluating.value = false;\n if (!hasFinished)\n cancelCallback();\n });\n });\n if (counterAtBeginning === counter)\n current.value = result;\n } catch (e) {\n onError(e);\n } finally {\n if (evaluating && counterAtBeginning === counter)\n evaluating.value = false;\n hasFinished = true;\n }\n });\n if (lazy) {\n return computed(() => {\n started.value = true;\n return current.value;\n });\n } else {\n return current;\n }\n}\n\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n let source = inject(key);\n if (defaultSource)\n source = inject(key, defaultSource);\n if (treatDefaultAsFactory)\n source = inject(key, defaultSource, treatDefaultAsFactory);\n if (typeof options === \"function\") {\n return computed((ctx) => options(source, ctx));\n } else {\n return computed({\n get: (ctx) => options.get(source, ctx),\n set: options.set\n });\n }\n}\n\nfunction createReusableTemplate(options = {}) {\n if (!isVue3 && !version.startsWith(\"2.7.\")) {\n if (process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] createReusableTemplate only works in Vue 2.7 or above.\");\n return;\n }\n const {\n inheritAttrs = true\n } = options;\n const render = shallowRef();\n const define = /* #__PURE__ */ defineComponent({\n setup(_, { slots }) {\n return () => {\n render.value = slots.default;\n };\n }\n });\n const reuse = /* #__PURE__ */ defineComponent({\n inheritAttrs,\n setup(_, { attrs, slots }) {\n return () => {\n var _a;\n if (!render.value && process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] Failed to find the definition of reusable template\");\n const vnode = (_a = render.value) == null ? void 0 : _a.call(render, { ...keysToCamelKebabCase(attrs), $slots: slots });\n return inheritAttrs && (vnode == null ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;\n };\n }\n });\n return makeDestructurable(\n { define, reuse },\n [define, reuse]\n );\n}\nfunction keysToCamelKebabCase(obj) {\n const newObj = {};\n for (const key in obj)\n newObj[camelize(key)] = obj[key];\n return newObj;\n}\n\nfunction createTemplatePromise(options = {}) {\n if (!isVue3) {\n if (process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] createTemplatePromise only works in Vue 3 or above.\");\n return;\n }\n let index = 0;\n const instances = ref([]);\n function create(...args) {\n const props = shallowReactive({\n key: index++,\n args,\n promise: void 0,\n resolve: () => {\n },\n reject: () => {\n },\n isResolving: false,\n options\n });\n instances.value.push(props);\n props.promise = new Promise((_resolve, _reject) => {\n props.resolve = (v) => {\n props.isResolving = true;\n return _resolve(v);\n };\n props.reject = _reject;\n }).finally(() => {\n props.promise = void 0;\n const index2 = instances.value.indexOf(props);\n if (index2 !== -1)\n instances.value.splice(index2, 1);\n });\n return props.promise;\n }\n function start(...args) {\n if (options.singleton && instances.value.length > 0)\n return instances.value[0].promise;\n return create(...args);\n }\n const component = /* #__PURE__ */ defineComponent((_, { slots }) => {\n const renderList = () => instances.value.map((props) => {\n var _a;\n return h(Fragment, { key: props.key }, (_a = slots.default) == null ? void 0 : _a.call(slots, props));\n });\n if (options.transition)\n return () => h(TransitionGroup, options.transition, renderList);\n return renderList;\n });\n component.start = start;\n return component;\n}\n\nfunction createUnrefFn(fn) {\n return function(...args) {\n return fn.apply(this, args.map((i) => toValue(i)));\n };\n}\n\nfunction unrefElement(elRef) {\n var _a;\n const plain = toValue(elRef);\n return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;\n}\n\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n\nfunction useEventListener(...args) {\n let target;\n let events;\n let listeners;\n let options;\n if (typeof args[0] === \"string\" || Array.isArray(args[0])) {\n [events, listeners, options] = args;\n target = defaultWindow;\n } else {\n [target, events, listeners, options] = args;\n }\n if (!target)\n return noop;\n if (!Array.isArray(events))\n events = [events];\n if (!Array.isArray(listeners))\n listeners = [listeners];\n const cleanups = [];\n const cleanup = () => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n };\n const register = (el, event, listener, options2) => {\n el.addEventListener(event, listener, options2);\n return () => el.removeEventListener(event, listener, options2);\n };\n const stopWatch = watch(\n () => [unrefElement(target), toValue(options)],\n ([el, options2]) => {\n cleanup();\n if (!el)\n return;\n const optionsClone = isObject(options2) ? { ...options2 } : options2;\n cleanups.push(\n ...events.flatMap((event) => {\n return listeners.map((listener) => register(el, event, listener, optionsClone));\n })\n );\n },\n { immediate: true, flush: \"post\" }\n );\n const stop = () => {\n stopWatch();\n cleanup();\n };\n tryOnScopeDispose(stop);\n return stop;\n}\n\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;\n if (!window)\n return noop;\n if (isIOS && !_iOSWorkaround) {\n _iOSWorkaround = true;\n Array.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop));\n window.document.documentElement.addEventListener(\"click\", noop);\n }\n let shouldListen = true;\n const shouldIgnore = (event) => {\n return ignore.some((target2) => {\n if (typeof target2 === \"string\") {\n return Array.from(window.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));\n } else {\n const el = unrefElement(target2);\n return el && (event.target === el || event.composedPath().includes(el));\n }\n });\n };\n const listener = (event) => {\n const el = unrefElement(target);\n if (!el || el === event.target || event.composedPath().includes(el))\n return;\n if (event.detail === 0)\n shouldListen = !shouldIgnore(event);\n if (!shouldListen) {\n shouldListen = true;\n return;\n }\n handler(event);\n };\n const cleanup = [\n useEventListener(window, \"click\", listener, { passive: true, capture }),\n useEventListener(window, \"pointerdown\", (e) => {\n const el = unrefElement(target);\n shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));\n }, { passive: true }),\n detectIframe && useEventListener(window, \"blur\", (event) => {\n setTimeout(() => {\n var _a;\n const el = unrefElement(target);\n if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === \"IFRAME\" && !(el == null ? void 0 : el.contains(window.document.activeElement)))\n handler(event);\n }, 0);\n })\n ].filter(Boolean);\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nfunction createKeyPredicate(keyFilter) {\n if (typeof keyFilter === \"function\")\n return keyFilter;\n else if (typeof keyFilter === \"string\")\n return (event) => event.key === keyFilter;\n else if (Array.isArray(keyFilter))\n return (event) => keyFilter.includes(event.key);\n return () => true;\n}\nfunction onKeyStroke(...args) {\n let key;\n let handler;\n let options = {};\n if (args.length === 3) {\n key = args[0];\n handler = args[1];\n options = args[2];\n } else if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n key = true;\n handler = args[0];\n options = args[1];\n } else {\n key = args[0];\n handler = args[1];\n }\n } else {\n key = true;\n handler = args[0];\n }\n const {\n target = defaultWindow,\n eventName = \"keydown\",\n passive = false,\n dedupe = false\n } = options;\n const predicate = createKeyPredicate(key);\n const listener = (e) => {\n if (e.repeat && toValue(dedupe))\n return;\n if (predicate(e))\n handler(e);\n };\n return useEventListener(target, eventName, listener, passive);\n}\nfunction onKeyDown(key, handler, options = {}) {\n return onKeyStroke(key, handler, { ...options, eventName: \"keydown\" });\n}\nfunction onKeyPressed(key, handler, options = {}) {\n return onKeyStroke(key, handler, { ...options, eventName: \"keypress\" });\n}\nfunction onKeyUp(key, handler, options = {}) {\n return onKeyStroke(key, handler, { ...options, eventName: \"keyup\" });\n}\n\nconst DEFAULT_DELAY = 500;\nconst DEFAULT_THRESHOLD = 10;\nfunction onLongPress(target, handler, options) {\n var _a, _b;\n const elementRef = computed(() => unrefElement(target));\n let timeout;\n let posStart;\n function clear() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = void 0;\n }\n posStart = void 0;\n }\n function onDown(ev) {\n var _a2, _b2, _c, _d;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n clear();\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n posStart = {\n x: ev.x,\n y: ev.y\n };\n timeout = setTimeout(\n () => handler(ev),\n (_d = options == null ? void 0 : options.delay) != null ? _d : DEFAULT_DELAY\n );\n }\n function onMove(ev) {\n var _a2, _b2, _c, _d;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n if (!posStart || (options == null ? void 0 : options.distanceThreshold) === false)\n return;\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n const dx = ev.x - posStart.x;\n const dy = ev.y - posStart.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n if (distance >= ((_d = options == null ? void 0 : options.distanceThreshold) != null ? _d : DEFAULT_THRESHOLD))\n clear();\n }\n const listenerOptions = {\n capture: (_a = options == null ? void 0 : options.modifiers) == null ? void 0 : _a.capture,\n once: (_b = options == null ? void 0 : options.modifiers) == null ? void 0 : _b.once\n };\n const cleanup = [\n useEventListener(elementRef, \"pointerdown\", onDown, listenerOptions),\n useEventListener(elementRef, \"pointermove\", onMove, listenerOptions),\n useEventListener(elementRef, [\"pointerup\", \"pointerleave\"], clear, listenerOptions)\n ];\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nfunction isFocusedElementEditable() {\n const { activeElement, body } = document;\n if (!activeElement)\n return false;\n if (activeElement === body)\n return false;\n switch (activeElement.tagName) {\n case \"INPUT\":\n case \"TEXTAREA\":\n return true;\n }\n return activeElement.hasAttribute(\"contenteditable\");\n}\nfunction isTypedCharValid({\n keyCode,\n metaKey,\n ctrlKey,\n altKey\n}) {\n if (metaKey || ctrlKey || altKey)\n return false;\n if (keyCode >= 48 && keyCode <= 57)\n return true;\n if (keyCode >= 65 && keyCode <= 90)\n return true;\n if (keyCode >= 97 && keyCode <= 122)\n return true;\n return false;\n}\nfunction onStartTyping(callback, options = {}) {\n const { document: document2 = defaultDocument } = options;\n const keydown = (event) => {\n !isFocusedElementEditable() && isTypedCharValid(event) && callback(event);\n };\n if (document2)\n useEventListener(document2, \"keydown\", keydown, { passive: true });\n}\n\nfunction templateRef(key, initialValue = null) {\n const instance = getCurrentInstance();\n let _trigger = () => {\n };\n const element = customRef((track, trigger) => {\n _trigger = trigger;\n return {\n get() {\n var _a, _b;\n track();\n return (_b = (_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.$refs[key]) != null ? _b : initialValue;\n },\n set() {\n }\n };\n });\n tryOnMounted(_trigger);\n onUpdated(_trigger);\n return element;\n}\n\nfunction useActiveElement(options = {}) {\n var _a;\n const {\n window = defaultWindow,\n deep = true\n } = options;\n const document = (_a = options.document) != null ? _a : window == null ? void 0 : window.document;\n const getDeepActiveElement = () => {\n var _a2;\n let element = document == null ? void 0 : document.activeElement;\n if (deep) {\n while (element == null ? void 0 : element.shadowRoot)\n element = (_a2 = element == null ? void 0 : element.shadowRoot) == null ? void 0 : _a2.activeElement;\n }\n return element;\n };\n const activeElement = ref();\n const trigger = () => {\n activeElement.value = getDeepActiveElement();\n };\n if (window) {\n useEventListener(window, \"blur\", (event) => {\n if (event.relatedTarget !== null)\n return;\n trigger();\n }, true);\n useEventListener(window, \"focus\", trigger, true);\n }\n trigger();\n return activeElement;\n}\n\nfunction useMounted() {\n const isMounted = ref(false);\n const instance = getCurrentInstance();\n if (instance) {\n onMounted(() => {\n isMounted.value = true;\n }, isVue2 ? null : instance);\n }\n return isMounted;\n}\n\nfunction useSupported(callback) {\n const isMounted = useMounted();\n return computed(() => {\n isMounted.value;\n return Boolean(callback());\n });\n}\n\nfunction useRafFn(fn, options = {}) {\n const {\n immediate = true,\n fpsLimit = void 0,\n window = defaultWindow\n } = options;\n const isActive = ref(false);\n const intervalLimit = fpsLimit ? 1e3 / fpsLimit : null;\n let previousFrameTimestamp = 0;\n let rafId = null;\n function loop(timestamp) {\n if (!isActive.value || !window)\n return;\n if (!previousFrameTimestamp)\n previousFrameTimestamp = timestamp;\n const delta = timestamp - previousFrameTimestamp;\n if (intervalLimit && delta < intervalLimit) {\n rafId = window.requestAnimationFrame(loop);\n return;\n }\n previousFrameTimestamp = timestamp;\n fn({ delta, timestamp });\n rafId = window.requestAnimationFrame(loop);\n }\n function resume() {\n if (!isActive.value && window) {\n isActive.value = true;\n previousFrameTimestamp = 0;\n rafId = window.requestAnimationFrame(loop);\n }\n }\n function pause() {\n isActive.value = false;\n if (rafId != null && window) {\n window.cancelAnimationFrame(rafId);\n rafId = null;\n }\n }\n if (immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive: readonly(isActive),\n pause,\n resume\n };\n}\n\nfunction useAnimate(target, keyframes, options) {\n let config;\n let animateOptions;\n if (isObject(options)) {\n config = options;\n animateOptions = objectOmit(options, [\"window\", \"immediate\", \"commitStyles\", \"persist\", \"onReady\", \"onError\"]);\n } else {\n config = { duration: options };\n animateOptions = options;\n }\n const {\n window = defaultWindow,\n immediate = true,\n commitStyles,\n persist,\n playbackRate: _playbackRate = 1,\n onReady,\n onError = (e) => {\n console.error(e);\n }\n } = config;\n const isSupported = useSupported(() => window && HTMLElement && \"animate\" in HTMLElement.prototype);\n const animate = shallowRef(void 0);\n const store = shallowReactive({\n startTime: null,\n currentTime: null,\n timeline: null,\n playbackRate: _playbackRate,\n pending: false,\n playState: immediate ? \"idle\" : \"paused\",\n replaceState: \"active\"\n });\n const pending = computed(() => store.pending);\n const playState = computed(() => store.playState);\n const replaceState = computed(() => store.replaceState);\n const startTime = computed({\n get() {\n return store.startTime;\n },\n set(value) {\n store.startTime = value;\n if (animate.value)\n animate.value.startTime = value;\n }\n });\n const currentTime = computed({\n get() {\n return store.currentTime;\n },\n set(value) {\n store.currentTime = value;\n if (animate.value) {\n animate.value.currentTime = value;\n syncResume();\n }\n }\n });\n const timeline = computed({\n get() {\n return store.timeline;\n },\n set(value) {\n store.timeline = value;\n if (animate.value)\n animate.value.timeline = value;\n }\n });\n const playbackRate = computed({\n get() {\n return store.playbackRate;\n },\n set(value) {\n store.playbackRate = value;\n if (animate.value)\n animate.value.playbackRate = value;\n }\n });\n const play = () => {\n if (animate.value) {\n try {\n animate.value.play();\n syncResume();\n } catch (e) {\n syncPause();\n onError(e);\n }\n } else {\n update();\n }\n };\n const pause = () => {\n var _a;\n try {\n (_a = animate.value) == null ? void 0 : _a.pause();\n syncPause();\n } catch (e) {\n onError(e);\n }\n };\n const reverse = () => {\n var _a;\n !animate.value && update();\n try {\n (_a = animate.value) == null ? void 0 : _a.reverse();\n syncResume();\n } catch (e) {\n syncPause();\n onError(e);\n }\n };\n const finish = () => {\n var _a;\n try {\n (_a = animate.value) == null ? void 0 : _a.finish();\n syncPause();\n } catch (e) {\n onError(e);\n }\n };\n const cancel = () => {\n var _a;\n try {\n (_a = animate.value) == null ? void 0 : _a.cancel();\n syncPause();\n } catch (e) {\n onError(e);\n }\n };\n watch(() => unrefElement(target), (el) => {\n el && update();\n });\n watch(() => keyframes, (value) => {\n !animate.value && update();\n if (!unrefElement(target) && animate.value) {\n animate.value.effect = new KeyframeEffect(\n unrefElement(target),\n toValue(value),\n animateOptions\n );\n }\n }, { deep: true });\n tryOnMounted(() => {\n nextTick(() => update(true));\n });\n tryOnScopeDispose(cancel);\n function update(init) {\n const el = unrefElement(target);\n if (!isSupported.value || !el)\n return;\n if (!animate.value)\n animate.value = el.animate(toValue(keyframes), animateOptions);\n if (commitStyles)\n animate.value.commitStyles();\n if (persist)\n animate.value.persist();\n if (_playbackRate !== 1)\n animate.value.playbackRate = _playbackRate;\n if (init && !immediate)\n animate.value.pause();\n else\n syncResume();\n onReady == null ? void 0 : onReady(animate.value);\n }\n useEventListener(animate, [\"cancel\", \"finish\", \"remove\"], syncPause);\n const { resume: resumeRef, pause: pauseRef } = useRafFn(() => {\n if (!animate.value)\n return;\n store.pending = animate.value.pending;\n store.playState = animate.value.playState;\n store.replaceState = animate.value.replaceState;\n store.startTime = animate.value.startTime;\n store.currentTime = animate.value.currentTime;\n store.timeline = animate.value.timeline;\n store.playbackRate = animate.value.playbackRate;\n }, { immediate: false });\n function syncResume() {\n if (isSupported.value)\n resumeRef();\n }\n function syncPause() {\n if (isSupported.value && window)\n window.requestAnimationFrame(pauseRef);\n }\n return {\n isSupported,\n animate,\n // actions\n play,\n pause,\n reverse,\n finish,\n cancel,\n // state\n pending,\n playState,\n replaceState,\n startTime,\n currentTime,\n timeline,\n playbackRate\n };\n}\n\nfunction useAsyncQueue(tasks, options) {\n const {\n interrupt = true,\n onError = noop,\n onFinished = noop,\n signal\n } = options || {};\n const promiseState = {\n aborted: \"aborted\",\n fulfilled: \"fulfilled\",\n pending: \"pending\",\n rejected: \"rejected\"\n };\n const initialResult = Array.from(Array.from({ length: tasks.length }), () => ({ state: promiseState.pending, data: null }));\n const result = reactive(initialResult);\n const activeIndex = ref(-1);\n if (!tasks || tasks.length === 0) {\n onFinished();\n return {\n activeIndex,\n result\n };\n }\n function updateResult(state, res) {\n activeIndex.value++;\n result[activeIndex.value].data = res;\n result[activeIndex.value].state = state;\n }\n tasks.reduce((prev, curr) => {\n return prev.then((prevRes) => {\n var _a;\n if (signal == null ? void 0 : signal.aborted) {\n updateResult(promiseState.aborted, new Error(\"aborted\"));\n return;\n }\n if (((_a = result[activeIndex.value]) == null ? void 0 : _a.state) === promiseState.rejected && interrupt) {\n onFinished();\n return;\n }\n const done = curr(prevRes).then((currentRes) => {\n updateResult(promiseState.fulfilled, currentRes);\n activeIndex.value === tasks.length - 1 && onFinished();\n return currentRes;\n });\n if (!signal)\n return done;\n return Promise.race([done, whenAborted(signal)]);\n }).catch((e) => {\n if (signal == null ? void 0 : signal.aborted) {\n updateResult(promiseState.aborted, e);\n return e;\n }\n updateResult(promiseState.rejected, e);\n onError();\n return e;\n });\n }, Promise.resolve());\n return {\n activeIndex,\n result\n };\n}\nfunction whenAborted(signal) {\n return new Promise((resolve, reject) => {\n const error = new Error(\"aborted\");\n if (signal.aborted)\n reject(error);\n else\n signal.addEventListener(\"abort\", () => reject(error), { once: true });\n });\n}\n\nfunction useAsyncState(promise, initialState, options) {\n const {\n immediate = true,\n delay = 0,\n onError = noop,\n onSuccess = noop,\n resetOnExecute = true,\n shallow = true,\n throwError\n } = options != null ? options : {};\n const state = shallow ? shallowRef(initialState) : ref(initialState);\n const isReady = ref(false);\n const isLoading = ref(false);\n const error = shallowRef(void 0);\n async function execute(delay2 = 0, ...args) {\n if (resetOnExecute)\n state.value = initialState;\n error.value = void 0;\n isReady.value = false;\n isLoading.value = true;\n if (delay2 > 0)\n await promiseTimeout(delay2);\n const _promise = typeof promise === \"function\" ? promise(...args) : promise;\n try {\n const data = await _promise;\n state.value = data;\n isReady.value = true;\n onSuccess(data);\n } catch (e) {\n error.value = e;\n onError(e);\n if (throwError)\n throw e;\n } finally {\n isLoading.value = false;\n }\n return state.value;\n }\n if (immediate)\n execute(delay);\n const shell = {\n state,\n isReady,\n isLoading,\n error,\n execute\n };\n function waitUntilIsLoaded() {\n return new Promise((resolve, reject) => {\n until(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);\n });\n }\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilIsLoaded().then(onFulfilled, onRejected);\n }\n };\n}\n\nconst defaults = {\n array: (v) => JSON.stringify(v),\n object: (v) => JSON.stringify(v),\n set: (v) => JSON.stringify(Array.from(v)),\n map: (v) => JSON.stringify(Object.fromEntries(v)),\n null: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n if (!target)\n return defaults.null;\n if (target instanceof Map)\n return defaults.map;\n else if (target instanceof Set)\n return defaults.set;\n else if (Array.isArray(target))\n return defaults.array;\n else\n return defaults.object;\n}\n\nfunction useBase64(target, options) {\n const base64 = ref(\"\");\n const promise = ref();\n function execute() {\n if (!isClient)\n return;\n promise.value = new Promise((resolve, reject) => {\n try {\n const _target = toValue(target);\n if (_target == null) {\n resolve(\"\");\n } else if (typeof _target === \"string\") {\n resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n } else if (_target instanceof Blob) {\n resolve(blobToBase64(_target));\n } else if (_target instanceof ArrayBuffer) {\n resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n } else if (_target instanceof HTMLCanvasElement) {\n resolve(_target.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n } else if (_target instanceof HTMLImageElement) {\n const img = _target.cloneNode(false);\n img.crossOrigin = \"Anonymous\";\n imgLoaded(img).then(() => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n resolve(canvas.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n }).catch(reject);\n } else if (typeof _target === \"object\") {\n const _serializeFn = (options == null ? void 0 : options.serializer) || getDefaultSerialization(_target);\n const serialized = _serializeFn(_target);\n return resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n } else {\n reject(new Error(\"target is unsupported types\"));\n }\n } catch (error) {\n reject(error);\n }\n });\n promise.value.then((res) => base64.value = res);\n return promise.value;\n }\n if (isRef(target) || typeof target === \"function\")\n watch(target, execute, { immediate: true });\n else\n execute();\n return {\n base64,\n promise,\n execute\n };\n}\nfunction imgLoaded(img) {\n return new Promise((resolve, reject) => {\n if (!img.complete) {\n img.onload = () => {\n resolve();\n };\n img.onerror = reject;\n } else {\n resolve();\n }\n });\n}\nfunction blobToBase64(blob) {\n return new Promise((resolve, reject) => {\n const fr = new FileReader();\n fr.onload = (e) => {\n resolve(e.target.result);\n };\n fr.onerror = reject;\n fr.readAsDataURL(blob);\n });\n}\n\nfunction useBattery(options = {}) {\n const { navigator = defaultNavigator } = options;\n const events = [\"chargingchange\", \"chargingtimechange\", \"dischargingtimechange\", \"levelchange\"];\n const isSupported = useSupported(() => navigator && \"getBattery\" in navigator && typeof navigator.getBattery === \"function\");\n const charging = ref(false);\n const chargingTime = ref(0);\n const dischargingTime = ref(0);\n const level = ref(1);\n let battery;\n function updateBatteryInfo() {\n charging.value = this.charging;\n chargingTime.value = this.chargingTime || 0;\n dischargingTime.value = this.dischargingTime || 0;\n level.value = this.level;\n }\n if (isSupported.value) {\n navigator.getBattery().then((_battery) => {\n battery = _battery;\n updateBatteryInfo.call(battery);\n useEventListener(battery, events, updateBatteryInfo, { passive: true });\n });\n }\n return {\n isSupported,\n charging,\n chargingTime,\n dischargingTime,\n level\n };\n}\n\nfunction useBluetooth(options) {\n let {\n acceptAllDevices = false\n } = options || {};\n const {\n filters = void 0,\n optionalServices = void 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => navigator && \"bluetooth\" in navigator);\n const device = shallowRef(void 0);\n const error = shallowRef(null);\n watch(device, () => {\n connectToBluetoothGATTServer();\n });\n async function requestDevice() {\n if (!isSupported.value)\n return;\n error.value = null;\n if (filters && filters.length > 0)\n acceptAllDevices = false;\n try {\n device.value = await (navigator == null ? void 0 : navigator.bluetooth.requestDevice({\n acceptAllDevices,\n filters,\n optionalServices\n }));\n } catch (err) {\n error.value = err;\n }\n }\n const server = ref();\n const isConnected = computed(() => {\n var _a;\n return ((_a = server.value) == null ? void 0 : _a.connected) || false;\n });\n async function connectToBluetoothGATTServer() {\n error.value = null;\n if (device.value && device.value.gatt) {\n device.value.addEventListener(\"gattserverdisconnected\", () => {\n });\n try {\n server.value = await device.value.gatt.connect();\n } catch (err) {\n error.value = err;\n }\n }\n }\n tryOnMounted(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.connect();\n });\n tryOnScopeDispose(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.disconnect();\n });\n return {\n isSupported,\n isConnected,\n // Device:\n device,\n requestDevice,\n // Server:\n server,\n // Errors:\n error\n };\n}\n\nfunction useMediaQuery(query, options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n let mediaQuery;\n const matches = ref(false);\n const handler = (event) => {\n matches.value = event.matches;\n };\n const cleanup = () => {\n if (!mediaQuery)\n return;\n if (\"removeEventListener\" in mediaQuery)\n mediaQuery.removeEventListener(\"change\", handler);\n else\n mediaQuery.removeListener(handler);\n };\n const stopWatch = watchEffect(() => {\n if (!isSupported.value)\n return;\n cleanup();\n mediaQuery = window.matchMedia(toValue(query));\n if (\"addEventListener\" in mediaQuery)\n mediaQuery.addEventListener(\"change\", handler);\n else\n mediaQuery.addListener(handler);\n matches.value = mediaQuery.matches;\n });\n tryOnScopeDispose(() => {\n stopWatch();\n cleanup();\n mediaQuery = void 0;\n });\n return matches;\n}\n\nconst breakpointsTailwind = {\n \"sm\": 640,\n \"md\": 768,\n \"lg\": 1024,\n \"xl\": 1280,\n \"2xl\": 1536\n};\nconst breakpointsBootstrapV5 = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400\n};\nconst breakpointsVuetifyV2 = {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1264,\n xl: 1904\n};\nconst breakpointsVuetifyV3 = {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560\n};\nconst breakpointsVuetify = breakpointsVuetifyV2;\nconst breakpointsAntDesign = {\n xs: 480,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1600\n};\nconst breakpointsQuasar = {\n xs: 0,\n sm: 600,\n md: 1024,\n lg: 1440,\n xl: 1920\n};\nconst breakpointsSematic = {\n mobileS: 320,\n mobileM: 375,\n mobileL: 425,\n tablet: 768,\n laptop: 1024,\n laptopL: 1440,\n desktop4K: 2560\n};\nconst breakpointsMasterCss = {\n \"3xs\": 360,\n \"2xs\": 480,\n \"xs\": 600,\n \"sm\": 768,\n \"md\": 1024,\n \"lg\": 1280,\n \"xl\": 1440,\n \"2xl\": 1600,\n \"3xl\": 1920,\n \"4xl\": 2560\n};\nconst breakpointsPrimeFlex = {\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200\n};\n\nfunction useBreakpoints(breakpoints, options = {}) {\n function getValue(k, delta) {\n let v = toValue(breakpoints[toValue(k)]);\n if (delta != null)\n v = increaseWithUnit(v, delta);\n if (typeof v === \"number\")\n v = `${v}px`;\n return v;\n }\n const { window = defaultWindow, strategy = \"min-width\" } = options;\n function match(query) {\n if (!window)\n return false;\n return window.matchMedia(query).matches;\n }\n const greaterOrEqual = (k) => {\n return useMediaQuery(() => `(min-width: ${getValue(k)})`, options);\n };\n const smallerOrEqual = (k) => {\n return useMediaQuery(() => `(max-width: ${getValue(k)})`, options);\n };\n const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n Object.defineProperty(shortcuts, k, {\n get: () => strategy === \"min-width\" ? greaterOrEqual(k) : smallerOrEqual(k),\n enumerable: true,\n configurable: true\n });\n return shortcuts;\n }, {});\n function current() {\n const points = Object.keys(breakpoints).map((i) => [i, greaterOrEqual(i)]);\n return computed(() => points.filter(([, v]) => v.value).map(([k]) => k));\n }\n return Object.assign(shortcutMethods, {\n greaterOrEqual,\n smallerOrEqual,\n greater(k) {\n return useMediaQuery(() => `(min-width: ${getValue(k, 0.1)})`, options);\n },\n smaller(k) {\n return useMediaQuery(() => `(max-width: ${getValue(k, -0.1)})`, options);\n },\n between(a, b) {\n return useMediaQuery(() => `(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`, options);\n },\n isGreater(k) {\n return match(`(min-width: ${getValue(k, 0.1)})`);\n },\n isGreaterOrEqual(k) {\n return match(`(min-width: ${getValue(k)})`);\n },\n isSmaller(k) {\n return match(`(max-width: ${getValue(k, -0.1)})`);\n },\n isSmallerOrEqual(k) {\n return match(`(max-width: ${getValue(k)})`);\n },\n isInBetween(a, b) {\n return match(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`);\n },\n current,\n active() {\n const bps = current();\n return computed(() => bps.value.length === 0 ? \"\" : bps.value.at(-1));\n }\n });\n}\n\nfunction useBroadcastChannel(options) {\n const {\n name,\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"BroadcastChannel\" in window);\n const isClosed = ref(false);\n const channel = ref();\n const data = ref();\n const error = shallowRef(null);\n const post = (data2) => {\n if (channel.value)\n channel.value.postMessage(data2);\n };\n const close = () => {\n if (channel.value)\n channel.value.close();\n isClosed.value = true;\n };\n if (isSupported.value) {\n tryOnMounted(() => {\n error.value = null;\n channel.value = new BroadcastChannel(name);\n channel.value.addEventListener(\"message\", (e) => {\n data.value = e.data;\n }, { passive: true });\n channel.value.addEventListener(\"messageerror\", (e) => {\n error.value = e;\n }, { passive: true });\n channel.value.addEventListener(\"close\", () => {\n isClosed.value = true;\n });\n });\n }\n tryOnScopeDispose(() => {\n close();\n });\n return {\n isSupported,\n channel,\n data,\n post,\n close,\n error,\n isClosed\n };\n}\n\nconst WRITABLE_PROPERTIES = [\n \"hash\",\n \"host\",\n \"hostname\",\n \"href\",\n \"pathname\",\n \"port\",\n \"protocol\",\n \"search\"\n];\nfunction useBrowserLocation(options = {}) {\n const { window = defaultWindow } = options;\n const refs = Object.fromEntries(\n WRITABLE_PROPERTIES.map((key) => [key, ref()])\n );\n for (const [key, ref2] of objectEntries(refs)) {\n watch(ref2, (value) => {\n if (!(window == null ? void 0 : window.location) || window.location[key] === value)\n return;\n window.location[key] = value;\n });\n }\n const buildState = (trigger) => {\n var _a;\n const { state: state2, length } = (window == null ? void 0 : window.history) || {};\n const { origin } = (window == null ? void 0 : window.location) || {};\n for (const key of WRITABLE_PROPERTIES)\n refs[key].value = (_a = window == null ? void 0 : window.location) == null ? void 0 : _a[key];\n return reactive({\n trigger,\n state: state2,\n length,\n origin,\n ...refs\n });\n };\n const state = ref(buildState(\"load\"));\n if (window) {\n useEventListener(window, \"popstate\", () => state.value = buildState(\"popstate\"), { passive: true });\n useEventListener(window, \"hashchange\", () => state.value = buildState(\"hashchange\"), { passive: true });\n }\n return state;\n}\n\nfunction useCached(refValue, comparator = (a, b) => a === b, watchOptions) {\n const cachedValue = ref(refValue.value);\n watch(() => refValue.value, (value) => {\n if (!comparator(value, cachedValue.value))\n cachedValue.value = value;\n }, watchOptions);\n return cachedValue;\n}\n\nfunction usePermission(permissionDesc, options = {}) {\n const {\n controls = false,\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"permissions\" in navigator);\n let permissionStatus;\n const desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n const state = ref();\n const onChange = () => {\n if (permissionStatus)\n state.value = permissionStatus.state;\n };\n const query = createSingletonPromise(async () => {\n if (!isSupported.value)\n return;\n if (!permissionStatus) {\n try {\n permissionStatus = await navigator.permissions.query(desc);\n useEventListener(permissionStatus, \"change\", onChange);\n onChange();\n } catch (e) {\n state.value = \"prompt\";\n }\n }\n return permissionStatus;\n });\n query();\n if (controls) {\n return {\n state,\n isSupported,\n query\n };\n } else {\n return state;\n }\n}\n\nfunction useClipboard(options = {}) {\n const {\n navigator = defaultNavigator,\n read = false,\n source,\n copiedDuring = 1500,\n legacy = false\n } = options;\n const isClipboardApiSupported = useSupported(() => navigator && \"clipboard\" in navigator);\n const permissionRead = usePermission(\"clipboard-read\");\n const permissionWrite = usePermission(\"clipboard-write\");\n const isSupported = computed(() => isClipboardApiSupported.value || legacy);\n const text = ref(\"\");\n const copied = ref(false);\n const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);\n function updateText() {\n if (isClipboardApiSupported.value && isAllowed(permissionRead.value)) {\n navigator.clipboard.readText().then((value) => {\n text.value = value;\n });\n } else {\n text.value = legacyRead();\n }\n }\n if (isSupported.value && read)\n useEventListener([\"copy\", \"cut\"], updateText);\n async function copy(value = toValue(source)) {\n if (isSupported.value && value != null) {\n if (isClipboardApiSupported.value && isAllowed(permissionWrite.value))\n await navigator.clipboard.writeText(value);\n else\n legacyCopy(value);\n text.value = value;\n copied.value = true;\n timeout.start();\n }\n }\n function legacyCopy(value) {\n const ta = document.createElement(\"textarea\");\n ta.value = value != null ? value : \"\";\n ta.style.position = \"absolute\";\n ta.style.opacity = \"0\";\n document.body.appendChild(ta);\n ta.select();\n document.execCommand(\"copy\");\n ta.remove();\n }\n function legacyRead() {\n var _a, _b, _c;\n return (_c = (_b = (_a = document == null ? void 0 : document.getSelection) == null ? void 0 : _a.call(document)) == null ? void 0 : _b.toString()) != null ? _c : \"\";\n }\n function isAllowed(status) {\n return status === \"granted\" || status === \"prompt\";\n }\n return {\n isSupported,\n text,\n copied,\n copy\n };\n}\n\nfunction useClipboardItems(options = {}) {\n const {\n navigator = defaultNavigator,\n read = false,\n source,\n copiedDuring = 1500\n } = options;\n const isSupported = useSupported(() => navigator && \"clipboard\" in navigator);\n const content = ref([]);\n const copied = ref(false);\n const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);\n function updateContent() {\n if (isSupported.value) {\n navigator.clipboard.read().then((items) => {\n content.value = items;\n });\n }\n }\n if (isSupported.value && read)\n useEventListener([\"copy\", \"cut\"], updateContent);\n async function copy(value = toValue(source)) {\n if (isSupported.value && value != null) {\n await navigator.clipboard.write(value);\n content.value = value;\n copied.value = true;\n timeout.start();\n }\n }\n return {\n isSupported,\n content,\n copied,\n copy\n };\n}\n\nfunction cloneFnJSON(source) {\n return JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n const cloned = ref({});\n const {\n manual,\n clone = cloneFnJSON,\n // watch options\n deep = true,\n immediate = true\n } = options;\n function sync() {\n cloned.value = clone(toValue(source));\n }\n if (!manual && (isRef(source) || typeof source === \"function\")) {\n watch(source, sync, {\n ...options,\n deep,\n immediate\n });\n } else {\n sync();\n }\n return { cloned, sync };\n}\n\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\nconst handlers = /* @__PURE__ */ getHandlers();\nfunction getHandlers() {\n if (!(globalKey in _global))\n _global[globalKey] = _global[globalKey] || {};\n return _global[globalKey];\n}\nfunction getSSRHandler(key, fallback) {\n return handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n handlers[key] = fn;\n}\n\nfunction guessSerializerType(rawInit) {\n return rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n\nconst StorageSerializers = {\n boolean: {\n read: (v) => v === \"true\",\n write: (v) => String(v)\n },\n object: {\n read: (v) => JSON.parse(v),\n write: (v) => JSON.stringify(v)\n },\n number: {\n read: (v) => Number.parseFloat(v),\n write: (v) => String(v)\n },\n any: {\n read: (v) => v,\n write: (v) => String(v)\n },\n string: {\n read: (v) => v,\n write: (v) => String(v)\n },\n map: {\n read: (v) => new Map(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v.entries()))\n },\n set: {\n read: (v) => new Set(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v))\n },\n date: {\n read: (v) => new Date(v),\n write: (v) => v.toISOString()\n }\n};\nconst customStorageEventName = \"vueuse-storage\";\nfunction useStorage(key, defaults, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n },\n initOnMounted\n } = options;\n const data = (shallow ? shallowRef : ref)(typeof defaults === \"function\" ? defaults() : defaults);\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorage\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n if (!storage)\n return data;\n const rawInit = toValue(defaults);\n const type = guessSerializerType(rawInit);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n const { pause: pauseWatch, resume: resumeWatch } = pausableWatch(\n data,\n () => write(data.value),\n { flush, deep, eventFilter }\n );\n if (window && listenToStorageChanges) {\n tryOnMounted(() => {\n useEventListener(window, \"storage\", update);\n useEventListener(window, customStorageEventName, updateFromCustomEvent);\n if (initOnMounted)\n update();\n });\n }\n if (!initOnMounted)\n update();\n function dispatchWriteEvent(oldValue, newValue) {\n if (window) {\n window.dispatchEvent(new CustomEvent(customStorageEventName, {\n detail: {\n key,\n oldValue,\n newValue,\n storageArea: storage\n }\n }));\n }\n }\n function write(v) {\n try {\n const oldValue = storage.getItem(key);\n if (v == null) {\n dispatchWriteEvent(oldValue, null);\n storage.removeItem(key);\n } else {\n const serialized = serializer.write(v);\n if (oldValue !== serialized) {\n storage.setItem(key, serialized);\n dispatchWriteEvent(oldValue, serialized);\n }\n }\n } catch (e) {\n onError(e);\n }\n }\n function read(event) {\n const rawValue = event ? event.newValue : storage.getItem(key);\n if (rawValue == null) {\n if (writeDefaults && rawInit != null)\n storage.setItem(key, serializer.write(rawInit));\n return rawInit;\n } else if (!event && mergeDefaults) {\n const value = serializer.read(rawValue);\n if (typeof mergeDefaults === \"function\")\n return mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n return { ...rawInit, ...value };\n return value;\n } else if (typeof rawValue !== \"string\") {\n return rawValue;\n } else {\n return serializer.read(rawValue);\n }\n }\n function update(event) {\n if (event && event.storageArea !== storage)\n return;\n if (event && event.key == null) {\n data.value = rawInit;\n return;\n }\n if (event && event.key !== key)\n return;\n pauseWatch();\n try {\n if ((event == null ? void 0 : event.newValue) !== serializer.write(data.value))\n data.value = read(event);\n } catch (e) {\n onError(e);\n } finally {\n if (event)\n nextTick(resumeWatch);\n else\n resumeWatch();\n }\n }\n function updateFromCustomEvent(event) {\n update(event.detail);\n }\n return data;\n}\n\nfunction usePreferredDark(options) {\n return useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n\nfunction useColorMode(options = {}) {\n const {\n selector = \"html\",\n attribute = \"class\",\n initialValue = \"auto\",\n window = defaultWindow,\n storage,\n storageKey = \"vueuse-color-scheme\",\n listenToStorageChanges = true,\n storageRef,\n emitAuto,\n disableTransition = true\n } = options;\n const modes = {\n auto: \"\",\n light: \"light\",\n dark: \"dark\",\n ...options.modes || {}\n };\n const preferredDark = usePreferredDark({ window });\n const system = computed(() => preferredDark.value ? \"dark\" : \"light\");\n const store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, { window, listenToStorageChanges }));\n const state = computed(() => store.value === \"auto\" ? system.value : store.value);\n const updateHTMLAttrs = getSSRHandler(\n \"updateHTMLAttrs\",\n (selector2, attribute2, value) => {\n const el = typeof selector2 === \"string\" ? window == null ? void 0 : window.document.querySelector(selector2) : unrefElement(selector2);\n if (!el)\n return;\n let style;\n if (disableTransition) {\n style = window.document.createElement(\"style\");\n const styleString = \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\";\n style.appendChild(document.createTextNode(styleString));\n window.document.head.appendChild(style);\n }\n if (attribute2 === \"class\") {\n const current = value.split(/\\s/g);\n Object.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n if (current.includes(v))\n el.classList.add(v);\n else\n el.classList.remove(v);\n });\n } else {\n el.setAttribute(attribute2, value);\n }\n if (disableTransition) {\n window.getComputedStyle(style).opacity;\n document.head.removeChild(style);\n }\n }\n );\n function defaultOnChanged(mode) {\n var _a;\n updateHTMLAttrs(selector, attribute, (_a = modes[mode]) != null ? _a : mode);\n }\n function onChanged(mode) {\n if (options.onChanged)\n options.onChanged(mode, defaultOnChanged);\n else\n defaultOnChanged(mode);\n }\n watch(state, onChanged, { flush: \"post\", immediate: true });\n tryOnMounted(() => onChanged(state.value));\n const auto = computed({\n get() {\n return emitAuto ? store.value : state.value;\n },\n set(v) {\n store.value = v;\n }\n });\n try {\n return Object.assign(auto, { store, system, state });\n } catch (e) {\n return auto;\n }\n}\n\nfunction useConfirmDialog(revealed = ref(false)) {\n const confirmHook = createEventHook();\n const cancelHook = createEventHook();\n const revealHook = createEventHook();\n let _resolve = noop;\n const reveal = (data) => {\n revealHook.trigger(data);\n revealed.value = true;\n return new Promise((resolve) => {\n _resolve = resolve;\n });\n };\n const confirm = (data) => {\n revealed.value = false;\n confirmHook.trigger(data);\n _resolve({ data, isCanceled: false });\n };\n const cancel = (data) => {\n revealed.value = false;\n cancelHook.trigger(data);\n _resolve({ data, isCanceled: true });\n };\n return {\n isRevealed: computed(() => revealed.value),\n reveal,\n confirm,\n cancel,\n onReveal: revealHook.on,\n onConfirm: confirmHook.on,\n onCancel: cancelHook.on\n };\n}\n\nfunction useMutationObserver(target, callback, options = {}) {\n const { window = defaultWindow, ...mutationOptions } = options;\n let observer;\n const isSupported = useSupported(() => window && \"MutationObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const targets = computed(() => {\n const value = toValue(target);\n const items = (Array.isArray(value) ? value : [value]).map(unrefElement).filter(notNullish);\n return new Set(items);\n });\n const stopWatch = watch(\n () => targets.value,\n (targets2) => {\n cleanup();\n if (isSupported.value && window && targets2.size) {\n observer = new MutationObserver(callback);\n targets2.forEach((el) => observer.observe(el, mutationOptions));\n }\n },\n { immediate: true, flush: \"post\" }\n );\n const takeRecords = () => {\n return observer == null ? void 0 : observer.takeRecords();\n };\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop,\n takeRecords\n };\n}\n\nfunction useCssVar(prop, target, options = {}) {\n const { window = defaultWindow, initialValue = \"\", observe = false } = options;\n const variable = ref(initialValue);\n const elRef = computed(() => {\n var _a;\n return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);\n });\n function updateCssVar() {\n var _a;\n const key = toValue(prop);\n const el = toValue(elRef);\n if (el && window) {\n const value = (_a = window.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim();\n variable.value = value || initialValue;\n }\n }\n if (observe) {\n useMutationObserver(elRef, updateCssVar, {\n attributeFilter: [\"style\", \"class\"],\n window\n });\n }\n watch(\n [elRef, () => toValue(prop)],\n updateCssVar,\n { immediate: true }\n );\n watch(\n variable,\n (val) => {\n var _a;\n if ((_a = elRef.value) == null ? void 0 : _a.style)\n elRef.value.style.setProperty(toValue(prop), val);\n }\n );\n return variable;\n}\n\nfunction useCurrentElement(rootComponent) {\n const vm = getCurrentInstance();\n const currentElement = computedWithControl(\n () => null,\n () => rootComponent ? unrefElement(rootComponent) : vm.proxy.$el\n );\n onUpdated(currentElement.trigger);\n onMounted(currentElement.trigger);\n return currentElement;\n}\n\nfunction useCycleList(list, options) {\n const state = shallowRef(getInitialValue());\n const listRef = toRef(list);\n const index = computed({\n get() {\n var _a;\n const targetList = listRef.value;\n let index2 = (options == null ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, targetList) : targetList.indexOf(state.value);\n if (index2 < 0)\n index2 = (_a = options == null ? void 0 : options.fallbackIndex) != null ? _a : 0;\n return index2;\n },\n set(v) {\n set(v);\n }\n });\n function set(i) {\n const targetList = listRef.value;\n const length = targetList.length;\n const index2 = (i % length + length) % length;\n const value = targetList[index2];\n state.value = value;\n return value;\n }\n function shift(delta = 1) {\n return set(index.value + delta);\n }\n function next(n = 1) {\n return shift(n);\n }\n function prev(n = 1) {\n return shift(-n);\n }\n function getInitialValue() {\n var _a, _b;\n return (_b = toValue((_a = options == null ? void 0 : options.initialValue) != null ? _a : toValue(list)[0])) != null ? _b : void 0;\n }\n watch(listRef, () => set(index.value));\n return {\n state,\n index,\n next,\n prev,\n go: set\n };\n}\n\nfunction useDark(options = {}) {\n const {\n valueDark = \"dark\",\n valueLight = \"\",\n window = defaultWindow\n } = options;\n const mode = useColorMode({\n ...options,\n onChanged: (mode2, defaultHandler) => {\n var _a;\n if (options.onChanged)\n (_a = options.onChanged) == null ? void 0 : _a.call(options, mode2 === \"dark\", defaultHandler, mode2);\n else\n defaultHandler(mode2);\n },\n modes: {\n dark: valueDark,\n light: valueLight\n }\n });\n const system = computed(() => {\n if (mode.system) {\n return mode.system.value;\n } else {\n const preferredDark = usePreferredDark({ window });\n return preferredDark.value ? \"dark\" : \"light\";\n }\n });\n const isDark = computed({\n get() {\n return mode.value === \"dark\";\n },\n set(v) {\n const modeVal = v ? \"dark\" : \"light\";\n if (system.value === modeVal)\n mode.value = \"auto\";\n else\n mode.value = modeVal;\n }\n });\n return isDark;\n}\n\nfunction fnBypass(v) {\n return v;\n}\nfunction fnSetSource(source, value) {\n return source.value = value;\n}\nfunction defaultDump(clone) {\n return clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n return clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction useManualRefHistory(source, options = {}) {\n const {\n clone = false,\n dump = defaultDump(clone),\n parse = defaultParse(clone),\n setSource = fnSetSource\n } = options;\n function _createHistoryRecord() {\n return markRaw({\n snapshot: dump(source.value),\n timestamp: timestamp()\n });\n }\n const last = ref(_createHistoryRecord());\n const undoStack = ref([]);\n const redoStack = ref([]);\n const _setSource = (record) => {\n setSource(source, parse(record.snapshot));\n last.value = record;\n };\n const commit = () => {\n undoStack.value.unshift(last.value);\n last.value = _createHistoryRecord();\n if (options.capacity && undoStack.value.length > options.capacity)\n undoStack.value.splice(options.capacity, Number.POSITIVE_INFINITY);\n if (redoStack.value.length)\n redoStack.value.splice(0, redoStack.value.length);\n };\n const clear = () => {\n undoStack.value.splice(0, undoStack.value.length);\n redoStack.value.splice(0, redoStack.value.length);\n };\n const undo = () => {\n const state = undoStack.value.shift();\n if (state) {\n redoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const redo = () => {\n const state = redoStack.value.shift();\n if (state) {\n undoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const reset = () => {\n _setSource(last.value);\n };\n const history = computed(() => [last.value, ...undoStack.value]);\n const canUndo = computed(() => undoStack.value.length > 0);\n const canRedo = computed(() => redoStack.value.length > 0);\n return {\n source,\n undoStack,\n redoStack,\n last,\n history,\n canUndo,\n canRedo,\n clear,\n commit,\n reset,\n undo,\n redo\n };\n}\n\nfunction useRefHistory(source, options = {}) {\n const {\n deep = false,\n flush = \"pre\",\n eventFilter\n } = options;\n const {\n eventFilter: composedFilter,\n pause,\n resume: resumeTracking,\n isActive: isTracking\n } = pausableFilter(eventFilter);\n const {\n ignoreUpdates,\n ignorePrevAsyncUpdates,\n stop\n } = watchIgnorable(\n source,\n commit,\n { deep, flush, eventFilter: composedFilter }\n );\n function setSource(source2, value) {\n ignorePrevAsyncUpdates();\n ignoreUpdates(() => {\n source2.value = value;\n });\n }\n const manualHistory = useManualRefHistory(source, { ...options, clone: options.clone || deep, setSource });\n const { clear, commit: manualCommit } = manualHistory;\n function commit() {\n ignorePrevAsyncUpdates();\n manualCommit();\n }\n function resume(commitNow) {\n resumeTracking();\n if (commitNow)\n commit();\n }\n function batch(fn) {\n let canceled = false;\n const cancel = () => canceled = true;\n ignoreUpdates(() => {\n fn(cancel);\n });\n if (!canceled)\n commit();\n }\n function dispose() {\n stop();\n clear();\n }\n return {\n ...manualHistory,\n isTracking,\n pause,\n resume,\n commit,\n batch,\n dispose\n };\n}\n\nfunction useDebouncedRefHistory(source, options = {}) {\n const filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n const history = useRefHistory(source, { ...options, eventFilter: filter });\n return {\n ...history\n };\n}\n\nfunction useDeviceMotion(options = {}) {\n const {\n window = defaultWindow,\n eventFilter = bypassFilter\n } = options;\n const acceleration = ref({ x: null, y: null, z: null });\n const rotationRate = ref({ alpha: null, beta: null, gamma: null });\n const interval = ref(0);\n const accelerationIncludingGravity = ref({\n x: null,\n y: null,\n z: null\n });\n if (window) {\n const onDeviceMotion = createFilterWrapper(\n eventFilter,\n (event) => {\n acceleration.value = event.acceleration;\n accelerationIncludingGravity.value = event.accelerationIncludingGravity;\n rotationRate.value = event.rotationRate;\n interval.value = event.interval;\n }\n );\n useEventListener(window, \"devicemotion\", onDeviceMotion);\n }\n return {\n acceleration,\n accelerationIncludingGravity,\n rotationRate,\n interval\n };\n}\n\nfunction useDeviceOrientation(options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"DeviceOrientationEvent\" in window);\n const isAbsolute = ref(false);\n const alpha = ref(null);\n const beta = ref(null);\n const gamma = ref(null);\n if (window && isSupported.value) {\n useEventListener(window, \"deviceorientation\", (event) => {\n isAbsolute.value = event.absolute;\n alpha.value = event.alpha;\n beta.value = event.beta;\n gamma.value = event.gamma;\n });\n }\n return {\n isSupported,\n isAbsolute,\n alpha,\n beta,\n gamma\n };\n}\n\nfunction useDevicePixelRatio(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const pixelRatio = ref(1);\n if (window) {\n let observe2 = function() {\n pixelRatio.value = window.devicePixelRatio;\n cleanup2();\n media = window.matchMedia(`(resolution: ${pixelRatio.value}dppx)`);\n media.addEventListener(\"change\", observe2, { once: true });\n }, cleanup2 = function() {\n media == null ? void 0 : media.removeEventListener(\"change\", observe2);\n };\n let media;\n observe2();\n tryOnScopeDispose(cleanup2);\n }\n return { pixelRatio };\n}\n\nfunction useDevicesList(options = {}) {\n const {\n navigator = defaultNavigator,\n requestPermissions = false,\n constraints = { audio: true, video: true },\n onUpdated\n } = options;\n const devices = ref([]);\n const videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n const audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n const audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n const isSupported = useSupported(() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);\n const permissionGranted = ref(false);\n let stream;\n async function update() {\n if (!isSupported.value)\n return;\n devices.value = await navigator.mediaDevices.enumerateDevices();\n onUpdated == null ? void 0 : onUpdated(devices.value);\n if (stream) {\n stream.getTracks().forEach((t) => t.stop());\n stream = null;\n }\n }\n async function ensurePermissions() {\n if (!isSupported.value)\n return false;\n if (permissionGranted.value)\n return true;\n const { state, query } = usePermission(\"camera\", { controls: true });\n await query();\n if (state.value !== \"granted\") {\n stream = await navigator.mediaDevices.getUserMedia(constraints);\n update();\n permissionGranted.value = true;\n } else {\n permissionGranted.value = true;\n }\n return permissionGranted.value;\n }\n if (isSupported.value) {\n if (requestPermissions)\n ensurePermissions();\n useEventListener(navigator.mediaDevices, \"devicechange\", update);\n update();\n }\n return {\n devices,\n ensurePermissions,\n permissionGranted,\n videoInputs,\n audioInputs,\n audioOutputs,\n isSupported\n };\n}\n\nfunction useDisplayMedia(options = {}) {\n var _a;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const video = options.video;\n const audio = options.audio;\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getDisplayMedia;\n });\n const constraint = { audio, video };\n const stream = shallowRef();\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getDisplayMedia(constraint);\n return stream.value;\n }\n async function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n watch(\n enabled,\n (v) => {\n if (v)\n _start();\n else\n _stop();\n },\n { immediate: true }\n );\n return {\n isSupported,\n stream,\n start,\n stop,\n enabled\n };\n}\n\nfunction useDocumentVisibility(options = {}) {\n const { document = defaultDocument } = options;\n if (!document)\n return ref(\"visible\");\n const visibility = ref(document.visibilityState);\n useEventListener(document, \"visibilitychange\", () => {\n visibility.value = document.visibilityState;\n });\n return visibility;\n}\n\nfunction useDraggable(target, options = {}) {\n var _a, _b;\n const {\n pointerTypes,\n preventDefault,\n stopPropagation,\n exact,\n onMove,\n onEnd,\n onStart,\n initialValue,\n axis = \"both\",\n draggingElement = defaultWindow,\n containerElement,\n handle: draggingHandle = target\n } = options;\n const position = ref(\n (_a = toValue(initialValue)) != null ? _a : { x: 0, y: 0 }\n );\n const pressedDelta = ref();\n const filterEvent = (e) => {\n if (pointerTypes)\n return pointerTypes.includes(e.pointerType);\n return true;\n };\n const handleEvent = (e) => {\n if (toValue(preventDefault))\n e.preventDefault();\n if (toValue(stopPropagation))\n e.stopPropagation();\n };\n const start = (e) => {\n var _a2;\n if (toValue(options.disabled) || !filterEvent(e))\n return;\n if (toValue(exact) && e.target !== toValue(target))\n return;\n const container = toValue(containerElement);\n const containerRect = (_a2 = container == null ? void 0 : container.getBoundingClientRect) == null ? void 0 : _a2.call(container);\n const targetRect = toValue(target).getBoundingClientRect();\n const pos = {\n x: e.clientX - (container ? targetRect.left - containerRect.left + container.scrollLeft : targetRect.left),\n y: e.clientY - (container ? targetRect.top - containerRect.top + container.scrollTop : targetRect.top)\n };\n if ((onStart == null ? void 0 : onStart(pos, e)) === false)\n return;\n pressedDelta.value = pos;\n handleEvent(e);\n };\n const move = (e) => {\n if (toValue(options.disabled) || !filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n const container = toValue(containerElement);\n const targetRect = toValue(target).getBoundingClientRect();\n let { x, y } = position.value;\n if (axis === \"x\" || axis === \"both\") {\n x = e.clientX - pressedDelta.value.x;\n if (container)\n x = Math.min(Math.max(0, x), container.scrollWidth - targetRect.width);\n }\n if (axis === \"y\" || axis === \"both\") {\n y = e.clientY - pressedDelta.value.y;\n if (container)\n y = Math.min(Math.max(0, y), container.scrollHeight - targetRect.height);\n }\n position.value = {\n x,\n y\n };\n onMove == null ? void 0 : onMove(position.value, e);\n handleEvent(e);\n };\n const end = (e) => {\n if (toValue(options.disabled) || !filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n pressedDelta.value = void 0;\n onEnd == null ? void 0 : onEnd(position.value, e);\n handleEvent(e);\n };\n if (isClient) {\n const config = { capture: (_b = options.capture) != null ? _b : true };\n useEventListener(draggingHandle, \"pointerdown\", start, config);\n useEventListener(draggingElement, \"pointermove\", move, config);\n useEventListener(draggingElement, \"pointerup\", end, config);\n }\n return {\n ...toRefs(position),\n position,\n isDragging: computed(() => !!pressedDelta.value),\n style: computed(\n () => `left:${position.value.x}px;top:${position.value.y}px;`\n )\n };\n}\n\nfunction useDropZone(target, options = {}) {\n const isOverDropZone = ref(false);\n const files = shallowRef(null);\n let counter = 0;\n let isDataTypeIncluded = true;\n if (isClient) {\n const _options = typeof options === \"function\" ? { onDrop: options } : options;\n const getFiles = (event) => {\n var _a, _b;\n const list = Array.from((_b = (_a = event.dataTransfer) == null ? void 0 : _a.files) != null ? _b : []);\n return files.value = list.length === 0 ? null : list;\n };\n useEventListener(target, \"dragenter\", (event) => {\n var _a, _b;\n const types = Array.from(((_a = event == null ? void 0 : event.dataTransfer) == null ? void 0 : _a.items) || []).map((i) => i.kind === \"file\" ? i.type : null).filter(notNullish);\n if (_options.dataTypes && event.dataTransfer) {\n const dataTypes = unref(_options.dataTypes);\n isDataTypeIncluded = typeof dataTypes === \"function\" ? dataTypes(types) : dataTypes ? dataTypes.some((item) => types.includes(item)) : true;\n if (!isDataTypeIncluded)\n return;\n }\n event.preventDefault();\n counter += 1;\n isOverDropZone.value = true;\n (_b = _options.onEnter) == null ? void 0 : _b.call(_options, getFiles(event), event);\n });\n useEventListener(target, \"dragover\", (event) => {\n var _a;\n if (!isDataTypeIncluded)\n return;\n event.preventDefault();\n (_a = _options.onOver) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n useEventListener(target, \"dragleave\", (event) => {\n var _a;\n if (!isDataTypeIncluded)\n return;\n event.preventDefault();\n counter -= 1;\n if (counter === 0)\n isOverDropZone.value = false;\n (_a = _options.onLeave) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n useEventListener(target, \"drop\", (event) => {\n var _a;\n event.preventDefault();\n counter = 0;\n isOverDropZone.value = false;\n (_a = _options.onDrop) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n }\n return {\n files,\n isOverDropZone\n };\n}\n\nfunction useResizeObserver(target, callback, options = {}) {\n const { window = defaultWindow, ...observerOptions } = options;\n let observer;\n const isSupported = useSupported(() => window && \"ResizeObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const targets = computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);\n const stopWatch = watch(\n targets,\n (els) => {\n cleanup();\n if (isSupported.value && window) {\n observer = new ResizeObserver(callback);\n for (const _el of els)\n _el && observer.observe(_el, observerOptions);\n }\n },\n { immediate: true, flush: \"post\" }\n );\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nfunction useElementBounding(target, options = {}) {\n const {\n reset = true,\n windowResize = true,\n windowScroll = true,\n immediate = true\n } = options;\n const height = ref(0);\n const bottom = ref(0);\n const left = ref(0);\n const right = ref(0);\n const top = ref(0);\n const width = ref(0);\n const x = ref(0);\n const y = ref(0);\n function update() {\n const el = unrefElement(target);\n if (!el) {\n if (reset) {\n height.value = 0;\n bottom.value = 0;\n left.value = 0;\n right.value = 0;\n top.value = 0;\n width.value = 0;\n x.value = 0;\n y.value = 0;\n }\n return;\n }\n const rect = el.getBoundingClientRect();\n height.value = rect.height;\n bottom.value = rect.bottom;\n left.value = rect.left;\n right.value = rect.right;\n top.value = rect.top;\n width.value = rect.width;\n x.value = rect.x;\n y.value = rect.y;\n }\n useResizeObserver(target, update);\n watch(() => unrefElement(target), (ele) => !ele && update());\n useMutationObserver(target, update, {\n attributeFilter: [\"style\", \"class\"]\n });\n if (windowScroll)\n useEventListener(\"scroll\", update, { capture: true, passive: true });\n if (windowResize)\n useEventListener(\"resize\", update, { passive: true });\n tryOnMounted(() => {\n if (immediate)\n update();\n });\n return {\n height,\n bottom,\n left,\n right,\n top,\n width,\n x,\n y,\n update\n };\n}\n\nfunction useElementByPoint(options) {\n const {\n x,\n y,\n document = defaultDocument,\n multiple,\n interval = \"requestAnimationFrame\",\n immediate = true\n } = options;\n const isSupported = useSupported(() => {\n if (toValue(multiple))\n return document && \"elementsFromPoint\" in document;\n return document && \"elementFromPoint\" in document;\n });\n const element = ref(null);\n const cb = () => {\n var _a, _b;\n element.value = toValue(multiple) ? (_a = document == null ? void 0 : document.elementsFromPoint(toValue(x), toValue(y))) != null ? _a : [] : (_b = document == null ? void 0 : document.elementFromPoint(toValue(x), toValue(y))) != null ? _b : null;\n };\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });\n return {\n isSupported,\n element,\n ...controls\n };\n}\n\nfunction useElementHover(el, options = {}) {\n const {\n delayEnter = 0,\n delayLeave = 0,\n window = defaultWindow\n } = options;\n const isHovered = ref(false);\n let timer;\n const toggle = (entering) => {\n const delay = entering ? delayEnter : delayLeave;\n if (timer) {\n clearTimeout(timer);\n timer = void 0;\n }\n if (delay)\n timer = setTimeout(() => isHovered.value = entering, delay);\n else\n isHovered.value = entering;\n };\n if (!window)\n return isHovered;\n useEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n useEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n return isHovered;\n}\n\nfunction useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {\n const { window = defaultWindow, box = \"content-box\" } = options;\n const isSVG = computed(() => {\n var _a, _b;\n return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes(\"svg\");\n });\n const width = ref(initialSize.width);\n const height = ref(initialSize.height);\n const { stop: stop1 } = useResizeObserver(\n target,\n ([entry]) => {\n const boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n if (window && isSVG.value) {\n const $elem = unrefElement(target);\n if ($elem) {\n const styles = window.getComputedStyle($elem);\n width.value = Number.parseFloat(styles.width);\n height.value = Number.parseFloat(styles.height);\n }\n } else {\n if (boxSize) {\n const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];\n width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n } else {\n width.value = entry.contentRect.width;\n height.value = entry.contentRect.height;\n }\n }\n },\n options\n );\n tryOnMounted(() => {\n const ele = unrefElement(target);\n if (ele) {\n width.value = \"offsetWidth\" in ele ? ele.offsetWidth : initialSize.width;\n height.value = \"offsetHeight\" in ele ? ele.offsetHeight : initialSize.height;\n }\n });\n const stop2 = watch(\n () => unrefElement(target),\n (ele) => {\n width.value = ele ? initialSize.width : 0;\n height.value = ele ? initialSize.height : 0;\n }\n );\n function stop() {\n stop1();\n stop2();\n }\n return {\n width,\n height,\n stop\n };\n}\n\nfunction useIntersectionObserver(target, callback, options = {}) {\n const {\n root,\n rootMargin = \"0px\",\n threshold = 0.1,\n window = defaultWindow,\n immediate = true\n } = options;\n const isSupported = useSupported(() => window && \"IntersectionObserver\" in window);\n const targets = computed(() => {\n const _target = toValue(target);\n return (Array.isArray(_target) ? _target : [_target]).map(unrefElement).filter(notNullish);\n });\n let cleanup = noop;\n const isActive = ref(immediate);\n const stopWatch = isSupported.value ? watch(\n () => [targets.value, unrefElement(root), isActive.value],\n ([targets2, root2]) => {\n cleanup();\n if (!isActive.value)\n return;\n if (!targets2.length)\n return;\n const observer = new IntersectionObserver(\n callback,\n {\n root: unrefElement(root2),\n rootMargin,\n threshold\n }\n );\n targets2.forEach((el) => el && observer.observe(el));\n cleanup = () => {\n observer.disconnect();\n cleanup = noop;\n };\n },\n { immediate, flush: \"post\" }\n ) : noop;\n const stop = () => {\n cleanup();\n stopWatch();\n isActive.value = false;\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n isActive,\n pause() {\n cleanup();\n isActive.value = false;\n },\n resume() {\n isActive.value = true;\n },\n stop\n };\n}\n\nfunction useElementVisibility(element, options = {}) {\n const { window = defaultWindow, scrollTarget, threshold = 0 } = options;\n const elementIsVisible = ref(false);\n useIntersectionObserver(\n element,\n (intersectionObserverEntries) => {\n let isIntersecting = elementIsVisible.value;\n let latestTime = 0;\n for (const entry of intersectionObserverEntries) {\n if (entry.time >= latestTime) {\n latestTime = entry.time;\n isIntersecting = entry.isIntersecting;\n }\n }\n elementIsVisible.value = isIntersecting;\n },\n {\n root: scrollTarget,\n window,\n threshold\n }\n );\n return elementIsVisible;\n}\n\nconst events = /* @__PURE__ */ new Map();\n\nfunction useEventBus(key) {\n const scope = getCurrentScope();\n function on(listener) {\n var _a;\n const listeners = events.get(key) || /* @__PURE__ */ new Set();\n listeners.add(listener);\n events.set(key, listeners);\n const _off = () => off(listener);\n (_a = scope == null ? void 0 : scope.cleanups) == null ? void 0 : _a.push(_off);\n return _off;\n }\n function once(listener) {\n function _listener(...args) {\n off(_listener);\n listener(...args);\n }\n return on(_listener);\n }\n function off(listener) {\n const listeners = events.get(key);\n if (!listeners)\n return;\n listeners.delete(listener);\n if (!listeners.size)\n reset();\n }\n function reset() {\n events.delete(key);\n }\n function emit(event, payload) {\n var _a;\n (_a = events.get(key)) == null ? void 0 : _a.forEach((v) => v(event, payload));\n }\n return { on, once, off, emit, reset };\n}\n\nfunction resolveNestedOptions$1(options) {\n if (options === true)\n return {};\n return options;\n}\nfunction useEventSource(url, events = [], options = {}) {\n const event = ref(null);\n const data = ref(null);\n const status = ref(\"CONNECTING\");\n const eventSource = ref(null);\n const error = shallowRef(null);\n const urlRef = toRef(url);\n let explicitlyClosed = false;\n let retried = 0;\n const {\n withCredentials = false,\n immediate = true\n } = options;\n const close = () => {\n if (isClient && eventSource.value) {\n eventSource.value.close();\n eventSource.value = null;\n status.value = \"CLOSED\";\n explicitlyClosed = true;\n }\n };\n const _init = () => {\n if (explicitlyClosed || typeof urlRef.value === \"undefined\")\n return;\n const es = new EventSource(urlRef.value, { withCredentials });\n status.value = \"CONNECTING\";\n eventSource.value = es;\n es.onopen = () => {\n status.value = \"OPEN\";\n error.value = null;\n };\n es.onerror = (e) => {\n status.value = \"CLOSED\";\n error.value = e;\n if (es.readyState === 2 && !explicitlyClosed && options.autoReconnect) {\n es.close();\n const {\n retries = -1,\n delay = 1e3,\n onFailed\n } = resolveNestedOptions$1(options.autoReconnect);\n retried += 1;\n if (typeof retries === \"number\" && (retries < 0 || retried < retries))\n setTimeout(_init, delay);\n else if (typeof retries === \"function\" && retries())\n setTimeout(_init, delay);\n else\n onFailed == null ? void 0 : onFailed();\n }\n };\n es.onmessage = (e) => {\n event.value = null;\n data.value = e.data;\n };\n for (const event_name of events) {\n useEventListener(es, event_name, (e) => {\n event.value = event_name;\n data.value = e.data || null;\n });\n }\n };\n const open = () => {\n if (!isClient)\n return;\n close();\n explicitlyClosed = false;\n retried = 0;\n _init();\n };\n if (immediate)\n watch(urlRef, open, { immediate: true });\n tryOnScopeDispose(close);\n return {\n eventSource,\n event,\n data,\n status,\n error,\n open,\n close\n };\n}\n\nfunction useEyeDropper(options = {}) {\n const { initialValue = \"\" } = options;\n const isSupported = useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n const sRGBHex = ref(initialValue);\n async function open(openOptions) {\n if (!isSupported.value)\n return;\n const eyeDropper = new window.EyeDropper();\n const result = await eyeDropper.open(openOptions);\n sRGBHex.value = result.sRGBHex;\n return result;\n }\n return { isSupported, sRGBHex, open };\n}\n\nfunction useFavicon(newIcon = null, options = {}) {\n const {\n baseUrl = \"\",\n rel = \"icon\",\n document = defaultDocument\n } = options;\n const favicon = toRef(newIcon);\n const applyIcon = (icon) => {\n const elements = document == null ? void 0 : document.head.querySelectorAll(`link[rel*=\"${rel}\"]`);\n if (!elements || elements.length === 0) {\n const link = document == null ? void 0 : document.createElement(\"link\");\n if (link) {\n link.rel = rel;\n link.href = `${baseUrl}${icon}`;\n link.type = `image/${icon.split(\".\").pop()}`;\n document == null ? void 0 : document.head.append(link);\n }\n return;\n }\n elements == null ? void 0 : elements.forEach((el) => el.href = `${baseUrl}${icon}`);\n };\n watch(\n favicon,\n (i, o) => {\n if (typeof i === \"string\" && i !== o)\n applyIcon(i);\n },\n { immediate: true }\n );\n return favicon;\n}\n\nconst payloadMapping = {\n json: \"application/json\",\n text: \"text/plain\"\n};\nfunction isFetchOptions(obj) {\n return obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\", \"updateDataOnError\");\n}\nfunction isAbsoluteURL(url) {\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\nfunction headersToObject(headers) {\n if (typeof Headers !== \"undefined\" && headers instanceof Headers)\n return Object.fromEntries(headers.entries());\n return headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n if (combination === \"overwrite\") {\n return async (ctx) => {\n const callback = callbacks[callbacks.length - 1];\n if (callback)\n return { ...ctx, ...await callback(ctx) };\n return ctx;\n };\n } else {\n return async (ctx) => {\n for (const callback of callbacks) {\n if (callback)\n ctx = { ...ctx, ...await callback(ctx) };\n }\n return ctx;\n };\n }\n}\nfunction createFetch(config = {}) {\n const _combination = config.combination || \"chain\";\n const _options = config.options || {};\n const _fetchOptions = config.fetchOptions || {};\n function useFactoryFetch(url, ...args) {\n const computedUrl = computed(() => {\n const baseUrl = toValue(config.baseUrl);\n const targetUrl = toValue(url);\n return baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n });\n let options = _options;\n let fetchOptions = _fetchOptions;\n if (args.length > 0) {\n if (isFetchOptions(args[0])) {\n options = {\n ...options,\n ...args[0],\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n };\n } else {\n fetchOptions = {\n ...fetchOptions,\n ...args[0],\n headers: {\n ...headersToObject(fetchOptions.headers) || {},\n ...headersToObject(args[0].headers) || {}\n }\n };\n }\n }\n if (args.length > 1 && isFetchOptions(args[1])) {\n options = {\n ...options,\n ...args[1],\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n };\n }\n return useFetch(computedUrl, fetchOptions, options);\n }\n return useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n var _a;\n const supportsAbort = typeof AbortController === \"function\";\n let fetchOptions = {};\n let options = {\n immediate: true,\n refetch: false,\n timeout: 0,\n updateDataOnError: false\n };\n const config = {\n method: \"GET\",\n type: \"text\",\n payload: void 0\n };\n if (args.length > 0) {\n if (isFetchOptions(args[0]))\n options = { ...options, ...args[0] };\n else\n fetchOptions = args[0];\n }\n if (args.length > 1) {\n if (isFetchOptions(args[1]))\n options = { ...options, ...args[1] };\n }\n const {\n fetch = (_a = defaultWindow) == null ? void 0 : _a.fetch,\n initialData,\n timeout\n } = options;\n const responseEvent = createEventHook();\n const errorEvent = createEventHook();\n const finallyEvent = createEventHook();\n const isFinished = ref(false);\n const isFetching = ref(false);\n const aborted = ref(false);\n const statusCode = ref(null);\n const response = shallowRef(null);\n const error = shallowRef(null);\n const data = shallowRef(initialData || null);\n const canAbort = computed(() => supportsAbort && isFetching.value);\n let controller;\n let timer;\n const abort = () => {\n if (supportsAbort) {\n controller == null ? void 0 : controller.abort();\n controller = new AbortController();\n controller.signal.onabort = () => aborted.value = true;\n fetchOptions = {\n ...fetchOptions,\n signal: controller.signal\n };\n }\n };\n const loading = (isLoading) => {\n isFetching.value = isLoading;\n isFinished.value = !isLoading;\n };\n if (timeout)\n timer = useTimeoutFn(abort, timeout, { immediate: false });\n let executeCounter = 0;\n const execute = async (throwOnFailed = false) => {\n var _a2, _b;\n abort();\n loading(true);\n error.value = null;\n statusCode.value = null;\n aborted.value = false;\n executeCounter += 1;\n const currentExecuteCounter = executeCounter;\n const defaultFetchOptions = {\n method: config.method,\n headers: {}\n };\n if (config.payload) {\n const headers = headersToObject(defaultFetchOptions.headers);\n const payload = toValue(config.payload);\n if (!config.payloadType && payload && Object.getPrototypeOf(payload) === Object.prototype && !(payload instanceof FormData))\n config.payloadType = \"json\";\n if (config.payloadType)\n headers[\"Content-Type\"] = (_a2 = payloadMapping[config.payloadType]) != null ? _a2 : config.payloadType;\n defaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n }\n let isCanceled = false;\n const context = {\n url: toValue(url),\n options: {\n ...defaultFetchOptions,\n ...fetchOptions\n },\n cancel: () => {\n isCanceled = true;\n }\n };\n if (options.beforeFetch)\n Object.assign(context, await options.beforeFetch(context));\n if (isCanceled || !fetch) {\n loading(false);\n return Promise.resolve(null);\n }\n let responseData = null;\n if (timer)\n timer.start();\n return fetch(\n context.url,\n {\n ...defaultFetchOptions,\n ...context.options,\n headers: {\n ...headersToObject(defaultFetchOptions.headers),\n ...headersToObject((_b = context.options) == null ? void 0 : _b.headers)\n }\n }\n ).then(async (fetchResponse) => {\n response.value = fetchResponse;\n statusCode.value = fetchResponse.status;\n responseData = await fetchResponse.clone()[config.type]();\n if (!fetchResponse.ok) {\n data.value = initialData || null;\n throw new Error(fetchResponse.statusText);\n }\n if (options.afterFetch) {\n ({ data: responseData } = await options.afterFetch({\n data: responseData,\n response: fetchResponse\n }));\n }\n data.value = responseData;\n responseEvent.trigger(fetchResponse);\n return fetchResponse;\n }).catch(async (fetchError) => {\n let errorData = fetchError.message || fetchError.name;\n if (options.onFetchError) {\n ({ error: errorData, data: responseData } = await options.onFetchError({\n data: responseData,\n error: fetchError,\n response: response.value\n }));\n }\n error.value = errorData;\n if (options.updateDataOnError)\n data.value = responseData;\n errorEvent.trigger(fetchError);\n if (throwOnFailed)\n throw fetchError;\n return null;\n }).finally(() => {\n if (currentExecuteCounter === executeCounter)\n loading(false);\n if (timer)\n timer.stop();\n finallyEvent.trigger(null);\n });\n };\n const refetch = toRef(options.refetch);\n watch(\n [\n refetch,\n toRef(url)\n ],\n ([refetch2]) => refetch2 && execute(),\n { deep: true }\n );\n const shell = {\n isFinished: readonly(isFinished),\n isFetching: readonly(isFetching),\n statusCode,\n response,\n error,\n data,\n canAbort,\n aborted,\n abort,\n execute,\n onFetchResponse: responseEvent.on,\n onFetchError: errorEvent.on,\n onFetchFinally: finallyEvent.on,\n // method\n get: setMethod(\"GET\"),\n put: setMethod(\"PUT\"),\n post: setMethod(\"POST\"),\n delete: setMethod(\"DELETE\"),\n patch: setMethod(\"PATCH\"),\n head: setMethod(\"HEAD\"),\n options: setMethod(\"OPTIONS\"),\n // type\n json: setType(\"json\"),\n text: setType(\"text\"),\n blob: setType(\"blob\"),\n arrayBuffer: setType(\"arrayBuffer\"),\n formData: setType(\"formData\")\n };\n function setMethod(method) {\n return (payload, payloadType) => {\n if (!isFetching.value) {\n config.method = method;\n config.payload = payload;\n config.payloadType = payloadType;\n if (isRef(config.payload)) {\n watch(\n [\n refetch,\n toRef(config.payload)\n ],\n ([refetch2]) => refetch2 && execute(),\n { deep: true }\n );\n }\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n };\n }\n return void 0;\n };\n }\n function waitUntilFinished() {\n return new Promise((resolve, reject) => {\n until(isFinished).toBe(true).then(() => resolve(shell)).catch((error2) => reject(error2));\n });\n }\n function setType(type) {\n return () => {\n if (!isFetching.value) {\n config.type = type;\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n };\n }\n return void 0;\n };\n }\n if (options.immediate)\n Promise.resolve().then(() => execute());\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n };\n}\nfunction joinPaths(start, end) {\n if (!start.endsWith(\"/\") && !end.startsWith(\"/\"))\n return `${start}/${end}`;\n return `${start}${end}`;\n}\n\nconst DEFAULT_OPTIONS = {\n multiple: true,\n accept: \"*\",\n reset: false,\n directory: false\n};\nfunction useFileDialog(options = {}) {\n const {\n document = defaultDocument\n } = options;\n const files = ref(null);\n const { on: onChange, trigger } = createEventHook();\n let input;\n if (document) {\n input = document.createElement(\"input\");\n input.type = \"file\";\n input.onchange = (event) => {\n const result = event.target;\n files.value = result.files;\n trigger(files.value);\n };\n }\n const reset = () => {\n files.value = null;\n if (input) {\n input.value = \"\";\n trigger(null);\n }\n };\n const open = (localOptions) => {\n if (!input)\n return;\n const _options = {\n ...DEFAULT_OPTIONS,\n ...options,\n ...localOptions\n };\n input.multiple = _options.multiple;\n input.accept = _options.accept;\n input.webkitdirectory = _options.directory;\n if (hasOwn(_options, \"capture\"))\n input.capture = _options.capture;\n if (_options.reset)\n reset();\n input.click();\n };\n return {\n files: readonly(files),\n open,\n reset,\n onChange\n };\n}\n\nfunction useFileSystemAccess(options = {}) {\n const {\n window: _window = defaultWindow,\n dataType = \"Text\"\n } = options;\n const window = _window;\n const isSupported = useSupported(() => window && \"showSaveFilePicker\" in window && \"showOpenFilePicker\" in window);\n const fileHandle = ref();\n const data = ref();\n const file = ref();\n const fileName = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.name) != null ? _b : \"\";\n });\n const fileMIME = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.type) != null ? _b : \"\";\n });\n const fileSize = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.size) != null ? _b : 0;\n });\n const fileLastModified = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.lastModified) != null ? _b : 0;\n });\n async function open(_options = {}) {\n if (!isSupported.value)\n return;\n const [handle] = await window.showOpenFilePicker({ ...toValue(options), ..._options });\n fileHandle.value = handle;\n await updateData();\n }\n async function create(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker({ ...options, ..._options });\n data.value = void 0;\n await updateData();\n }\n async function save(_options = {}) {\n if (!isSupported.value)\n return;\n if (!fileHandle.value)\n return saveAs(_options);\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function saveAs(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker({ ...options, ..._options });\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function updateFile() {\n var _a;\n file.value = await ((_a = fileHandle.value) == null ? void 0 : _a.getFile());\n }\n async function updateData() {\n var _a, _b;\n await updateFile();\n const type = toValue(dataType);\n if (type === \"Text\")\n data.value = await ((_a = file.value) == null ? void 0 : _a.text());\n else if (type === \"ArrayBuffer\")\n data.value = await ((_b = file.value) == null ? void 0 : _b.arrayBuffer());\n else if (type === \"Blob\")\n data.value = file.value;\n }\n watch(() => toValue(dataType), updateData);\n return {\n isSupported,\n data,\n file,\n fileName,\n fileMIME,\n fileSize,\n fileLastModified,\n open,\n create,\n save,\n saveAs,\n updateData\n };\n}\n\nfunction useFocus(target, options = {}) {\n const { initialValue = false, focusVisible = false } = options;\n const innerFocused = ref(false);\n const targetElement = computed(() => unrefElement(target));\n useEventListener(targetElement, \"focus\", (event) => {\n var _a, _b;\n if (!focusVisible || ((_b = (_a = event.target).matches) == null ? void 0 : _b.call(_a, \":focus-visible\")))\n innerFocused.value = true;\n });\n useEventListener(targetElement, \"blur\", () => innerFocused.value = false);\n const focused = computed({\n get: () => innerFocused.value,\n set(value) {\n var _a, _b;\n if (!value && innerFocused.value)\n (_a = targetElement.value) == null ? void 0 : _a.blur();\n else if (value && !innerFocused.value)\n (_b = targetElement.value) == null ? void 0 : _b.focus();\n }\n });\n watch(\n targetElement,\n () => {\n focused.value = initialValue;\n },\n { immediate: true, flush: \"post\" }\n );\n return { focused };\n}\n\nfunction useFocusWithin(target, options = {}) {\n const activeElement = useActiveElement(options);\n const targetElement = computed(() => unrefElement(target));\n const focused = computed(() => targetElement.value && activeElement.value ? targetElement.value.contains(activeElement.value) : false);\n return { focused };\n}\n\nfunction useFps(options) {\n var _a;\n const fps = ref(0);\n if (typeof performance === \"undefined\")\n return fps;\n const every = (_a = options == null ? void 0 : options.every) != null ? _a : 10;\n let last = performance.now();\n let ticks = 0;\n useRafFn(() => {\n ticks += 1;\n if (ticks >= every) {\n const now = performance.now();\n const diff = now - last;\n fps.value = Math.round(1e3 / (diff / ticks));\n last = now;\n ticks = 0;\n }\n });\n return fps;\n}\n\nconst eventHandlers = [\n \"fullscreenchange\",\n \"webkitfullscreenchange\",\n \"webkitendfullscreen\",\n \"mozfullscreenchange\",\n \"MSFullscreenChange\"\n];\nfunction useFullscreen(target, options = {}) {\n const {\n document = defaultDocument,\n autoExit = false\n } = options;\n const targetRef = computed(() => {\n var _a;\n return (_a = unrefElement(target)) != null ? _a : document == null ? void 0 : document.querySelector(\"html\");\n });\n const isFullscreen = ref(false);\n const requestMethod = computed(() => {\n return [\n \"requestFullscreen\",\n \"webkitRequestFullscreen\",\n \"webkitEnterFullscreen\",\n \"webkitEnterFullScreen\",\n \"webkitRequestFullScreen\",\n \"mozRequestFullScreen\",\n \"msRequestFullscreen\"\n ].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n });\n const exitMethod = computed(() => {\n return [\n \"exitFullscreen\",\n \"webkitExitFullscreen\",\n \"webkitExitFullScreen\",\n \"webkitCancelFullScreen\",\n \"mozCancelFullScreen\",\n \"msExitFullscreen\"\n ].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n });\n const fullscreenEnabled = computed(() => {\n return [\n \"fullScreen\",\n \"webkitIsFullScreen\",\n \"webkitDisplayingFullscreen\",\n \"mozFullScreen\",\n \"msFullscreenElement\"\n ].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n });\n const fullscreenElementMethod = [\n \"fullscreenElement\",\n \"webkitFullscreenElement\",\n \"mozFullScreenElement\",\n \"msFullscreenElement\"\n ].find((m) => document && m in document);\n const isSupported = useSupported(() => targetRef.value && document && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0);\n const isCurrentElementFullScreen = () => {\n if (fullscreenElementMethod)\n return (document == null ? void 0 : document[fullscreenElementMethod]) === targetRef.value;\n return false;\n };\n const isElementFullScreen = () => {\n if (fullscreenEnabled.value) {\n if (document && document[fullscreenEnabled.value] != null) {\n return document[fullscreenEnabled.value];\n } else {\n const target2 = targetRef.value;\n if ((target2 == null ? void 0 : target2[fullscreenEnabled.value]) != null) {\n return Boolean(target2[fullscreenEnabled.value]);\n }\n }\n }\n return false;\n };\n async function exit() {\n if (!isSupported.value || !isFullscreen.value)\n return;\n if (exitMethod.value) {\n if ((document == null ? void 0 : document[exitMethod.value]) != null) {\n await document[exitMethod.value]();\n } else {\n const target2 = targetRef.value;\n if ((target2 == null ? void 0 : target2[exitMethod.value]) != null)\n await target2[exitMethod.value]();\n }\n }\n isFullscreen.value = false;\n }\n async function enter() {\n if (!isSupported.value || isFullscreen.value)\n return;\n if (isElementFullScreen())\n await exit();\n const target2 = targetRef.value;\n if (requestMethod.value && (target2 == null ? void 0 : target2[requestMethod.value]) != null) {\n await target2[requestMethod.value]();\n isFullscreen.value = true;\n }\n }\n async function toggle() {\n await (isFullscreen.value ? exit() : enter());\n }\n const handlerCallback = () => {\n const isElementFullScreenValue = isElementFullScreen();\n if (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen())\n isFullscreen.value = isElementFullScreenValue;\n };\n useEventListener(document, eventHandlers, handlerCallback, false);\n useEventListener(() => unrefElement(targetRef), eventHandlers, handlerCallback, false);\n if (autoExit)\n tryOnScopeDispose(exit);\n return {\n isSupported,\n isFullscreen,\n enter,\n exit,\n toggle\n };\n}\n\nfunction mapGamepadToXbox360Controller(gamepad) {\n return computed(() => {\n if (gamepad.value) {\n return {\n buttons: {\n a: gamepad.value.buttons[0],\n b: gamepad.value.buttons[1],\n x: gamepad.value.buttons[2],\n y: gamepad.value.buttons[3]\n },\n bumper: {\n left: gamepad.value.buttons[4],\n right: gamepad.value.buttons[5]\n },\n triggers: {\n left: gamepad.value.buttons[6],\n right: gamepad.value.buttons[7]\n },\n stick: {\n left: {\n horizontal: gamepad.value.axes[0],\n vertical: gamepad.value.axes[1],\n button: gamepad.value.buttons[10]\n },\n right: {\n horizontal: gamepad.value.axes[2],\n vertical: gamepad.value.axes[3],\n button: gamepad.value.buttons[11]\n }\n },\n dpad: {\n up: gamepad.value.buttons[12],\n down: gamepad.value.buttons[13],\n left: gamepad.value.buttons[14],\n right: gamepad.value.buttons[15]\n },\n back: gamepad.value.buttons[8],\n start: gamepad.value.buttons[9]\n };\n }\n return null;\n });\n}\nfunction useGamepad(options = {}) {\n const {\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"getGamepads\" in navigator);\n const gamepads = ref([]);\n const onConnectedHook = createEventHook();\n const onDisconnectedHook = createEventHook();\n const stateFromGamepad = (gamepad) => {\n const hapticActuators = [];\n const vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n if (vibrationActuator)\n hapticActuators.push(vibrationActuator);\n if (gamepad.hapticActuators)\n hapticActuators.push(...gamepad.hapticActuators);\n return {\n ...gamepad,\n id: gamepad.id,\n hapticActuators,\n axes: gamepad.axes.map((axes) => axes),\n buttons: gamepad.buttons.map((button) => ({ pressed: button.pressed, touched: button.touched, value: button.value })),\n index: gamepad.index\n };\n };\n const updateGamepadState = () => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n for (const gamepad of _gamepads) {\n if (gamepad && gamepads.value[gamepad.index])\n gamepads.value[gamepad.index] = stateFromGamepad(gamepad);\n }\n };\n const { isActive, pause, resume } = useRafFn(updateGamepadState);\n const onGamepadConnected = (gamepad) => {\n if (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n gamepads.value.push(stateFromGamepad(gamepad));\n onConnectedHook.trigger(gamepad.index);\n }\n resume();\n };\n const onGamepadDisconnected = (gamepad) => {\n gamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n onDisconnectedHook.trigger(gamepad.index);\n };\n useEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad));\n useEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad));\n tryOnMounted(() => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n for (const gamepad of _gamepads) {\n if (gamepad && gamepads.value[gamepad.index])\n onGamepadConnected(gamepad);\n }\n });\n pause();\n return {\n isSupported,\n onConnected: onConnectedHook.on,\n onDisconnected: onDisconnectedHook.on,\n gamepads,\n pause,\n resume,\n isActive\n };\n}\n\nfunction useGeolocation(options = {}) {\n const {\n enableHighAccuracy = true,\n maximumAge = 3e4,\n timeout = 27e3,\n navigator = defaultNavigator,\n immediate = true\n } = options;\n const isSupported = useSupported(() => navigator && \"geolocation\" in navigator);\n const locatedAt = ref(null);\n const error = shallowRef(null);\n const coords = ref({\n accuracy: 0,\n latitude: Number.POSITIVE_INFINITY,\n longitude: Number.POSITIVE_INFINITY,\n altitude: null,\n altitudeAccuracy: null,\n heading: null,\n speed: null\n });\n function updatePosition(position) {\n locatedAt.value = position.timestamp;\n coords.value = position.coords;\n error.value = null;\n }\n let watcher;\n function resume() {\n if (isSupported.value) {\n watcher = navigator.geolocation.watchPosition(\n updatePosition,\n (err) => error.value = err,\n {\n enableHighAccuracy,\n maximumAge,\n timeout\n }\n );\n }\n }\n if (immediate)\n resume();\n function pause() {\n if (watcher && navigator)\n navigator.geolocation.clearWatch(watcher);\n }\n tryOnScopeDispose(() => {\n pause();\n });\n return {\n isSupported,\n coords,\n locatedAt,\n error,\n resume,\n pause\n };\n}\n\nconst defaultEvents$1 = [\"mousemove\", \"mousedown\", \"resize\", \"keydown\", \"touchstart\", \"wheel\"];\nconst oneMinute = 6e4;\nfunction useIdle(timeout = oneMinute, options = {}) {\n const {\n initialState = false,\n listenForVisibilityChange = true,\n events = defaultEvents$1,\n window = defaultWindow,\n eventFilter = throttleFilter(50)\n } = options;\n const idle = ref(initialState);\n const lastActive = ref(timestamp());\n let timer;\n const reset = () => {\n idle.value = false;\n clearTimeout(timer);\n timer = setTimeout(() => idle.value = true, timeout);\n };\n const onEvent = createFilterWrapper(\n eventFilter,\n () => {\n lastActive.value = timestamp();\n reset();\n }\n );\n if (window) {\n const document = window.document;\n for (const event of events)\n useEventListener(window, event, onEvent, { passive: true });\n if (listenForVisibilityChange) {\n useEventListener(document, \"visibilitychange\", () => {\n if (!document.hidden)\n onEvent();\n });\n }\n reset();\n }\n return {\n idle,\n lastActive,\n reset\n };\n}\n\nasync function loadImage(options) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n const { src, srcset, sizes, class: clazz, loading, crossorigin, referrerPolicy } = options;\n img.src = src;\n if (srcset)\n img.srcset = srcset;\n if (sizes)\n img.sizes = sizes;\n if (clazz)\n img.className = clazz;\n if (loading)\n img.loading = loading;\n if (crossorigin)\n img.crossOrigin = crossorigin;\n if (referrerPolicy)\n img.referrerPolicy = referrerPolicy;\n img.onload = () => resolve(img);\n img.onerror = reject;\n });\n}\nfunction useImage(options, asyncStateOptions = {}) {\n const state = useAsyncState(\n () => loadImage(toValue(options)),\n void 0,\n {\n resetOnExecute: true,\n ...asyncStateOptions\n }\n );\n watch(\n () => toValue(options),\n () => state.execute(asyncStateOptions.delay),\n { deep: true }\n );\n return state;\n}\n\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\nfunction useScroll(element, options = {}) {\n const {\n throttle = 0,\n idle = 200,\n onStop = noop,\n onScroll = noop,\n offset = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n },\n eventListenerOptions = {\n capture: false,\n passive: true\n },\n behavior = \"auto\",\n window = defaultWindow,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const internalX = ref(0);\n const internalY = ref(0);\n const x = computed({\n get() {\n return internalX.value;\n },\n set(x2) {\n scrollTo(x2, void 0);\n }\n });\n const y = computed({\n get() {\n return internalY.value;\n },\n set(y2) {\n scrollTo(void 0, y2);\n }\n });\n function scrollTo(_x, _y) {\n var _a, _b, _c;\n if (!window)\n return;\n const _element = toValue(element);\n if (!_element)\n return;\n (_c = _element instanceof Document ? window.document.body : _element) == null ? void 0 : _c.scrollTo({\n top: (_a = toValue(_y)) != null ? _a : y.value,\n left: (_b = toValue(_x)) != null ? _b : x.value,\n behavior: toValue(behavior)\n });\n }\n const isScrolling = ref(false);\n const arrivedState = reactive({\n left: true,\n right: false,\n top: true,\n bottom: false\n });\n const directions = reactive({\n left: false,\n right: false,\n top: false,\n bottom: false\n });\n const onScrollEnd = (e) => {\n if (!isScrolling.value)\n return;\n isScrolling.value = false;\n directions.left = false;\n directions.right = false;\n directions.top = false;\n directions.bottom = false;\n onStop(e);\n };\n const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n const setArrivedState = (target) => {\n var _a;\n if (!window)\n return;\n const el = ((_a = target == null ? void 0 : target.document) == null ? void 0 : _a.documentElement) || (target == null ? void 0 : target.documentElement) || unrefElement(target);\n const { display, flexDirection } = getComputedStyle(el);\n const scrollLeft = el.scrollLeft;\n directions.left = scrollLeft < internalX.value;\n directions.right = scrollLeft > internalX.value;\n const left = Math.abs(scrollLeft) <= (offset.left || 0);\n const right = Math.abs(scrollLeft) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n if (display === \"flex\" && flexDirection === \"row-reverse\") {\n arrivedState.left = right;\n arrivedState.right = left;\n } else {\n arrivedState.left = left;\n arrivedState.right = right;\n }\n internalX.value = scrollLeft;\n let scrollTop = el.scrollTop;\n if (target === window.document && !scrollTop)\n scrollTop = window.document.body.scrollTop;\n directions.top = scrollTop < internalY.value;\n directions.bottom = scrollTop > internalY.value;\n const top = Math.abs(scrollTop) <= (offset.top || 0);\n const bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n if (display === \"flex\" && flexDirection === \"column-reverse\") {\n arrivedState.top = bottom;\n arrivedState.bottom = top;\n } else {\n arrivedState.top = top;\n arrivedState.bottom = bottom;\n }\n internalY.value = scrollTop;\n };\n const onScrollHandler = (e) => {\n var _a;\n if (!window)\n return;\n const eventTarget = (_a = e.target.documentElement) != null ? _a : e.target;\n setArrivedState(eventTarget);\n isScrolling.value = true;\n onScrollEndDebounced(e);\n onScroll(e);\n };\n useEventListener(\n element,\n \"scroll\",\n throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler,\n eventListenerOptions\n );\n tryOnMounted(() => {\n try {\n const _element = toValue(element);\n if (!_element)\n return;\n setArrivedState(_element);\n } catch (e) {\n onError(e);\n }\n });\n useEventListener(\n element,\n \"scrollend\",\n onScrollEnd,\n eventListenerOptions\n );\n return {\n x,\n y,\n isScrolling,\n arrivedState,\n directions,\n measure() {\n const _element = toValue(element);\n if (window && _element)\n setArrivedState(_element);\n }\n };\n}\n\nfunction resolveElement(el) {\n if (typeof Window !== \"undefined\" && el instanceof Window)\n return el.document.documentElement;\n if (typeof Document !== \"undefined\" && el instanceof Document)\n return el.documentElement;\n return el;\n}\n\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n var _a;\n const {\n direction = \"bottom\",\n interval = 100,\n canLoadMore = () => true\n } = options;\n const state = reactive(useScroll(\n element,\n {\n ...options,\n offset: {\n [direction]: (_a = options.distance) != null ? _a : 0,\n ...options.offset\n }\n }\n ));\n const promise = ref();\n const isLoading = computed(() => !!promise.value);\n const observedElement = computed(() => {\n return resolveElement(toValue(element));\n });\n const isElementVisible = useElementVisibility(observedElement);\n function checkAndLoad() {\n state.measure();\n if (!observedElement.value || !isElementVisible.value || !canLoadMore(observedElement.value))\n return;\n const { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;\n const isNarrower = direction === \"bottom\" || direction === \"top\" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;\n if (state.arrivedState[direction] || isNarrower) {\n if (!promise.value) {\n promise.value = Promise.all([\n onLoadMore(state),\n new Promise((resolve) => setTimeout(resolve, interval))\n ]).finally(() => {\n promise.value = null;\n nextTick(() => checkAndLoad());\n });\n }\n }\n }\n watch(\n () => [state.arrivedState[direction], isElementVisible.value],\n checkAndLoad,\n { immediate: true }\n );\n return {\n isLoading\n };\n}\n\nconst defaultEvents = [\"mousedown\", \"mouseup\", \"keydown\", \"keyup\"];\nfunction useKeyModifier(modifier, options = {}) {\n const {\n events = defaultEvents,\n document = defaultDocument,\n initial = null\n } = options;\n const state = ref(initial);\n if (document) {\n events.forEach((listenerEvent) => {\n useEventListener(document, listenerEvent, (evt) => {\n if (typeof evt.getModifierState === \"function\")\n state.value = evt.getModifierState(modifier);\n });\n });\n }\n return state;\n}\n\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.localStorage, options);\n}\n\nconst DefaultMagicKeysAliasMap = {\n ctrl: \"control\",\n command: \"meta\",\n cmd: \"meta\",\n option: \"alt\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\"\n};\n\nfunction useMagicKeys(options = {}) {\n const {\n reactive: useReactive = false,\n target = defaultWindow,\n aliasMap = DefaultMagicKeysAliasMap,\n passive = true,\n onEventFired = noop\n } = options;\n const current = reactive(/* @__PURE__ */ new Set());\n const obj = {\n toJSON() {\n return {};\n },\n current\n };\n const refs = useReactive ? reactive(obj) : obj;\n const metaDeps = /* @__PURE__ */ new Set();\n const usedKeys = /* @__PURE__ */ new Set();\n function setRefs(key, value) {\n if (key in refs) {\n if (useReactive)\n refs[key] = value;\n else\n refs[key].value = value;\n }\n }\n function reset() {\n current.clear();\n for (const key of usedKeys)\n setRefs(key, false);\n }\n function updateRefs(e, value) {\n var _a, _b;\n const key = (_a = e.key) == null ? void 0 : _a.toLowerCase();\n const code = (_b = e.code) == null ? void 0 : _b.toLowerCase();\n const values = [code, key].filter(Boolean);\n if (key) {\n if (value)\n current.add(key);\n else\n current.delete(key);\n }\n for (const key2 of values) {\n usedKeys.add(key2);\n setRefs(key2, value);\n }\n if (key === \"meta\" && !value) {\n metaDeps.forEach((key2) => {\n current.delete(key2);\n setRefs(key2, false);\n });\n metaDeps.clear();\n } else if (typeof e.getModifierState === \"function\" && e.getModifierState(\"Meta\") && value) {\n [...current, ...values].forEach((key2) => metaDeps.add(key2));\n }\n }\n useEventListener(target, \"keydown\", (e) => {\n updateRefs(e, true);\n return onEventFired(e);\n }, { passive });\n useEventListener(target, \"keyup\", (e) => {\n updateRefs(e, false);\n return onEventFired(e);\n }, { passive });\n useEventListener(\"blur\", reset, { passive: true });\n useEventListener(\"focus\", reset, { passive: true });\n const proxy = new Proxy(\n refs,\n {\n get(target2, prop, rec) {\n if (typeof prop !== \"string\")\n return Reflect.get(target2, prop, rec);\n prop = prop.toLowerCase();\n if (prop in aliasMap)\n prop = aliasMap[prop];\n if (!(prop in refs)) {\n if (/[+_-]/.test(prop)) {\n const keys = prop.split(/[+_-]/g).map((i) => i.trim());\n refs[prop] = computed(() => keys.every((key) => toValue(proxy[key])));\n } else {\n refs[prop] = ref(false);\n }\n }\n const r = Reflect.get(target2, prop, rec);\n return useReactive ? toValue(r) : r;\n }\n }\n );\n return proxy;\n}\n\nfunction usingElRef(source, cb) {\n if (toValue(source))\n cb(toValue(source));\n}\nfunction timeRangeToArray(timeRanges) {\n let ranges = [];\n for (let i = 0; i < timeRanges.length; ++i)\n ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n return ranges;\n}\nfunction tracksToArray(tracks) {\n return Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({ id, label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }));\n}\nconst defaultOptions = {\n src: \"\",\n tracks: []\n};\nfunction useMediaControls(target, options = {}) {\n options = {\n ...defaultOptions,\n ...options\n };\n const {\n document = defaultDocument\n } = options;\n const currentTime = ref(0);\n const duration = ref(0);\n const seeking = ref(false);\n const volume = ref(1);\n const waiting = ref(false);\n const ended = ref(false);\n const playing = ref(false);\n const rate = ref(1);\n const stalled = ref(false);\n const buffered = ref([]);\n const tracks = ref([]);\n const selectedTrack = ref(-1);\n const isPictureInPicture = ref(false);\n const muted = ref(false);\n const supportsPictureInPicture = document && \"pictureInPictureEnabled\" in document;\n const sourceErrorEvent = createEventHook();\n const disableTrack = (track) => {\n usingElRef(target, (el) => {\n if (track) {\n const id = typeof track === \"number\" ? track : track.id;\n el.textTracks[id].mode = \"disabled\";\n } else {\n for (let i = 0; i < el.textTracks.length; ++i)\n el.textTracks[i].mode = \"disabled\";\n }\n selectedTrack.value = -1;\n });\n };\n const enableTrack = (track, disableTracks = true) => {\n usingElRef(target, (el) => {\n const id = typeof track === \"number\" ? track : track.id;\n if (disableTracks)\n disableTrack();\n el.textTracks[id].mode = \"showing\";\n selectedTrack.value = id;\n });\n };\n const togglePictureInPicture = () => {\n return new Promise((resolve, reject) => {\n usingElRef(target, async (el) => {\n if (supportsPictureInPicture) {\n if (!isPictureInPicture.value) {\n el.requestPictureInPicture().then(resolve).catch(reject);\n } else {\n document.exitPictureInPicture().then(resolve).catch(reject);\n }\n }\n });\n });\n };\n watchEffect(() => {\n if (!document)\n return;\n const el = toValue(target);\n if (!el)\n return;\n const src = toValue(options.src);\n let sources = [];\n if (!src)\n return;\n if (typeof src === \"string\")\n sources = [{ src }];\n else if (Array.isArray(src))\n sources = src;\n else if (isObject(src))\n sources = [src];\n el.querySelectorAll(\"source\").forEach((e) => {\n e.removeEventListener(\"error\", sourceErrorEvent.trigger);\n e.remove();\n });\n sources.forEach(({ src: src2, type }) => {\n const source = document.createElement(\"source\");\n source.setAttribute(\"src\", src2);\n source.setAttribute(\"type\", type || \"\");\n source.addEventListener(\"error\", sourceErrorEvent.trigger);\n el.appendChild(source);\n });\n el.load();\n });\n tryOnScopeDispose(() => {\n const el = toValue(target);\n if (!el)\n return;\n el.querySelectorAll(\"source\").forEach((e) => e.removeEventListener(\"error\", sourceErrorEvent.trigger));\n });\n watch([target, volume], () => {\n const el = toValue(target);\n if (!el)\n return;\n el.volume = volume.value;\n });\n watch([target, muted], () => {\n const el = toValue(target);\n if (!el)\n return;\n el.muted = muted.value;\n });\n watch([target, rate], () => {\n const el = toValue(target);\n if (!el)\n return;\n el.playbackRate = rate.value;\n });\n watchEffect(() => {\n if (!document)\n return;\n const textTracks = toValue(options.tracks);\n const el = toValue(target);\n if (!textTracks || !textTracks.length || !el)\n return;\n el.querySelectorAll(\"track\").forEach((e) => e.remove());\n textTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n const track = document.createElement(\"track\");\n track.default = isDefault || false;\n track.kind = kind;\n track.label = label;\n track.src = src;\n track.srclang = srcLang;\n if (track.default)\n selectedTrack.value = i;\n el.appendChild(track);\n });\n });\n const { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n const el = toValue(target);\n if (!el)\n return;\n el.currentTime = time;\n });\n const { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n const el = toValue(target);\n if (!el)\n return;\n isPlaying ? el.play() : el.pause();\n });\n useEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = toValue(target).currentTime));\n useEventListener(target, \"durationchange\", () => duration.value = toValue(target).duration);\n useEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(toValue(target).buffered));\n useEventListener(target, \"seeking\", () => seeking.value = true);\n useEventListener(target, \"seeked\", () => seeking.value = false);\n useEventListener(target, [\"waiting\", \"loadstart\"], () => {\n waiting.value = true;\n ignorePlayingUpdates(() => playing.value = false);\n });\n useEventListener(target, \"loadeddata\", () => waiting.value = false);\n useEventListener(target, \"playing\", () => {\n waiting.value = false;\n ended.value = false;\n ignorePlayingUpdates(() => playing.value = true);\n });\n useEventListener(target, \"ratechange\", () => rate.value = toValue(target).playbackRate);\n useEventListener(target, \"stalled\", () => stalled.value = true);\n useEventListener(target, \"ended\", () => ended.value = true);\n useEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false));\n useEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true));\n useEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true);\n useEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false);\n useEventListener(target, \"volumechange\", () => {\n const el = toValue(target);\n if (!el)\n return;\n volume.value = el.volume;\n muted.value = el.muted;\n });\n const listeners = [];\n const stop = watch([target], () => {\n const el = toValue(target);\n if (!el)\n return;\n stop();\n listeners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks));\n });\n tryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n return {\n currentTime,\n duration,\n waiting,\n seeking,\n ended,\n stalled,\n buffered,\n playing,\n rate,\n // Volume\n volume,\n muted,\n // Tracks\n tracks,\n selectedTrack,\n enableTrack,\n disableTrack,\n // Picture in Picture\n supportsPictureInPicture,\n togglePictureInPicture,\n isPictureInPicture,\n // Events\n onSourceError: sourceErrorEvent.on\n };\n}\n\nfunction getMapVue2Compat() {\n const data = shallowReactive({});\n return {\n get: (key) => data[key],\n set: (key, value) => set(data, key, value),\n has: (key) => hasOwn(data, key),\n delete: (key) => del(data, key),\n clear: () => {\n Object.keys(data).forEach((key) => {\n del(data, key);\n });\n }\n };\n}\nfunction useMemoize(resolver, options) {\n const initCache = () => {\n if (options == null ? void 0 : options.cache)\n return shallowReactive(options.cache);\n if (isVue2)\n return getMapVue2Compat();\n return shallowReactive(/* @__PURE__ */ new Map());\n };\n const cache = initCache();\n const generateKey = (...args) => (options == null ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n const _loadData = (key, ...args) => {\n cache.set(key, resolver(...args));\n return cache.get(key);\n };\n const loadData = (...args) => _loadData(generateKey(...args), ...args);\n const deleteData = (...args) => {\n cache.delete(generateKey(...args));\n };\n const clearData = () => {\n cache.clear();\n };\n const memoized = (...args) => {\n const key = generateKey(...args);\n if (cache.has(key))\n return cache.get(key);\n return _loadData(key, ...args);\n };\n memoized.load = loadData;\n memoized.delete = deleteData;\n memoized.clear = clearData;\n memoized.generateKey = generateKey;\n memoized.cache = cache;\n return memoized;\n}\n\nfunction useMemory(options = {}) {\n const memory = ref();\n const isSupported = useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n if (isSupported.value) {\n const { interval = 1e3 } = options;\n useIntervalFn(() => {\n memory.value = performance.memory;\n }, interval, { immediate: options.immediate, immediateCallback: options.immediateCallback });\n }\n return { isSupported, memory };\n}\n\nconst UseMouseBuiltinExtractors = {\n page: (event) => [event.pageX, event.pageY],\n client: (event) => [event.clientX, event.clientY],\n screen: (event) => [event.screenX, event.screenY],\n movement: (event) => event instanceof Touch ? null : [event.movementX, event.movementY]\n};\nfunction useMouse(options = {}) {\n const {\n type = \"page\",\n touch = true,\n resetOnTouchEnds = false,\n initialValue = { x: 0, y: 0 },\n window = defaultWindow,\n target = window,\n scroll = true,\n eventFilter\n } = options;\n let _prevMouseEvent = null;\n const x = ref(initialValue.x);\n const y = ref(initialValue.y);\n const sourceType = ref(null);\n const extractor = typeof type === \"function\" ? type : UseMouseBuiltinExtractors[type];\n const mouseHandler = (event) => {\n const result = extractor(event);\n _prevMouseEvent = event;\n if (result) {\n [x.value, y.value] = result;\n sourceType.value = \"mouse\";\n }\n };\n const touchHandler = (event) => {\n if (event.touches.length > 0) {\n const result = extractor(event.touches[0]);\n if (result) {\n [x.value, y.value] = result;\n sourceType.value = \"touch\";\n }\n }\n };\n const scrollHandler = () => {\n if (!_prevMouseEvent || !window)\n return;\n const pos = extractor(_prevMouseEvent);\n if (_prevMouseEvent instanceof MouseEvent && pos) {\n x.value = pos[0] + window.scrollX;\n y.value = pos[1] + window.scrollY;\n }\n };\n const reset = () => {\n x.value = initialValue.x;\n y.value = initialValue.y;\n };\n const mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);\n const touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);\n const scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();\n if (target) {\n const listenerOptions = { passive: true };\n useEventListener(target, [\"mousemove\", \"dragover\"], mouseHandlerWrapper, listenerOptions);\n if (touch && type !== \"movement\") {\n useEventListener(target, [\"touchstart\", \"touchmove\"], touchHandlerWrapper, listenerOptions);\n if (resetOnTouchEnds)\n useEventListener(target, \"touchend\", reset, listenerOptions);\n }\n if (scroll && type === \"page\")\n useEventListener(window, \"scroll\", scrollHandlerWrapper, { passive: true });\n }\n return {\n x,\n y,\n sourceType\n };\n}\n\nfunction useMouseInElement(target, options = {}) {\n const {\n handleOutside = true,\n window = defaultWindow\n } = options;\n const type = options.type || \"page\";\n const { x, y, sourceType } = useMouse(options);\n const targetRef = ref(target != null ? target : window == null ? void 0 : window.document.body);\n const elementX = ref(0);\n const elementY = ref(0);\n const elementPositionX = ref(0);\n const elementPositionY = ref(0);\n const elementHeight = ref(0);\n const elementWidth = ref(0);\n const isOutside = ref(true);\n let stop = () => {\n };\n if (window) {\n stop = watch(\n [targetRef, x, y],\n () => {\n const el = unrefElement(targetRef);\n if (!el)\n return;\n const {\n left,\n top,\n width,\n height\n } = el.getBoundingClientRect();\n elementPositionX.value = left + (type === \"page\" ? window.pageXOffset : 0);\n elementPositionY.value = top + (type === \"page\" ? window.pageYOffset : 0);\n elementHeight.value = height;\n elementWidth.value = width;\n const elX = x.value - elementPositionX.value;\n const elY = y.value - elementPositionY.value;\n isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n if (handleOutside || !isOutside.value) {\n elementX.value = elX;\n elementY.value = elY;\n }\n },\n { immediate: true }\n );\n useEventListener(document, \"mouseleave\", () => {\n isOutside.value = true;\n });\n }\n return {\n x,\n y,\n sourceType,\n elementX,\n elementY,\n elementPositionX,\n elementPositionY,\n elementHeight,\n elementWidth,\n isOutside,\n stop\n };\n}\n\nfunction useMousePressed(options = {}) {\n const {\n touch = true,\n drag = true,\n capture = false,\n initialValue = false,\n window = defaultWindow\n } = options;\n const pressed = ref(initialValue);\n const sourceType = ref(null);\n if (!window) {\n return {\n pressed,\n sourceType\n };\n }\n const onPressed = (srcType) => () => {\n pressed.value = true;\n sourceType.value = srcType;\n };\n const onReleased = () => {\n pressed.value = false;\n sourceType.value = null;\n };\n const target = computed(() => unrefElement(options.target) || window);\n useEventListener(target, \"mousedown\", onPressed(\"mouse\"), { passive: true, capture });\n useEventListener(window, \"mouseleave\", onReleased, { passive: true, capture });\n useEventListener(window, \"mouseup\", onReleased, { passive: true, capture });\n if (drag) {\n useEventListener(target, \"dragstart\", onPressed(\"mouse\"), { passive: true, capture });\n useEventListener(window, \"drop\", onReleased, { passive: true, capture });\n useEventListener(window, \"dragend\", onReleased, { passive: true, capture });\n }\n if (touch) {\n useEventListener(target, \"touchstart\", onPressed(\"touch\"), { passive: true, capture });\n useEventListener(window, \"touchend\", onReleased, { passive: true, capture });\n useEventListener(window, \"touchcancel\", onReleased, { passive: true, capture });\n }\n return {\n pressed,\n sourceType\n };\n}\n\nfunction useNavigatorLanguage(options = {}) {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"language\" in navigator);\n const language = ref(navigator == null ? void 0 : navigator.language);\n useEventListener(window, \"languagechange\", () => {\n if (navigator)\n language.value = navigator.language;\n });\n return {\n isSupported,\n language\n };\n}\n\nfunction useNetwork(options = {}) {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"connection\" in navigator);\n const isOnline = ref(true);\n const saveData = ref(false);\n const offlineAt = ref(void 0);\n const onlineAt = ref(void 0);\n const downlink = ref(void 0);\n const downlinkMax = ref(void 0);\n const rtt = ref(void 0);\n const effectiveType = ref(void 0);\n const type = ref(\"unknown\");\n const connection = isSupported.value && navigator.connection;\n function updateNetworkInformation() {\n if (!navigator)\n return;\n isOnline.value = navigator.onLine;\n offlineAt.value = isOnline.value ? void 0 : Date.now();\n onlineAt.value = isOnline.value ? Date.now() : void 0;\n if (connection) {\n downlink.value = connection.downlink;\n downlinkMax.value = connection.downlinkMax;\n effectiveType.value = connection.effectiveType;\n rtt.value = connection.rtt;\n saveData.value = connection.saveData;\n type.value = connection.type;\n }\n }\n if (window) {\n useEventListener(window, \"offline\", () => {\n isOnline.value = false;\n offlineAt.value = Date.now();\n });\n useEventListener(window, \"online\", () => {\n isOnline.value = true;\n onlineAt.value = Date.now();\n });\n }\n if (connection)\n useEventListener(connection, \"change\", updateNetworkInformation, false);\n updateNetworkInformation();\n return {\n isSupported,\n isOnline,\n saveData,\n offlineAt,\n onlineAt,\n downlink,\n downlinkMax,\n effectiveType,\n rtt,\n type\n };\n}\n\nfunction useNow(options = {}) {\n const {\n controls: exposeControls = false,\n interval = \"requestAnimationFrame\"\n } = options;\n const now = ref(/* @__PURE__ */ new Date());\n const update = () => now.value = /* @__PURE__ */ new Date();\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(update, { immediate: true }) : useIntervalFn(update, interval, { immediate: true });\n if (exposeControls) {\n return {\n now,\n ...controls\n };\n } else {\n return now;\n }\n}\n\nfunction useObjectUrl(object) {\n const url = ref();\n const release = () => {\n if (url.value)\n URL.revokeObjectURL(url.value);\n url.value = void 0;\n };\n watch(\n () => toValue(object),\n (newObject) => {\n release();\n if (newObject)\n url.value = URL.createObjectURL(newObject);\n },\n { immediate: true }\n );\n tryOnScopeDispose(release);\n return readonly(url);\n}\n\nfunction useClamp(value, min, max) {\n if (typeof value === \"function\" || isReadonly(value))\n return computed(() => clamp(toValue(value), toValue(min), toValue(max)));\n const _value = ref(value);\n return computed({\n get() {\n return _value.value = clamp(_value.value, toValue(min), toValue(max));\n },\n set(value2) {\n _value.value = clamp(value2, toValue(min), toValue(max));\n }\n });\n}\n\nfunction useOffsetPagination(options) {\n const {\n total = Number.POSITIVE_INFINITY,\n pageSize = 10,\n page = 1,\n onPageChange = noop,\n onPageSizeChange = noop,\n onPageCountChange = noop\n } = options;\n const currentPageSize = useClamp(pageSize, 1, Number.POSITIVE_INFINITY);\n const pageCount = computed(() => Math.max(\n 1,\n Math.ceil(toValue(total) / toValue(currentPageSize))\n ));\n const currentPage = useClamp(page, 1, pageCount);\n const isFirstPage = computed(() => currentPage.value === 1);\n const isLastPage = computed(() => currentPage.value === pageCount.value);\n if (isRef(page)) {\n syncRef(page, currentPage, {\n direction: isReadonly(page) ? \"ltr\" : \"both\"\n });\n }\n if (isRef(pageSize)) {\n syncRef(pageSize, currentPageSize, {\n direction: isReadonly(pageSize) ? \"ltr\" : \"both\"\n });\n }\n function prev() {\n currentPage.value--;\n }\n function next() {\n currentPage.value++;\n }\n const returnValue = {\n currentPage,\n currentPageSize,\n pageCount,\n isFirstPage,\n isLastPage,\n prev,\n next\n };\n watch(currentPage, () => {\n onPageChange(reactive(returnValue));\n });\n watch(currentPageSize, () => {\n onPageSizeChange(reactive(returnValue));\n });\n watch(pageCount, () => {\n onPageCountChange(reactive(returnValue));\n });\n return returnValue;\n}\n\nfunction useOnline(options = {}) {\n const { isOnline } = useNetwork(options);\n return isOnline;\n}\n\nfunction usePageLeave(options = {}) {\n const { window = defaultWindow } = options;\n const isLeft = ref(false);\n const handler = (event) => {\n if (!window)\n return;\n event = event || window.event;\n const from = event.relatedTarget || event.toElement;\n isLeft.value = !from;\n };\n if (window) {\n useEventListener(window, \"mouseout\", handler, { passive: true });\n useEventListener(window.document, \"mouseleave\", handler, { passive: true });\n useEventListener(window.document, \"mouseenter\", handler, { passive: true });\n }\n return isLeft;\n}\n\nfunction useScreenOrientation(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"screen\" in window && \"orientation\" in window.screen);\n const screenOrientation = isSupported.value ? window.screen.orientation : {};\n const orientation = ref(screenOrientation.type);\n const angle = ref(screenOrientation.angle || 0);\n if (isSupported.value) {\n useEventListener(window, \"orientationchange\", () => {\n orientation.value = screenOrientation.type;\n angle.value = screenOrientation.angle;\n });\n }\n const lockOrientation = (type) => {\n if (isSupported.value && typeof screenOrientation.lock === \"function\")\n return screenOrientation.lock(type);\n return Promise.reject(new Error(\"Not supported\"));\n };\n const unlockOrientation = () => {\n if (isSupported.value && typeof screenOrientation.unlock === \"function\")\n screenOrientation.unlock();\n };\n return {\n isSupported,\n orientation,\n angle,\n lockOrientation,\n unlockOrientation\n };\n}\n\nfunction useParallax(target, options = {}) {\n const {\n deviceOrientationTiltAdjust = (i) => i,\n deviceOrientationRollAdjust = (i) => i,\n mouseTiltAdjust = (i) => i,\n mouseRollAdjust = (i) => i,\n window = defaultWindow\n } = options;\n const orientation = reactive(useDeviceOrientation({ window }));\n const screenOrientation = reactive(useScreenOrientation({ window }));\n const {\n elementX: x,\n elementY: y,\n elementWidth: width,\n elementHeight: height\n } = useMouseInElement(target, { handleOutside: false, window });\n const source = computed(() => {\n if (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0))\n return \"deviceOrientation\";\n return \"mouse\";\n });\n const roll = computed(() => {\n if (source.value === \"deviceOrientation\") {\n let value;\n switch (screenOrientation.orientation) {\n case \"landscape-primary\":\n value = orientation.gamma / 90;\n break;\n case \"landscape-secondary\":\n value = -orientation.gamma / 90;\n break;\n case \"portrait-primary\":\n value = -orientation.beta / 90;\n break;\n case \"portrait-secondary\":\n value = orientation.beta / 90;\n break;\n default:\n value = -orientation.beta / 90;\n }\n return deviceOrientationRollAdjust(value);\n } else {\n const value = -(y.value - height.value / 2) / height.value;\n return mouseRollAdjust(value);\n }\n });\n const tilt = computed(() => {\n if (source.value === \"deviceOrientation\") {\n let value;\n switch (screenOrientation.orientation) {\n case \"landscape-primary\":\n value = orientation.beta / 90;\n break;\n case \"landscape-secondary\":\n value = -orientation.beta / 90;\n break;\n case \"portrait-primary\":\n value = orientation.gamma / 90;\n break;\n case \"portrait-secondary\":\n value = -orientation.gamma / 90;\n break;\n default:\n value = orientation.gamma / 90;\n }\n return deviceOrientationTiltAdjust(value);\n } else {\n const value = (x.value - width.value / 2) / width.value;\n return mouseTiltAdjust(value);\n }\n });\n return { roll, tilt, source };\n}\n\nfunction useParentElement(element = useCurrentElement()) {\n const parentElement = shallowRef();\n const update = () => {\n const el = unrefElement(element);\n if (el)\n parentElement.value = el.parentElement;\n };\n tryOnMounted(update);\n watch(() => toValue(element), update);\n return parentElement;\n}\n\nfunction usePerformanceObserver(options, callback) {\n const {\n window = defaultWindow,\n immediate = true,\n ...performanceOptions\n } = options;\n const isSupported = useSupported(() => window && \"PerformanceObserver\" in window);\n let observer;\n const stop = () => {\n observer == null ? void 0 : observer.disconnect();\n };\n const start = () => {\n if (isSupported.value) {\n stop();\n observer = new PerformanceObserver(callback);\n observer.observe(performanceOptions);\n }\n };\n tryOnScopeDispose(stop);\n if (immediate)\n start();\n return {\n isSupported,\n start,\n stop\n };\n}\n\nconst defaultState = {\n x: 0,\n y: 0,\n pointerId: 0,\n pressure: 0,\n tiltX: 0,\n tiltY: 0,\n width: 0,\n height: 0,\n twist: 0,\n pointerType: null\n};\nconst keys = /* @__PURE__ */ Object.keys(defaultState);\nfunction usePointer(options = {}) {\n const {\n target = defaultWindow\n } = options;\n const isInside = ref(false);\n const state = ref(options.initialValue || {});\n Object.assign(state.value, defaultState, state.value);\n const handler = (event) => {\n isInside.value = true;\n if (options.pointerTypes && !options.pointerTypes.includes(event.pointerType))\n return;\n state.value = objectPick(event, keys, false);\n };\n if (target) {\n const listenerOptions = { passive: true };\n useEventListener(target, [\"pointerdown\", \"pointermove\", \"pointerup\"], handler, listenerOptions);\n useEventListener(target, \"pointerleave\", () => isInside.value = false, listenerOptions);\n }\n return {\n ...toRefs(state),\n isInside\n };\n}\n\nfunction usePointerLock(target, options = {}) {\n const { document = defaultDocument } = options;\n const isSupported = useSupported(() => document && \"pointerLockElement\" in document);\n const element = ref();\n const triggerElement = ref();\n let targetElement;\n if (isSupported.value) {\n useEventListener(document, \"pointerlockchange\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n element.value = document.pointerLockElement;\n if (!element.value)\n targetElement = triggerElement.value = null;\n }\n });\n useEventListener(document, \"pointerlockerror\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n const action = document.pointerLockElement ? \"release\" : \"acquire\";\n throw new Error(`Failed to ${action} pointer lock.`);\n }\n });\n }\n async function lock(e) {\n var _a;\n if (!isSupported.value)\n throw new Error(\"Pointer Lock API is not supported by your browser.\");\n triggerElement.value = e instanceof Event ? e.currentTarget : null;\n targetElement = e instanceof Event ? (_a = unrefElement(target)) != null ? _a : triggerElement.value : unrefElement(e);\n if (!targetElement)\n throw new Error(\"Target element undefined.\");\n targetElement.requestPointerLock();\n return await until(element).toBe(targetElement);\n }\n async function unlock() {\n if (!element.value)\n return false;\n document.exitPointerLock();\n await until(element).toBeNull();\n return true;\n }\n return {\n isSupported,\n element,\n triggerElement,\n lock,\n unlock\n };\n}\n\nfunction usePointerSwipe(target, options = {}) {\n const targetRef = toRef(target);\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart,\n disableTextSelect = false\n } = options;\n const posStart = reactive({ x: 0, y: 0 });\n const updatePosStart = (x, y) => {\n posStart.x = x;\n posStart.y = y;\n };\n const posEnd = reactive({ x: 0, y: 0 });\n const updatePosEnd = (x, y) => {\n posEnd.x = x;\n posEnd.y = y;\n };\n const distanceX = computed(() => posStart.x - posEnd.x);\n const distanceY = computed(() => posStart.y - posEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n const isSwiping = ref(false);\n const isPointerDown = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return \"none\";\n if (abs(distanceX.value) > abs(distanceY.value)) {\n return distanceX.value > 0 ? \"left\" : \"right\";\n } else {\n return distanceY.value > 0 ? \"up\" : \"down\";\n }\n });\n const eventIsAllowed = (e) => {\n var _a, _b, _c;\n const isReleasingButton = e.buttons === 0;\n const isPrimaryButton = e.buttons === 1;\n return (_c = (_b = (_a = options.pointerTypes) == null ? void 0 : _a.includes(e.pointerType)) != null ? _b : isReleasingButton || isPrimaryButton) != null ? _c : true;\n };\n const stops = [\n useEventListener(target, \"pointerdown\", (e) => {\n if (!eventIsAllowed(e))\n return;\n isPointerDown.value = true;\n const eventTarget = e.target;\n eventTarget == null ? void 0 : eventTarget.setPointerCapture(e.pointerId);\n const { clientX: x, clientY: y } = e;\n updatePosStart(x, y);\n updatePosEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }),\n useEventListener(target, \"pointermove\", (e) => {\n if (!eventIsAllowed(e))\n return;\n if (!isPointerDown.value)\n return;\n const { clientX: x, clientY: y } = e;\n updatePosEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }),\n useEventListener(target, \"pointerup\", (e) => {\n if (!eventIsAllowed(e))\n return;\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isPointerDown.value = false;\n isSwiping.value = false;\n })\n ];\n tryOnMounted(() => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n (_b = (_a = targetRef.value) == null ? void 0 : _a.style) == null ? void 0 : _b.setProperty(\"touch-action\", \"none\");\n if (disableTextSelect) {\n (_d = (_c = targetRef.value) == null ? void 0 : _c.style) == null ? void 0 : _d.setProperty(\"-webkit-user-select\", \"none\");\n (_f = (_e = targetRef.value) == null ? void 0 : _e.style) == null ? void 0 : _f.setProperty(\"-ms-user-select\", \"none\");\n (_h = (_g = targetRef.value) == null ? void 0 : _g.style) == null ? void 0 : _h.setProperty(\"user-select\", \"none\");\n }\n });\n const stop = () => stops.forEach((s) => s());\n return {\n isSwiping: readonly(isSwiping),\n direction: readonly(direction),\n posStart: readonly(posStart),\n posEnd: readonly(posEnd),\n distanceX,\n distanceY,\n stop\n };\n}\n\nfunction usePreferredColorScheme(options) {\n const isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n const isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n return computed(() => {\n if (isDark.value)\n return \"dark\";\n if (isLight.value)\n return \"light\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredContrast(options) {\n const isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n const isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n const isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n return computed(() => {\n if (isMore.value)\n return \"more\";\n if (isLess.value)\n return \"less\";\n if (isCustom.value)\n return \"custom\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredLanguages(options = {}) {\n const { window = defaultWindow } = options;\n if (!window)\n return ref([\"en\"]);\n const navigator = window.navigator;\n const value = ref(navigator.languages);\n useEventListener(window, \"languagechange\", () => {\n value.value = navigator.languages;\n });\n return value;\n}\n\nfunction usePreferredReducedMotion(options) {\n const isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n return computed(() => {\n if (isReduced.value)\n return \"reduce\";\n return \"no-preference\";\n });\n}\n\nfunction usePrevious(value, initialValue) {\n const previous = shallowRef(initialValue);\n watch(\n toRef(value),\n (_, oldValue) => {\n previous.value = oldValue;\n },\n { flush: \"sync\" }\n );\n return readonly(previous);\n}\n\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\nfunction useScreenSafeArea() {\n const top = ref(\"\");\n const right = ref(\"\");\n const bottom = ref(\"\");\n const left = ref(\"\");\n if (isClient) {\n const topCssVar = useCssVar(topVarName);\n const rightCssVar = useCssVar(rightVarName);\n const bottomCssVar = useCssVar(bottomVarName);\n const leftCssVar = useCssVar(leftVarName);\n topCssVar.value = \"env(safe-area-inset-top, 0px)\";\n rightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n bottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n leftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n update();\n useEventListener(\"resize\", useDebounceFn(update));\n }\n function update() {\n top.value = getValue(topVarName);\n right.value = getValue(rightVarName);\n bottom.value = getValue(bottomVarName);\n left.value = getValue(leftVarName);\n }\n return {\n top,\n right,\n bottom,\n left,\n update\n };\n}\nfunction getValue(position) {\n return getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n const {\n immediate = true,\n manual = false,\n type = \"text/javascript\",\n async = true,\n crossOrigin,\n referrerPolicy,\n noModule,\n defer,\n document = defaultDocument,\n attrs = {}\n } = options;\n const scriptTag = ref(null);\n let _promise = null;\n const loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n const resolveWithElement = (el2) => {\n scriptTag.value = el2;\n resolve(el2);\n return el2;\n };\n if (!document) {\n resolve(false);\n return;\n }\n let shouldAppend = false;\n let el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n if (!el) {\n el = document.createElement(\"script\");\n el.type = type;\n el.async = async;\n el.src = toValue(src);\n if (defer)\n el.defer = defer;\n if (crossOrigin)\n el.crossOrigin = crossOrigin;\n if (noModule)\n el.noModule = noModule;\n if (referrerPolicy)\n el.referrerPolicy = referrerPolicy;\n Object.entries(attrs).forEach(([name, value]) => el == null ? void 0 : el.setAttribute(name, value));\n shouldAppend = true;\n } else if (el.hasAttribute(\"data-loaded\")) {\n resolveWithElement(el);\n }\n el.addEventListener(\"error\", (event) => reject(event));\n el.addEventListener(\"abort\", (event) => reject(event));\n el.addEventListener(\"load\", () => {\n el.setAttribute(\"data-loaded\", \"true\");\n onLoaded(el);\n resolveWithElement(el);\n });\n if (shouldAppend)\n el = document.head.appendChild(el);\n if (!waitForScriptLoad)\n resolveWithElement(el);\n });\n const load = (waitForScriptLoad = true) => {\n if (!_promise)\n _promise = loadScript(waitForScriptLoad);\n return _promise;\n };\n const unload = () => {\n if (!document)\n return;\n _promise = null;\n if (scriptTag.value)\n scriptTag.value = null;\n const el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n if (el)\n document.head.removeChild(el);\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnUnmounted(unload);\n return { scriptTag, load, unload };\n}\n\nfunction checkOverflowScroll(ele) {\n const style = window.getComputedStyle(ele);\n if (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) {\n return true;\n } else {\n const parent = ele.parentNode;\n if (!parent || parent.tagName === \"BODY\")\n return false;\n return checkOverflowScroll(parent);\n }\n}\nfunction preventDefault(rawEvent) {\n const e = rawEvent || window.event;\n const _target = e.target;\n if (checkOverflowScroll(_target))\n return false;\n if (e.touches.length > 1)\n return true;\n if (e.preventDefault)\n e.preventDefault();\n return false;\n}\nconst elInitialOverflow = /* @__PURE__ */ new WeakMap();\nfunction useScrollLock(element, initialState = false) {\n const isLocked = ref(initialState);\n let stopTouchMoveListener = null;\n watch(toRef(element), (el) => {\n const target = resolveElement(toValue(el));\n if (target) {\n const ele = target;\n if (!elInitialOverflow.get(ele))\n elInitialOverflow.set(ele, ele.style.overflow);\n if (isLocked.value)\n ele.style.overflow = \"hidden\";\n }\n }, {\n immediate: true\n });\n const lock = () => {\n const el = resolveElement(toValue(element));\n if (!el || isLocked.value)\n return;\n if (isIOS) {\n stopTouchMoveListener = useEventListener(\n el,\n \"touchmove\",\n (e) => {\n preventDefault(e);\n },\n { passive: false }\n );\n }\n el.style.overflow = \"hidden\";\n isLocked.value = true;\n };\n const unlock = () => {\n var _a;\n const el = resolveElement(toValue(element));\n if (!el || !isLocked.value)\n return;\n isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());\n el.style.overflow = (_a = elInitialOverflow.get(el)) != null ? _a : \"\";\n elInitialOverflow.delete(el);\n isLocked.value = false;\n };\n tryOnScopeDispose(unlock);\n return computed({\n get() {\n return isLocked.value;\n },\n set(v) {\n if (v)\n lock();\n else\n unlock();\n }\n });\n}\n\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.sessionStorage, options);\n}\n\nfunction useShare(shareOptions = {}, options = {}) {\n const { navigator = defaultNavigator } = options;\n const _navigator = navigator;\n const isSupported = useSupported(() => _navigator && \"canShare\" in _navigator);\n const share = async (overrideOptions = {}) => {\n if (isSupported.value) {\n const data = {\n ...toValue(shareOptions),\n ...toValue(overrideOptions)\n };\n let granted = true;\n if (data.files && _navigator.canShare)\n granted = _navigator.canShare({ files: data.files });\n if (granted)\n return _navigator.share(data);\n }\n };\n return {\n isSupported,\n share\n };\n}\n\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n var _a, _b, _c, _d;\n const [source] = args;\n let compareFn = defaultCompare;\n let options = {};\n if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n options = args[1];\n compareFn = (_a = options.compareFn) != null ? _a : defaultCompare;\n } else {\n compareFn = (_b = args[1]) != null ? _b : defaultCompare;\n }\n } else if (args.length > 2) {\n compareFn = (_c = args[1]) != null ? _c : defaultCompare;\n options = (_d = args[2]) != null ? _d : {};\n }\n const {\n dirty = false,\n sortFn = defaultSortFn\n } = options;\n if (!dirty)\n return computed(() => sortFn([...toValue(source)], compareFn));\n watchEffect(() => {\n const result = sortFn(toValue(source), compareFn);\n if (isRef(source))\n source.value = result;\n else\n source.splice(0, source.length, ...result);\n });\n return source;\n}\n\nfunction useSpeechRecognition(options = {}) {\n const {\n interimResults = true,\n continuous = true,\n window = defaultWindow\n } = options;\n const lang = toRef(options.lang || \"en-US\");\n const isListening = ref(false);\n const isFinal = ref(false);\n const result = ref(\"\");\n const error = shallowRef(void 0);\n const toggle = (value = !isListening.value) => {\n isListening.value = value;\n };\n const start = () => {\n isListening.value = true;\n };\n const stop = () => {\n isListening.value = false;\n };\n const SpeechRecognition = window && (window.SpeechRecognition || window.webkitSpeechRecognition);\n const isSupported = useSupported(() => SpeechRecognition);\n let recognition;\n if (isSupported.value) {\n recognition = new SpeechRecognition();\n recognition.continuous = continuous;\n recognition.interimResults = interimResults;\n recognition.lang = toValue(lang);\n recognition.onstart = () => {\n isFinal.value = false;\n };\n watch(lang, (lang2) => {\n if (recognition && !isListening.value)\n recognition.lang = lang2;\n });\n recognition.onresult = (event) => {\n const transcript = Array.from(event.results).map((result2) => {\n isFinal.value = result2.isFinal;\n return result2[0];\n }).map((result2) => result2.transcript).join(\"\");\n result.value = transcript;\n error.value = void 0;\n };\n recognition.onerror = (event) => {\n error.value = event;\n };\n recognition.onend = () => {\n isListening.value = false;\n recognition.lang = toValue(lang);\n };\n watch(isListening, () => {\n if (isListening.value)\n recognition.start();\n else\n recognition.stop();\n });\n }\n tryOnScopeDispose(() => {\n isListening.value = false;\n });\n return {\n isSupported,\n isListening,\n isFinal,\n recognition,\n result,\n error,\n toggle,\n start,\n stop\n };\n}\n\nfunction useSpeechSynthesis(text, options = {}) {\n const {\n pitch = 1,\n rate = 1,\n volume = 1,\n window = defaultWindow\n } = options;\n const synth = window && window.speechSynthesis;\n const isSupported = useSupported(() => synth);\n const isPlaying = ref(false);\n const status = ref(\"init\");\n const spokenText = toRef(text || \"\");\n const lang = toRef(options.lang || \"en-US\");\n const error = shallowRef(void 0);\n const toggle = (value = !isPlaying.value) => {\n isPlaying.value = value;\n };\n const bindEventsForUtterance = (utterance2) => {\n utterance2.lang = toValue(lang);\n utterance2.voice = toValue(options.voice) || null;\n utterance2.pitch = toValue(pitch);\n utterance2.rate = toValue(rate);\n utterance2.volume = volume;\n utterance2.onstart = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onpause = () => {\n isPlaying.value = false;\n status.value = \"pause\";\n };\n utterance2.onresume = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onend = () => {\n isPlaying.value = false;\n status.value = \"end\";\n };\n utterance2.onerror = (event) => {\n error.value = event;\n };\n };\n const utterance = computed(() => {\n isPlaying.value = false;\n status.value = \"init\";\n const newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n bindEventsForUtterance(newUtterance);\n return newUtterance;\n });\n const speak = () => {\n synth.cancel();\n utterance && synth.speak(utterance.value);\n };\n const stop = () => {\n synth.cancel();\n isPlaying.value = false;\n };\n if (isSupported.value) {\n bindEventsForUtterance(utterance.value);\n watch(lang, (lang2) => {\n if (utterance.value && !isPlaying.value)\n utterance.value.lang = lang2;\n });\n if (options.voice) {\n watch(options.voice, () => {\n synth.cancel();\n });\n }\n watch(isPlaying, () => {\n if (isPlaying.value)\n synth.resume();\n else\n synth.pause();\n });\n }\n tryOnScopeDispose(() => {\n isPlaying.value = false;\n });\n return {\n isSupported,\n isPlaying,\n status,\n utterance,\n error,\n stop,\n toggle,\n speak\n };\n}\n\nfunction useStepper(steps, initialStep) {\n const stepsRef = ref(steps);\n const stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n const index = ref(stepNames.value.indexOf(initialStep != null ? initialStep : stepNames.value[0]));\n const current = computed(() => at(index.value));\n const isFirst = computed(() => index.value === 0);\n const isLast = computed(() => index.value === stepNames.value.length - 1);\n const next = computed(() => stepNames.value[index.value + 1]);\n const previous = computed(() => stepNames.value[index.value - 1]);\n function at(index2) {\n if (Array.isArray(stepsRef.value))\n return stepsRef.value[index2];\n return stepsRef.value[stepNames.value[index2]];\n }\n function get(step) {\n if (!stepNames.value.includes(step))\n return;\n return at(stepNames.value.indexOf(step));\n }\n function goTo(step) {\n if (stepNames.value.includes(step))\n index.value = stepNames.value.indexOf(step);\n }\n function goToNext() {\n if (isLast.value)\n return;\n index.value++;\n }\n function goToPrevious() {\n if (isFirst.value)\n return;\n index.value--;\n }\n function goBackTo(step) {\n if (isAfter(step))\n goTo(step);\n }\n function isNext(step) {\n return stepNames.value.indexOf(step) === index.value + 1;\n }\n function isPrevious(step) {\n return stepNames.value.indexOf(step) === index.value - 1;\n }\n function isCurrent(step) {\n return stepNames.value.indexOf(step) === index.value;\n }\n function isBefore(step) {\n return index.value < stepNames.value.indexOf(step);\n }\n function isAfter(step) {\n return index.value > stepNames.value.indexOf(step);\n }\n return {\n steps: stepsRef,\n stepNames,\n index,\n current,\n next,\n previous,\n isFirst,\n isLast,\n at,\n get,\n goTo,\n goToNext,\n goToPrevious,\n goBackTo,\n isNext,\n isPrevious,\n isCurrent,\n isBefore,\n isAfter\n };\n}\n\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const rawInit = toValue(initialValue);\n const type = guessSerializerType(rawInit);\n const data = (shallow ? shallowRef : ref)(initialValue);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorageAsync\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n async function read(event) {\n if (!storage || event && event.key !== key)\n return;\n try {\n const rawValue = event ? event.newValue : await storage.getItem(key);\n if (rawValue == null) {\n data.value = rawInit;\n if (writeDefaults && rawInit !== null)\n await storage.setItem(key, await serializer.write(rawInit));\n } else if (mergeDefaults) {\n const value = await serializer.read(rawValue);\n if (typeof mergeDefaults === \"function\")\n data.value = mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n data.value = { ...rawInit, ...value };\n else\n data.value = value;\n } else {\n data.value = await serializer.read(rawValue);\n }\n } catch (e) {\n onError(e);\n }\n }\n read();\n if (window && listenToStorageChanges)\n useEventListener(window, \"storage\", (e) => Promise.resolve().then(() => read(e)));\n if (storage) {\n watchWithFilter(\n data,\n async () => {\n try {\n if (data.value == null)\n await storage.removeItem(key);\n else\n await storage.setItem(key, await serializer.write(data.value));\n } catch (e) {\n onError(e);\n }\n },\n {\n flush,\n deep,\n eventFilter\n }\n );\n }\n return data;\n}\n\nlet _id = 0;\nfunction useStyleTag(css, options = {}) {\n const isLoaded = ref(false);\n const {\n document = defaultDocument,\n immediate = true,\n manual = false,\n id = `vueuse_styletag_${++_id}`\n } = options;\n const cssRef = ref(css);\n let stop = () => {\n };\n const load = () => {\n if (!document)\n return;\n const el = document.getElementById(id) || document.createElement(\"style\");\n if (!el.isConnected) {\n el.id = id;\n if (options.media)\n el.media = options.media;\n document.head.appendChild(el);\n }\n if (isLoaded.value)\n return;\n stop = watch(\n cssRef,\n (value) => {\n el.textContent = value;\n },\n { immediate: true }\n );\n isLoaded.value = true;\n };\n const unload = () => {\n if (!document || !isLoaded.value)\n return;\n stop();\n document.head.removeChild(document.getElementById(id));\n isLoaded.value = false;\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnScopeDispose(unload);\n return {\n id,\n css: cssRef,\n unload,\n load,\n isLoaded: readonly(isLoaded)\n };\n}\n\nfunction useSwipe(target, options = {}) {\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart,\n passive = true,\n window = defaultWindow\n } = options;\n const coordsStart = reactive({ x: 0, y: 0 });\n const coordsEnd = reactive({ x: 0, y: 0 });\n const diffX = computed(() => coordsStart.x - coordsEnd.x);\n const diffY = computed(() => coordsStart.y - coordsEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n const isSwiping = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return \"none\";\n if (abs(diffX.value) > abs(diffY.value)) {\n return diffX.value > 0 ? \"left\" : \"right\";\n } else {\n return diffY.value > 0 ? \"up\" : \"down\";\n }\n });\n const getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n const updateCoordsStart = (x, y) => {\n coordsStart.x = x;\n coordsStart.y = y;\n };\n const updateCoordsEnd = (x, y) => {\n coordsEnd.x = x;\n coordsEnd.y = y;\n };\n let listenerOptions;\n const isPassiveEventSupported = checkPassiveEventSupport(window == null ? void 0 : window.document);\n if (!passive)\n listenerOptions = isPassiveEventSupported ? { passive: false, capture: true } : { capture: true };\n else\n listenerOptions = isPassiveEventSupported ? { passive: true } : { capture: false };\n const onTouchEnd = (e) => {\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isSwiping.value = false;\n };\n const stops = [\n useEventListener(target, \"touchstart\", (e) => {\n if (e.touches.length !== 1)\n return;\n if (listenerOptions.capture && !listenerOptions.passive)\n e.preventDefault();\n const [x, y] = getTouchEventCoords(e);\n updateCoordsStart(x, y);\n updateCoordsEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }, listenerOptions),\n useEventListener(target, \"touchmove\", (e) => {\n if (e.touches.length !== 1)\n return;\n const [x, y] = getTouchEventCoords(e);\n updateCoordsEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }, listenerOptions),\n useEventListener(target, [\"touchend\", \"touchcancel\"], onTouchEnd, listenerOptions)\n ];\n const stop = () => stops.forEach((s) => s());\n return {\n isPassiveEventSupported,\n isSwiping,\n direction,\n coordsStart,\n coordsEnd,\n lengthX: diffX,\n lengthY: diffY,\n stop\n };\n}\nfunction checkPassiveEventSupport(document) {\n if (!document)\n return false;\n let supportsPassive = false;\n const optionsBlock = {\n get passive() {\n supportsPassive = true;\n return false;\n }\n };\n document.addEventListener(\"x\", noop, optionsBlock);\n document.removeEventListener(\"x\", noop);\n return supportsPassive;\n}\n\nfunction useTemplateRefsList() {\n const refs = ref([]);\n refs.value.set = (el) => {\n if (el)\n refs.value.push(el);\n };\n onBeforeUpdate(() => {\n refs.value.length = 0;\n });\n return refs;\n}\n\nfunction useTextDirection(options = {}) {\n const {\n document = defaultDocument,\n selector = \"html\",\n observe = false,\n initialValue = \"ltr\"\n } = options;\n function getValue() {\n var _a, _b;\n return (_b = (_a = document == null ? void 0 : document.querySelector(selector)) == null ? void 0 : _a.getAttribute(\"dir\")) != null ? _b : initialValue;\n }\n const dir = ref(getValue());\n tryOnMounted(() => dir.value = getValue());\n if (observe && document) {\n useMutationObserver(\n document.querySelector(selector),\n () => dir.value = getValue(),\n { attributes: true }\n );\n }\n return computed({\n get() {\n return dir.value;\n },\n set(v) {\n var _a, _b;\n dir.value = v;\n if (!document)\n return;\n if (dir.value)\n (_a = document.querySelector(selector)) == null ? void 0 : _a.setAttribute(\"dir\", dir.value);\n else\n (_b = document.querySelector(selector)) == null ? void 0 : _b.removeAttribute(\"dir\");\n }\n });\n}\n\nfunction getRangesFromSelection(selection) {\n var _a;\n const rangeCount = (_a = selection.rangeCount) != null ? _a : 0;\n return Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n}\nfunction useTextSelection(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const selection = ref(null);\n const text = computed(() => {\n var _a, _b;\n return (_b = (_a = selection.value) == null ? void 0 : _a.toString()) != null ? _b : \"\";\n });\n const ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n const rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n function onSelectionChange() {\n selection.value = null;\n if (window)\n selection.value = window.getSelection();\n }\n if (window)\n useEventListener(window.document, \"selectionchange\", onSelectionChange);\n return {\n text,\n rects,\n ranges,\n selection\n };\n}\n\nfunction useTextareaAutosize(options) {\n var _a;\n const textarea = ref(options == null ? void 0 : options.element);\n const input = ref(options == null ? void 0 : options.input);\n const styleProp = (_a = options == null ? void 0 : options.styleProp) != null ? _a : \"height\";\n const textareaScrollHeight = ref(1);\n function triggerResize() {\n var _a2, _b;\n if (!textarea.value)\n return;\n let height = \"\";\n textarea.value.style[styleProp] = \"1px\";\n textareaScrollHeight.value = (_a2 = textarea.value) == null ? void 0 : _a2.scrollHeight;\n if (options == null ? void 0 : options.styleTarget)\n toValue(options.styleTarget).style[styleProp] = `${textareaScrollHeight.value}px`;\n else\n height = `${textareaScrollHeight.value}px`;\n textarea.value.style[styleProp] = height;\n (_b = options == null ? void 0 : options.onResize) == null ? void 0 : _b.call(options);\n }\n watch([input, textarea], () => nextTick(triggerResize), { immediate: true });\n useResizeObserver(textarea, () => triggerResize());\n if (options == null ? void 0 : options.watch)\n watch(options.watch, triggerResize, { immediate: true, deep: true });\n return {\n textarea,\n input,\n triggerResize\n };\n}\n\nfunction useThrottledRefHistory(source, options = {}) {\n const { throttle = 200, trailing = true } = options;\n const filter = throttleFilter(throttle, trailing);\n const history = useRefHistory(source, { ...options, eventFilter: filter });\n return {\n ...history\n };\n}\n\nconst DEFAULT_UNITS = [\n { max: 6e4, value: 1e3, name: \"second\" },\n { max: 276e4, value: 6e4, name: \"minute\" },\n { max: 72e6, value: 36e5, name: \"hour\" },\n { max: 5184e5, value: 864e5, name: \"day\" },\n { max: 24192e5, value: 6048e5, name: \"week\" },\n { max: 28512e6, value: 2592e6, name: \"month\" },\n { max: Number.POSITIVE_INFINITY, value: 31536e6, name: \"year\" }\n];\nconst DEFAULT_MESSAGES = {\n justNow: \"just now\",\n past: (n) => n.match(/\\d/) ? `${n} ago` : n,\n future: (n) => n.match(/\\d/) ? `in ${n}` : n,\n month: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n year: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n day: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n week: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n hour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n minute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n second: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n invalid: \"\"\n};\nfunction DEFAULT_FORMATTER(date) {\n return date.toISOString().slice(0, 10);\n}\nfunction useTimeAgo(time, options = {}) {\n const {\n controls: exposeControls = false,\n updateInterval = 3e4\n } = options;\n const { now, ...controls } = useNow({ interval: updateInterval, controls: true });\n const timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options, toValue(now)));\n if (exposeControls) {\n return {\n timeAgo,\n ...controls\n };\n } else {\n return timeAgo;\n }\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n var _a;\n const {\n max,\n messages = DEFAULT_MESSAGES,\n fullDateFormatter = DEFAULT_FORMATTER,\n units = DEFAULT_UNITS,\n showSecond = false,\n rounding = \"round\"\n } = options;\n const roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n const diff = +now - +from;\n const absDiff = Math.abs(diff);\n function getValue(diff2, unit) {\n return roundFn(Math.abs(diff2) / unit.value);\n }\n function format(diff2, unit) {\n const val = getValue(diff2, unit);\n const past = diff2 > 0;\n const str = applyFormat(unit.name, val, past);\n return applyFormat(past ? \"past\" : \"future\", str, past);\n }\n function applyFormat(name, val, isPast) {\n const formatter = messages[name];\n if (typeof formatter === \"function\")\n return formatter(val, isPast);\n return formatter.replace(\"{0}\", val.toString());\n }\n if (absDiff < 6e4 && !showSecond)\n return messages.justNow;\n if (typeof max === \"number\" && absDiff > max)\n return fullDateFormatter(new Date(from));\n if (typeof max === \"string\") {\n const unitMax = (_a = units.find((i) => i.name === max)) == null ? void 0 : _a.max;\n if (unitMax && absDiff > unitMax)\n return fullDateFormatter(new Date(from));\n }\n for (const [idx, unit] of units.entries()) {\n const val = getValue(diff, unit);\n if (val <= 0 && units[idx - 1])\n return format(diff, units[idx - 1]);\n if (absDiff < unit.max)\n return format(diff, unit);\n }\n return messages.invalid;\n}\n\nfunction useTimeoutPoll(fn, interval, timeoutPollOptions) {\n const { start } = useTimeoutFn(loop, interval, { immediate: false });\n const isActive = ref(false);\n async function loop() {\n if (!isActive.value)\n return;\n await fn();\n start();\n }\n function resume() {\n if (!isActive.value) {\n isActive.value = true;\n loop();\n }\n }\n function pause() {\n isActive.value = false;\n }\n if (timeoutPollOptions == null ? void 0 : timeoutPollOptions.immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive,\n pause,\n resume\n };\n}\n\nfunction useTimestamp(options = {}) {\n const {\n controls: exposeControls = false,\n offset = 0,\n immediate = true,\n interval = \"requestAnimationFrame\",\n callback\n } = options;\n const ts = ref(timestamp() + offset);\n const update = () => ts.value = timestamp() + offset;\n const cb = callback ? () => {\n update();\n callback(ts.value);\n } : update;\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });\n if (exposeControls) {\n return {\n timestamp: ts,\n ...controls\n };\n } else {\n return ts;\n }\n}\n\nfunction useTitle(newTitle = null, options = {}) {\n var _a, _b, _c;\n const {\n document = defaultDocument,\n restoreOnUnmount = (t) => t\n } = options;\n const originalTitle = (_a = document == null ? void 0 : document.title) != null ? _a : \"\";\n const title = toRef((_b = newTitle != null ? newTitle : document == null ? void 0 : document.title) != null ? _b : null);\n const isReadonly = newTitle && typeof newTitle === \"function\";\n function format(t) {\n if (!(\"titleTemplate\" in options))\n return t;\n const template = options.titleTemplate || \"%s\";\n return typeof template === \"function\" ? template(t) : toValue(template).replace(/%s/g, t);\n }\n watch(\n title,\n (t, o) => {\n if (t !== o && document)\n document.title = format(typeof t === \"string\" ? t : \"\");\n },\n { immediate: true }\n );\n if (options.observe && !options.titleTemplate && document && !isReadonly) {\n useMutationObserver(\n (_c = document.head) == null ? void 0 : _c.querySelector(\"title\"),\n () => {\n if (document && document.title !== title.value)\n title.value = format(document.title);\n },\n { childList: true }\n );\n }\n tryOnBeforeUnmount(() => {\n if (restoreOnUnmount) {\n const restoredTitle = restoreOnUnmount(originalTitle, title.value || \"\");\n if (restoredTitle != null && document)\n document.title = restoredTitle;\n }\n });\n return title;\n}\n\nconst _TransitionPresets = {\n easeInSine: [0.12, 0, 0.39, 0],\n easeOutSine: [0.61, 1, 0.88, 1],\n easeInOutSine: [0.37, 0, 0.63, 1],\n easeInQuad: [0.11, 0, 0.5, 0],\n easeOutQuad: [0.5, 1, 0.89, 1],\n easeInOutQuad: [0.45, 0, 0.55, 1],\n easeInCubic: [0.32, 0, 0.67, 0],\n easeOutCubic: [0.33, 1, 0.68, 1],\n easeInOutCubic: [0.65, 0, 0.35, 1],\n easeInQuart: [0.5, 0, 0.75, 0],\n easeOutQuart: [0.25, 1, 0.5, 1],\n easeInOutQuart: [0.76, 0, 0.24, 1],\n easeInQuint: [0.64, 0, 0.78, 0],\n easeOutQuint: [0.22, 1, 0.36, 1],\n easeInOutQuint: [0.83, 0, 0.17, 1],\n easeInExpo: [0.7, 0, 0.84, 0],\n easeOutExpo: [0.16, 1, 0.3, 1],\n easeInOutExpo: [0.87, 0, 0.13, 1],\n easeInCirc: [0.55, 0, 1, 0.45],\n easeOutCirc: [0, 0.55, 0.45, 1],\n easeInOutCirc: [0.85, 0, 0.15, 1],\n easeInBack: [0.36, 0, 0.66, -0.56],\n easeOutBack: [0.34, 1.56, 0.64, 1],\n easeInOutBack: [0.68, -0.6, 0.32, 1.6]\n};\nconst TransitionPresets = /* @__PURE__ */ Object.assign({}, { linear: identity }, _TransitionPresets);\nfunction createEasingFunction([p0, p1, p2, p3]) {\n const a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n const b = (a1, a2) => 3 * a2 - 6 * a1;\n const c = (a1) => 3 * a1;\n const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n const getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n const getTforX = (x) => {\n let aGuessT = x;\n for (let i = 0; i < 4; ++i) {\n const currentSlope = getSlope(aGuessT, p0, p2);\n if (currentSlope === 0)\n return aGuessT;\n const currentX = calcBezier(aGuessT, p0, p2) - x;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n };\n return (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction lerp(a, b, alpha) {\n return a + alpha * (b - a);\n}\nfunction toVec(t) {\n return (typeof t === \"number\" ? [t] : t) || [];\n}\nfunction executeTransition(source, from, to, options = {}) {\n var _a, _b;\n const fromVal = toValue(from);\n const toVal = toValue(to);\n const v1 = toVec(fromVal);\n const v2 = toVec(toVal);\n const duration = (_a = toValue(options.duration)) != null ? _a : 1e3;\n const startedAt = Date.now();\n const endAt = Date.now() + duration;\n const trans = typeof options.transition === \"function\" ? options.transition : (_b = toValue(options.transition)) != null ? _b : identity;\n const ease = typeof trans === \"function\" ? trans : createEasingFunction(trans);\n return new Promise((resolve) => {\n source.value = fromVal;\n const tick = () => {\n var _a2;\n if ((_a2 = options.abort) == null ? void 0 : _a2.call(options)) {\n resolve();\n return;\n }\n const now = Date.now();\n const alpha = ease((now - startedAt) / duration);\n const arr = toVec(source.value).map((n, i) => lerp(v1[i], v2[i], alpha));\n if (Array.isArray(source.value))\n source.value = arr.map((n, i) => {\n var _a3, _b2;\n return lerp((_a3 = v1[i]) != null ? _a3 : 0, (_b2 = v2[i]) != null ? _b2 : 0, alpha);\n });\n else if (typeof source.value === \"number\")\n source.value = arr[0];\n if (now < endAt) {\n requestAnimationFrame(tick);\n } else {\n source.value = toVal;\n resolve();\n }\n };\n tick();\n });\n}\nfunction useTransition(source, options = {}) {\n let currentId = 0;\n const sourceVal = () => {\n const v = toValue(source);\n return typeof v === \"number\" ? v : v.map(toValue);\n };\n const outputRef = ref(sourceVal());\n watch(sourceVal, async (to) => {\n var _a, _b;\n if (toValue(options.disabled))\n return;\n const id = ++currentId;\n if (options.delay)\n await promiseTimeout(toValue(options.delay));\n if (id !== currentId)\n return;\n const toVal = Array.isArray(to) ? to.map(toValue) : toValue(to);\n (_a = options.onStarted) == null ? void 0 : _a.call(options);\n await executeTransition(outputRef, outputRef.value, toVal, {\n ...options,\n abort: () => {\n var _a2;\n return id !== currentId || ((_a2 = options.abort) == null ? void 0 : _a2.call(options));\n }\n });\n (_b = options.onFinished) == null ? void 0 : _b.call(options);\n }, { deep: true });\n watch(() => toValue(options.disabled), (disabled) => {\n if (disabled) {\n currentId++;\n outputRef.value = sourceVal();\n }\n });\n tryOnScopeDispose(() => {\n currentId++;\n });\n return computed(() => toValue(options.disabled) ? sourceVal() : outputRef.value);\n}\n\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n const {\n initialValue = {},\n removeNullishValues = true,\n removeFalsyValues = false,\n write: enableWrite = true,\n window = defaultWindow\n } = options;\n if (!window)\n return reactive(initialValue);\n const state = reactive({});\n function getRawParams() {\n if (mode === \"history\") {\n return window.location.search || \"\";\n } else if (mode === \"hash\") {\n const hash = window.location.hash || \"\";\n const index = hash.indexOf(\"?\");\n return index > 0 ? hash.slice(index) : \"\";\n } else {\n return (window.location.hash || \"\").replace(/^#/, \"\");\n }\n }\n function constructQuery(params) {\n const stringified = params.toString();\n if (mode === \"history\")\n return `${stringified ? `?${stringified}` : \"\"}${window.location.hash || \"\"}`;\n if (mode === \"hash-params\")\n return `${window.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n const hash = window.location.hash || \"#\";\n const index = hash.indexOf(\"?\");\n if (index > 0)\n return `${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n return `${hash}${stringified ? `?${stringified}` : \"\"}`;\n }\n function read() {\n return new URLSearchParams(getRawParams());\n }\n function updateState(params) {\n const unusedKeys = new Set(Object.keys(state));\n for (const key of params.keys()) {\n const paramsForKey = params.getAll(key);\n state[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n unusedKeys.delete(key);\n }\n Array.from(unusedKeys).forEach((key) => delete state[key]);\n }\n const { pause, resume } = pausableWatch(\n state,\n () => {\n const params = new URLSearchParams(\"\");\n Object.keys(state).forEach((key) => {\n const mapEntry = state[key];\n if (Array.isArray(mapEntry))\n mapEntry.forEach((value) => params.append(key, value));\n else if (removeNullishValues && mapEntry == null)\n params.delete(key);\n else if (removeFalsyValues && !mapEntry)\n params.delete(key);\n else\n params.set(key, mapEntry);\n });\n write(params);\n },\n { deep: true }\n );\n function write(params, shouldUpdate) {\n pause();\n if (shouldUpdate)\n updateState(params);\n window.history.replaceState(\n window.history.state,\n window.document.title,\n window.location.pathname + constructQuery(params)\n );\n resume();\n }\n function onChanged() {\n if (!enableWrite)\n return;\n write(read(), true);\n }\n useEventListener(window, \"popstate\", onChanged, false);\n if (mode !== \"history\")\n useEventListener(window, \"hashchange\", onChanged, false);\n const initial = read();\n if (initial.keys().next().value)\n updateState(initial);\n else\n Object.assign(state, initialValue);\n return state;\n}\n\nfunction useUserMedia(options = {}) {\n var _a, _b;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const autoSwitch = ref((_b = options.autoSwitch) != null ? _b : true);\n const constraints = ref(options.constraints);\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getUserMedia;\n });\n const stream = shallowRef();\n function getDeviceOptions(type) {\n switch (type) {\n case \"video\": {\n if (constraints.value)\n return constraints.value.video || false;\n break;\n }\n case \"audio\": {\n if (constraints.value)\n return constraints.value.audio || false;\n break;\n }\n }\n }\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getUserMedia({\n video: getDeviceOptions(\"video\"),\n audio: getDeviceOptions(\"audio\")\n });\n return stream.value;\n }\n function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n async function restart() {\n _stop();\n return await start();\n }\n watch(\n enabled,\n (v) => {\n if (v)\n _start();\n else\n _stop();\n },\n { immediate: true }\n );\n watch(\n constraints,\n () => {\n if (autoSwitch.value && stream.value)\n restart();\n },\n { immediate: true }\n );\n tryOnScopeDispose(() => {\n stop();\n });\n return {\n isSupported,\n stream,\n start,\n stop,\n restart,\n constraints,\n enabled,\n autoSwitch\n };\n}\n\nfunction useVModel(props, key, emit, options = {}) {\n var _a, _b, _c, _d, _e;\n const {\n clone = false,\n passive = false,\n eventName,\n deep = false,\n defaultValue,\n shouldEmit\n } = options;\n const vm = getCurrentInstance();\n const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));\n let event = eventName;\n if (!key) {\n if (isVue2) {\n const modelOptions = (_e = (_d = vm == null ? void 0 : vm.proxy) == null ? void 0 : _d.$options) == null ? void 0 : _e.model;\n key = (modelOptions == null ? void 0 : modelOptions.value) || \"value\";\n if (!eventName)\n event = (modelOptions == null ? void 0 : modelOptions.event) || \"input\";\n } else {\n key = \"modelValue\";\n }\n }\n event = event || `update:${key.toString()}`;\n const cloneFn = (val) => !clone ? val : typeof clone === \"function\" ? clone(val) : cloneFnJSON(val);\n const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n const triggerEmit = (value) => {\n if (shouldEmit) {\n if (shouldEmit(value))\n _emit(event, value);\n } else {\n _emit(event, value);\n }\n };\n if (passive) {\n const initialValue = getValue();\n const proxy = ref(initialValue);\n let isUpdating = false;\n watch(\n () => props[key],\n (v) => {\n if (!isUpdating) {\n isUpdating = true;\n proxy.value = cloneFn(v);\n nextTick(() => isUpdating = false);\n }\n }\n );\n watch(\n proxy,\n (v) => {\n if (!isUpdating && (v !== props[key] || deep))\n triggerEmit(v);\n },\n { deep }\n );\n return proxy;\n } else {\n return computed({\n get() {\n return getValue();\n },\n set(value) {\n triggerEmit(value);\n }\n });\n }\n}\n\nfunction useVModels(props, emit, options = {}) {\n const ret = {};\n for (const key in props) {\n ret[key] = useVModel(\n props,\n key,\n emit,\n options\n );\n }\n return ret;\n}\n\nfunction useVibrate(options) {\n const {\n pattern = [],\n interval = 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => typeof navigator !== \"undefined\" && \"vibrate\" in navigator);\n const patternRef = toRef(pattern);\n let intervalControls;\n const vibrate = (pattern2 = patternRef.value) => {\n if (isSupported.value)\n navigator.vibrate(pattern2);\n };\n const stop = () => {\n if (isSupported.value)\n navigator.vibrate(0);\n intervalControls == null ? void 0 : intervalControls.pause();\n };\n if (interval > 0) {\n intervalControls = useIntervalFn(\n vibrate,\n interval,\n {\n immediate: false,\n immediateCallback: false\n }\n );\n }\n return {\n isSupported,\n pattern,\n intervalControls,\n vibrate,\n stop\n };\n}\n\nfunction useVirtualList(list, options) {\n const { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n return {\n list: currentList,\n scrollTo,\n containerProps: {\n ref: containerRef,\n onScroll: () => {\n calculateRange();\n },\n style: containerStyle\n },\n wrapperProps\n };\n}\nfunction useVirtualListResources(list) {\n const containerRef = ref(null);\n const size = useElementSize(containerRef);\n const currentList = ref([]);\n const source = shallowRef(list);\n const state = ref({ start: 0, end: 10 });\n return { state, source, currentList, size, containerRef };\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n return (containerSize) => {\n if (typeof itemSize === \"number\")\n return Math.ceil(containerSize / itemSize);\n const { start = 0 } = state.value;\n let sum = 0;\n let capacity = 0;\n for (let i = start; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n capacity = i;\n if (sum > containerSize)\n break;\n }\n return capacity - start;\n };\n}\nfunction createGetOffset(source, itemSize) {\n return (scrollDirection) => {\n if (typeof itemSize === \"number\")\n return Math.floor(scrollDirection / itemSize) + 1;\n let sum = 0;\n let offset = 0;\n for (let i = 0; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n if (sum >= scrollDirection) {\n offset = i;\n break;\n }\n }\n return offset + 1;\n };\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n return () => {\n const element = containerRef.value;\n if (element) {\n const offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n const viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n const from = offset - overscan;\n const to = offset + viewCapacity + overscan;\n state.value = {\n start: from < 0 ? 0 : from,\n end: to > source.value.length ? source.value.length : to\n };\n currentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n data: ele,\n index: index + state.value.start\n }));\n }\n };\n}\nfunction createGetDistance(itemSize, source) {\n return (index) => {\n if (typeof itemSize === \"number\") {\n const size2 = index * itemSize;\n return size2;\n }\n const size = source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n return size;\n };\n}\nfunction useWatchForSizes(size, list, calculateRange) {\n watch([size.width, size.height, list], () => {\n calculateRange();\n });\n}\nfunction createComputedTotalSize(itemSize, source) {\n return computed(() => {\n if (typeof itemSize === \"number\")\n return source.value.length * itemSize;\n return source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n });\n}\nconst scrollToDictionaryForElementScrollKey = {\n horizontal: \"scrollLeft\",\n vertical: \"scrollTop\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef) {\n return (index) => {\n if (containerRef.value) {\n containerRef.value[scrollToDictionaryForElementScrollKey[type]] = getDistance(index);\n calculateRange();\n }\n };\n}\nfunction useHorizontalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowX: \"auto\" };\n const { itemWidth, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n const getOffset = createGetOffset(source, itemWidth);\n const calculateRange = createCalculateRange(\"horizontal\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceLeft = createGetDistance(itemWidth, source);\n const offsetLeft = computed(() => getDistanceLeft(state.value.start));\n const totalWidth = createComputedTotalSize(itemWidth, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n height: \"100%\",\n width: `${totalWidth.value - offsetLeft.value}px`,\n marginLeft: `${offsetLeft.value}px`,\n display: \"flex\"\n }\n };\n });\n return {\n scrollTo,\n calculateRange,\n wrapperProps,\n containerStyle,\n currentList,\n containerRef\n };\n}\nfunction useVerticalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowY: \"auto\" };\n const { itemHeight, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n const getOffset = createGetOffset(source, itemHeight);\n const calculateRange = createCalculateRange(\"vertical\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceTop = createGetDistance(itemHeight, source);\n const offsetTop = computed(() => getDistanceTop(state.value.start));\n const totalHeight = createComputedTotalSize(itemHeight, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n width: \"100%\",\n height: `${totalHeight.value - offsetTop.value}px`,\n marginTop: `${offsetTop.value}px`\n }\n };\n });\n return {\n calculateRange,\n scrollTo,\n containerStyle,\n wrapperProps,\n currentList,\n containerRef\n };\n}\n\nfunction useWakeLock(options = {}) {\n const {\n navigator = defaultNavigator,\n document = defaultDocument\n } = options;\n let wakeLock;\n const isSupported = useSupported(() => navigator && \"wakeLock\" in navigator);\n const isActive = ref(false);\n async function onVisibilityChange() {\n if (!isSupported.value || !wakeLock)\n return;\n if (document && document.visibilityState === \"visible\")\n wakeLock = await navigator.wakeLock.request(\"screen\");\n isActive.value = !wakeLock.released;\n }\n if (document)\n useEventListener(document, \"visibilitychange\", onVisibilityChange, { passive: true });\n async function request(type) {\n if (!isSupported.value)\n return;\n wakeLock = await navigator.wakeLock.request(type);\n isActive.value = !wakeLock.released;\n }\n async function release() {\n if (!isSupported.value || !wakeLock)\n return;\n await wakeLock.release();\n isActive.value = !wakeLock.released;\n wakeLock = null;\n }\n return {\n isSupported,\n isActive,\n request,\n release\n };\n}\n\nfunction useWebNotification(options = {}) {\n const {\n window = defaultWindow,\n requestPermissions: _requestForPermissions = true\n } = options;\n const defaultWebNotificationOptions = options;\n const isSupported = useSupported(() => !!window && \"Notification\" in window);\n const permissionGranted = ref(isSupported.value && \"permission\" in Notification && Notification.permission === \"granted\");\n const notification = ref(null);\n const ensurePermissions = async () => {\n if (!isSupported.value)\n return;\n if (!permissionGranted.value && Notification.permission !== \"denied\") {\n const result = await Notification.requestPermission();\n if (result === \"granted\")\n permissionGranted.value = true;\n }\n return permissionGranted.value;\n };\n const { on: onClick, trigger: clickTrigger } = createEventHook();\n const { on: onShow, trigger: showTrigger } = createEventHook();\n const { on: onError, trigger: errorTrigger } = createEventHook();\n const { on: onClose, trigger: closeTrigger } = createEventHook();\n const show = async (overrides) => {\n if (!isSupported.value || !permissionGranted.value)\n return;\n const options2 = Object.assign({}, defaultWebNotificationOptions, overrides);\n notification.value = new Notification(options2.title || \"\", options2);\n notification.value.onclick = clickTrigger;\n notification.value.onshow = showTrigger;\n notification.value.onerror = errorTrigger;\n notification.value.onclose = closeTrigger;\n return notification.value;\n };\n const close = () => {\n if (notification.value)\n notification.value.close();\n notification.value = null;\n };\n if (_requestForPermissions)\n tryOnMounted(ensurePermissions);\n tryOnScopeDispose(close);\n if (isSupported.value && window) {\n const document = window.document;\n useEventListener(document, \"visibilitychange\", (e) => {\n e.preventDefault();\n if (document.visibilityState === \"visible\") {\n close();\n }\n });\n }\n return {\n isSupported,\n notification,\n ensurePermissions,\n permissionGranted,\n show,\n close,\n onClick,\n onShow,\n onError,\n onClose\n };\n}\n\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n if (options === true)\n return {};\n return options;\n}\nfunction useWebSocket(url, options = {}) {\n const {\n onConnected,\n onDisconnected,\n onError,\n onMessage,\n immediate = true,\n autoClose = true,\n protocols = []\n } = options;\n const data = ref(null);\n const status = ref(\"CLOSED\");\n const wsRef = ref();\n const urlRef = toRef(url);\n let heartbeatPause;\n let heartbeatResume;\n let explicitlyClosed = false;\n let retried = 0;\n let bufferedData = [];\n let pongTimeoutWait;\n const _sendBuffer = () => {\n if (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n for (const buffer of bufferedData)\n wsRef.value.send(buffer);\n bufferedData = [];\n }\n };\n const resetHeartbeat = () => {\n clearTimeout(pongTimeoutWait);\n pongTimeoutWait = void 0;\n };\n const close = (code = 1e3, reason) => {\n if (!isClient || !wsRef.value)\n return;\n explicitlyClosed = true;\n resetHeartbeat();\n heartbeatPause == null ? void 0 : heartbeatPause();\n wsRef.value.close(code, reason);\n wsRef.value = void 0;\n };\n const send = (data2, useBuffer = true) => {\n if (!wsRef.value || status.value !== \"OPEN\") {\n if (useBuffer)\n bufferedData.push(data2);\n return false;\n }\n _sendBuffer();\n wsRef.value.send(data2);\n return true;\n };\n const _init = () => {\n if (explicitlyClosed || typeof urlRef.value === \"undefined\")\n return;\n const ws = new WebSocket(urlRef.value, protocols);\n wsRef.value = ws;\n status.value = \"CONNECTING\";\n ws.onopen = () => {\n status.value = \"OPEN\";\n onConnected == null ? void 0 : onConnected(ws);\n heartbeatResume == null ? void 0 : heartbeatResume();\n _sendBuffer();\n };\n ws.onclose = (ev) => {\n status.value = \"CLOSED\";\n onDisconnected == null ? void 0 : onDisconnected(ws, ev);\n if (!explicitlyClosed && options.autoReconnect) {\n const {\n retries = -1,\n delay = 1e3,\n onFailed\n } = resolveNestedOptions(options.autoReconnect);\n retried += 1;\n if (typeof retries === \"number\" && (retries < 0 || retried < retries))\n setTimeout(_init, delay);\n else if (typeof retries === \"function\" && retries())\n setTimeout(_init, delay);\n else\n onFailed == null ? void 0 : onFailed();\n }\n };\n ws.onerror = (e) => {\n onError == null ? void 0 : onError(ws, e);\n };\n ws.onmessage = (e) => {\n if (options.heartbeat) {\n resetHeartbeat();\n const {\n message = DEFAULT_PING_MESSAGE\n } = resolveNestedOptions(options.heartbeat);\n if (e.data === message)\n return;\n }\n data.value = e.data;\n onMessage == null ? void 0 : onMessage(ws, e);\n };\n };\n if (options.heartbeat) {\n const {\n message = DEFAULT_PING_MESSAGE,\n interval = 1e3,\n pongTimeout = 1e3\n } = resolveNestedOptions(options.heartbeat);\n const { pause, resume } = useIntervalFn(\n () => {\n send(message, false);\n if (pongTimeoutWait != null)\n return;\n pongTimeoutWait = setTimeout(() => {\n close();\n explicitlyClosed = false;\n }, pongTimeout);\n },\n interval,\n { immediate: false }\n );\n heartbeatPause = pause;\n heartbeatResume = resume;\n }\n if (autoClose) {\n if (isClient)\n useEventListener(\"beforeunload\", () => close());\n tryOnScopeDispose(close);\n }\n const open = () => {\n if (!isClient && !isWorker)\n return;\n close();\n explicitlyClosed = false;\n retried = 0;\n _init();\n };\n if (immediate)\n open();\n return {\n data,\n status,\n close,\n send,\n open,\n ws: wsRef\n };\n}\n\nfunction useWebWorker(arg0, workerOptions, options) {\n const {\n window = defaultWindow\n } = options != null ? options : {};\n const data = ref(null);\n const worker = shallowRef();\n const post = (...args) => {\n if (!worker.value)\n return;\n worker.value.postMessage(...args);\n };\n const terminate = function terminate2() {\n if (!worker.value)\n return;\n worker.value.terminate();\n };\n if (window) {\n if (typeof arg0 === \"string\")\n worker.value = new Worker(arg0, workerOptions);\n else if (typeof arg0 === \"function\")\n worker.value = arg0();\n else\n worker.value = arg0;\n worker.value.onmessage = (e) => {\n data.value = e.data;\n };\n tryOnScopeDispose(() => {\n if (worker.value)\n worker.value.terminate();\n });\n }\n return {\n data,\n post,\n terminate,\n worker\n };\n}\n\nfunction jobRunner(userFunc) {\n return (e) => {\n const userFuncArgs = e.data[0];\n return Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n postMessage([\"SUCCESS\", result]);\n }).catch((error) => {\n postMessage([\"ERROR\", error]);\n });\n };\n}\n\nfunction depsParser(deps) {\n if (deps.length === 0)\n return \"\";\n const depsString = deps.map((dep) => `'${dep}'`).toString();\n return `importScripts(${depsString})`;\n}\n\nfunction createWorkerBlobUrl(fn, deps) {\n const blobCode = `${depsParser(deps)}; onmessage=(${jobRunner})(${fn})`;\n const blob = new Blob([blobCode], { type: \"text/javascript\" });\n const url = URL.createObjectURL(blob);\n return url;\n}\n\nfunction useWebWorkerFn(fn, options = {}) {\n const {\n dependencies = [],\n timeout,\n window = defaultWindow\n } = options;\n const worker = ref();\n const workerStatus = ref(\"PENDING\");\n const promise = ref({});\n const timeoutId = ref();\n const workerTerminate = (status = \"PENDING\") => {\n if (worker.value && worker.value._url && window) {\n worker.value.terminate();\n URL.revokeObjectURL(worker.value._url);\n promise.value = {};\n worker.value = void 0;\n window.clearTimeout(timeoutId.value);\n workerStatus.value = status;\n }\n };\n workerTerminate();\n tryOnScopeDispose(workerTerminate);\n const generateWorker = () => {\n const blobUrl = createWorkerBlobUrl(fn, dependencies);\n const newWorker = new Worker(blobUrl);\n newWorker._url = blobUrl;\n newWorker.onmessage = (e) => {\n const { resolve = () => {\n }, reject = () => {\n } } = promise.value;\n const [status, result] = e.data;\n switch (status) {\n case \"SUCCESS\":\n resolve(result);\n workerTerminate(status);\n break;\n default:\n reject(result);\n workerTerminate(\"ERROR\");\n break;\n }\n };\n newWorker.onerror = (e) => {\n const { reject = () => {\n } } = promise.value;\n e.preventDefault();\n reject(e);\n workerTerminate(\"ERROR\");\n };\n if (timeout) {\n timeoutId.value = setTimeout(\n () => workerTerminate(\"TIMEOUT_EXPIRED\"),\n timeout\n );\n }\n return newWorker;\n };\n const callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n promise.value = {\n resolve,\n reject\n };\n worker.value && worker.value.postMessage([[...fnArgs]]);\n workerStatus.value = \"RUNNING\";\n });\n const workerFn = (...fnArgs) => {\n if (workerStatus.value === \"RUNNING\") {\n console.error(\n \"[useWebWorkerFn] You can only run one instance of the worker at a time.\"\n );\n return Promise.reject();\n }\n worker.value = generateWorker();\n return callWorker(...fnArgs);\n };\n return {\n workerFn,\n workerStatus,\n workerTerminate\n };\n}\n\nfunction useWindowFocus(options = {}) {\n const { window = defaultWindow } = options;\n if (!window)\n return ref(false);\n const focused = ref(window.document.hasFocus());\n useEventListener(window, \"blur\", () => {\n focused.value = false;\n });\n useEventListener(window, \"focus\", () => {\n focused.value = true;\n });\n return focused;\n}\n\nfunction useWindowScroll(options = {}) {\n const { window = defaultWindow, behavior = \"auto\" } = options;\n if (!window) {\n return {\n x: ref(0),\n y: ref(0)\n };\n }\n const internalX = ref(window.scrollX);\n const internalY = ref(window.scrollY);\n const x = computed({\n get() {\n return internalX.value;\n },\n set(x2) {\n scrollTo({ left: x2, behavior });\n }\n });\n const y = computed({\n get() {\n return internalY.value;\n },\n set(y2) {\n scrollTo({ top: y2, behavior });\n }\n });\n useEventListener(\n window,\n \"scroll\",\n () => {\n internalX.value = window.scrollX;\n internalY.value = window.scrollY;\n },\n {\n capture: false,\n passive: true\n }\n );\n return { x, y };\n}\n\nfunction useWindowSize(options = {}) {\n const {\n window = defaultWindow,\n initialWidth = Number.POSITIVE_INFINITY,\n initialHeight = Number.POSITIVE_INFINITY,\n listenOrientation = true,\n includeScrollbar = true\n } = options;\n const width = ref(initialWidth);\n const height = ref(initialHeight);\n const update = () => {\n if (window) {\n if (includeScrollbar) {\n width.value = window.innerWidth;\n height.value = window.innerHeight;\n } else {\n width.value = window.document.documentElement.clientWidth;\n height.value = window.document.documentElement.clientHeight;\n }\n }\n };\n update();\n tryOnMounted(update);\n useEventListener(\"resize\", update, { passive: true });\n if (listenOrientation) {\n const matches = useMediaQuery(\"(orientation: portrait)\");\n watch(matches, () => update());\n }\n return { width, height };\n}\n\nexport { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, computedAsync as asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, breakpointsVuetifyV2, breakpointsVuetifyV3, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, getSSRHandler, mapGamepadToXbox360Controller, onClickOutside, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, setSSRHandler, templateRef, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useClipboardItems, useCloned, useColorMode, useConfirmDialog, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useRafFn, useRefHistory, useResizeObserver, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };\n","import { watch } from \"vue\";\n\n/**\n * Sleep function to be used in conjuction with async await:\n *\n * eg: await sleep(5000);\n *\n * @param delay\n * @returns {Promise<any>}\n */\nexport function sleep(delay) {\n return new Promise((resolve) => setTimeout(resolve, delay));\n}\n\n/**\n * Wait for a ref to have a value and then resolve the promise\n *\n * @param ref\n * @param value\n * @returns {Promise<void>}\n */\nexport function waitForRef(ref, value) {\n return new Promise<void>((resolve) => {\n watch(ref, (newValue) => {\n if (newValue === value) {\n resolve();\n }\n });\n });\n}\n\n/**\n * Returns a number that is constrained to the given range.\n * @param min\n * @param max\n * @param value\n * @returns {number}\n */\nexport function minmax(min, max, value) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * Convert meters to miles\n * @param meters\n * @returns {number}\n */\nexport function metersToMiles(meters) {\n return meters * 0.000621371;\n}\n\n/**\n * Convert miles to meters\n * @param miles\n * @returns {number}\n */\nexport function milesToMeters(miles) {\n return miles / 0.000621371;\n}\n\n/**\n * Parses a string for Lat and Long coords\n * @param location\n * @returns {null|{lng: number, lat: number}}\n */\nexport function parseCoords(location) {\n const latLong = location.split(\",\");\n\n if (latLong.length === 2) {\n const lat = parseFloat(latLong[0].trim());\n const lng = parseFloat(latLong[1].trim());\n\n if (!isNaN(lat) && !isNaN(lng)) {\n return {\n lat,\n lng,\n };\n }\n }\n\n return null;\n}\n","import { useGeolocation } from \"@vueuse/core\";\nimport { computed } from \"vue\";\nimport { sleep } from \"./utils\";\n\nlet isLoaded = false;\nlet hasAlreadyWaited = false;\nlet geolocationError = null;\nlet hasLocation = null;\nlet geolocation = null;\n\nexport function useCompatibility(requestLocation = true) {\n if (!isLoaded && requestLocation) {\n const { coords, error, locatedAt } = useGeolocation();\n geolocationError = error;\n hasLocation = locatedAt;\n geolocation = coords;\n isLoaded = true;\n }\n\n const isLocationSupported = \"geolocation\" in navigator;\n\n const location = computed(() => {\n if (hasLocation?.value) {\n return geolocation?.value;\n }\n return null;\n });\n\n const isCompatible = computed(() => !geolocationError?.value && !!hasLocation?.value);\n\n /**\n * Wait for location to be available and returns the location when it is or null after the wait period times out.\n * @param maxWait\n */\n const waitForLocation = async (maxWait = 3000) => {\n // We only should wait once, if we already waited and failed, its unlikely the location will be available at a\n // later time\n if (hasAlreadyWaited) {\n return location;\n }\n\n hasAlreadyWaited = true;\n let waitTime = 0;\n while (!location.value) {\n await sleep(100);\n waitTime += 100;\n\n if (waitTime > maxWait) {\n return null;\n }\n }\n\n return location;\n };\n\n return {\n isLocationSupported,\n isCompatible,\n geolocationError,\n hasLocation,\n location,\n waitForLocation\n };\n}\n","// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import { DateTime, IANAZone } from \"luxon\";\n\nconst SERVER_TZ = new IANAZone(\"America/Chicago\");\n\n/**\n * Converts a date string from the server's time zone to the user's time zone.\n * @param {String} dateTimeString\n * @returns {DateTime}\n */\nexport function localizedDateTime(dateTimeString) {\n dateTimeString = dateTimeString?.replace(\"T\", \" \");\n // noinspection JSCheckFunctionSignatures\n return DateTime.fromSQL(dateTimeString, { zone: SERVER_TZ }).setZone(\"local\");\n}\n\n/**\n * Converts a date string from the user's time zone to the server's time zone.\n * @param dateTimeString\n * @returns {DateTime}\n */\nexport function remoteDateTime(dateTimeString) {\n dateTimeString = dateTimeString?.replace(\"T\", \" \");\n // noinspection JSCheckFunctionSignatures\n return DateTime.fromSQL(dateTimeString, { zone: \"local\" }).setZone(SERVER_TZ);\n}\n\n/**\n * @param {DateTime|String} dateTime\n * @returns {DateTime|*}\n */\nexport function parseDateTime(dateTime) {\n if (typeof dateTime === \"string\") {\n dateTime = dateTime.replace(\"T\", \" \").replace(/\\//g, \"-\");\n return DateTime.fromSQL(dateTime);\n }\n return dateTime || DateTime.fromSQL(\"0000-00-00 00:00:00\");\n}\n\n/**\n * Parses a Quasar formatted date string into a Luxon DateTime object\n * @param date\n * @param format\n * @returns {DateTime}\n */\nexport function parseQDate(date, format = \"yyyy/MM/dd\") {\n return DateTime.fromFormat(date, format);\n}\n\n/**\n * Parses a Quasar formatted date/time string into a Luxon DateTime object\n * @param date\n * @param format\n * @returns {DateTime}\n */\nexport function parseQDateTime(date, format = \"yyyy/MM/dd HH:mm:ss\") {\n return DateTime.fromFormat(date, format);\n}\n\n/**\n * Formats a Luxon DateTime object into a Quasar formatted date string\n * @param date\n * @returns {string}\n */\nexport function fQDate(date) {\n return fDate(date, { format: \"yyyy/MM/dd\" });\n}\n\n/**\n *\n * @param {String} dateTimeString\n * @param options\n * @returns {string}\n */\nexport function fLocalizedDateTime(dateTimeString, options = {}) {\n return fDateTime(localizedDateTime(dateTimeString), options);\n}\n\n/**\n * Formats a date/time object or string into a human-readable format\n *\n * @param {String|Object} dateTime\n * @param format\n * @param {String|null} empty\n * @returns {string}\n */\nexport function fDateTime(\n dateTime = null,\n { format = \"M/d/yy h:mma\", empty = \"- -\" } = {}\n) {\n const formatted = (dateTime ? parseDateTime(dateTime) : DateTime.now()).toFormat(format).toLowerCase();\n return formatted === \"invalid datetime\" ? empty : formatted;\n}\n\n/**\n * Formats a date/time object or string into the best format for DB input\n * @param dateTime\n * @returns {string}\n */\nexport function dbDateTime(dateTime = null) {\n return fDateTime(dateTime, { format: \"yyyy-MM-dd HH:mm:ss\", empty: null });\n}\n\n/**\n * Formats a date object or string into a human-readable format\n * @param {String|Object} dateTime\n * @param {String|null} empty\n * @param format\n * @returns {string}\n */\nexport function fDate(dateTime, { empty = \"--\", format = \"M/d/yy\" } = {}) {\n const formatted = parseDateTime(dateTime).toFormat(format);\n return [\"Invalid DateTime\", \"invalid datetime\"].includes(formatted) ? empty : formatted;\n}\n\n/**\n * Formats a number of seconds into Hours / Minutes / Seconds or just Minutes and Seconds\n *\n * @param second\n * @returns {string}\n */\nexport function fSecondsToTime(second) {\n const time = DateTime.now().setZone(\"UTC\").startOf(\"year\").set({ second });\n const hours = Math.floor(second / 3600);\n return (hours ? hours + \":\" : \"\") + time.toFormat(\"mm:ss\");\n}\n\n/**\n * Formats an amount into USD currency format\n * @param amount\n * @returns {string}\n */\nexport function fCurrency(amount) {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\"\n }).format(amount);\n}\n\n/**\n * Formats a number into a human-readable format\n * @param number\n * @param options\n * @returns {string}\n */\nexport function fNumber(number, options = {}) {\n return new Intl.NumberFormat(\"en-US\", options).format(number);\n}\n\n/**\n * Truncates the string by removing chars from the middle of the string\n * @param str\n * @param maxLength\n * @returns {string|*}\n */\nexport function centerTruncate(str, maxLength) {\n if (str.length > maxLength) {\n const frontCharCount = Math.floor((maxLength - 3) / 2);\n const backCharCount = maxLength - frontCharCount - 3;\n return (\n str.substring(0, frontCharCount) +\n \"...\" +\n str.substring(str.length - backCharCount)\n );\n } else {\n return str;\n }\n}\n\n/**\n * Formats a number into a percentage\n * @param num\n * @param options\n * @returns {string}\n */\nexport function fPercent(num, options = { multiplier: 100, maximumFractionDigits: 1, NaN: \"N/A\" }) {\n num = parseFloat(num);\n\n if (isNaN(num)) {\n return options.NaN;\n }\n\n return fNumber(num * options.multiplier, options) + \"%\";\n}\n\n\nexport function fPhone(value) {\n if (!value || typeof value !== \"string\") {\n return value || \"\";\n }\n\n const input = value.replace(/\\D/g, \"\").split(\"\");\n let phone = \"\";\n\n const startsWithOne = input.length > 0 && input[0] === \"1\";\n const shift = startsWithOne ? 1 : 0;\n\n input.map((number, index) => {\n switch (index) {\n case shift:\n phone += \"(\";\n break;\n case shift + 3:\n phone += \") \";\n break;\n case shift + 6:\n phone += \"-\";\n break;\n case shift + 10:\n phone += \" x\";\n break;\n }\n if (index === 0 && number === \"1\") {\n phone += \"+1 \";\n } else {\n phone += number;\n }\n });\n\n if (value === \"+1 (\") {\n return \"\";\n }\n\n return phone;\n}\n","import { parseDateTime } from \"./formats\";\n\nexport function diffInDays(date1, date2) {\n return parseDateTime(date2).diff(parseDateTime(date1), [\"days\"]).days;\n}\n","// download.js v4.2, by dandavis; 2008-2016. [CCBY2] see http://danml.com/download.html for tests/usage\n// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and\n// optional mime v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for\n// larger+faster saves than dataURLs v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback\n// was improved with force-download mime and base64 support. 3.1 improved safari handling. v4 adds AMD/UMD, commonJS,\n// and plain browser support v4.1 adds url download capability via solo URL argument (same domain/CORS only) v4.2 adds\n// semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors\n// https://github.com/rndme/download\n\n/* eslint-disable */\nexport function download(data, strFileName, strMimeType) {\n var self = window;\n // this script is only for browsers anyway...\n\n var defaultMime = \"application/octet-stream\";\n // this default mime also triggers iframe downloads\n\n var mimeType = strMimeType || defaultMime;\n\n var payload = data;\n\n var url = !strFileName && !strMimeType && payload;\n\n var anchor = document.createElement(\"a\");\n\n var toString = function (a) {\n return String(a);\n };\n\n // @ts-ignore\n var myBlob = self.Blob || self.MozBlob || self.WebKitBlob || toString;\n\n var fileName = strFileName || \"download\";\n\n var blob;\n\n var reader;\n myBlob = myBlob.call ? myBlob.bind(self) : Blob;\n\n if (String(this) === \"true\") {\n // reverse arguments, allowing download.bind(true, \"text/xml\", \"export.xml\") to act as a callback\n payload = [payload, mimeType];\n mimeType = payload[0];\n payload = payload[1];\n }\n\n if (url && url.length < 2048) {\n // if no filename and no mime, assume a url was passed as the only argument\n fileName = url.split(\"/\").pop().split(\"?\")[0];\n anchor.href = url; // assign href prop to temp anchor\n\n // if the browser determines that it's a potentially valid url path:\n if (\n anchor.href.indexOf(url) !== -1 ||\n anchor.href.indexOf(encodeURI(url)) !== -1 ||\n anchor.href === encodeURI(url)\n ) {\n var ajax = new XMLHttpRequest();\n ajax.open(\"GET\", url + \"?no-cache=\" + Date.now(), true);\n ajax.responseType = \"blob\";\n ajax.onload = function (e) {\n // @ts-ignore\n download(e.target.response, fileName, defaultMime);\n };\n ajax.onerror = function (e) {\n // As a fallback, just open the request in a new tab\n window.open(url, \"_blank\").focus();\n };\n setTimeout(function () {\n ajax.send();\n }, 0); // allows setting custom ajax headers using the return:\n return ajax;\n } else {\n throw new Error(\"Invalid URL given, cannot download file: \" + url);\n }\n } // end if url?\n\n // go ahead and download dataURLs right away\n if (/^data:[\\w+-]+\\/[\\w+-]+[,;]/.test(payload)) {\n if (payload.length > 1024 * 1024 * 1.999 && myBlob !== toString) {\n payload = dataUrlToBlob(payload);\n mimeType = payload.type || defaultMime;\n } else {\n // IE10 can't do a[download], only Blobs\n // everyone else can save dataURLs un-processed\n // @ts-ignore\n return navigator.msSaveBlob ? navigator.msSaveBlob(dataUrlToBlob(payload), fileName) : saver(payload);\n }\n } // end if dataURL passed?\n\n blob =\n payload instanceof myBlob\n ? payload\n : new myBlob([payload], { type: mimeType });\n\n function dataUrlToBlob(strUrl) {\n var parts = strUrl.split(/[:;,]/);\n\n var type = parts[1];\n\n var decoder = parts[2] === \"base64\" ? atob : decodeURIComponent;\n\n var binData = decoder(parts.pop());\n\n var mx = binData.length;\n\n var i = 0;\n\n var uiArr = new Uint8Array(mx);\n\n for (i; i < mx; ++i) uiArr[i] = binData.charCodeAt(i);\n\n return new myBlob([uiArr], { type: type });\n }\n\n function saver(url, winMode) {\n if (\"download\" in anchor) {\n // html5 A[download]\n anchor.href = url;\n anchor.setAttribute(\"download\", fileName);\n anchor.className = \"download-js-link\";\n anchor.innerHTML = \"downloading...\";\n anchor.style.display = \"none\";\n document.body.appendChild(anchor);\n setTimeout(function () {\n anchor.click();\n document.body.removeChild(anchor);\n if (winMode === true) {\n setTimeout(function () {\n self.URL.revokeObjectURL(anchor.href);\n }, 250);\n }\n }, 66);\n return true;\n }\n\n // handle non-a[download] safari as best we can:\n if (\n /(Version)\\/(\\d+)\\.(\\d+)(?:\\.(\\d+))?.*Safari\\//.test(navigator.userAgent)\n ) {\n url = url.replace(/^data:([\\w/\\-+]+)/, defaultMime);\n if (!window.open(url)) {\n // popup blocked, offer direct download:\n if (\n confirm(\n \"Displaying New Document\\n\\nUse Save As... to download, then click back to return to this page.\"\n )\n ) {\n location.href = url;\n }\n }\n return true;\n }\n\n // do iframe dataURL download (old ch+FF):\n var f = document.createElement(\"iframe\");\n document.body.appendChild(f);\n\n if (!winMode) {\n // force a mime that will download:\n url = \"data:\" + url.replace(/^data:([\\w/\\-+]+)/, defaultMime);\n }\n f.src = url;\n setTimeout(function () {\n document.body.removeChild(f);\n }, 333);\n } // end saver\n\n // @ts-ignore\n if (navigator.msSaveBlob) {\n // IE10+ : (has Blob, but not a[download] or URL)\n // @ts-ignore\n return navigator.msSaveBlob(blob, fileName);\n }\n\n if (self.URL) {\n // simple fast and modern way using Blob and URL:\n saver(self.URL.createObjectURL(blob), true);\n } else {\n // handle non-Blob()+non-URL browsers:\n if (typeof blob === \"string\" || blob.constructor === toString) {\n try {\n // @ts-ignore\n return saver(\"data:\" + mimeType + \";base64,\" + self.btoa(blob));\n } catch (y) {\n // @ts-ignore\n return saver(\"data:\" + mimeType + \",\" + encodeURIComponent(blob));\n }\n }\n\n // Blob but not URL support:\n reader = new FileReader();\n reader.onload = function (e) {\n // @ts-ignore\n saver(this.result);\n };\n reader.readAsDataURL(blob);\n }\n return true;\n}\n","import { download } from \"./download\";\n\n/**\n * Asynchronously load a file from the URL and trigger a download in the browser\n *\n * @param url\n * @param filename\n * @param postParams\n * @returns {Promise<void>}\n */\nexport async function downloadFile(url, filename = \"\", postParams = null) {\n let fetchOptions = undefined;\n\n if (postParams) {\n fetchOptions = {\n method: \"POST\",\n \"Content-Type\": \"application/json\",\n body: JSON.stringify(postParams)\n };\n }\n\n const response = await fetch(url, fetchOptions);\n\n if (!response.ok) {\n throw Error(\"File download failed: invalid response from server\");\n }\n\n let errorMessage;\n\n // Handle a JSON response (which indicates an error occurred)\n try {\n // @ts-expect-error data is defined on response\n const jsonResponse = JSON.parse(new TextDecoder().decode(response.data));\n console.error(\"Error downloading file:\", jsonResponse);\n errorMessage = jsonResponse.message;\n if (jsonResponse.errors) {\n errorMessage = jsonResponse.errors[0].message;\n }\n } catch (e) {\n // we expect an error thrown for invalid JSON when the response is a file\n }\n\n if (errorMessage) {\n throw new Error(\"Failed to download file: \" + errorMessage);\n }\n\n await downloadFileResponse(response, filename);\n}\n\n/**\n * Downloads a file from a response object w/ a file attachment\n *\n * @param response\n * @param filename\n */\nexport async function downloadFileResponse(response, filename = \"\") {\n const contentDisposition = getResponseHeader(\n response,\n \"content-disposition\",\n \"\"\n );\n\n const contentType = getResponseHeader(response, \"content-type\", \"\");\n\n const match = contentDisposition.match(/filename=\"([^\"]+)\"/);\n\n filename = filename || (match && match[1]) || \"download.pdf\";\n\n let data = response.data;\n if (!data) {\n data = await response.blob();\n }\n\n download(data, filename, contentType);\n}\n\n/**\n * Get a header from a response object\n * @param response\n * @param header\n * @param defaultValue\n * @returns {*}\n */\nexport function getResponseHeader(response, header, defaultValue) {\n if (response.headers) {\n if (typeof response.headers.get === \"function\") {\n return response.headers.get(header) || defaultValue;\n } else {\n return response.headers[header] || defaultValue;\n }\n }\n}\n","export default class DataView {\n constructor(buffer) {\n if (bufferTypeIsUnsupported(buffer)) {\n throw new Error('DataView: Passed buffer type is unsupported.');\n }\n\n this.buffer = buffer;\n this.byteLength = this.buffer.length;\n }\n\n getUint8(offset) {\n return this.buffer.readUInt8(offset);\n }\n\n getUint16(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readUInt16LE(offset);\n }\n return this.buffer.readUInt16BE(offset);\n }\n\n getUint32(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readUInt32LE(offset);\n }\n return this.buffer.readUInt32BE(offset);\n }\n\n getInt32(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readInt32LE(offset);\n }\n return this.buffer.readInt32BE(offset);\n }\n}\n\nfunction bufferTypeIsUnsupported(buffer) {\n return typeof buffer !== 'object'\n || buffer.length === undefined\n || buffer.readUInt8 === undefined\n || buffer.readUInt16LE === undefined\n || buffer.readUInt16BE === undefined\n || buffer.readUInt32LE === undefined\n || buffer.readUInt32BE === undefined\n || buffer.readInt32LE === undefined\n || buffer.readInt32BE === undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport DataViewWrapper from './dataview.js';\n\nexport function getDataView(data, byteOffset, byteLength) {\n try {\n return new DataView(data, byteOffset, byteLength);\n } catch (error) {\n return new DataViewWrapper(data, byteOffset, byteLength);\n }\n}\n\nexport function getStringFromDataView(dataView, offset, length) {\n const chars = [];\n for (let i = 0; i < length && offset + i < dataView.byteLength; i++) {\n chars.push(dataView.getUint8(offset + i));\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getNullTerminatedStringFromDataView(dataView, offset) {\n const chars = [];\n let i = 0;\n while (offset + i < dataView.byteLength) {\n const char = dataView.getUint8(offset + i);\n if (char === 0) {\n break;\n }\n chars.push(char);\n i++;\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getUnicodeStringFromDataView(dataView, offset, length) {\n const chars = [];\n for (let i = 0; i < length && offset + i < dataView.byteLength; i += 2) {\n chars.push(dataView.getUint16(offset + i));\n }\n if (chars[chars.length - 1] === 0) {\n chars.pop();\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getPascalStringFromDataView(dataView, offset) {\n const size = dataView.getUint8(offset);\n const string = getStringFromDataView(dataView, offset + 1, size);\n return [size, string];\n}\n\nexport function getStringValueFromArray(charArray) {\n return charArray.map((charCode) => String.fromCharCode(charCode)).join('');\n}\n\nexport function getCharacterArray(string) {\n return string.split('').map((character) => character.charCodeAt(0));\n}\n\nexport function objectAssign() {\n for (let i = 1; i < arguments.length; i++) {\n for (const property in arguments[i]) {\n arguments[0][property] = arguments[i][property];\n }\n }\n\n return arguments[0];\n}\n\nexport function deferInit(object, key, initializer) {\n let initialized = false;\n Object.defineProperty(object, key, {\n get() {\n if (!initialized) {\n initialized = true;\n Object.defineProperty(object, key, {\n configurable: true,\n enumerable: true,\n value: initializer.apply(object),\n writable: true\n });\n }\n return object[key];\n },\n configurable: true,\n enumerable: true\n });\n}\n\nexport function getBase64Image(image) {\n if (typeof btoa !== 'undefined') {\n if (typeof image === 'string') {\n // This only happens during the build tests using Node 16+ (npm run test:build).\n return btoa(image);\n }\n // IE11- does not implement reduce on the Uint8Array prototype.\n return btoa(Array.prototype.reduce.call(new Uint8Array(image), (data, byte) => data + String.fromCharCode(byte), ''));\n }\n if (typeof Buffer === 'undefined') {\n return undefined;\n }\n if (typeof Buffer.from !== 'undefined') { // eslint-disable-line no-undef\n return Buffer.from(image).toString('base64'); // eslint-disable-line no-undef\n }\n return (new Buffer(image)).toString('base64'); // eslint-disable-line no-undef\n}\n\nexport function dataUriToBuffer(dataUri) {\n const data = dataUri.substring(dataUri.indexOf(',') + 1);\n\n if (dataUri.indexOf(';base64') !== -1) {\n if (typeof atob !== 'undefined') {\n return Uint8Array.from(atob(data), (char) => char.charCodeAt(0)).buffer;\n }\n if (typeof Buffer === 'undefined') {\n return undefined;\n }\n if (typeof Buffer.from !== 'undefined') { // eslint-disable-line no-undef\n return Buffer.from(data, 'base64'); // eslint-disable-line no-undef\n }\n return new Buffer(data, 'base64'); // eslint-disable-line no-undef\n }\n\n const decodedData = decodeURIComponent(data);\n if (typeof Buffer !== 'undefined') {\n if (typeof Buffer.from !== 'undefined') { // eslint-disable-line no-undef\n return Buffer.from(decodedData); // eslint-disable-line no-undef\n }\n return new Buffer(decodedData); // eslint-disable-line no-undef\n }\n return Uint8Array.from(decodedData, (char) => char.charCodeAt(0)).buffer;\n}\n\nexport function padStart(string, length, character) {\n const padding = strRepeat(character, length - string.length);\n return padding + string;\n}\n\nexport function parseFloatRadix(string, radix) {\n return parseInt(string.replace('.', ''), radix)\n / Math.pow(radix, (string.split('.')[1] || '').length);\n}\n\nexport function strRepeat(string, num) {\n return new Array(num + 1).join(string);\n}\n\nexport const COMPRESSION_METHOD_NONE = undefined;\nexport const COMPRESSION_METHOD_DEFLATE = 0;\n\nexport function decompress(dataView, compressionMethod, returnType = 'string') {\n if (compressionMethod === COMPRESSION_METHOD_DEFLATE) {\n if (typeof DecompressionStream === 'function') {\n const decompressionStream = new DecompressionStream('deflate');\n const decompressedStream = new Blob([dataView]).stream().pipeThrough(decompressionStream);\n if (returnType === 'dataview') {\n return new Response(decompressedStream).arrayBuffer().then((arrayBuffer) => new DataView(arrayBuffer));\n }\n return new Response(decompressedStream).text();\n }\n }\n if (compressionMethod !== undefined) {\n return Promise.reject(`Unknown compression method ${compressionMethod}.`);\n }\n return dataView;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n USE_FILE: true,\n USE_JFIF: true,\n USE_PNG_FILE: true,\n USE_EXIF: true,\n USE_IPTC: true,\n USE_XMP: true,\n USE_ICC: true,\n USE_MPF: true,\n USE_PHOTOSHOP: true,\n USE_THUMBNAIL: true,\n USE_TIFF: true,\n USE_JPEG: true,\n USE_PNG: true,\n USE_HEIC: true,\n USE_AVIF: true,\n USE_WEBP: true,\n USE_GIF: true\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport function getStringValue(value) {\n return value.map((charCode) => String.fromCharCode(charCode)).join('');\n}\n\nexport function getEncodedString(value) {\n if (value.length >= 8) {\n const encoding = getStringValue(value.slice(0, 8));\n\n if (encoding === 'ASCII\\x00\\x00\\x00') {\n return getStringValue(value.slice(8));\n } else if (encoding === 'JIS\\x00\\x00\\x00\\x00\\x00') {\n return '[JIS encoded text]';\n } else if (encoding === 'UNICODE\\x00') {\n return '[Unicode encoded text]';\n } else if (encoding === '\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00') {\n return '[Undefined encoding]';\n }\n }\n\n return 'Undefined';\n}\n\nexport function getCalculatedGpsValue(value) {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nconst LITTLE_ENDIAN = 0x4949;\nconst BIG_ENDIAN = 0x4d4d;\n\nexport default {\n BIG_ENDIAN,\n LITTLE_ENDIAN,\n getByteOrder\n};\n\nfunction getByteOrder(dataView, tiffHeaderOffset) {\n if (dataView.getUint16(tiffHeaderOffset) === LITTLE_ENDIAN) {\n return LITTLE_ENDIAN;\n } else if (dataView.getUint16(tiffHeaderOffset) === BIG_ENDIAN) {\n return BIG_ENDIAN;\n }\n throw new Error('Illegal byte order value. Faulty image.');\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\nimport Constants from './constants.js';\n\nexport default {\n isTiffFile,\n findTiffOffsets\n};\n\nfunction isTiffFile(dataView) {\n const MIN_TIFF_DATA_BUFFER_LENGTH = 4;\n\n return !!dataView && (dataView.byteLength >= MIN_TIFF_DATA_BUFFER_LENGTH) && hasTiffMarker(dataView);\n}\n\nfunction hasTiffMarker(dataView) {\n const TIFF_ID = 0x2a;\n const TIFF_ID_OFFSET = 2;\n\n const littleEndian = dataView.getUint16(0) === ByteOrder.LITTLE_ENDIAN;\n return dataView.getUint16(TIFF_ID_OFFSET, littleEndian) === TIFF_ID;\n}\n\nfunction findTiffOffsets() {\n const TIFF_FILE_HEADER_OFFSET = 0;\n\n if (Constants.USE_EXIF) {\n return {\n hasAppMarkers: true,\n tiffHeaderOffset: TIFF_FILE_HEADER_OFFSET\n };\n }\n return {};\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isJpegFile,\n findJpegOffsets\n};\n\nconst MIN_JPEG_DATA_BUFFER_LENGTH = 2;\nconst JPEG_ID = 0xffd8;\nconst JPEG_ID_SIZE = 2;\nconst APP_ID_OFFSET = 4;\nconst APP_MARKER_SIZE = 2;\nconst JFIF_DATA_OFFSET = 2; // From start of APP0 marker.\nconst TIFF_HEADER_OFFSET = 10; // From start of APP1 marker.\nconst IPTC_DATA_OFFSET = 18; // From start of APP13 marker.\nconst XMP_DATA_OFFSET = 33; // From start of APP1 marker.\nconst XMP_EXTENDED_DATA_OFFSET = 79; // From start of APP1 marker including GUID, total length, and offset.\nconst APP2_ICC_DATA_OFFSET = 18; // From start of APP2 marker including marker and chunk/chunk total numbers.\nconst MPF_DATA_OFFSET = 8;\n\nconst APP2_ICC_IDENTIFIER = 'ICC_PROFILE\\0';\nconst ICC_CHUNK_NUMBER_OFFSET = APP_ID_OFFSET + APP2_ICC_IDENTIFIER.length;\nconst ICC_TOTAL_CHUNKS_OFFSET = ICC_CHUNK_NUMBER_OFFSET + 1;\n\nconst APP2_MPF_IDENTIFIER = 'MPF\\0';\n\nconst SOF0_MARKER = 0xffc0;\nconst SOF2_MARKER = 0xffc2;\nconst DHT_MARKER = 0xffc4;\nconst DQT_MARKER = 0xffdb;\nconst DRI_MARKER = 0xffdd;\nconst SOS_MARKER = 0xffda;\n\nconst APP0_MARKER = 0xffe0;\nconst APP1_MARKER = 0xffe1;\nconst APP2_MARKER = 0xffe2;\nconst APP13_MARKER = 0xffed;\nconst APP15_MARKER = 0xffef;\nconst COMMENT_MARKER = 0xfffe;\n\n// Any number of fill bytes can be placed before an app marker. It's actually the first 0xff that is the\n// fill byte and the next 0xff is either another fill byte or the first half of the next app marker.\nconst FILL_BYTE = 0xffff;\n\nconst APP0_JFIF_IDENTIFIER = 'JFIF';\nconst APP1_EXIF_IDENTIFIER = 'Exif';\nconst APP1_XMP_IDENTIFIER = 'http://ns.adobe.com/xap/1.0/\\x00';\nconst APP1_XMP_EXTENDED_IDENTIFIER = 'http://ns.adobe.com/xmp/extension/\\x00';\nconst APP13_IPTC_IDENTIFIER = 'Photoshop 3.0';\n\nfunction isJpegFile(dataView) {\n return !!dataView && (dataView.byteLength >= MIN_JPEG_DATA_BUFFER_LENGTH) && (dataView.getUint16(0) === JPEG_ID);\n}\n\nfunction findJpegOffsets(dataView) {\n let appMarkerPosition = JPEG_ID_SIZE;\n let fieldLength;\n let sof0DataOffset;\n let sof2DataOffset;\n let jfifDataOffset;\n let tiffHeaderOffset;\n let iptcDataOffset;\n let xmpChunks;\n let iccChunks;\n let mpfDataOffset;\n\n while (appMarkerPosition + APP_ID_OFFSET + 5 <= dataView.byteLength) {\n if (Constants.USE_FILE && isSOF0Marker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n sof0DataOffset = appMarkerPosition + APP_MARKER_SIZE;\n } else if (Constants.USE_FILE && isSOF2Marker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n sof2DataOffset = appMarkerPosition + APP_MARKER_SIZE;\n } else if (Constants.USE_JFIF && isApp0JfifMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n jfifDataOffset = appMarkerPosition + JFIF_DATA_OFFSET;\n } else if (Constants.USE_EXIF && isApp1ExifMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n tiffHeaderOffset = appMarkerPosition + TIFF_HEADER_OFFSET;\n } else if (Constants.USE_XMP && isApp1XmpMarker(dataView, appMarkerPosition)) {\n if (!xmpChunks) {\n xmpChunks = [];\n }\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n xmpChunks.push(getXmpChunkDetails(appMarkerPosition, fieldLength));\n } else if (Constants.USE_XMP && isApp1ExtendedXmpMarker(dataView, appMarkerPosition)) {\n if (!xmpChunks) {\n xmpChunks = [];\n }\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n xmpChunks.push(getExtendedXmpChunkDetails(appMarkerPosition, fieldLength));\n } else if (Constants.USE_IPTC && isApp13PhotoshopMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n iptcDataOffset = appMarkerPosition + IPTC_DATA_OFFSET;\n } else if (Constants.USE_ICC && isApp2ICCMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n const iccDataOffset = appMarkerPosition + APP2_ICC_DATA_OFFSET;\n const iccDataLength = fieldLength - (APP2_ICC_DATA_OFFSET - APP_MARKER_SIZE);\n\n const iccChunkNumber = dataView.getUint8(appMarkerPosition + ICC_CHUNK_NUMBER_OFFSET);\n const iccChunksTotal = dataView.getUint8(appMarkerPosition + ICC_TOTAL_CHUNKS_OFFSET);\n if (!iccChunks) {\n iccChunks = [];\n }\n iccChunks.push({offset: iccDataOffset, length: iccDataLength, chunkNumber: iccChunkNumber, chunksTotal: iccChunksTotal});\n } else if (Constants.USE_MPF && isApp2MPFMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n mpfDataOffset = appMarkerPosition + MPF_DATA_OFFSET;\n } else if (isAppMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n } else if (isFillByte(dataView, appMarkerPosition)) {\n appMarkerPosition++;\n continue;\n } else {\n break;\n }\n appMarkerPosition += APP_MARKER_SIZE + fieldLength;\n }\n\n return {\n hasAppMarkers: appMarkerPosition > JPEG_ID_SIZE,\n fileDataOffset: sof0DataOffset || sof2DataOffset,\n jfifDataOffset,\n tiffHeaderOffset,\n iptcDataOffset,\n xmpChunks,\n iccChunks,\n mpfDataOffset\n };\n}\n\nfunction isSOF0Marker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === SOF0_MARKER);\n}\n\nfunction isSOF2Marker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === SOF2_MARKER);\n}\n\nfunction isApp2ICCMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP2_ICC_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP2_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP2_ICC_IDENTIFIER);\n}\n\nfunction isApp2MPFMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP2_MPF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP2_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP2_MPF_IDENTIFIER);\n}\n\nfunction isApp0JfifMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP0_JFIF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP0_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP0_JFIF_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isApp1ExifMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP1_EXIF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_EXIF_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isApp1XmpMarker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && isXmpIdentifier(dataView, appMarkerPosition);\n}\n\nfunction isXmpIdentifier(dataView, appMarkerPosition) {\n const markerIdLength = APP1_XMP_IDENTIFIER.length;\n return getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_XMP_IDENTIFIER;\n}\n\nfunction isApp1ExtendedXmpMarker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && isExtendedXmpIdentifier(dataView, appMarkerPosition);\n}\n\nfunction isExtendedXmpIdentifier(dataView, appMarkerPosition) {\n const markerIdLength = APP1_XMP_EXTENDED_IDENTIFIER.length;\n return getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_XMP_EXTENDED_IDENTIFIER;\n}\n\nfunction getXmpChunkDetails(appMarkerPosition, fieldLength) {\n return {\n dataOffset: appMarkerPosition + XMP_DATA_OFFSET,\n length: fieldLength - (XMP_DATA_OFFSET - APP_MARKER_SIZE)\n };\n}\n\nfunction getExtendedXmpChunkDetails(appMarkerPosition, fieldLength) {\n return {\n dataOffset: appMarkerPosition + XMP_EXTENDED_DATA_OFFSET,\n length: fieldLength - (XMP_EXTENDED_DATA_OFFSET - APP_MARKER_SIZE)\n };\n}\n\nfunction isApp13PhotoshopMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP13_IPTC_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP13_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP13_IPTC_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isAppMarker(dataView, appMarkerPosition) {\n const appMarker = dataView.getUint16(appMarkerPosition);\n return ((appMarker >= APP0_MARKER) && (appMarker <= APP15_MARKER))\n || (appMarker === COMMENT_MARKER)\n || (appMarker === SOF0_MARKER)\n || (appMarker === SOF2_MARKER)\n || (appMarker === DHT_MARKER)\n || (appMarker === DQT_MARKER)\n || (appMarker === DRI_MARKER)\n || (appMarker === SOS_MARKER);\n}\n\nfunction isFillByte(dataView, appMarkerPosition) {\n return dataView.getUint16(appMarkerPosition) === FILL_BYTE;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// Specification: http://www.libpng.org/pub/png/spec/1.2/\n\nimport {getStringFromDataView, getNullTerminatedStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isPngFile,\n findPngOffsets\n};\n\nconst PNG_ID = '\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a';\nconst PNG_CHUNK_LENGTH_SIZE = 4;\nexport const PNG_CHUNK_TYPE_SIZE = 4;\nexport const PNG_CHUNK_LENGTH_OFFSET = 0;\nexport const PNG_CHUNK_TYPE_OFFSET = PNG_CHUNK_LENGTH_SIZE;\nexport const PNG_CHUNK_DATA_OFFSET = PNG_CHUNK_LENGTH_SIZE + PNG_CHUNK_TYPE_SIZE;\nconst PNG_XMP_PREFIX = 'XML:com.adobe.xmp\\x00';\nexport const TYPE_TEXT = 'tEXt';\nexport const TYPE_ITXT = 'iTXt';\nexport const TYPE_ZTXT = 'zTXt';\nexport const TYPE_PHYS = 'pHYs';\nexport const TYPE_TIME = 'tIME';\nexport const TYPE_EXIF = 'eXIf';\nexport const TYPE_ICCP = 'iCCP';\n\nfunction isPngFile(dataView) {\n return !!dataView && getStringFromDataView(dataView, 0, PNG_ID.length) === PNG_ID;\n}\n\nfunction findPngOffsets(dataView, async) {\n const PNG_CRC_SIZE = 4;\n\n const offsets = {\n hasAppMarkers: false\n };\n\n let offset = PNG_ID.length;\n\n while (offset + PNG_CHUNK_LENGTH_SIZE + PNG_CHUNK_TYPE_SIZE <= dataView.byteLength) {\n if (Constants.USE_PNG_FILE && isPngImageHeaderChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n offsets.pngHeaderOffset = offset + PNG_CHUNK_DATA_OFFSET;\n } else if (Constants.USE_XMP && isPngXmpChunk(dataView, offset)) {\n const dataOffset = getPngXmpDataOffset(dataView, offset);\n if (dataOffset !== undefined) {\n offsets.hasAppMarkers = true;\n offsets.xmpChunks = [{\n dataOffset,\n length: dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET) - (dataOffset - (offset + PNG_CHUNK_DATA_OFFSET))\n }];\n }\n } else if (isPngTextChunk(dataView, offset, async)) {\n offsets.hasAppMarkers = true;\n const chunkType = getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE);\n if (!offsets.pngTextChunks) {\n offsets.pngTextChunks = [];\n }\n offsets.pngTextChunks.push({\n length: dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET),\n type: chunkType,\n offset: offset + PNG_CHUNK_DATA_OFFSET\n });\n } else if (isPngExifChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n offsets.tiffHeaderOffset = offset + PNG_CHUNK_DATA_OFFSET;\n } else if (Constants.USE_ICC && async && isPngIccpChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n const chunkDataLength = dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET);\n const iccHeaderOffset = offset + PNG_CHUNK_DATA_OFFSET;\n const {profileName, compressionMethod, compressedProfileOffset} = parseIccHeader(dataView, iccHeaderOffset);\n if (!offsets.iccChunks) {\n offsets.iccChunks = [];\n }\n offsets.iccChunks.push({\n offset: compressedProfileOffset,\n length: chunkDataLength - (compressedProfileOffset - iccHeaderOffset),\n chunkNumber: 1,\n chunksTotal: 1,\n profileName,\n compressionMethod\n });\n } else if (isPngChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n if (!offsets.pngChunkOffsets) {\n offsets.pngChunkOffsets = [];\n }\n offsets.pngChunkOffsets.push(offset + PNG_CHUNK_LENGTH_OFFSET);\n }\n\n offset += dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET)\n + PNG_CHUNK_LENGTH_SIZE\n + PNG_CHUNK_TYPE_SIZE\n + PNG_CRC_SIZE;\n }\n\n return offsets;\n}\n\nfunction isPngImageHeaderChunk(dataView, offset) {\n const PNG_CHUNK_TYPE_IMAGE_HEADER = 'IHDR';\n return getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === PNG_CHUNK_TYPE_IMAGE_HEADER;\n}\n\nfunction isPngXmpChunk(dataView, offset) {\n return (getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === TYPE_ITXT)\n && (getStringFromDataView(dataView, offset + PNG_CHUNK_DATA_OFFSET, PNG_XMP_PREFIX.length) === PNG_XMP_PREFIX);\n}\n\nfunction isPngTextChunk(dataView, offset, async) {\n const chunkType = getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE);\n return chunkType === TYPE_TEXT || chunkType === TYPE_ITXT || (chunkType === TYPE_ZTXT && async);\n}\n\nfunction isPngExifChunk(dataView, offset) {\n return getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === TYPE_EXIF;\n}\n\nfunction isPngIccpChunk(dataView, offset) {\n return getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === TYPE_ICCP;\n}\n\nfunction isPngChunk(dataView, offset) {\n const SUPPORTED_PNG_CHUNK_TYPES = [TYPE_PHYS, TYPE_TIME];\n const chunkType = getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE);\n return SUPPORTED_PNG_CHUNK_TYPES.includes(chunkType);\n}\n\nfunction getPngXmpDataOffset(dataView, offset) {\n const COMPRESSION_FLAG_SIZE = 1;\n const COMPRESSION_METHOD_SIZE = 1;\n\n offset += PNG_CHUNK_DATA_OFFSET + PNG_XMP_PREFIX.length + COMPRESSION_FLAG_SIZE + COMPRESSION_METHOD_SIZE;\n\n let numberOfNullSeparators = 0;\n while (numberOfNullSeparators < 2 && offset < dataView.byteLength) {\n if (dataView.getUint8(offset) === 0x00) {\n numberOfNullSeparators++;\n }\n offset++;\n }\n if (numberOfNullSeparators < 2) {\n return undefined;\n }\n return offset;\n}\n\nfunction parseIccHeader(dataView, offset) {\n const NULL_SEPARATOR_SIZE = 1;\n const COMPRESSION_METHOD_SIZE = 1;\n\n const profileName = getNullTerminatedStringFromDataView(dataView, offset);\n offset += profileName.length + NULL_SEPARATOR_SIZE;\n\n const compressionMethod = dataView.getUint8(offset);\n offset += COMPRESSION_METHOD_SIZE;\n\n return {\n profileName,\n compressionMethod,\n compressedProfileOffset: offset\n };\n}\n","export function get64BitValue(dataView, offset) {\n // It's a bit tricky to handle 64 bit numbers in JavaScript. Let's\n // wait until there are real-world examples where it is necessary.\n return dataView.getUint32(offset + 4);\n}\n","import {get64BitValue} from './image-header-iso-bmff-utils.js';\n\nexport function parseItemLocationBox(dataView, version, contentOffset, boxLength) {\n const FLAGS_SIZE = 3;\n\n const {offsets, sizes} = getItemLocationBoxOffsetsAndSizes(version, contentOffset + FLAGS_SIZE);\n\n const offsetSize = dataView.getUint8(offsets.offsetSize) >> 4;\n sizes.item.extent.extentOffset = offsetSize;\n const lengthSize = dataView.getUint8(offsets.lengthSize) & 0x0f;\n sizes.item.extent.extentLength = lengthSize;\n const baseOffsetSize = dataView.getUint8(offsets.baseOffsetSize) >> 4;\n sizes.item.baseOffset = baseOffsetSize;\n const indexSize = getIndexSize(dataView, offsets.indexSize, version);\n sizes.item.extent.extentIndex = indexSize !== undefined ? indexSize : 0;\n const itemCount = getItemCount(dataView, offsets.itemCount, version);\n\n return {\n type: 'iloc',\n items: getItems(dataView, version, offsets, sizes, offsetSize, lengthSize, indexSize, itemCount),\n length: boxLength\n };\n}\n\nfunction getItemLocationBoxOffsetsAndSizes(version, contentOffset) {\n const sizes = {\n item: {\n dataReferenceIndex: 2,\n extentCount: 2,\n extent: {}\n }\n };\n if (version < 2) {\n sizes.itemCount = 2;\n sizes.item.itemId = 2;\n } else if (version === 2) {\n sizes.itemCount = 4;\n sizes.item.itemId = 4;\n }\n if (version === 1 || version === 2) {\n sizes.item.constructionMethod = 2;\n } else {\n sizes.item.constructionMethod = 0;\n }\n\n const offsets = {\n offsetSize: contentOffset,\n lengthSize: contentOffset,\n baseOffsetSize: contentOffset + 1,\n indexSize: contentOffset + 1\n };\n offsets.itemCount = contentOffset + 2;\n offsets.items = offsets.itemCount + sizes.itemCount;\n offsets.item = {\n itemId: 0\n };\n offsets.item.constructionMethod = offsets.item.itemId + sizes.item.itemId;\n offsets.item.dataReferenceIndex = offsets.item.constructionMethod + sizes.item.constructionMethod;\n\n return {offsets, sizes};\n}\n\nfunction getIndexSize(dataView, offset, version) {\n if (version === 1 || version === 2) {\n return dataView.getUint8(offset) & 0x0f;\n }\n return undefined;\n}\n\nfunction getItemCount(dataView, offset, version) {\n if (version < 2) {\n return dataView.getUint16(offset);\n } else if (version === 2) {\n return dataView.getUint32(offset);\n }\n return undefined;\n}\n\nfunction getItems(dataView, version, offsets, sizes, offsetSize, lengthSize, indexSize, itemCount) {\n if (itemCount === undefined) {\n return [];\n }\n\n const items = [];\n let offset = offsets.items;\n\n for (let i = 0; i < itemCount; i++) {\n const item = {extents: []};\n item.itemId = getItemId(dataView, offset, version);\n offset += sizes.item.itemId;\n item.constructionMethod = (version === 1) || (version === 2) ? dataView.getUint16(offset) & 0x0f : undefined;\n offset += sizes.item.constructionMethod;\n item.dataReferenceIndex = dataView.getUint16(offset);\n offset += sizes.item.dataReferenceIndex;\n item.baseOffset = getVariableSizedValue(dataView, offset, sizes.item.baseOffset);\n offset += sizes.item.baseOffset;\n item.extentCount = dataView.getUint16(offset);\n offset += sizes.item.extentCount;\n for (let j = 0; j < item.extentCount; j++) {\n const extent = {};\n\n extent.extentIndex = getExtentIndex(dataView, version, offset, indexSize);\n offset += sizes.item.extent.extentIndex;\n extent.extentOffset = getVariableSizedValue(dataView, offset, offsetSize);\n offset += sizes.item.extent.extentOffset;\n extent.extentLength = getVariableSizedValue(dataView, offset, lengthSize);\n offset += sizes.item.extent.extentLength;\n\n item.extents.push(extent);\n }\n\n items.push(item);\n }\n\n return items;\n}\n\nfunction getItemId(dataView, offset, version) {\n if (version < 2) {\n return dataView.getUint16(offset);\n } else if (version === 2) {\n return dataView.getUint32(offset);\n }\n return undefined;\n}\n\nfunction getExtentIndex(dataView, version, offset, indexSize) {\n if ((version === 1 || version === 2) && indexSize > 0) {\n return getVariableSizedValue(dataView, offset, indexSize);\n }\n return undefined;\n}\n\nfunction getVariableSizedValue(dataView, offset, size) {\n if (size === 4) {\n return dataView.getUint32(offset);\n }\n if (size === 8) {\n // eslint-disable-next-line no-console\n console.warn('This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed.');\n return get64BitValue(dataView, offset);\n }\n return 0;\n}\n","import Constants from './constants.js';\nimport {getNullTerminatedStringFromDataView, getStringFromDataView} from './utils.js';\n// import {get64BitValue} from './image-header-iso-bmff-utils.js';\nimport {parseItemLocationBox} from './image-header-iso-bmff-iloc.js';\n\n// HEIC and AVIF files are based on the ISO-BMFF format. This file format is\n// built up by boxes. There are boxes and full boxes. All box types have a\n// length (4 or 8 bytes) and a type (4 bytes). Full boxes also have a version\n// (1 byte) and flags (3 bytes). The boxes can be nested. Each box type has its\n// own structure that can be seen in the specification.\n//\n// For metadata we are interested in the meta box. The meta box contains sub\n// boxes. The sub box type iinf has info about which types of metadata are\n// present in the file. The item ID we get from there we then look up in the\n// iloc sub box to get the offset to the real location of the metadata.\n//\n// The ICC profiles is a bit more nested. We have to look in\n// meta > iprp > ipco > colr, and then the whole profile is stored there.\n\n// These are actually 32-bit strings, not random IDs, e.g. \"ftyp\" and \"meta\".\nconst TYPE_FTYP = 0x66747970;\nconst TYPE_IPRP = 0x69707270;\nconst TYPE_META = 0x6d657461;\nconst TYPE_ILOC = 0x696c6f63;\nconst TYPE_IINF = 0x69696e66;\nconst TYPE_INFE = 0x696e6665;\nconst TYPE_IPCO = 0x6970636f;\nconst TYPE_COLR = 0x636f6c72;\n\n// const EXTENSION_TYPE_FDEL = 0x6664656c;\n\nexport const ITEM_INFO_TYPE_EXIF = 0x45786966;\nexport const ITEM_INFO_TYPE_MIME = 0x6d696d65;\nconst ITEM_INFO_TYPE_URI = 0x75726920;\n\n/**\n * Parses a ISO-BMFF box from the provided data view starting at the given offset.\n *\n * @param {DataView} dataView - The DataView to parse.\n * @param {number} offset - The offset at which to start parsing.\n * @returns {Object} The parsed box.\n */\nexport function parseBox(dataView, offset) {\n const BOX_TYPE_OFFSET = 4;\n const BOX_MIN_LENGTH = 8;\n const VERSION_SIZE = 1;\n\n const {length, contentOffset} = getBoxLength(dataView, offset);\n if (length < BOX_MIN_LENGTH) {\n return undefined;\n }\n\n const type = dataView.getUint32(offset + BOX_TYPE_OFFSET);\n\n if (type === TYPE_FTYP) {\n return parseFileTypeBox(dataView, contentOffset, length);\n }\n if (type === TYPE_IPRP) {\n return parseItemPropertiesBox(dataView, offset, contentOffset, length);\n }\n if (type === TYPE_IPCO) {\n return parseItemPropertyContainerBox(dataView, offset, contentOffset, length);\n }\n if (type === TYPE_COLR) {\n return parseColorInformationBox(dataView, contentOffset, length);\n }\n\n // The following are full boxes, also containing version and flags.\n const version = dataView.getUint8(contentOffset);\n\n if (type === TYPE_META) {\n return parseMetadataBox(dataView, offset, contentOffset + VERSION_SIZE, length);\n }\n if (type === TYPE_ILOC) {\n return parseItemLocationBox(dataView, version, contentOffset + VERSION_SIZE, length);\n }\n if (type === TYPE_IINF) {\n return parseItemInformationBox(dataView, offset, version, contentOffset + VERSION_SIZE, length);\n }\n if (type === TYPE_INFE) {\n return parseItemInformationEntryBox(dataView, offset, version, contentOffset + VERSION_SIZE, length);\n }\n\n return {\n // type: getStringFromDataView(dataView, offset + BOX_TYPE_OFFSET, 4),\n type: undefined,\n length\n };\n}\n\n/**\n * @typedef {Object} BoxLength\n * @property {number} length The length of the box including length and type.\n * @property {number} contentOffset\n */\n\n/**\n * @param {DataView} dataView\n * @param {number} offset\n * @returns {BoxLength}\n */\nfunction getBoxLength(dataView, offset) {\n const BOX_LENGTH_SIZE = 4;\n const BOX_TYPE_SIZE = 4;\n const BOX_EXTENDED_SIZE = 8;\n const BOX_EXTENDED_SIZE_LOW_OFFSET = 12;\n\n const boxLength = dataView.getUint32(offset);\n if (extendsToEndOfFile(boxLength)) {\n return {\n length: dataView.byteLength - offset,\n contentOffset: offset + BOX_LENGTH_SIZE + BOX_TYPE_SIZE,\n };\n }\n if (hasExtendedSize(boxLength)) {\n if (hasEmptyHighBits(dataView, offset)) {\n // It's a bit tricky to handle 64 bit numbers in JavaScript. Let's\n // wait until there are real-world examples where it is necessary.\n return {\n length: dataView.getUint32(offset + BOX_EXTENDED_SIZE_LOW_OFFSET),\n contentOffset: offset + BOX_LENGTH_SIZE + BOX_TYPE_SIZE + BOX_EXTENDED_SIZE,\n };\n }\n }\n\n return {\n length: boxLength,\n contentOffset: offset + BOX_LENGTH_SIZE + BOX_TYPE_SIZE,\n };\n}\n\nfunction extendsToEndOfFile(boxLength) {\n return boxLength === 0;\n}\n\nfunction hasExtendedSize(boxLength) {\n return boxLength === 1;\n}\n\nfunction hasEmptyHighBits(dataView, offset) {\n const BOX_EXTENDED_SIZE_OFFSET = 8;\n return dataView.getUint32(offset + BOX_EXTENDED_SIZE_OFFSET) === 0;\n}\n\n/**\n * @typedef {Object} Offsets\n * @property {number} tiffHeaderOffset\n * @property {Array<Object>} xmpChunks\n * @property {Array<Object>} iccChunks\n * @property {boolean} hasAppMarkers\n */\n\n/**\n * Finds the offsets of ISO-BMFF-structued data in the provided data view.\n *\n * @param {DataView} dataView - The data view to find offsets in.\n * @returns {Offsets} An object containing the offsets of the TIFF header, XMP chunks, ICC chunks, and a boolean indicating if any of these exist.\n */\nexport function findOffsets(dataView) {\n if (Constants.USE_EXIF || Constants.USE_XMP || Constants.USE_ICC) {\n const offsets = {};\n const metaBox = findMetaBox(dataView);\n\n if (!metaBox) {\n return {hasAppMarkers: false};\n }\n\n if (Constants.USE_EXIF) {\n offsets.tiffHeaderOffset = findExifOffset(dataView, metaBox);\n }\n if (Constants.USE_XMP) {\n offsets.xmpChunks = findXmpChunks(metaBox);\n }\n if (Constants.USE_ICC) {\n offsets.iccChunks = findIccChunks(metaBox);\n }\n offsets.hasAppMarkers = (offsets.tiffHeaderOffset !== undefined) || (offsets.xmpChunks !== undefined) || (offsets.iccChunks !== undefined);\n return offsets;\n }\n\n return {};\n}\n\nfunction findMetaBox(dataView) {\n const BOX_LENGTH_SIZE = 4;\n const BOX_TYPE_SIZE = 4;\n\n let offset = 0;\n\n while (offset + BOX_LENGTH_SIZE + BOX_TYPE_SIZE <= dataView.byteLength) {\n const box = parseBox(dataView, offset);\n\n if (box === undefined) {\n break;\n }\n\n if (box.type === 'meta') {\n return box;\n }\n\n offset += box.length;\n }\n\n return undefined;\n}\n\nfunction findExifOffset(dataView, metaBox) {\n try {\n const exifItemId = findIinfExifItemId(metaBox).itemId;\n const ilocItem = findIlocItem(metaBox, exifItemId);\n const exifOffset = ilocItem.baseOffset + ilocItem.extents[0].extentOffset;\n return getTiffHeaderOffset(dataView, exifOffset);\n } catch (error) {\n return undefined;\n }\n}\n\nfunction findIinfExifItemId(metaBox) {\n return metaBox.subBoxes.find((box) => box.type === 'iinf').itemInfos.find((itemInfo) => itemInfo.itemType === ITEM_INFO_TYPE_EXIF);\n}\n\nfunction findIlocItem(metaBox, itemId) {\n return metaBox.subBoxes.find((box) => box.type === 'iloc').items.find((item) => item.itemId === itemId);\n}\n\nfunction getTiffHeaderOffset(dataView, exifOffset) {\n // ISO-BMFF formatted files store the Exif data as an \"Exif block\" where the\n // first 32 bits is the TIFF header offset.\n const TIFF_HEADER_OFFSET_SIZE = 4;\n return exifOffset + TIFF_HEADER_OFFSET_SIZE + dataView.getUint32(exifOffset);\n}\n\nfunction findXmpChunks(metaBox) {\n try {\n const xmpItemId = findIinfXmpItemId(metaBox).itemId;\n const ilocItem = findIlocItem(metaBox, xmpItemId);\n const ilocItemExtent = findIlocItem(metaBox, xmpItemId).extents[0];\n return [\n {\n dataOffset: ilocItem.baseOffset + ilocItemExtent.extentOffset,\n length: ilocItemExtent.extentLength,\n }\n ];\n } catch (error) {\n return undefined;\n }\n}\n\nfunction findIinfXmpItemId(metaBox) {\n return metaBox.subBoxes.find((box) => box.type === 'iinf')\n .itemInfos.find((itemInfo) => itemInfo.itemType === ITEM_INFO_TYPE_MIME && itemInfo.contentType === 'application/rdf+xml');\n}\n\nfunction findIccChunks(metaBox) {\n // This finds the first ICC chunk, but there could be one for each image\n // that is embedded in the file. If it turns out we need to match the ICC\n // chunk to a specific image, we need to check the \"ipma\" in addition to the\n // \"ipco\" (currently we only extract the \"ipco\" so more code would be\n // needed).\n try {\n const icc = metaBox.subBoxes.find((box) => box.type === 'iprp')\n .subBoxes.find((box) => box.type === 'ipco')\n .properties.find((box) => box.type === 'colr')\n .icc;\n if (icc) {\n return [icc];\n }\n } catch (error) {\n // Let it pass through.\n }\n return undefined;\n}\n\nfunction parseFileTypeBox(dataView, contentOffset, boxLength) {\n const MAJOR_BRAND_SIZE = 4;\n const majorBrand = getStringFromDataView(dataView, contentOffset, MAJOR_BRAND_SIZE);\n\n return {\n type: 'ftyp',\n majorBrand,\n length: boxLength\n };\n}\n\nfunction parseItemPropertiesBox(dataView, startOffset, contentOffset, length) {\n return {\n type: 'iprp',\n subBoxes: parseSubBoxes(dataView, contentOffset, length - (contentOffset - startOffset)),\n length,\n };\n}\n\nfunction parseItemPropertyContainerBox(dataView, startOffset, contentOffset, length) {\n return {\n type: 'ipco',\n properties: parseSubBoxes(dataView, contentOffset, length - (contentOffset - startOffset)),\n length,\n };\n}\n\nfunction parseColorInformationBox(dataView, contentOffset, length) {\n return {\n type: 'colr',\n icc: parseIcc(dataView, contentOffset),\n length,\n };\n}\n\nfunction parseIcc(dataView, contentOffset) {\n const COLOR_TYPE_SIZE = 4;\n\n const colorType = getStringFromDataView(dataView, contentOffset, COLOR_TYPE_SIZE);\n if (colorType !== 'prof' && colorType !== 'rICC') {\n // Support for nclx would require some restructuring for ICC handling.\n // Probably do it as a separate feature instead of combining with ICC.\n // Exiftool groups it under QuickTime. The test file test.avif has nclx.\n return undefined;\n }\n\n return {\n offset: contentOffset + COLOR_TYPE_SIZE,\n length: dataView.getUint32(contentOffset + COLOR_TYPE_SIZE),\n chunkNumber: 1,\n chunksTotal: 1\n };\n}\n\nfunction parseMetadataBox(dataView, startOffset, contentOffset, length) {\n const FLAGS_SIZE = 3;\n\n return {\n type: 'meta',\n subBoxes: parseSubBoxes(dataView, contentOffset + FLAGS_SIZE, length - (contentOffset + FLAGS_SIZE - startOffset)),\n length\n };\n}\n\n/**\n * @param {DataView} dataView\n * @param {number} offset The offset to start parsing from.\n * @param {number} length The length of all sub boxes combined.\n * @return {Array<Object>}\n */\nfunction parseSubBoxes(dataView, offset, length) {\n const ACCEPTED_ITEM_INFO_TYPES = [\n ITEM_INFO_TYPE_EXIF,\n ITEM_INFO_TYPE_MIME,\n ];\n\n const subBoxes = [];\n let currentOffset = offset;\n while (currentOffset < offset + length) {\n const box = parseBox(dataView, currentOffset);\n if (box === undefined) {\n break;\n }\n if (box.type !== undefined && (box.itemType === undefined || ACCEPTED_ITEM_INFO_TYPES.indexOf(box.itemType) !== -1)) {\n subBoxes.push(box);\n }\n currentOffset += box.length;\n }\n return subBoxes;\n}\n\nfunction parseItemInformationBox(dataView, startOffset, version, contentOffset, length) {\n const {offsets} = getItemInformationBoxOffsetsAndSizes(version, contentOffset);\n\n return {\n type: 'iinf',\n itemInfos: parseSubBoxes(dataView, offsets.itemInfos, length - (offsets.itemInfos - startOffset)),\n length\n };\n}\n\nfunction getItemInformationBoxOffsetsAndSizes(version, contentOffset) {\n const FLAGS_SIZE = 3;\n\n const offsets = {entryCount: contentOffset + FLAGS_SIZE};\n const sizes = {};\n\n if (version === 0) {\n sizes.entryCount = 2;\n } else {\n sizes.entryCount = 4;\n }\n\n offsets.itemInfos = offsets.entryCount + sizes.entryCount;\n\n return {offsets};\n}\n\nfunction parseItemInformationEntryBox(dataView, startOffset, version, contentOffset, length) {\n const FLAGS_SIZE = 3;\n\n contentOffset += FLAGS_SIZE;\n const entry = {type: 'infe', length};\n\n if (version === 0 || version === 1) {\n entry.itemId = dataView.getUint16(contentOffset);\n contentOffset += 2;\n entry.itemProtectionIndex = dataView.getUint16(contentOffset);\n contentOffset += 2;\n entry.itemName = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.itemName.length + 1;\n // entry.contentType = getNullTerminatedStringFromDataView(dataView, offset);\n // offset += entry.contentType.length + 1;\n // Since contentEncoding is optional we need to check the offset against length here.\n // entry.contentEncoding = getNullTerminatedStringFromDataView(dataView, offset);\n // offset += entry.contentEncoding.length + 1;\n }\n // The following code should be correct but we currently don't need it.\n // if (version === 1) {\n // // Everything here is optional, check the offset against length.\n // entry.extensionType = dataView.getUint32(contentOffset);\n // contentOffset += 4;\n // if (entry.extensionType === EXTENSION_TYPE_FDEL) {\n // entry.contentLocation = getNullTerminatedStringFromDataView(dataView, contentOffset);\n // contentOffset += entry.contentLocation.length + 1;\n // entry.contentMd5 = getNullTerminatedStringFromDataView(dataView, contentOffset);\n // contentOffset += entry.contentMd5.length + 1;\n // entry.contentLength = get64BitValue(dataView, contentOffset);\n // contentOffset += 8;\n // entry.transferLength = get64BitValue(dataView, contentOffset);\n // contentOffset += 8;\n // entry.entryCount = dataView.getUint8(contentOffset);\n // contentOffset += 1;\n // entry.entries = [];\n // for (let i = 0; i < entry.entryCount; i++) {\n // entry.entries.push({groupId: dataView.getUint32(contentOffset)});\n // contentOffset += 4;\n // }\n // }\n // }\n if (version >= 2) {\n if (version === 2) {\n entry.itemId = dataView.getUint16(contentOffset);\n contentOffset += 2;\n } else if (version === 3) {\n entry.itemId = dataView.getUint32(contentOffset);\n contentOffset += 4;\n }\n entry.itemProtectionIndex = dataView.getUint16(contentOffset);\n contentOffset += 2;\n // entry.itemTypeAscii = getStringFromDataView(dataView, offset, 4); // For testing.\n entry.itemType = dataView.getUint32(contentOffset);\n contentOffset += 4;\n entry.itemName = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.itemName.length + 1;\n if (entry.itemType === ITEM_INFO_TYPE_MIME) {\n entry.contentType = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.contentType.length + 1;\n if (startOffset + length > contentOffset) {\n entry.contentEncoding = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.contentEncoding.length + 1;\n }\n } else if (entry.itemType === ITEM_INFO_TYPE_URI) {\n entry.itemUri = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.itemUri.length + 1;\n }\n }\n return entry;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {parseBox, findOffsets} from './image-header-iso-bmff.js';\n\nexport default {\n isHeicFile,\n findHeicOffsets\n};\n\n/**\n * Checks if the provided data view represents a HEIC/HEIF file.\n *\n * @param {DataView} dataView - The data view to check.\n * @returns {boolean} True if the data view represents a HEIC/HEIF file, false otherwise.\n */\nfunction isHeicFile(dataView) {\n if (!dataView) {\n return false;\n }\n\n const HEIC_MAJOR_BRANDS = ['heic', 'heix', 'hevc', 'hevx', 'heim', 'heis', 'hevm', 'hevs', 'mif1'];\n\n try {\n const headerBox = parseBox(dataView, 0);\n return headerBox && HEIC_MAJOR_BRANDS.indexOf(headerBox.majorBrand) !== -1;\n } catch (error) {\n return false;\n }\n}\n\n/**\n * Finds the offsets of a HEIC file in the provided data view.\n *\n * @param {DataView} dataView - The data view to find offsets in.\n * @returns {Object} An object containing the offsets of the TIFF header, XMP chunks, ICC chunks, and a boolean indicating if any of these exist.\n */\nfunction findHeicOffsets(dataView) {\n return findOffsets(dataView);\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// Specification:\n// https://aomediacodec.github.io/av1-avif\n\nimport {parseBox, findOffsets} from './image-header-iso-bmff.js';\n\nexport default {\n isAvifFile,\n findAvifOffsets\n};\n\n/**\n * Checks if the provided data view represents an AVIF file.\n *\n * @param {DataView} dataView - The data view to check.\n * @returns {boolean} True if the data view represents an AVIF file, false otherwise.\n */\nfunction isAvifFile(dataView) {\n if (!dataView) {\n return false;\n }\n\n try {\n const headerBox = parseBox(dataView, 0);\n return headerBox && headerBox.majorBrand === 'avif';\n } catch (error) {\n return false;\n }\n}\n\n/**\n * Finds the offsets of an AVIF file in the provided data view.\n *\n * @param {DataView} dataView - The data view to find offsets in.\n * @returns {Object} An object containing the offsets of the TIFF header, XMP chunks, ICC chunks, and a boolean indicating if any of these exist.\n */\nfunction findAvifOffsets(dataView) {\n return findOffsets(dataView);\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isWebpFile,\n findOffsets\n};\n\nfunction isWebpFile(dataView) {\n const RIFF_ID_OFFSET = 0;\n const RIFF_ID = 'RIFF';\n const WEBP_MARKER_OFFSET = 8;\n const WEBP_MARKER = 'WEBP';\n\n return !!dataView && getStringFromDataView(dataView, RIFF_ID_OFFSET, RIFF_ID.length) === RIFF_ID\n && getStringFromDataView(dataView, WEBP_MARKER_OFFSET, WEBP_MARKER.length) === WEBP_MARKER;\n}\n\nfunction findOffsets(dataView) {\n const SUB_CHUNK_START_OFFSET = 12;\n const CHUNK_SIZE_OFFSET = 4;\n const EXIF_IDENTIFIER = 'Exif\\x00\\x00';\n const CHUNK_HEADER_SIZE = 8;\n\n let offset = SUB_CHUNK_START_OFFSET;\n let hasAppMarkers = false;\n let tiffHeaderOffset;\n let xmpChunks;\n let iccChunks;\n let vp8xChunkOffset;\n\n while (offset + CHUNK_HEADER_SIZE < dataView.byteLength) {\n const chunkId = getStringFromDataView(dataView, offset, 4);\n const chunkSize = dataView.getUint32(offset + CHUNK_SIZE_OFFSET, true);\n\n if (Constants.USE_EXIF && (chunkId === 'EXIF')) {\n hasAppMarkers = true;\n if (getStringFromDataView(dataView, offset + CHUNK_HEADER_SIZE, EXIF_IDENTIFIER.length) === EXIF_IDENTIFIER) {\n tiffHeaderOffset = offset + CHUNK_HEADER_SIZE + EXIF_IDENTIFIER.length;\n } else {\n tiffHeaderOffset = offset + CHUNK_HEADER_SIZE;\n }\n } else if (Constants.USE_XMP && (chunkId === 'XMP ')) {\n hasAppMarkers = true;\n xmpChunks = [{\n dataOffset: offset + CHUNK_HEADER_SIZE,\n length: chunkSize\n }];\n } else if (Constants.USE_ICC && (chunkId === 'ICCP')) {\n hasAppMarkers = true;\n iccChunks = [{\n offset: offset + CHUNK_HEADER_SIZE,\n length: chunkSize,\n chunkNumber: 1,\n chunksTotal: 1\n }];\n } else if (chunkId === 'VP8X') {\n hasAppMarkers = true;\n vp8xChunkOffset = offset + CHUNK_HEADER_SIZE;\n }\n\n offset += CHUNK_HEADER_SIZE + (chunkSize % 2 === 0 ? chunkSize : chunkSize + 1);\n }\n\n return {\n hasAppMarkers,\n tiffHeaderOffset,\n xmpChunks,\n iccChunks,\n vp8xChunkOffset\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\n\nexport default {\n isGifFile,\n findOffsets\n};\n\nconst GIF_SIGNATURE_SIZE = 6;\nconst GIF_SIGNATURES = ['GIF87a', 'GIF89a'];\n\nfunction isGifFile(dataView) {\n return !!dataView && GIF_SIGNATURES.includes(getStringFromDataView(dataView, 0, GIF_SIGNATURE_SIZE));\n}\n\nfunction findOffsets() {\n return {\n gifHeaderOffset: 0\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Constants from './constants.js';\nimport Tiff from './image-header-tiff.js';\nimport Jpeg from './image-header-jpeg.js';\nimport Png from './image-header-png.js';\nimport Heic from './image-header-heic.js';\nimport Avif from './image-header-avif.js';\nimport Webp from './image-header-webp.js';\nimport Gif from './image-header-gif.js';\nimport {objectAssign} from './utils.js';\n\nexport default {\n parseAppMarkers\n};\n\nfunction parseAppMarkers(dataView, async) {\n if (Constants.USE_TIFF && Tiff.isTiffFile(dataView)) {\n return addFileType(Tiff.findTiffOffsets(), 'tiff', 'TIFF');\n }\n\n if (Constants.USE_JPEG && Jpeg.isJpegFile(dataView)) {\n return addFileType(Jpeg.findJpegOffsets(dataView), 'jpeg', 'JPEG');\n }\n\n if (Constants.USE_PNG && Png.isPngFile(dataView)) {\n return addFileType(Png.findPngOffsets(dataView, async), 'png', 'PNG');\n }\n\n if (Constants.USE_HEIC && Heic.isHeicFile(dataView)) {\n return addFileType(Heic.findHeicOffsets(dataView), 'heic', 'HEIC');\n }\n\n if (Constants.USE_AVIF && Avif.isAvifFile(dataView)) {\n return addFileType(Avif.findAvifOffsets(dataView), 'avif', 'AVIF');\n }\n\n if (Constants.USE_WEBP && Webp.isWebpFile(dataView)) {\n return addFileType(Webp.findOffsets(dataView), 'webp', 'WebP');\n }\n\n if (Constants.USE_GIF && Gif.isGifFile(dataView)) {\n return addFileType(Gif.findOffsets(dataView), 'gif', 'GIF');\n }\n\n throw new Error('Invalid image format');\n}\n\nfunction addFileType(offsets, fileType, fileTypeDescription) {\n return objectAssign({}, offsets, {fileType: {value: fileType, description: fileTypeDescription}});\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n ApertureValue: (value) => Math.pow(Math.sqrt(2), value[0] / value[1]).toFixed(2),\n ColorSpace(value) {\n if (value === 1) {\n return 'sRGB';\n } else if (value === 0xffff) {\n return 'Uncalibrated';\n }\n return 'Unknown';\n },\n ComponentsConfiguration(value) {\n return value.map((character) => {\n if (character === 0x31) {\n return 'Y';\n } else if (character === 0x32) {\n return 'Cb';\n } else if (character === 0x33) {\n return 'Cr';\n } else if (character === 0x34) {\n return 'R';\n } else if (character === 0x35) {\n return 'G';\n } else if (character === 0x36) {\n return 'B';\n }\n }).join('');\n },\n Contrast(value) {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Soft';\n } else if (value === 2) {\n return 'Hard';\n }\n return 'Unknown';\n },\n CustomRendered(value) {\n if (value === 0) {\n return 'Normal process';\n } else if (value === 1) {\n return 'Custom process';\n }\n return 'Unknown';\n },\n ExposureMode(value) {\n if (value === 0) {\n return 'Auto exposure';\n } else if (value === 1) {\n return 'Manual exposure';\n } else if (value === 2) {\n return 'Auto bracket';\n }\n return 'Unknown';\n },\n ExposureProgram(value) {\n if (value === 0) {\n return 'Undefined';\n } else if (value === 1) {\n return 'Manual';\n } else if (value === 2) {\n return 'Normal program';\n } else if (value === 3) {\n return 'Aperture priority';\n } else if (value === 4) {\n return 'Shutter priority';\n } else if (value === 5) {\n return 'Creative program';\n } else if (value === 6) {\n return 'Action program';\n } else if (value === 7) {\n return 'Portrait mode';\n } else if (value === 8) {\n return 'Landscape mode';\n } else if (value === 9) {\n return 'Bulb';\n }\n return 'Unknown';\n },\n ExposureTime(value) {\n if (value[0] / value[1] > 0.25) {\n const decimal = value[0] / value[1];\n if (Number.isInteger(decimal)) {\n return '' + decimal;\n }\n return decimal.toFixed(1);\n }\n if (value[0] !== 0) {\n return `1/${Math.round(value[1] / value[0])}`;\n }\n return `0/${value[1]}`;\n },\n FNumber: (value) => `f/${value[0] / value[1]}`,\n FocalLength: (value) => (value[0] / value[1]) + ' mm',\n FocalPlaneResolutionUnit(value) {\n if (value === 2) {\n return 'inches';\n } else if (value === 3) {\n return 'centimeters';\n }\n return 'Unknown';\n },\n LightSource: (value) => {\n if (value === 1) {\n return 'Daylight';\n } else if (value === 2) {\n return 'Fluorescent';\n } else if (value === 3) {\n return 'Tungsten (incandescent light)';\n } else if (value === 4) {\n return 'Flash';\n } else if (value === 9) {\n return 'Fine weather';\n } else if (value === 10) {\n return 'Cloudy weather';\n } else if (value === 11) {\n return 'Shade';\n } else if (value === 12) {\n return 'Daylight fluorescent (D 5700 – 7100K)';\n } else if (value === 13) {\n return 'Day white fluorescent (N 4600 – 5400K)';\n } else if (value === 14) {\n return 'Cool white fluorescent (W 3900 – 4500K)';\n } else if (value === 15) {\n return 'White fluorescent (WW 3200 – 3700K)';\n } else if (value === 17) {\n return 'Standard light A';\n } else if (value === 18) {\n return 'Standard light B';\n } else if (value === 19) {\n return 'Standard light C';\n } else if (value === 20) {\n return 'D55';\n } else if (value === 21) {\n return 'D65';\n } else if (value === 22) {\n return 'D75';\n } else if (value === 23) {\n return 'D50';\n } else if (value === 24) {\n return 'ISO studio tungsten';\n } else if (value === 255) {\n return 'Other light source';\n }\n return 'Unknown';\n },\n MeteringMode(value) {\n if (value === 1) {\n return 'Average';\n } else if (value === 2) {\n return 'CenterWeightedAverage';\n } else if (value === 3) {\n return 'Spot';\n } else if (value === 4) {\n return 'MultiSpot';\n } else if (value === 5) {\n return 'Pattern';\n } else if (value === 6) {\n return 'Partial';\n } else if (value === 255) {\n return 'Other';\n }\n return 'Unknown';\n },\n ResolutionUnit(value) {\n if (value === 2) {\n return 'inches';\n }\n if (value === 3) {\n return 'centimeters';\n }\n return 'Unknown';\n },\n Saturation(value) {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Low saturation';\n } else if (value === 2) {\n return 'High saturation';\n }\n return 'Unknown';\n },\n SceneCaptureType(value) {\n if (value === 0) {\n return 'Standard';\n } else if (value === 1) {\n return 'Landscape';\n } else if (value === 2) {\n return 'Portrait';\n } else if (value === 3) {\n return 'Night scene';\n }\n return 'Unknown';\n },\n Sharpness(value) {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Soft';\n } else if (value === 2) {\n return 'Hard';\n }\n return 'Unknown';\n },\n ShutterSpeedValue(value) {\n const denominator = Math.pow(2, value[0] / value[1]);\n if (denominator <= 1) {\n return `${Math.round(1 / denominator)}`;\n }\n return `1/${Math.round(denominator)}`;\n },\n WhiteBalance(value) {\n if (value === 0) {\n return 'Auto white balance';\n } else if (value === 1) {\n return 'Manual white balance';\n }\n return 'Unknown';\n },\n XResolution: (value) => '' + Math.round(value[0] / value[1]),\n YResolution: (value) => '' + Math.round(value[0] / value[1])\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 0x000b: 'ProcessingSoftware',\n 0x00fe: {\n name: 'SubfileType',\n description: (value) => ({\n 0x0: 'Full-resolution image',\n 0x1: 'Reduced-resolution image',\n 0x2: 'Single page of multi-page image',\n 0x3: 'Single page of multi-page reduced-resolution image',\n 0x4: 'Transparency mask',\n 0x5: 'Transparency mask of reduced-resolution image',\n 0x6: 'Transparency mask of multi-page image',\n 0x7: 'Transparency mask of reduced-resolution multi-page image',\n 0x10001: 'Alternate reduced-resolution image',\n 0xffffffff: 'Invalid'\n })[value] || 'Unknown'\n },\n 0x00ff: {\n name: 'OldSubfileType',\n description: (value) => ({\n 0: 'Full-resolution image',\n 1: 'Reduced-resolution image',\n 2: 'Single page of multi-page image'\n })[value] || 'Unknown'\n },\n 0x0100: 'ImageWidth',\n 0x0101: 'ImageLength',\n 0x0102: 'BitsPerSample',\n 0x0103: 'Compression',\n 0x0106: 'PhotometricInterpretation',\n 0x0107: {\n name: 'Thresholding',\n description: (value) => ({\n 1: 'No dithering or halftoning',\n 2: 'Ordered dither or halfton',\n 3: 'Randomized dither'\n })[value] || 'Unknown'\n },\n 0x0108: 'CellWidth',\n 0x0109: 'CellLength',\n 0x010a: {\n name: 'FillOrder',\n description: (value) => ({\n 1: 'Normal',\n 2: 'Reversed'\n })[value] || 'Unknown'\n },\n 0x010d: 'DocumentName',\n 0x010e: 'ImageDescription',\n 0x010f: 'Make',\n 0x0110: 'Model',\n 0x0111: 'StripOffsets',\n 0x0112: {\n name: 'Orientation',\n description: (value) => {\n if (value === 1) {\n return 'top-left';\n }\n if (value === 2) {\n return 'top-right';\n }\n if (value === 3) {\n return 'bottom-right';\n }\n if (value === 4) {\n return 'bottom-left';\n }\n if (value === 5) {\n return 'left-top';\n }\n if (value === 6) {\n return 'right-top';\n }\n if (value === 7) {\n return 'right-bottom';\n }\n if (value === 8) {\n return 'left-bottom';\n }\n return 'Undefined';\n }\n },\n 0x0115: 'SamplesPerPixel',\n 0x0116: 'RowsPerStrip',\n 0x0117: 'StripByteCounts',\n 0x0118: 'MinSampleValue',\n 0x0119: 'MaxSampleValue',\n 0x011a: {\n 'name': 'XResolution',\n 'description': TagNamesCommon.XResolution\n },\n 0x011b: {\n 'name': 'YResolution',\n 'description': TagNamesCommon.YResolution\n },\n 0x011c: 'PlanarConfiguration',\n 0x011d: 'PageName',\n 0x011e: {\n 'name': 'XPosition',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x011f: {\n 'name': 'YPosition',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x0122: {\n name: 'GrayResponseUnit',\n description: (value) => ({\n 1: '0.1',\n 2: '0.001',\n 3: '0.0001',\n 4: '1e-05',\n 5: '1e-06'\n })[value] || 'Unknown'\n },\n 0x0128: {\n name: 'ResolutionUnit',\n description: TagNamesCommon.ResolutionUnit\n },\n 0x0129: 'PageNumber',\n 0x012d: 'TransferFunction',\n 0x0131: 'Software',\n 0x0132: 'DateTime',\n 0x013b: 'Artist',\n 0x013c: 'HostComputer',\n 0x013d: 'Predictor',\n 0x013e: {\n 'name': 'WhitePoint',\n 'description': (values) => {\n return values.map((value) => `${value[0]}/${value[1]}`).join(', ');\n }\n },\n 0x013f: {\n 'name': 'PrimaryChromaticities',\n 'description': (values) => {\n return values.map((value) => `${value[0]}/${value[1]}`).join(', ');\n }\n },\n 0x0141: 'HalftoneHints',\n 0x0142: 'TileWidth',\n 0x0143: 'TileLength',\n 0x014a: 'A100DataOffset',\n 0x014c: {\n name: 'InkSet',\n description: (value) => ({\n 1: 'CMYK',\n 2: 'Not CMYK'\n })[value] || 'Unknown'\n },\n 0x0151: 'TargetPrinter',\n 0x0152: {\n name: 'ExtraSamples',\n description: (value) => ({\n 0: 'Unspecified',\n 1: 'Associated Alpha',\n 2: 'Unassociated Alpha',\n })[value] || 'Unknown'\n },\n 0x0153: {\n name: 'SampleFormat',\n description: (value) => {\n const formats = {\n 1: 'Unsigned',\n 2: 'Signed',\n 3: 'Float',\n 4: 'Undefined',\n 5: 'Complex int',\n 6: 'Complex float',\n };\n if (!Array.isArray(value)) {\n return 'Unknown';\n }\n return value.map((sample) => formats[sample] || 'Unknown').join(', ');\n }\n },\n 0x0201: 'JPEGInterchangeFormat',\n 0x0202: 'JPEGInterchangeFormatLength',\n 0x0211: {\n 'name': 'YCbCrCoefficients',\n 'description': (values) => {\n return values.map((value) => '' + value[0] / value[1]).join('/');\n }\n },\n 0x0212: 'YCbCrSubSampling',\n 0x0213: {\n name: 'YCbCrPositioning',\n description: (value) => {\n if (value === 1) {\n return 'centered';\n }\n if (value === 2) {\n return 'co-sited';\n }\n return 'undefined ' + value;\n }\n },\n 0x0214: {\n 'name': 'ReferenceBlackWhite',\n 'description': (values) => {\n return values.map((value) => '' + value[0] / value[1]).join(', ');\n }\n },\n 0x02bc: 'ApplicationNotes',\n 0x4746: 'Rating',\n 0x4749: 'RatingPercent',\n 0x8298: {\n name: 'Copyright',\n description: (value) => value.join('; ')\n },\n 0x830e: 'PixelScale',\n 0x83bb: 'IPTC-NAA',\n 0x8480: 'IntergraphMatrix',\n 0x8482: 'ModelTiePoint',\n 0x8546: 'SEMInfo',\n 0x85d8: 'ModelTransform',\n 0x8649: 'PhotoshopSettings',\n 0x8769: 'Exif IFD Pointer',\n 0x8773: 'ICC_Profile',\n 0x87af: 'GeoTiffDirectory',\n 0x87b0: 'GeoTiffDoubleParams',\n 0x87b1: 'GeoTiffAsciiParams',\n 0x8825: 'GPS Info IFD Pointer',\n 0x9c9b: 'XPTitle',\n 0x9c9c: 'XPComment',\n 0x9c9d: 'XPAuthor',\n 0x9c9e: 'XPKeywords',\n 0x9c9f: 'XPSubject',\n 0xa480: 'GDALMetadata',\n 0xa481: 'GDALNoData',\n 0xc4a5: 'PrintIM',\n 0xc613: 'DNGBackwardVersion',\n 0xc614: 'UniqueCameraModel',\n 0xc615: 'LocalizedCameraModel',\n 0xc621: 'ColorMatrix1',\n 0xc622: 'ColorMatrix2',\n 0xc623: 'CameraCalibration1',\n 0xc624: 'CameraCalibration2',\n 0xc625: 'ReductionMatrix1',\n 0xc626: 'ReductionMatrix2',\n 0xc627: 'AnalogBalance',\n 0xc628: 'AsShotNeutral',\n 0xc629: 'AsShotWhiteXY',\n 0xc62a: 'BaselineExposure',\n 0xc62b: 'BaselineNoise',\n 0xc62c: 'BaselineSharpness',\n 0xc62e: 'LinearResponseLimit',\n 0xc62f: 'CameraSerialNumber',\n 0xc630: 'DNGLensInfo',\n 0xc633: 'ShadowScale',\n 0xc635: {\n name: 'MakerNoteSafety',\n description: (value) => ({\n 0: 'Unsafe',\n 1: 'Safe'\n })[value] || 'Unknown'\n },\n 0xc65a: {\n name: 'CalibrationIlluminant1',\n description: TagNamesCommon['LightSource']\n },\n 0xc65b: {\n name: 'CalibrationIlluminant2',\n description: TagNamesCommon['LightSource']\n },\n 0xc65d: 'RawDataUniqueID',\n 0xc68b: 'OriginalRawFileName',\n 0xc68c: 'OriginalRawFileData',\n 0xc68f: 'AsShotICCProfile',\n 0xc690: 'AsShotPreProfileMatrix',\n 0xc691: 'CurrentICCProfile',\n 0xc692: 'CurrentPreProfileMatrix',\n 0xc6bf: 'ColorimetricReference',\n 0xc6c5: 'SRawType',\n 0xc6d2: 'PanasonicTitle',\n 0xc6d3: 'PanasonicTitle2',\n 0xc6f3: 'CameraCalibrationSig',\n 0xc6f4: 'ProfileCalibrationSig',\n 0xc6f5: 'ProfileIFD',\n 0xc6f6: 'AsShotProfileName',\n 0xc6f8: 'ProfileName',\n 0xc6f9: 'ProfileHueSatMapDims',\n 0xc6fa: 'ProfileHueSatMapData1',\n 0xc6fb: 'ProfileHueSatMapData2',\n 0xc6fc: 'ProfileToneCurve',\n 0xc6fd: {\n name: 'ProfileEmbedPolicy',\n description: (value) => ({\n 0: 'Allow Copying',\n 1: 'Embed if Used',\n 2: 'Never Embed',\n 3: 'No Restrictions'\n })[value] || 'Unknown'\n },\n 0xc6fe: 'ProfileCopyright',\n 0xc714: 'ForwardMatrix1',\n 0xc715: 'ForwardMatrix2',\n 0xc716: 'PreviewApplicationName',\n 0xc717: 'PreviewApplicationVersion',\n 0xc718: 'PreviewSettingsName',\n 0xc719: 'PreviewSettingsDigest',\n 0xc71a: {\n name: 'PreviewColorSpace',\n description: (value) => ({\n 1: 'Gray Gamma 2.2',\n 2: 'sRGB',\n 3: 'Adobe RGB',\n 4: 'ProPhoto RGB'\n })[value] || 'Unknown'\n },\n 0xc71b: 'PreviewDateTime',\n 0xc71c: 'RawImageDigest',\n 0xc71d: 'OriginalRawFileDigest',\n 0xc725: 'ProfileLookTableDims',\n 0xc726: 'ProfileLookTableData',\n 0xc763: 'TimeCodes',\n 0xc764: 'FrameRate',\n 0xc772: 'TStop',\n 0xc789: 'ReelName',\n 0xc791: 'OriginalDefaultFinalSize',\n 0xc792: 'OriginalBestQualitySize',\n 0xc793: 'OriginalDefaultCropSize',\n 0xc7a1: 'CameraLabel',\n 0xc7a3: {\n name: 'ProfileHueSatMapEncoding',\n description: (value) => ({\n 0: 'Linear',\n 1: 'sRGB'\n })[value] || 'Unknown'\n },\n 0xc7a4: {\n name: 'ProfileLookTableEncoding',\n description: (value) => ({\n 0: 'Linear',\n 1: 'sRGB'\n })[value] || 'Unknown'\n },\n 0xc7a5: 'BaselineExposureOffset',\n 0xc7a6: {\n name: 'DefaultBlackRender',\n description: (value) => ({\n 0: 'Auto',\n 1: 'None'\n })[value] || 'Unknown'\n },\n 0xc7a7: 'NewRawImageDigest',\n 0xc7a8: 'RawToPreviewGain'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue, getEncodedString} from './tag-names-utils.js';\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 0x829a: {\n 'name': 'ExposureTime',\n 'description': TagNamesCommon.ExposureTime\n },\n 0x829d: {\n 'name': 'FNumber',\n 'description': TagNamesCommon.FNumber\n },\n 0x8822: {\n 'name': 'ExposureProgram',\n 'description': TagNamesCommon.ExposureProgram\n },\n 0x8824: 'SpectralSensitivity',\n 0x8827: 'ISOSpeedRatings',\n 0x8828: {\n 'name': 'OECF',\n 'description': () => '[Raw OECF table data]'\n },\n 0x882a: 'TimeZoneOffset',\n 0x882b: 'SelfTimerMode',\n 0x8830: {\n name: 'SensitivityType',\n description: (value) => ({\n 1: 'Standard Output Sensitivity',\n 2: 'Recommended Exposure Index',\n 3: 'ISO Speed',\n 4: 'Standard Output Sensitivity and Recommended Exposure Index',\n 5: 'Standard Output Sensitivity and ISO Speed',\n 6: 'Recommended Exposure Index and ISO Speed',\n 7: 'Standard Output Sensitivity, Recommended Exposure Index and ISO Speed'\n })[value] || 'Unknown'\n },\n 0x8831: 'StandardOutputSensitivity',\n 0x8832: 'RecommendedExposureIndex',\n 0x8833: 'ISOSpeed',\n 0x8834: 'ISOSpeedLatitudeyyy',\n 0x8835: 'ISOSpeedLatitudezzz',\n 0x9000: {\n 'name': 'ExifVersion',\n 'description': (value) => getStringValue(value)\n },\n 0x9003: 'DateTimeOriginal',\n 0x9004: 'DateTimeDigitized',\n 0x9009: 'GooglePlusUploadCode',\n 0x9010: 'OffsetTime',\n 0x9011: 'OffsetTimeOriginal',\n 0x9012: 'OffsetTimeDigitized',\n 0x9101: {\n 'name': 'ComponentsConfiguration',\n 'description': TagNamesCommon.ComponentsConfiguration\n },\n 0x9102: 'CompressedBitsPerPixel',\n 0x9201: {\n 'name': 'ShutterSpeedValue',\n 'description': TagNamesCommon.ShutterSpeedValue\n },\n 0x9202: {\n 'name': 'ApertureValue',\n 'description': TagNamesCommon.ApertureValue\n },\n 0x9203: 'BrightnessValue',\n 0x9204: 'ExposureBiasValue',\n 0x9205: {\n 'name': 'MaxApertureValue',\n 'description': (value) => {\n return Math.pow(Math.sqrt(2), value[0] / value[1]).toFixed(2);\n }\n },\n 0x9206: {\n 'name': 'SubjectDistance',\n 'description': (value) => (value[0] / value[1]) + ' m'\n },\n 0x9207: {\n 'name': 'MeteringMode',\n 'description': TagNamesCommon.MeteringMode\n },\n 0x9208: {\n 'name': 'LightSource',\n description: TagNamesCommon.LightSource\n },\n 0x9209: {\n 'name': 'Flash',\n 'description': (value) => {\n if (value === 0x00) {\n return 'Flash did not fire';\n } else if (value === 0x01) {\n return 'Flash fired';\n } else if (value === 0x05) {\n return 'Strobe return light not detected';\n } else if (value === 0x07) {\n return 'Strobe return light detected';\n } else if (value === 0x09) {\n return 'Flash fired, compulsory flash mode';\n } else if (value === 0x0d) {\n return 'Flash fired, compulsory flash mode, return light not detected';\n } else if (value === 0x0f) {\n return 'Flash fired, compulsory flash mode, return light detected';\n } else if (value === 0x10) {\n return 'Flash did not fire, compulsory flash mode';\n } else if (value === 0x18) {\n return 'Flash did not fire, auto mode';\n } else if (value === 0x19) {\n return 'Flash fired, auto mode';\n } else if (value === 0x1d) {\n return 'Flash fired, auto mode, return light not detected';\n } else if (value === 0x1f) {\n return 'Flash fired, auto mode, return light detected';\n } else if (value === 0x20) {\n return 'No flash function';\n } else if (value === 0x41) {\n return 'Flash fired, red-eye reduction mode';\n } else if (value === 0x45) {\n return 'Flash fired, red-eye reduction mode, return light not detected';\n } else if (value === 0x47) {\n return 'Flash fired, red-eye reduction mode, return light detected';\n } else if (value === 0x49) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode';\n } else if (value === 0x4d) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected';\n } else if (value === 0x4f) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected';\n } else if (value === 0x59) {\n return 'Flash fired, auto mode, red-eye reduction mode';\n } else if (value === 0x5d) {\n return 'Flash fired, auto mode, return light not detected, red-eye reduction mode';\n } else if (value === 0x5f) {\n return 'Flash fired, auto mode, return light detected, red-eye reduction mode';\n }\n return 'Unknown';\n }\n },\n 0x920a: {\n 'name': 'FocalLength',\n 'description': TagNamesCommon.FocalLength\n },\n 0x9211: 'ImageNumber',\n 0x9212: {\n name: 'SecurityClassification',\n description: (value) => ({\n 'C': 'Confidential',\n 'R': 'Restricted',\n 'S': 'Secret',\n 'T': 'Top Secret',\n 'U': 'Unclassified'\n })[value] || 'Unknown'\n },\n 0x9213: 'ImageHistory',\n 0x9214: {\n 'name': 'SubjectArea',\n 'description': (value) => {\n if (value.length === 2) {\n return `Location; X: ${value[0]}, Y: ${value[1]}`;\n } else if (value.length === 3) {\n return `Circle; X: ${value[0]}, Y: ${value[1]}, diameter: ${value[2]}`;\n } else if (value.length === 4) {\n return `Rectangle; X: ${value[0]}, Y: ${value[1]}, width: ${value[2]}, height: ${value[3]}`;\n }\n return 'Unknown';\n }\n },\n 0x927c: {\n 'name': 'MakerNote',\n 'description': () => '[Raw maker note data]'\n },\n 0x9286: {\n 'name': 'UserComment',\n 'description': getEncodedString\n },\n 0x9290: 'SubSecTime',\n 0x9291: 'SubSecTimeOriginal',\n 0x9292: 'SubSecTimeDigitized',\n 0x935c: 'ImageSourceData',\n 0x9400: {\n 'name': 'AmbientTemperature',\n 'description': (value) => (value[0] / value[1]) + ' °C'\n },\n 0x9401: {\n 'name': 'Humidity',\n 'description': (value) => (value[0] / value[1]) + ' %'\n },\n 0x9402: {\n 'name': 'Pressure',\n 'description': (value) => (value[0] / value[1]) + ' hPa'\n },\n 0x9403: {\n 'name': 'WaterDepth',\n 'description': (value) => (value[0] / value[1]) + ' m'\n },\n 0x9404: {\n 'name': 'Acceleration',\n 'description': (value) => (value[0] / value[1]) + ' mGal'\n },\n 0x9405: {\n 'name': 'CameraElevationAngle',\n 'description': (value) => (value[0] / value[1]) + ' °'\n },\n 0xa000: {\n 'name': 'FlashpixVersion',\n 'description': (value) => value.map((charCode) => String.fromCharCode(charCode)).join('')\n },\n 0xa001: {\n 'name': 'ColorSpace',\n 'description': TagNamesCommon.ColorSpace\n },\n 0xa002: 'PixelXDimension',\n 0xa003: 'PixelYDimension',\n 0xa004: 'RelatedSoundFile',\n 0xa005: 'Interoperability IFD Pointer',\n 0xa20b: 'FlashEnergy',\n 0xa20c: {\n 'name': 'SpatialFrequencyResponse',\n 'description': () => '[Raw SFR table data]'\n },\n 0xa20e: 'FocalPlaneXResolution',\n 0xa20f: 'FocalPlaneYResolution',\n 0xa210: {\n 'name': 'FocalPlaneResolutionUnit',\n 'description': TagNamesCommon.FocalPlaneResolutionUnit\n },\n 0xa214: {\n 'name': 'SubjectLocation',\n 'description': ([x, y]) => `X: ${x}, Y: ${y}`\n },\n 0xa215: 'ExposureIndex',\n 0xa217: {\n 'name': 'SensingMethod',\n 'description': (value) => {\n if (value === 1) {\n return 'Undefined';\n } else if (value === 2) {\n return 'One-chip color area sensor';\n } else if (value === 3) {\n return 'Two-chip color area sensor';\n } else if (value === 4) {\n return 'Three-chip color area sensor';\n } else if (value === 5) {\n return 'Color sequential area sensor';\n } else if (value === 7) {\n return 'Trilinear sensor';\n } else if (value === 8) {\n return 'Color sequential linear sensor';\n }\n return 'Unknown';\n }\n },\n 0xa300: {\n 'name': 'FileSource',\n 'description': (value) => {\n if (value === 3) {\n return 'DSC';\n }\n return 'Unknown';\n }\n },\n 0xa301: {\n 'name': 'SceneType',\n 'description': (value) => {\n if (value === 1) {\n return 'A directly photographed image';\n }\n return 'Unknown';\n }\n },\n 0xa302: {\n 'name': 'CFAPattern',\n 'description': () => '[Raw CFA pattern table data]'\n },\n 0xa401: {\n 'name': 'CustomRendered',\n 'description': TagNamesCommon.CustomRendered\n },\n 0xa402: {\n 'name': 'ExposureMode',\n 'description': TagNamesCommon.ExposureMode\n },\n 0xa403: {\n 'name': 'WhiteBalance',\n 'description': TagNamesCommon.WhiteBalance\n },\n 0xa404: {\n 'name': 'DigitalZoomRatio',\n 'description': (value) => {\n if (value[0] === 0) {\n return 'Digital zoom was not used';\n }\n return '' + (value[0] / value[1]);\n }\n },\n 0xa405: {\n 'name': 'FocalLengthIn35mmFilm',\n 'description': (value) => {\n if (value === 0) {\n return 'Unknown';\n }\n return value;\n }\n },\n 0xa406: {\n 'name': 'SceneCaptureType',\n 'description': TagNamesCommon.SceneCaptureType\n },\n 0xa407: {\n 'name': 'GainControl',\n 'description': (value) => {\n if (value === 0) {\n return 'None';\n } else if (value === 1) {\n return 'Low gain up';\n } else if (value === 2) {\n return 'High gain up';\n } else if (value === 3) {\n return 'Low gain down';\n } else if (value === 4) {\n return 'High gain down';\n }\n return 'Unknown';\n }\n },\n 0xa408: {\n 'name': 'Contrast',\n 'description': TagNamesCommon.Contrast\n },\n 0xa409: {\n 'name': 'Saturation',\n 'description': TagNamesCommon.Saturation\n },\n 0xa40a: {\n 'name': 'Sharpness',\n 'description': TagNamesCommon.Sharpness\n },\n 0xa40b: {\n 'name': 'DeviceSettingDescription',\n 'description': () => '[Raw device settings table data]'\n },\n 0xa40c: {\n 'name': 'SubjectDistanceRange',\n 'description': (value) => {\n if (value === 1) {\n return 'Macro';\n } else if (value === 2) {\n return 'Close view';\n } else if (value === 3) {\n return 'Distant view';\n }\n return 'Unknown';\n }\n },\n 0xa420: 'ImageUniqueID',\n 0xa430: 'CameraOwnerName',\n 0xa431: 'BodySerialNumber',\n 0xa432: {\n 'name': 'LensSpecification',\n 'description': (value) => {\n const focalLengths = `${value[0][0] / value[0][1]}-${value[1][0] / value[1][1]} mm`;\n if (value[3][1] === 0) {\n return `${focalLengths} f/?`;\n }\n return `${focalLengths} f/${1 / ((value[2][1] / value[2][1]) / (value[3][0] / value[3][1]))}`;\n }\n },\n 0xa433: 'LensMake',\n 0xa434: 'LensModel',\n 0xa435: 'LensSerialNumber',\n 0xa460: {\n name: 'CompositeImage',\n description: (value) => ({\n 1: 'Not a Composite Image',\n 2: 'General Composite Image',\n 3: 'Composite Image Captured While Shooting',\n })[value] || 'Unknown'\n },\n 0xa461: 'SourceImageNumberOfCompositeImage',\n 0xa462: 'SourceExposureTimesOfCompositeImage',\n 0xa500: 'Gamma',\n 0xea1c: 'Padding',\n 0xea1d: 'OffsetSchema',\n 0xfde8: 'OwnerName',\n 0xfde9: 'SerialNumber',\n 0xfdea: 'Lens',\n 0xfe4c: 'RawFile',\n 0xfe4d: 'Converter',\n 0xfe4e: 'WhiteBalance',\n 0xfe51: 'Exposure',\n 0xfe52: 'Shadows',\n 0xfe53: 'Brightness',\n 0xfe54: 'Contrast',\n 0xfe55: 'Saturation',\n 0xfe56: 'Sharpness',\n 0xfe57: 'Smoothness',\n 0xfe58: 'MoireFilter'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getEncodedString, getCalculatedGpsValue} from './tag-names-utils.js';\n\nexport default {\n 0x0000: {\n 'name': 'GPSVersionID',\n 'description': (value) => {\n if (value[0] === 2 && value[1] === 2 && value[2] === 0 && value[3] === 0) {\n return 'Version 2.2';\n }\n return 'Unknown';\n }\n },\n 0x0001: {\n 'name': 'GPSLatitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'N') {\n return 'North latitude';\n } else if (ref === 'S') {\n return 'South latitude';\n }\n return 'Unknown';\n }\n },\n 0x0002: {\n 'name': 'GPSLatitude',\n 'description': getCalculatedGpsValue\n },\n 0x0003: {\n 'name': 'GPSLongitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'E') {\n return 'East longitude';\n } else if (ref === 'W') {\n return 'West longitude';\n }\n return 'Unknown';\n }\n },\n 0x0004: {\n 'name': 'GPSLongitude',\n 'description': getCalculatedGpsValue\n },\n 0x0005: {\n 'name': 'GPSAltitudeRef',\n 'description': (value) => {\n if (value === 0) {\n return 'Sea level';\n } else if (value === 1) {\n return 'Sea level reference (negative value)';\n }\n return 'Unknown';\n }\n },\n 0x0006: {\n 'name': 'GPSAltitude',\n 'description': (value) => {\n return (value[0] / value[1]) + ' m';\n }\n },\n 0x0007: {\n 'name': 'GPSTimeStamp',\n 'description': (values) => {\n return values.map(([numerator, denominator]) => {\n const num = numerator / denominator;\n if (/^\\d(\\.|$)/.test(`${num}`)) {\n return `0${num}`;\n }\n return num;\n }).join(':');\n }\n },\n 0x0008: 'GPSSatellites',\n 0x0009: {\n 'name': 'GPSStatus',\n 'description': (value) => {\n const status = value.join('');\n if (status === 'A') {\n return 'Measurement in progress';\n } else if (status === 'V') {\n return 'Measurement Interoperability';\n }\n return 'Unknown';\n }\n },\n 0x000a: {\n 'name': 'GPSMeasureMode',\n 'description': (value) => {\n const mode = value.join('');\n if (mode === '2') {\n return '2-dimensional measurement';\n } else if (mode === '3') {\n return '3-dimensional measurement';\n }\n return 'Unknown';\n }\n },\n 0x000b: 'GPSDOP',\n 0x000c: {\n 'name': 'GPSSpeedRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'K') {\n return 'Kilometers per hour';\n } else if (ref === 'M') {\n return 'Miles per hour';\n } else if (ref === 'N') {\n return 'Knots';\n }\n return 'Unknown';\n }\n },\n 0x000d: 'GPSSpeed',\n 0x000e: {\n 'name': 'GPSTrackRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x000f: 'GPSTrack',\n 0x0010: {\n 'name': 'GPSImgDirectionRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x0011: 'GPSImgDirection',\n 0x0012: 'GPSMapDatum',\n 0x0013: {\n 'name': 'GPSDestLatitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'N') {\n return 'North latitude';\n } else if (ref === 'S') {\n return 'South latitude';\n }\n return 'Unknown';\n }\n },\n 0x0014: {\n 'name': 'GPSDestLatitude',\n 'description': (value) => {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n }\n },\n 0x0015: {\n 'name': 'GPSDestLongitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'E') {\n return 'East longitude';\n } else if (ref === 'W') {\n return 'West longitude';\n }\n return 'Unknown';\n }\n },\n 0x0016: {\n 'name': 'GPSDestLongitude',\n 'description': (value) => {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n }\n },\n 0x0017: {\n 'name': 'GPSDestBearingRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x0018: 'GPSDestBearing',\n 0x0019: {\n 'name': 'GPSDestDistanceRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'K') {\n return 'Kilometers';\n } else if (ref === 'M') {\n return 'Miles';\n } else if (ref === 'N') {\n return 'Knots';\n }\n return 'Unknown';\n }\n },\n 0x001a: 'GPSDestDistance',\n 0x001b: {\n 'name': 'GPSProcessingMethod',\n 'description': getEncodedString\n },\n 0x001c: {\n 'name': 'GPSAreaInformation',\n 'description': getEncodedString\n },\n 0x001d: 'GPSDateStamp',\n 0x001e: {\n 'name': 'GPSDifferential',\n 'description': (value) => {\n if (value === 0) {\n return 'Measurement without differential correction';\n } else if (value === 1) {\n return 'Differential correction applied';\n }\n return 'Unknown';\n }\n },\n 0x001f: 'GPSHPositioningError'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 0x0001: 'InteroperabilityIndex',\n 0x0002: {\n name: 'InteroperabilityVersion',\n description: (value) => getStringValue(value)\n },\n 0x1000: 'RelatedImageFileFormat',\n 0x1001: 'RelatedImageWidth',\n 0x1002: 'RelatedImageHeight'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 0xb000: {\n 'name': 'MPFVersion',\n 'description': (value) => getStringValue(value)\n },\n 0xb001: 'NumberOfImages',\n 0xb002: 'MPEntry',\n 0xb003: 'ImageUIDList',\n 0xb004: 'TotalFrames'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {objectAssign} from './utils.js';\nimport Constants from './constants.js';\nimport TagNames0thIfd from './tag-names-0th-ifd.js';\nimport TagNamesExifIfd from './tag-names-exif-ifd.js';\nimport TagNamesGpsIfd from './tag-names-gps-ifd.js';\nimport TagNamesInteroperabilityIfd from './tag-names-interoperability-ifd.js';\nimport TagNamesMpfIfd from './tag-names-mpf-ifd.js';\n\nconst tagNames0thExifIfds = objectAssign({}, TagNames0thIfd, TagNamesExifIfd);\n\nexport const IFD_TYPE_0TH = '0th';\nexport const IFD_TYPE_1ST = '1st';\nexport const IFD_TYPE_EXIF = 'exif';\nexport const IFD_TYPE_GPS = 'gps';\nexport const IFD_TYPE_INTEROPERABILITY = 'interoperability';\nexport const IFD_TYPE_MPF = 'mpf';\n\nexport default {\n [IFD_TYPE_0TH]: tagNames0thExifIfds,\n [IFD_TYPE_1ST]: TagNames0thIfd,\n [IFD_TYPE_EXIF]: tagNames0thExifIfds,\n [IFD_TYPE_GPS]: TagNamesGpsIfd,\n [IFD_TYPE_INTEROPERABILITY]: TagNamesInteroperabilityIfd,\n [IFD_TYPE_MPF]: Constants.USE_MPF ? TagNamesMpfIfd : {},\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\n\nconst typeSizes = {\n 1: 1, // BYTE\n 2: 1, // ASCII\n 3: 2, // SHORT\n 4: 4, // LONG\n 5: 8, // RATIONAL\n 7: 1, // UNDEFINED\n 9: 4, // SLONG\n 10: 8, // SRATIONAL\n 13: 4 // IFD\n};\n\nconst tagTypes = {\n 'BYTE': 1,\n 'ASCII': 2,\n 'SHORT': 3,\n 'LONG': 4,\n 'RATIONAL': 5,\n 'UNDEFINED': 7,\n 'SLONG': 9,\n 'SRATIONAL': 10,\n 'IFD': 13\n};\n\nexport default {\n getAsciiValue,\n getByteAt,\n getAsciiAt,\n getShortAt,\n getLongAt,\n getRationalAt,\n getUndefinedAt,\n getSlongAt,\n getSrationalAt,\n getIfdPointerAt,\n typeSizes,\n tagTypes,\n getTypeSize\n};\n\nfunction getAsciiValue(charArray) {\n return charArray.map((charCode) => String.fromCharCode(charCode));\n}\n\nfunction getByteAt(dataView, offset) {\n return dataView.getUint8(offset);\n}\n\nfunction getAsciiAt(dataView, offset) {\n return dataView.getUint8(offset);\n}\n\nfunction getShortAt(dataView, offset, byteOrder) {\n return dataView.getUint16(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getLongAt(dataView, offset, byteOrder) {\n return dataView.getUint32(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getRationalAt(dataView, offset, byteOrder) {\n return [getLongAt(dataView, offset, byteOrder), getLongAt(dataView, offset + 4, byteOrder)];\n}\n\nfunction getUndefinedAt(dataView, offset) {\n return getByteAt(dataView, offset);\n}\n\nfunction getSlongAt(dataView, offset, byteOrder) {\n return dataView.getInt32(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getSrationalAt(dataView, offset, byteOrder) {\n return [getSlongAt(dataView, offset, byteOrder), getSlongAt(dataView, offset + 4, byteOrder)];\n}\n\nfunction getIfdPointerAt(dataView, offset, byteOrder) {\n return getLongAt(dataView, offset, byteOrder);\n}\n\nfunction getTypeSize(typeName) {\n if (tagTypes[typeName] === undefined) {\n throw new Error('No such type found.');\n }\n\n return typeSizes[tagTypes[typeName]];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Constants from './constants.js';\nimport Types from './types.js';\nimport TagNames, {IFD_TYPE_0TH, IFD_TYPE_1ST} from './tag-names.js';\n\nconst getTagValueAt = {\n 1: Types.getByteAt,\n 2: Types.getAsciiAt,\n 3: Types.getShortAt,\n 4: Types.getLongAt,\n 5: Types.getRationalAt,\n 7: Types.getUndefinedAt,\n 9: Types.getSlongAt,\n 10: Types.getSrationalAt,\n 13: Types.getIfdPointerAt\n};\n\nexport function get0thIfdOffset(dataView, tiffHeaderOffset, byteOrder) {\n return tiffHeaderOffset + Types.getLongAt(dataView, tiffHeaderOffset + 4, byteOrder);\n}\n\nexport function readIfd(dataView, ifdType, tiffHeaderOffset, offset, byteOrder, includeUnknown) {\n const FIELD_COUNT_SIZE = Types.getTypeSize('SHORT');\n const FIELD_SIZE = 12;\n\n const tags = {};\n const numberOfFields = getNumberOfFields(dataView, offset, byteOrder);\n\n offset += FIELD_COUNT_SIZE;\n for (let fieldIndex = 0; fieldIndex < numberOfFields; fieldIndex++) {\n if (offset + FIELD_SIZE > dataView.byteLength) {\n break;\n }\n\n const tag = readTag(dataView, ifdType, tiffHeaderOffset, offset, byteOrder, includeUnknown);\n if (tag !== undefined) {\n tags[tag.name] = {\n 'id': tag.id,\n 'value': tag.value,\n 'description': tag.description\n };\n }\n\n offset += FIELD_SIZE;\n }\n\n if (Constants.USE_THUMBNAIL && (offset < dataView.byteLength - Types.getTypeSize('LONG'))) {\n const nextIfdOffset = Types.getLongAt(dataView, offset, byteOrder);\n if (nextIfdOffset !== 0 && ifdType === IFD_TYPE_0TH) {\n tags['Thumbnail'] = readIfd(dataView, IFD_TYPE_1ST, tiffHeaderOffset, tiffHeaderOffset + nextIfdOffset, byteOrder, true);\n }\n }\n\n return tags;\n}\n\nfunction getNumberOfFields(dataView, offset, byteOrder) {\n if (offset + Types.getTypeSize('SHORT') <= dataView.byteLength) {\n return Types.getShortAt(dataView, offset, byteOrder);\n }\n return 0;\n}\n\nfunction readTag(dataView, ifdType, tiffHeaderOffset, offset, byteOrder, includeUnknown) {\n const TAG_CODE_IPTC_NAA = 0x83bb;\n const TAG_TYPE_OFFSET = Types.getTypeSize('SHORT');\n const TAG_COUNT_OFFSET = TAG_TYPE_OFFSET + Types.getTypeSize('SHORT');\n const TAG_VALUE_OFFSET = TAG_COUNT_OFFSET + Types.getTypeSize('LONG');\n\n const tagCode = Types.getShortAt(dataView, offset, byteOrder);\n const tagType = Types.getShortAt(dataView, offset + TAG_TYPE_OFFSET, byteOrder);\n const tagCount = Types.getLongAt(dataView, offset + TAG_COUNT_OFFSET, byteOrder);\n let tagValue;\n\n if (Types.typeSizes[tagType] === undefined || (!includeUnknown && TagNames[ifdType][tagCode] === undefined)) {\n return undefined;\n }\n\n if (tagValueFitsInOffsetSlot(tagType, tagCount)) {\n tagValue = getTagValue(dataView, offset + TAG_VALUE_OFFSET, tagType, tagCount, byteOrder);\n } else {\n const tagValueOffset = Types.getLongAt(dataView, offset + TAG_VALUE_OFFSET, byteOrder);\n if (tagValueFitsInDataView(dataView, tiffHeaderOffset, tagValueOffset, tagType, tagCount)) {\n const forceByteType = tagCode === TAG_CODE_IPTC_NAA;\n tagValue = getTagValue(dataView, tiffHeaderOffset + tagValueOffset, tagType, tagCount, byteOrder, forceByteType);\n } else {\n tagValue = '<faulty value>';\n }\n }\n\n if (tagType === Types.tagTypes['ASCII']) {\n tagValue = splitNullSeparatedAsciiString(tagValue);\n tagValue = decodeAsciiValue(tagValue);\n }\n\n let tagName = `undefined-${tagCode}`;\n let tagDescription = tagValue;\n\n if (TagNames[ifdType][tagCode] !== undefined) {\n if ((TagNames[ifdType][tagCode]['name'] !== undefined) && (TagNames[ifdType][tagCode]['description'] !== undefined)) {\n tagName = TagNames[ifdType][tagCode]['name'];\n try {\n tagDescription = TagNames[ifdType][tagCode]['description'](tagValue);\n } catch (error) {\n tagDescription = getDescriptionFromTagValue(tagValue);\n }\n } else if ((tagType === Types.tagTypes['RATIONAL']) || (tagType === Types.tagTypes['SRATIONAL'])) {\n tagName = TagNames[ifdType][tagCode];\n tagDescription = '' + (tagValue[0] / tagValue[1]);\n } else {\n tagName = TagNames[ifdType][tagCode];\n tagDescription = getDescriptionFromTagValue(tagValue);\n }\n }\n\n return {\n id: tagCode,\n name: tagName,\n value: tagValue,\n description: tagDescription\n };\n}\n\nfunction tagValueFitsInOffsetSlot(tagType, tagCount) {\n return Types.typeSizes[tagType] * tagCount <= Types.getTypeSize('LONG');\n}\n\nfunction getTagValue(dataView, offset, type, count, byteOrder, forceByteType = false) {\n let value = [];\n\n if (forceByteType) {\n count = count * Types.typeSizes[type];\n type = Types.tagTypes['BYTE'];\n }\n for (let valueIndex = 0; valueIndex < count; valueIndex++) {\n value.push(getTagValueAt[type](dataView, offset, byteOrder));\n offset += Types.typeSizes[type];\n }\n\n if (type === Types.tagTypes['ASCII']) {\n value = Types.getAsciiValue(value);\n } else if (value.length === 1) {\n value = value[0];\n }\n\n return value;\n}\n\nfunction tagValueFitsInDataView(dataView, tiffHeaderOffset, tagValueOffset, tagType, tagCount) {\n return tiffHeaderOffset + tagValueOffset + Types.typeSizes[tagType] * tagCount <= dataView.byteLength;\n}\n\nfunction splitNullSeparatedAsciiString(string) {\n const tagValue = [];\n let i = 0;\n\n for (let j = 0; j < string.length; j++) {\n if (string[j] === '\\x00') {\n i++;\n continue;\n }\n if (tagValue[i] === undefined) {\n tagValue[i] = '';\n }\n tagValue[i] += string[j];\n }\n\n return tagValue;\n}\n\nfunction decodeAsciiValue(asciiValue) {\n try {\n return asciiValue.map((value) => decodeURIComponent(escape(value)));\n } catch (error) {\n return asciiValue;\n }\n}\n\nfunction getDescriptionFromTagValue(tagValue) {\n if (tagValue instanceof Array) {\n return tagValue.join(', ');\n }\n return tagValue;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {objectAssign} from './utils.js';\nimport ByteOrder from './byte-order.js';\nimport {IFD_TYPE_0TH, IFD_TYPE_EXIF, IFD_TYPE_GPS, IFD_TYPE_INTEROPERABILITY} from './tag-names.js';\nimport {readIfd, get0thIfdOffset} from './tags-helpers.js';\n\nconst EXIF_IFD_POINTER_KEY = 'Exif IFD Pointer';\nconst GPS_INFO_IFD_POINTER_KEY = 'GPS Info IFD Pointer';\nconst INTEROPERABILITY_IFD_POINTER_KEY = 'Interoperability IFD Pointer';\n\nexport default {\n read,\n};\n\nfunction read(dataView, tiffHeaderOffset, includeUnknown) {\n const byteOrder = ByteOrder.getByteOrder(dataView, tiffHeaderOffset);\n let tags = read0thIfd(dataView, tiffHeaderOffset, byteOrder, includeUnknown);\n tags = readExifIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown);\n tags = readGpsIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown);\n tags = readInteroperabilityIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown);\n\n return tags;\n}\n\nfunction read0thIfd(dataView, tiffHeaderOffset, byteOrder, includeUnknown) {\n return readIfd(dataView, IFD_TYPE_0TH, tiffHeaderOffset, get0thIfdOffset(dataView, tiffHeaderOffset, byteOrder), byteOrder, includeUnknown);\n}\n\nfunction readExifIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown) {\n if (tags[EXIF_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, IFD_TYPE_EXIF, tiffHeaderOffset, tiffHeaderOffset + tags[EXIF_IFD_POINTER_KEY].value, byteOrder, includeUnknown));\n }\n\n return tags;\n}\n\nfunction readGpsIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown) {\n if (tags[GPS_INFO_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, IFD_TYPE_GPS, tiffHeaderOffset, tiffHeaderOffset + tags[GPS_INFO_IFD_POINTER_KEY].value, byteOrder, includeUnknown));\n }\n\n return tags;\n}\n\nfunction readInteroperabilityIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown) {\n if (tags[INTEROPERABILITY_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, IFD_TYPE_INTEROPERABILITY, tiffHeaderOffset, tiffHeaderOffset + tags[INTEROPERABILITY_IFD_POINTER_KEY].value, byteOrder, includeUnknown));\n }\n\n return tags;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\nimport Types from './types.js';\nimport {IFD_TYPE_MPF} from './tag-names.js';\nimport {deferInit, getBase64Image} from './utils.js';\nimport {readIfd, get0thIfdOffset} from './tags-helpers.js';\n\nexport default {\n read\n};\n\nconst ENTRY_SIZE = 16;\n\nfunction read(dataView, dataOffset, includeUnknown) {\n const byteOrder = ByteOrder.getByteOrder(dataView, dataOffset);\n const tags = readIfd(dataView, IFD_TYPE_MPF, dataOffset, get0thIfdOffset(dataView, dataOffset, byteOrder), byteOrder, includeUnknown);\n return addMpfImages(dataView, dataOffset, tags, byteOrder);\n}\n\nfunction addMpfImages(dataView, dataOffset, tags, byteOrder) {\n if (!tags['MPEntry']) {\n return tags;\n }\n\n const images = [];\n for (let i = 0; i < Math.ceil(tags['MPEntry'].value.length / ENTRY_SIZE); i++) {\n images[i] = {};\n\n const attributes = getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE, Types.getTypeSize('LONG'), byteOrder);\n images[i]['ImageFlags'] = getImageFlags(attributes);\n images[i]['ImageFormat'] = getImageFormat(attributes);\n images[i]['ImageType'] = getImageType(attributes);\n\n const imageSize = getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 4, Types.getTypeSize('LONG'), byteOrder);\n images[i]['ImageSize'] = {\n value: imageSize,\n description: '' + imageSize\n };\n\n const imageOffset = getImageOffset(i, tags['MPEntry'], byteOrder, dataOffset);\n images[i]['ImageOffset'] = {\n value: imageOffset,\n description: '' + imageOffset\n };\n\n const dependentImage1EntryNumber =\n getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 12, Types.getTypeSize('SHORT'), byteOrder);\n images[i]['DependentImage1EntryNumber'] = {\n value: dependentImage1EntryNumber,\n description: '' + dependentImage1EntryNumber\n };\n\n const dependentImage2EntryNumber =\n getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 14, Types.getTypeSize('SHORT'), byteOrder);\n images[i]['DependentImage2EntryNumber'] = {\n value: dependentImage2EntryNumber,\n description: '' + dependentImage2EntryNumber\n };\n\n images[i].image = dataView.buffer.slice(imageOffset, imageOffset + imageSize);\n deferInit(images[i], 'base64', function () {\n return getBase64Image(this.image);\n });\n }\n\n tags['Images'] = images;\n\n return tags;\n}\n\nfunction getImageNumberValue(entries, offset, size, byteOrder) {\n if (byteOrder === ByteOrder.LITTLE_ENDIAN) {\n let value = 0;\n for (let i = 0; i < size; i++) {\n value += entries[offset + i] << (8 * i);\n }\n return value;\n }\n\n let value = 0;\n for (let i = 0; i < size; i++) {\n value += entries[offset + i] << (8 * (size - 1 - i));\n }\n return value;\n}\n\nfunction getImageFlags(attributes) {\n const flags = [\n (attributes >> 31) & 0x1,\n (attributes >> 30) & 0x1,\n (attributes >> 29) & 0x1\n ];\n\n const flagsDescription = [];\n\n if (flags[0]) {\n flagsDescription.push('Dependent Parent Image');\n }\n if (flags[1]) {\n flagsDescription.push('Dependent Child Image');\n }\n if (flags[2]) {\n flagsDescription.push('Representative Image');\n }\n\n return {\n value: flags,\n description: flagsDescription.join(', ') || 'None'\n };\n}\n\nfunction getImageFormat(attributes) {\n const imageFormat = attributes >> 24 & 0x7;\n return {\n value: imageFormat,\n description: imageFormat === 0 ? 'JPEG' : 'Unknown'\n };\n}\n\nfunction getImageType(attributes) {\n const type = attributes & 0xffffff;\n const descriptions = {\n 0x30000: 'Baseline MP Primary Image',\n 0x10001: 'Large Thumbnail (VGA equivalent)',\n 0x10002: 'Large Thumbnail (Full HD equivalent)',\n 0x20001: 'Multi-Frame Image (Panorama)',\n 0x20002: 'Multi-Frame Image (Disparity)',\n 0x20003: 'Multi-Frame Image (Multi-Angle)',\n 0x0: 'Undefined',\n };\n\n return {\n value: type,\n description: descriptions[type] || 'Unknown'\n };\n}\n\nfunction getImageOffset(imageIndex, mpEntry, byteOrder, dataOffset) {\n if (isFirstIndividualImage(imageIndex)) {\n return 0;\n }\n return getImageNumberValue(mpEntry.value, imageIndex * ENTRY_SIZE + 8, Types.getTypeSize('LONG'), byteOrder) + dataOffset;\n}\n\nfunction isFirstIndividualImage(imageIndex) {\n return imageIndex === 0;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, fileDataOffset) {\n const length = getLength(dataView, fileDataOffset);\n const numberOfColorComponents = getNumberOfColorComponents(dataView, fileDataOffset, length);\n return {\n 'Bits Per Sample': getDataPrecision(dataView, fileDataOffset, length),\n 'Image Height': getImageHeight(dataView, fileDataOffset, length),\n 'Image Width': getImageWidth(dataView, fileDataOffset, length),\n 'Color Components': numberOfColorComponents,\n 'Subsampling': numberOfColorComponents && getSubsampling(dataView, fileDataOffset, numberOfColorComponents.value, length)\n };\n}\n\nfunction getLength(dataView, fileDataOffset) {\n return Types.getShortAt(dataView, fileDataOffset);\n}\n\nfunction getDataPrecision(dataView, fileDataOffset, length) {\n const OFFSET = 2;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getImageHeight(dataView, fileDataOffset, length) {\n const OFFSET = 3;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageWidth(dataView, fileDataOffset, length) {\n const OFFSET = 5;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getNumberOfColorComponents(dataView, fileDataOffset, length) {\n const OFFSET = 7;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getSubsampling(dataView, fileDataOffset, numberOfColorComponents, length) {\n const OFFSET = 8;\n const SIZE = 3 * numberOfColorComponents;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const components = [];\n\n for (let i = 0; i < numberOfColorComponents; i++) {\n const componentOffset = fileDataOffset + OFFSET + i * 3;\n components.push([\n Types.getByteAt(dataView, componentOffset),\n Types.getByteAt(dataView, componentOffset + 1),\n Types.getByteAt(dataView, componentOffset + 2)\n ]);\n }\n\n return {\n value: components,\n description: components.length > 1 ? getComponentIds(components) + getSamplingType(components) : ''\n };\n}\n\nfunction getComponentIds(components) {\n const ids = {\n 0x01: 'Y',\n 0x02: 'Cb',\n 0x03: 'Cr',\n 0x04: 'I',\n 0x05: 'Q',\n };\n\n return components.map((compontent) => ids[compontent[0]]).join('');\n}\n\nfunction getSamplingType(components) {\n const types = {\n 0x11: '4:4:4 (1 1)',\n 0x12: '4:4:0 (1 2)',\n 0x14: '4:4:1 (1 4)',\n 0x21: '4:2:2 (2 1)',\n 0x22: '4:2:0 (2 2)',\n 0x24: '4:2:1 (2 4)',\n 0x41: '4:1:1 (4 1)',\n 0x42: '4:1:0 (4 2)'\n };\n\n if (components.length === 0 || components[0][1] === undefined || types[components[0][1]] === undefined) {\n return '';\n }\n\n return types[components[0][1]];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, jfifDataOffset) {\n const length = getLength(dataView, jfifDataOffset);\n const thumbnailWidth = getThumbnailWidth(dataView, jfifDataOffset, length);\n const thumbnailHeight = getThumbnailHeight(dataView, jfifDataOffset, length);\n const tags = {\n 'JFIF Version': getVersion(dataView, jfifDataOffset, length),\n 'Resolution Unit': getResolutionUnit(dataView, jfifDataOffset, length),\n 'XResolution': getXResolution(dataView, jfifDataOffset, length),\n 'YResolution': getYResolution(dataView, jfifDataOffset, length),\n 'JFIF Thumbnail Width': thumbnailWidth,\n 'JFIF Thumbnail Height': thumbnailHeight\n };\n\n if (thumbnailWidth !== undefined && thumbnailHeight !== undefined) {\n const thumbnail = getThumbnail(dataView, jfifDataOffset, 3 * thumbnailWidth.value * thumbnailHeight.value, length);\n if (thumbnail) {\n tags['JFIF Thumbnail'] = thumbnail;\n }\n }\n\n for (const tagName in tags) {\n if (tags[tagName] === undefined) {\n delete tags[tagName];\n }\n }\n\n return tags;\n}\n\nfunction getLength(dataView, jfifDataOffset) {\n return Types.getShortAt(dataView, jfifDataOffset);\n}\n\nfunction getVersion(dataView, jfifDataOffset, length) {\n const OFFSET = 7;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const majorVersion = Types.getByteAt(dataView, jfifDataOffset + OFFSET);\n const minorVersion = Types.getByteAt(dataView, jfifDataOffset + OFFSET + 1);\n return {\n value: majorVersion * 0x100 + minorVersion,\n description: majorVersion + '.' + minorVersion\n };\n}\n\nfunction getResolutionUnit(dataView, jfifDataOffset, length) {\n const OFFSET = 9;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: getResolutionUnitDescription(value)\n };\n}\n\nfunction getResolutionUnitDescription(value) {\n if (value === 0) {\n return 'None';\n }\n if (value === 1) {\n return 'inches';\n }\n if (value === 2) {\n return 'cm';\n }\n return 'Unknown';\n}\n\nfunction getXResolution(dataView, jfifDataOffset, length) {\n const OFFSET = 10;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getYResolution(dataView, jfifDataOffset, length) {\n const OFFSET = 12;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getThumbnailWidth(dataView, jfifDataOffset, length) {\n const OFFSET = 14;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getThumbnailHeight(dataView, jfifDataOffset, length) {\n const OFFSET = 15;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getThumbnail(dataView, jfifDataOffset, thumbnailLength, length) {\n const OFFSET = 16;\n\n if (thumbnailLength === 0 || OFFSET + thumbnailLength > length) {\n return undefined;\n }\n\n const value = dataView.buffer.slice(jfifDataOffset + OFFSET, jfifDataOffset + OFFSET + thumbnailLength);\n return {\n value,\n description: '<24-bit RGB pixel data>'\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 'iptc': {\n 0x0100: {\n 'name': 'Model Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0105: {\n 'name': 'Destination',\n 'repeatable': true\n },\n 0x0114: {\n 'name': 'File Format',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0116: {\n 'name': 'File Format Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x011e: 'Service Identifier',\n 0x0128: 'Envelope Number',\n 0x0132: 'Product ID',\n 0x013c: 'Envelope Priority',\n 0x0146: {\n 'name': 'Date Sent',\n 'description': getCreationDate\n },\n 0x0150: {\n 'name': 'Time Sent',\n 'description': getCreationTime\n },\n 0x015a: {\n 'name': 'Coded Character Set',\n 'description': getEncodingName,\n 'encoding_name': getEncodingName,\n },\n 0x0164: 'UNO',\n 0x0178: {\n 'name': 'ARM Identifier',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x017a: {\n 'name': 'ARM Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0200: {\n 'name': 'Record Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0203: 'Object Type Reference',\n 0x0204: 'Object Attribute Reference',\n 0x0205: 'Object Name',\n 0x0207: 'Edit Status',\n 0x0208: {\n 'name': 'Editorial Update',\n 'description': (value) => {\n if (getStringValue(value) === '01') {\n return 'Additional Language';\n }\n return 'Unknown';\n }\n },\n 0x020a: 'Urgency',\n 0x020c: {\n 'name': 'Subject Reference',\n 'repeatable': true,\n 'description': (value) => {\n const parts = getStringValue(value).split(':');\n return parts[2] + (parts[3] ? '/' + parts[3] : '') + (parts[4] ? '/' + parts[4] : '');\n }\n },\n 0x020f: 'Category',\n 0x0214: {\n 'name': 'Supplemental Category',\n 'repeatable': true\n },\n 0x0216: 'Fixture Identifier',\n 0x0219: {\n 'name': 'Keywords',\n 'repeatable': true\n },\n 0x021a: {\n 'name': 'Content Location Code',\n 'repeatable': true\n },\n 0x021b: {\n 'name': 'Content Location Name',\n 'repeatable': true\n },\n 0x021e: 'Release Date',\n 0x0223: 'Release Time',\n 0x0225: 'Expiration Date',\n 0x0226: 'Expiration Time',\n 0x0228: 'Special Instructions',\n 0x022a: {\n 'name': 'Action Advised',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === '01') {\n return 'Object Kill';\n } else if (string === '02') {\n return 'Object Replace';\n } else if (string === '03') {\n return 'Object Append';\n } else if (string === '04') {\n return 'Object Reference';\n }\n return 'Unknown';\n }\n },\n 0x022d: {\n 'name': 'Reference Service',\n 'repeatable': true\n },\n 0x022f: {\n 'name': 'Reference Date',\n 'repeatable': true\n },\n 0x0232: {\n 'name': 'Reference Number',\n 'repeatable': true\n },\n 0x0237: {\n 'name': 'Date Created',\n 'description': getCreationDate\n },\n 0x023c: {\n 'name': 'Time Created',\n 'description': getCreationTime\n },\n 0x023e: {\n 'name': 'Digital Creation Date',\n 'description': getCreationDate\n },\n 0x023f: {\n 'name': 'Digital Creation Time',\n 'description': getCreationTime\n },\n 0x0241: 'Originating Program',\n 0x0246: 'Program Version',\n 0x024b: {\n 'name': 'Object Cycle',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === 'a') {\n return 'morning';\n } else if (string === 'p') {\n return 'evening';\n } else if (string === 'b') {\n return 'both';\n }\n return 'Unknown';\n }\n },\n 0x0250: {\n 'name': 'By-line',\n 'repeatable': true\n },\n 0x0255: {\n 'name': 'By-line Title',\n 'repeatable': true\n },\n 0x025a: 'City',\n 0x025c: 'Sub-location',\n 0x025f: 'Province/State',\n 0x0264: 'Country/Primary Location Code',\n 0x0265: 'Country/Primary Location Name',\n 0x0267: 'Original Transmission Reference',\n 0x0269: 'Headline',\n 0x026e: 'Credit',\n 0x0273: 'Source',\n 0x0274: 'Copyright Notice',\n 0x0276: {\n 'name': 'Contact',\n 'repeatable': true\n },\n 0x0278: 'Caption/Abstract',\n 0x027a: {\n 'name': 'Writer/Editor',\n 'repeatable': true\n },\n 0x027d: {\n 'name': 'Rasterized Caption',\n 'description': (value) => value\n },\n 0x0282: 'Image Type',\n 0x0283: {\n 'name': 'Image Orientation',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === 'P') {\n return 'Portrait';\n } else if (string === 'L') {\n return 'Landscape';\n } else if (string === 'S') {\n return 'Square';\n }\n return 'Unknown';\n }\n },\n 0x0287: 'Language Identifier',\n 0x0296: {\n 'name': 'Audio Type',\n 'description': (value) => {\n const stringValue = getStringValue(value);\n const character0 = stringValue.charAt(0);\n const character1 = stringValue.charAt(1);\n let description = '';\n\n if (character0 === '1') {\n description += 'Mono';\n } else if (character0 === '2') {\n description += 'Stereo';\n }\n\n if (character1 === 'A') {\n description += ', actuality';\n } else if (character1 === 'C') {\n description += ', question and answer session';\n } else if (character1 === 'M') {\n description += ', music, transmitted by itself';\n } else if (character1 === 'Q') {\n description += ', response to a question';\n } else if (character1 === 'R') {\n description += ', raw sound';\n } else if (character1 === 'S') {\n description += ', scener';\n } else if (character1 === 'V') {\n description += ', voicer';\n } else if (character1 === 'W') {\n description += ', wrap';\n }\n\n if (description !== '') {\n return description;\n }\n return stringValue;\n }\n },\n 0x0297: {\n 'name': 'Audio Sampling Rate',\n 'description': (value) => parseInt(getStringValue(value), 10) + ' Hz'\n },\n 0x0298: {\n 'name': 'Audio Sampling Resolution',\n 'description': (value) => {\n const bits = parseInt(getStringValue(value), 10);\n return bits + (bits === 1 ? ' bit' : ' bits');\n }\n },\n 0x0299: {\n 'name': 'Audio Duration',\n 'description': (value) => {\n const duration = getStringValue(value);\n if (duration.length >= 6) {\n return duration.substr(0, 2) + ':' + duration.substr(2, 2) + ':' + duration.substr(4, 2);\n }\n return duration;\n }\n },\n 0x029a: 'Audio Outcue',\n 0x02ba: 'Short Document ID',\n 0x02bb: 'Unique Document ID',\n 0x02bc: 'Owner ID',\n 0x02c8: {\n 'name': (value) => {\n if (value.length === 2) {\n return 'ObjectData Preview File Format';\n }\n return 'Record 2 destination';\n },\n 'description': (value) => {\n if (value.length === 2) {\n const intValue = (value[0] << 8) + value[1];\n if (intValue === 0) {\n return 'No ObjectData';\n } else if (intValue === 1) {\n return 'IPTC-NAA Digital Newsphoto Parameter Record';\n } else if (intValue === 2) {\n return 'IPTC7901 Recommended Message Format';\n } else if (intValue === 3) {\n return 'Tagged Image File Format (Adobe/Aldus Image data)';\n } else if (intValue === 4) {\n return 'Illustrator (Adobe Graphics data)';\n } else if (intValue === 5) {\n return 'AppleSingle (Apple Computer Inc)';\n } else if (intValue === 6) {\n return 'NAA 89-3 (ANPA 1312)';\n } else if (intValue === 7) {\n return 'MacBinary II';\n } else if (intValue === 8) {\n return 'IPTC Unstructured Character Oriented File Format (UCOFF)';\n } else if (intValue === 9) {\n return 'United Press International ANPA 1312 variant';\n } else if (intValue === 10) {\n return 'United Press International Down-Load Message';\n } else if (intValue === 11) {\n return 'JPEG File Interchange (JFIF)';\n } else if (intValue === 12) {\n return 'Photo-CD Image-Pac (Eastman Kodak)';\n } else if (intValue === 13) {\n return 'Microsoft Bit Mapped Graphics File [*.BMP]';\n } else if (intValue === 14) {\n return 'Digital Audio File [*.WAV] (Microsoft & Creative Labs)';\n } else if (intValue === 15) {\n return 'Audio plus Moving Video [*.AVI] (Microsoft)';\n } else if (intValue === 16) {\n return 'PC DOS/Windows Executable Files [*.COM][*.EXE]';\n } else if (intValue === 17) {\n return 'Compressed Binary File [*.ZIP] (PKWare Inc)';\n } else if (intValue === 18) {\n return 'Audio Interchange File Format AIFF (Apple Computer Inc)';\n } else if (intValue === 19) {\n return 'RIFF Wave (Microsoft Corporation)';\n } else if (intValue === 20) {\n return 'Freehand (Macromedia/Aldus)';\n } else if (intValue === 21) {\n return 'Hypertext Markup Language \"HTML\" (The Internet Society)';\n } else if (intValue === 22) {\n return 'MPEG 2 Audio Layer 2 (Musicom), ISO/IEC';\n } else if (intValue === 23) {\n return 'MPEG 2 Audio Layer 3, ISO/IEC';\n } else if (intValue === 24) {\n return 'Portable Document File (*.PDF) Adobe';\n } else if (intValue === 25) {\n return 'News Industry Text Format (NITF)';\n } else if (intValue === 26) {\n return 'Tape Archive (*.TAR)';\n } else if (intValue === 27) {\n return 'Tidningarnas Telegrambyrå NITF version (TTNITF DTD)';\n } else if (intValue === 28) {\n return 'Ritzaus Bureau NITF version (RBNITF DTD)';\n } else if (intValue === 29) {\n return 'Corel Draw [*.CDR]';\n }\n return `Unknown format ${intValue}`;\n }\n return getStringValue(value);\n }\n },\n 0x02c9: {\n 'name': 'ObjectData Preview File Format Version',\n 'description': (value, tags) => {\n // Format ID, Version ID, Version Description\n const formatVersions = {\n '00': {'00': '1'},\n '01': {'01': '1', '02': '2', '03': '3', '04': '4'},\n '02': {'04': '4'},\n '03': {'01': '5.0', '02': '6.0'},\n '04': {'01': '1.40'},\n '05': {'01': '2'},\n '06': {'01': '1'},\n '11': {'01': '1.02'},\n '20': {'01': '3.1', '02': '4.0', '03': '5.0', '04': '5.5'},\n '21': {'02': '2.0'}\n };\n const stringValue = getStringValue(value);\n\n if (tags['ObjectData Preview File Format']) {\n const objectDataPreviewFileFormat = getStringValue(tags['ObjectData Preview File Format'].value);\n if (formatVersions[objectDataPreviewFileFormat]\n && formatVersions[objectDataPreviewFileFormat][stringValue]) {\n return formatVersions[objectDataPreviewFileFormat][stringValue];\n }\n }\n\n return stringValue;\n }\n },\n 0x02ca: 'ObjectData Preview Data',\n 0x070a: {\n 'name': 'Size Mode',\n 'description': (value) => {\n return (value[0]).toString();\n }\n },\n 0x0714: {\n 'name': 'Max Subfile Size',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n },\n 0x075a: {\n 'name': 'ObjectData Size Announced',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n },\n 0x075f: {\n 'name': 'Maximum ObjectData Size',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n }\n }\n};\n\nfunction getCreationDate(value) {\n const date = getStringValue(value);\n\n if (date.length >= 8) {\n return date.substr(0, 4) + '-' + date.substr(4, 2) + '-' + date.substr(6, 2);\n }\n\n return date;\n}\n\nfunction getCreationTime(value) {\n const time = getStringValue(value);\n let parsedTime = time;\n\n if (time.length >= 6) {\n parsedTime = time.substr(0, 2) + ':' + time.substr(2, 2) + ':' + time.substr(4, 2);\n if (time.length === 11) {\n parsedTime += time.substr(6, 1) + time.substr(7, 2) + ':' + time.substr(9, 2);\n }\n }\n\n return parsedTime;\n}\n\nfunction getEncodingName(value) {\n const string = getStringValue(value);\n if (string === '\\x1b%G') {\n return 'UTF-8';\n } else if (string === '\\x1b%5') {\n return 'Windows-1252';\n } else if (string === '\\x1b%/G') {\n return 'UTF-8 Level 1';\n } else if (string === '\\x1b%/H') {\n return 'UTF-8 Level 2';\n } else if (string === '\\x1b%/I') {\n return 'UTF-8 Level 3';\n } else if (string === '\\x1B/A') {\n return 'ISO-8859-1';\n } else if (string === '\\x1B/B') {\n return 'ISO-8859-2';\n } else if (string === '\\x1B/C') {\n return 'ISO-8859-3';\n } else if (string === '\\x1B/D') {\n return 'ISO-8859-4';\n } else if (string === '\\x1B/@') {\n return 'ISO-8859-5';\n } else if (string === '\\x1B/G') {\n return 'ISO-8859-6';\n } else if (string === '\\x1B/F') {\n return 'ISO-8859-7';\n } else if (string === '\\x1B/H') {\n return 'ISO-8859-8';\n }\n return 'Unknown';\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n get\n};\n\nfunction get() {\n if (typeof TextDecoder !== 'undefined') {\n return TextDecoder;\n }\n\n return undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TextDecoder from './text-decoder.js';\n\nconst TAG_HEADER_SIZE = 5;\n\nexport default {\n decode,\n TAG_HEADER_SIZE\n};\n\nfunction decode(encoding, tagValue) {\n const Decoder = TextDecoder.get();\n if ((typeof Decoder !== 'undefined') && (encoding !== undefined)) {\n try {\n return new Decoder(encoding).decode(tagValue instanceof DataView ? tagValue.buffer : Uint8Array.from(tagValue));\n } catch (error) {\n // Pass through and fall back to ASCII decoding.\n }\n }\n\n const stringValue = tagValue.map((charCode) => String.fromCharCode(charCode)).join('');\n return decodeAsciiValue(stringValue);\n}\n\nfunction decodeAsciiValue(asciiValue) {\n try {\n return decodeURIComponent(escape(asciiValue));\n } catch (error) {\n return asciiValue;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport IptcTagNames from './iptc-tag-names.js';\nimport TagDecoder from './tag-decoder.js';\n\nconst BYTES_8BIM = 0x3842494d;\nconst BYTES_8BIM_SIZE = 4;\nconst RESOURCE_BLOCK_HEADER_SIZE = BYTES_8BIM_SIZE + 8;\nconst NAA_RESOURCE_BLOCK_TYPE = 0x0404;\nconst TAG_HEADER_SIZE = 5;\n\nexport default {\n read\n};\n\nfunction read(dataView, dataOffset, includeUnknown) {\n try {\n if (Array.isArray(dataView)) {\n return parseTags(new DataView(Uint8Array.from(dataView).buffer), {size: dataView.length}, 0, includeUnknown);\n }\n const {naaBlock, dataOffset: newDataOffset} = getNaaResourceBlock(dataView, dataOffset);\n return parseTags(dataView, naaBlock, newDataOffset, includeUnknown);\n } catch (error) {\n return {};\n }\n}\n\nfunction getNaaResourceBlock(dataView, dataOffset) {\n while (dataOffset + RESOURCE_BLOCK_HEADER_SIZE <= dataView.byteLength) {\n const resourceBlock = getResourceBlock(dataView, dataOffset);\n if (isNaaResourceBlock(resourceBlock)) {\n return {naaBlock: resourceBlock, dataOffset: dataOffset + RESOURCE_BLOCK_HEADER_SIZE};\n }\n dataOffset += RESOURCE_BLOCK_HEADER_SIZE + resourceBlock.size + getBlockPadding(resourceBlock);\n }\n throw new Error('No IPTC NAA resource block.');\n}\n\nfunction getResourceBlock(dataView, dataOffset) {\n const RESOURCE_BLOCK_SIZE_OFFSET = 10;\n\n if (dataView.getUint32(dataOffset, false) !== BYTES_8BIM) {\n throw new Error('Not an IPTC resource block.');\n }\n\n return {\n type: dataView.getUint16(dataOffset + BYTES_8BIM_SIZE),\n size: dataView.getUint16(dataOffset + RESOURCE_BLOCK_SIZE_OFFSET)\n };\n}\n\nfunction isNaaResourceBlock(resourceBlock) {\n return resourceBlock.type === NAA_RESOURCE_BLOCK_TYPE;\n}\n\nfunction getBlockPadding(resourceBlock) {\n if (resourceBlock.size % 2 !== 0) {\n return 1;\n }\n return 0;\n}\n\nfunction parseTags(dataView, naaBlock, dataOffset, includeUnknown) {\n const tags = {};\n let encoding = undefined;\n\n const endOfBlockOffset = dataOffset + naaBlock['size'];\n\n while ((dataOffset < endOfBlockOffset) && (dataOffset < dataView.byteLength)) {\n const {tag, tagSize} = readTag(dataView, dataOffset, tags, encoding, includeUnknown);\n\n if (tag === null) {\n break;\n }\n\n if (tag) {\n if ('encoding' in tag) {\n encoding = tag.encoding;\n }\n\n if ((tags[tag.name] === undefined) || (tag['repeatable'] === undefined)) {\n tags[tag.name] = {\n id: tag.id,\n value: tag.value,\n description: tag.description\n };\n } else {\n if (!(tags[tag.name] instanceof Array)) {\n tags[tag.name] = [{\n id: tags[tag.name].id,\n value: tags[tag.name].value,\n description: tags[tag.name].description\n }];\n }\n tags[tag.name].push({\n id: tag.id,\n value: tag.value,\n description: tag.description\n });\n }\n }\n\n dataOffset += TAG_HEADER_SIZE + tagSize;\n }\n\n return tags;\n}\n\nfunction readTag(dataView, dataOffset, tags, encoding, includeUnknown) {\n const TAG_CODE_OFFSET = 1;\n const TAG_SIZE_OFFSET = 3;\n\n if (leadByteIsMissing(dataView, dataOffset)) {\n return {tag: null, tagSize: 0};\n }\n\n const tagCode = dataView.getUint16(dataOffset + TAG_CODE_OFFSET);\n const tagSize = dataView.getUint16(dataOffset + TAG_SIZE_OFFSET);\n\n if (!includeUnknown && !IptcTagNames['iptc'][tagCode]) {\n return {tag: undefined, tagSize};\n }\n\n const tagValue = getTagValue(dataView, dataOffset + TAG_HEADER_SIZE, tagSize);\n\n const tag = {\n id: tagCode,\n name: getTagName(IptcTagNames['iptc'][tagCode], tagCode, tagValue),\n value: tagValue,\n description: getTagDescription(IptcTagNames['iptc'][tagCode], tagValue, tags, encoding)\n };\n if (tagIsRepeatable(tagCode)) {\n tag['repeatable'] = true;\n }\n if (tagContainsEncoding(tagCode)) {\n tag['encoding'] = IptcTagNames['iptc'][tagCode]['encoding_name'](tagValue);\n }\n\n return {tag, tagSize};\n}\n\nfunction leadByteIsMissing(dataView, dataOffset) {\n const TAG_LEAD_BYTE = 0x1c;\n return dataView.getUint8(dataOffset) !== TAG_LEAD_BYTE;\n}\n\nfunction getTagValue(dataView, offset, size) {\n const value = [];\n\n for (let valueIndex = 0; valueIndex < size; valueIndex++) {\n value.push(dataView.getUint8(offset + valueIndex));\n }\n\n return value;\n}\n\nfunction getTagName(tag, tagCode, tagValue) {\n if (!tag) {\n return `undefined-${tagCode}`;\n }\n if (tagIsName(tag)) {\n return tag;\n }\n if (hasDynamicName(tag)) {\n return tag['name'](tagValue);\n }\n return tag['name'];\n}\n\nfunction tagIsName(tag) {\n return typeof tag === 'string';\n}\n\nfunction hasDynamicName(tag) {\n return typeof (tag['name']) === 'function';\n}\n\nfunction getTagDescription(tag, tagValue, tags, encoding) {\n if (hasDescriptionProperty(tag)) {\n try {\n return tag['description'](tagValue, tags);\n } catch (error) {\n // Fall through to next handler.\n }\n }\n if (tagValueIsText(tag, tagValue)) {\n return TagDecoder.decode(encoding, tagValue);\n }\n return tagValue;\n}\n\nfunction tagValueIsText(tag, tagValue) {\n return tag && tagValue instanceof Array;\n}\n\nfunction hasDescriptionProperty(tag) {\n return tag && tag['description'] !== undefined;\n}\n\nfunction tagIsRepeatable(tagCode) {\n return IptcTagNames['iptc'][tagCode] && IptcTagNames['iptc'][tagCode]['repeatable'];\n}\n\nfunction tagContainsEncoding(tagCode) {\n return IptcTagNames['iptc'][tagCode] && IptcTagNames['iptc'][tagCode]['encoding_name'] !== undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 'tiff:Orientation'(value) {\n if (value === '1') {\n return 'Horizontal (normal)';\n }\n if (value === '2') {\n return 'Mirror horizontal';\n }\n if (value === '3') {\n return 'Rotate 180';\n }\n if (value === '4') {\n return 'Mirror vertical';\n }\n if (value === '5') {\n return 'Mirror horizontal and rotate 270 CW';\n }\n if (value === '6') {\n return 'Rotate 90 CW';\n }\n if (value === '7') {\n return 'Mirror horizontal and rotate 90 CW';\n }\n if (value === '8') {\n return 'Rotate 270 CW';\n }\n return value;\n },\n 'tiff:ResolutionUnit': (value) => TagNamesCommon.ResolutionUnit(parseInt(value, 10)),\n 'tiff:XResolution': (value) => fraction(TagNamesCommon.XResolution, value),\n 'tiff:YResolution': (value) => fraction(TagNamesCommon.YResolution, value),\n 'exif:ApertureValue': (value) => fraction(TagNamesCommon.ApertureValue, value),\n 'exif:GPSLatitude': calculateGPSValue,\n 'exif:GPSLongitude': calculateGPSValue,\n 'exif:FNumber': (value) => fraction(TagNamesCommon.FNumber, value),\n 'exif:FocalLength': (value) => fraction(TagNamesCommon.FocalLength, value),\n 'exif:FocalPlaneResolutionUnit': (value) => TagNamesCommon.FocalPlaneResolutionUnit(parseInt(value, 10)),\n 'exif:ColorSpace': (value) => TagNamesCommon.ColorSpace(parseNumber(value)),\n 'exif:ComponentsConfiguration'(value, description) {\n if (/^\\d, \\d, \\d, \\d$/.test(description)) {\n const numbers = description.split(', ').map((number) => number.charCodeAt(0));\n return TagNamesCommon.ComponentsConfiguration(numbers);\n }\n return description;\n },\n 'exif:Contrast': (value) => TagNamesCommon.Contrast(parseInt(value, 10)),\n 'exif:CustomRendered': (value) => TagNamesCommon.CustomRendered(parseInt(value, 10)),\n 'exif:ExposureMode': (value) => TagNamesCommon.ExposureMode(parseInt(value, 10)),\n 'exif:ExposureProgram': (value) => TagNamesCommon.ExposureProgram(parseInt(value, 10)),\n 'exif:ExposureTime'(value) {\n if (isFraction(value)) {\n return TagNamesCommon.ExposureTime(value.split('/').map((number) => parseInt(number, 10)));\n }\n return value;\n },\n 'exif:MeteringMode': (value) => TagNamesCommon.MeteringMode(parseInt(value, 10)),\n 'exif:Saturation': (value) => TagNamesCommon.Saturation(parseInt(value, 10)),\n 'exif:SceneCaptureType': (value) => TagNamesCommon.SceneCaptureType(parseInt(value, 10)),\n 'exif:Sharpness': (value) => TagNamesCommon.Sharpness(parseInt(value, 10)),\n 'exif:ShutterSpeedValue': (value) => fraction(TagNamesCommon.ShutterSpeedValue, value),\n 'exif:WhiteBalance': (value) => TagNamesCommon.WhiteBalance(parseInt(value, 10))\n};\n\nfunction fraction(func, value) {\n if (isFraction(value)) {\n return func(value.split('/'));\n }\n return value;\n}\n\nfunction parseNumber(value) {\n if (value.substring(0, 2) === '0x') {\n return parseInt(value.substring(2), 16);\n }\n return parseInt(value, 10);\n}\n\nfunction isFraction(value) {\n return /^-?\\d+\\/-?\\d+$/.test(value);\n}\n\nfunction calculateGPSValue(value) {\n const [degreesString, minutesString] = value.split(',');\n if ((degreesString !== undefined) && (minutesString !== undefined)) {\n const degrees = parseFloat(degreesString);\n const minutes = parseFloat(minutesString);\n const ref = minutesString.charAt(minutesString.length - 1);\n if ((!Number.isNaN(degrees)) && (!Number.isNaN(minutes))) {\n return '' + (degrees + minutes / 60) + ref;\n }\n }\n return value;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n get\n};\n\nfunction get() {\n if (typeof DOMParser !== 'undefined') {\n return new DOMParser();\n }\n try {\n // eslint-disable-next-line no-undef\n return new (__non_webpack_require__('@xmldom/xmldom').DOMParser)({\n errorHandler: {\n error: () => {\n throw new Error('Faulty XML');\n }\n }\n });\n } catch (error) {\n return undefined;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView, objectAssign} from './utils.js';\nimport XmpTagNames from './xmp-tag-names.js';\nimport DOMParser from './dom-parser.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, chunks) {\n const tags = {};\n\n if (typeof dataView === 'string') {\n readTags(tags, dataView);\n return tags;\n }\n\n const [standardXmp, extendedXmp] = extractCompleteChunks(dataView, chunks);\n\n const hasStandardTags = readTags(tags, standardXmp);\n\n if (extendedXmp) {\n const hasExtendedTags = readTags(tags, extendedXmp);\n\n if (!hasStandardTags && !hasExtendedTags) {\n // Some writers are not spec-compliant in that they split an XMP\n // metadata tree over both the standard XMP block and the extended\n // XMP block. If we failed parsing both of the XMPs in the regular\n // way, we try to combine them to see if that works better.\n delete tags._raw;\n readTags(tags, combineChunks(dataView, chunks));\n }\n }\n\n return tags;\n}\n\n// The first chunk is always the regular XMP document. Then there is something\n// called extended XMP. The extended XMP is also a single XMP document but it\n// can be divided into multiple chunks that need to be combined into one.\nfunction extractCompleteChunks(dataView, chunks) {\n if (chunks.length === 0) {\n return [];\n }\n\n const completeChunks = [combineChunks(dataView, chunks.slice(0, 1))];\n if (chunks.length > 1) {\n completeChunks.push(combineChunks(dataView, chunks.slice(1)));\n }\n\n return completeChunks;\n}\n\nfunction combineChunks(dataView, chunks) {\n const totalLength = chunks.reduce((size, chunk) => size + chunk.length, 0);\n const combinedChunks = new Uint8Array(totalLength);\n let offset = 0;\n\n for (let i = 0; i < chunks.length; i++) {\n const chunk = chunks[i];\n const slice = dataView.buffer.slice(chunk.dataOffset, chunk.dataOffset + chunk.length);\n combinedChunks.set(new Uint8Array(slice), offset);\n offset += chunk.length;\n }\n\n return new DataView(combinedChunks.buffer);\n}\n\nfunction readTags(tags, chunkDataView) {\n try {\n const {doc, raw} = getDocument(chunkDataView);\n tags._raw = (tags._raw || '') + raw;\n const rdf = getRDF(doc);\n\n objectAssign(tags, parseXMPObject(convertToObject(rdf, true)));\n return true;\n } catch (error) {\n return false;\n }\n}\n\nfunction getDocument(chunkDataView) {\n const domParser = DOMParser.get();\n if (!domParser) {\n console.warn('Warning: DOMParser is not available. It is needed to be able to parse XMP tags.'); // eslint-disable-line no-console\n throw new Error();\n }\n\n const xmlString = typeof chunkDataView === 'string' ? chunkDataView : getStringFromDataView(chunkDataView, 0, chunkDataView.byteLength);\n const doc = domParser.parseFromString(trimXmlSource(xmlString), 'application/xml');\n\n if (doc.documentElement.nodeName === 'parsererror') {\n throw new Error(doc.documentElement.textContent);\n }\n\n return {\n doc,\n raw: xmlString,\n };\n}\n\nfunction trimXmlSource(xmlSource) {\n return xmlSource.replace(/^.+(<\\?xpacket begin)/, '$1').replace(/(<\\?xpacket end=\".*\"\\?>).+$/, '$1');\n}\n\nfunction getRDF(node) {\n for (let i = 0; i < node.childNodes.length; i++) {\n if (node.childNodes[i].tagName === 'x:xmpmeta') {\n return getRDF(node.childNodes[i]);\n }\n if (node.childNodes[i].tagName === 'rdf:RDF') {\n return node.childNodes[i];\n }\n }\n\n throw new Error();\n}\n\nfunction convertToObject(node, isTopNode = false) {\n const childNodes = getChildNodes(node);\n\n if (hasTextOnlyContent(childNodes)) {\n if (isTopNode) {\n return {};\n }\n return getTextValue(childNodes[0]);\n }\n\n return getElementsFromNodes(childNodes);\n}\n\nfunction getChildNodes(node) {\n const elements = [];\n\n for (let i = 0; i < node.childNodes.length; i++) {\n elements.push(node.childNodes[i]);\n }\n\n return elements;\n}\n\nfunction hasTextOnlyContent(nodes) {\n return (nodes.length === 1) && (nodes[0].nodeName === '#text');\n}\n\nfunction getTextValue(node) {\n return node.nodeValue;\n}\n\nfunction getElementsFromNodes(nodes) {\n const elements = {};\n\n nodes.forEach((node) => {\n if (isElement(node)) {\n const nodeElement = getElementFromNode(node);\n\n if (elements[node.nodeName] !== undefined) {\n if (!Array.isArray(elements[node.nodeName])) {\n elements[node.nodeName] = [elements[node.nodeName]];\n }\n elements[node.nodeName].push(nodeElement);\n } else {\n elements[node.nodeName] = nodeElement;\n }\n }\n });\n\n return elements;\n}\n\nfunction isElement(node) {\n return (node.nodeName) && (node.nodeName !== '#text');\n}\n\nfunction getElementFromNode(node) {\n return {\n attributes: getAttributes(node),\n value: convertToObject(node)\n };\n}\n\nfunction getAttributes(element) {\n const attributes = {};\n\n for (let i = 0; i < element.attributes.length; i++) {\n attributes[element.attributes[i].nodeName] = decodeURIComponent(escape(element.attributes[i].value));\n }\n\n return attributes;\n}\n\nfunction parseXMPObject(xmpObject) {\n const tags = {};\n\n if (typeof xmpObject === 'string') {\n return xmpObject;\n }\n\n for (const nodeName in xmpObject) {\n let nodes = xmpObject[nodeName];\n\n if (!Array.isArray(nodes)) {\n nodes = [nodes];\n }\n\n nodes.forEach((node) => {\n objectAssign(tags, parseNodeAttributesAsTags(node.attributes));\n if (typeof node.value === 'object') {\n objectAssign(tags, parseNodeChildrenAsTags(node.value));\n }\n });\n }\n\n return tags;\n}\n\nfunction parseNodeAttributesAsTags(attributes) {\n const tags = {};\n\n for (const name in attributes) {\n try {\n if (isTagAttribute(name)) {\n tags[getLocalName(name)] = {\n value: attributes[name],\n attributes: {},\n description: getDescription(attributes[name], name)\n };\n }\n } catch (error) {\n // Keep going and try to parse the rest of the tags.\n }\n }\n\n return tags;\n}\n\nfunction isTagAttribute(name) {\n return (name !== 'rdf:parseType') && (!isNamespaceDefinition(name));\n}\n\nfunction isNamespaceDefinition(name) {\n return name.split(':')[0] === 'xmlns';\n}\n\nfunction getLocalName(name) {\n if (/^MicrosoftPhoto(_\\d+_)?:Rating$/i.test(name)) {\n return 'RatingPercent';\n }\n return name.split(':')[1];\n}\n\nfunction getDescription(value, name = undefined) {\n if (Array.isArray(value)) {\n const arrayDescription = getDescriptionOfArray(value);\n if ((name) && (typeof XmpTagNames[name] === 'function')) {\n return XmpTagNames[name](value, arrayDescription);\n }\n return arrayDescription;\n }\n if (typeof value === 'object') {\n return getDescriptionOfObject(value);\n }\n\n try {\n if ((name) && (typeof XmpTagNames[name] === 'function')) {\n return XmpTagNames[name](value);\n }\n return decodeURIComponent(escape(value));\n } catch (error) {\n return value;\n }\n}\n\nfunction getDescriptionOfArray(value) {\n return value.map((item) => {\n if (item.value !== undefined) {\n return getDescription(item.value);\n }\n return getDescription(item);\n }).join(', ');\n}\n\nfunction getDescriptionOfObject(value) {\n const descriptions = [];\n\n for (const key in value) {\n descriptions.push(`${getClearTextKey(key)}: ${getDescription(value[key].value)}`);\n }\n\n return descriptions.join('; ');\n}\n\nfunction getClearTextKey(key) {\n if (key === 'CiAdrCity') {\n return 'CreatorCity';\n }\n if (key === 'CiAdrCtry') {\n return 'CreatorCountry';\n }\n if (key === 'CiAdrExtadr') {\n return 'CreatorAddress';\n }\n if (key === 'CiAdrPcode') {\n return 'CreatorPostalCode';\n }\n if (key === 'CiAdrRegion') {\n return 'CreatorRegion';\n }\n if (key === 'CiEmailWork') {\n return 'CreatorWorkEmail';\n }\n if (key === 'CiTelWork') {\n return 'CreatorWorkPhone';\n }\n if (key === 'CiUrlWork') {\n return 'CreatorWorkUrl';\n }\n return key;\n}\n\nfunction parseNodeChildrenAsTags(children) {\n const tags = {};\n\n for (const name in children) {\n try {\n if (!isNamespaceDefinition(name)) {\n tags[getLocalName(name)] = parseNodeAsTag(children[name], name);\n }\n } catch (error) {\n // Keep going and try to parse the rest of the tags.\n }\n }\n\n return tags;\n}\n\nfunction parseNodeAsTag(node, name) {\n if (isDuplicateTag(node)) {\n return parseNodeAsDuplicateTag(node, name);\n }\n if (isEmptyResourceTag(node)) {\n return {value: '', attributes: {}, description: ''};\n }\n if (hasNestedSimpleRdfDescription(node)) {\n return parseNodeAsSimpleRdfDescription(node, name);\n }\n if (hasNestedStructureRdfDescription(node)) {\n return parseNodeAsStructureRdfDescription(node, name);\n }\n if (isCompactStructure(node)) {\n return parseNodeAsCompactStructure(node, name);\n }\n if (isArray(node)) {\n return parseNodeAsArray(node, name);\n }\n return parseNodeAsSimpleValue(node, name);\n}\n\nfunction isEmptyResourceTag(node) {\n return (node.attributes['rdf:parseType'] === 'Resource')\n && (typeof node.value === 'string')\n && (node.value.trim() === '');\n}\n\nfunction isDuplicateTag(node) {\n return Array.isArray(node);\n}\n\nfunction parseNodeAsDuplicateTag(node, name) {\n return parseNodeAsSimpleValue(node[node.length - 1], name);\n}\n\nfunction hasNestedSimpleRdfDescription(node) {\n return ((node.attributes['rdf:parseType'] === 'Resource') && (node.value['rdf:value'] !== undefined))\n || ((node.value['rdf:Description'] !== undefined) && (node.value['rdf:Description'].value['rdf:value'] !== undefined));\n}\n\nfunction parseNodeAsSimpleRdfDescription(node, name) {\n const attributes = parseNodeAttributes(node);\n\n if (node.value['rdf:Description'] !== undefined) {\n node = node.value['rdf:Description'];\n }\n\n objectAssign(attributes, parseNodeAttributes(node), parseNodeChildrenAsAttributes(node));\n\n const value = parseRdfValue(node);\n\n return {\n value,\n attributes,\n description: getDescription(value, name)\n };\n}\n\nfunction parseNodeAttributes(node) {\n const attributes = {};\n\n for (const name in node.attributes) {\n if ((name !== 'rdf:parseType') && (name !== 'rdf:resource') && (!isNamespaceDefinition(name))) {\n attributes[getLocalName(name)] = node.attributes[name];\n }\n }\n\n return attributes;\n}\n\nfunction parseNodeChildrenAsAttributes(node) {\n const attributes = {};\n\n for (const name in node.value) {\n if ((name !== 'rdf:value') && (!isNamespaceDefinition(name))) {\n attributes[getLocalName(name)] = node.value[name].value;\n }\n }\n\n return attributes;\n}\n\nfunction parseRdfValue(node) {\n return getURIValue(node.value['rdf:value']) || node.value['rdf:value'].value;\n}\n\nfunction hasNestedStructureRdfDescription(node) {\n return (node.attributes['rdf:parseType'] === 'Resource')\n || ((node.value['rdf:Description'] !== undefined) && (node.value['rdf:Description'].value['rdf:value'] === undefined));\n}\n\nfunction parseNodeAsStructureRdfDescription(node, name) {\n const tag = {\n value: {},\n attributes: {}\n };\n\n if (node.value['rdf:Description'] !== undefined) {\n objectAssign(tag.value, parseNodeAttributesAsTags(node.value['rdf:Description'].attributes));\n objectAssign(tag.attributes, parseNodeAttributes(node));\n node = node.value['rdf:Description'];\n }\n\n objectAssign(tag.value, parseNodeChildrenAsTags(node.value));\n\n tag.description = getDescription(tag.value, name);\n\n return tag;\n}\n\nfunction isCompactStructure(node) {\n return (Object.keys(node.value).length === 0)\n && (node.attributes['xml:lang'] === undefined)\n && (node.attributes['rdf:resource'] === undefined);\n}\n\nfunction parseNodeAsCompactStructure(node, name) {\n const value = parseNodeAttributesAsTags(node.attributes);\n\n return {\n value,\n attributes: {},\n description: getDescription(value, name)\n };\n}\n\nfunction isArray(node) {\n return getArrayChild(node.value) !== undefined;\n}\n\nfunction getArrayChild(value) {\n return value['rdf:Bag'] || value['rdf:Seq'] || value['rdf:Alt'];\n}\n\nfunction parseNodeAsArray(node, name) {\n let items = getArrayChild(node.value).value['rdf:li'];\n const attributes = parseNodeAttributes(node);\n const value = [];\n\n if (items === undefined) {\n items = [];\n } else if (!Array.isArray(items)) {\n items = [items];\n }\n\n items.forEach((item) => {\n value.push(parseArrayValue(item));\n });\n\n return {\n value,\n attributes,\n description: getDescription(value, name)\n };\n}\n\nfunction parseArrayValue(item) {\n if (hasNestedSimpleRdfDescription(item)) {\n return parseNodeAsSimpleRdfDescription(item);\n }\n if (hasNestedStructureRdfDescription(item)) {\n return parseNodeAsStructureRdfDescription(item).value;\n }\n if (isCompactStructure(item)) {\n return parseNodeAsCompactStructure(item).value;\n }\n\n return parseNodeAsSimpleValue(item);\n}\n\nfunction parseNodeAsSimpleValue(node, name) {\n const value = getURIValue(node) || parseXMPObject(node.value);\n\n return {\n value,\n attributes: parseNodeAttributes(node),\n description: getDescription(value, name)\n };\n}\n\nfunction getURIValue(node) {\n return node.attributes && node.attributes['rdf:resource'];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\nimport {\n getPascalStringFromDataView,\n padStart,\n parseFloatRadix,\n strRepeat\n} from './utils.js';\n\n// export const OsTypeKeys = {\n// OBJC: 'Objc',\n// DOUB: 'doub',\n// UNTF: 'UntF',\n// TEXT: 'TEXT',\n// BOOL: 'bool',\n// ENUM: 'enum',\n// LONG: 'long'\n// };\n\nexport const PathRecordTypes = {\n CLOSED_SUBPATH_LENGTH: 0,\n CLOSED_SUBPATH_BEZIER_LINKED: 1,\n CLOSED_SUBPATH_BEZIER_UNLINKED: 2,\n OPEN_SUBPATH_LENGTH: 3,\n OPEN_SUBPATH_BEZIER_LINKED: 4,\n OPEN_SUBPATH_BEZIER_UNLINKED: 5,\n FILL_RULE: 6,\n CLIPBOARD: 7,\n INITIAL_FILL_RULE: 8\n};\n\nconst PATH_RECORD_SIZE = 24;\n\nexport default {\n // 0x0425: {\n // name: 'CaptionDigest',\n // description(dataView) {\n // let description = '';\n // for (let i = 0; i < dataView.byteLength; i++) {\n // const byte = dataView.getUint8(i);\n // description += padStart(byte.toString(16), 2, '0');\n // }\n // return description;\n // }\n // },\n // Commented out for now to lower bundle size until someone asks for it.\n // 0x043a: {\n // name: 'PrintInformation',\n // description: parseDescriptor\n // },\n // 0x043b: {\n // name: 'PrintStyle',\n // description: parseDescriptor\n // },\n 0x07d0: {\n name: 'PathInformation',\n description: pathResource\n },\n 0x0bb7: {\n name: 'ClippingPathName',\n description(dataView) {\n const [, string] = getPascalStringFromDataView(dataView, 0);\n return string;\n }\n },\n};\n\n// function parseDescriptor(dataView) {\n// const DESCRIPTOR_VERSION_SIZE = 4;\n// // This is a unicode string terminated with null. Unsure about the format though since in my example image it starts with 0x0000.\n// const UNCLEAR_CLASS_ID_NAME_PART_SIZE = 6;\n// let offset = 0;\n// offset += DESCRIPTOR_VERSION_SIZE + UNCLEAR_CLASS_ID_NAME_PART_SIZE;\n// const [classId, classIdSize] = getBlockValue(dataView, offset);\n// offset += classIdSize;\n// const numItems = Types.getLongAt(dataView, offset);\n// offset += 4;\n// const descriptor = {[classId]: {}};\n// for (let i = 0; i < numItems; i++) {\n// const [itemKey, itemKeySize] = getBlockValue(dataView, offset);\n// offset += itemKeySize;\n// const osTypeKey = getStringFromDataView(dataView, offset, 4);\n// offset += 4;\n// try {\n// const {itemValue, itemSize} = getItemValue(dataView, offset, osTypeKey);\n// offset += itemSize;\n// descriptor[classId][ITEM_KEY_TERMS[itemKey] || itemKey] = itemValue;\n// } catch (error) {\n// // We can't recover from unknown OS type key since we don't know\n// // where the next one starts.\n// break;\n// }\n// }\n// return JSON.stringify(descriptor);\n// }\n\n// function getBlockValue(dataView, offset, unicode = false) {\n// const length = (unicode ? 2 : 1) * Types.getLongAt(dataView, offset) || 4;\n// offset += 4;\n// const value = (unicode ? getUnicodeStringFromDataView : getStringFromDataView)(dataView, offset, length);\n// offset += length;\n// return [value, 4 + length];\n// }\n\n// function getItemValue(dataView, offset, osTypeKey) {\n// // Not all OSType keys are implemented yet because they are missing in the example image.\n// if (osTypeKey === OsTypeKeys.OBJC) {\n// const [classIdName, classIdNameSize] = getBlockValue(dataView, offset, true);\n// offset += classIdNameSize;\n// const [classId, classIdSize] = getBlockValue(dataView, offset);\n// offset += classIdSize;\n// const _offset = Types.getLongAt(dataView, offset);\n// return {\n// itemValue: {[classIdName]: {[classId]: _offset}},\n// itemSize: classIdNameSize + classIdSize + 4\n// };\n// }\n// if (osTypeKey === OsTypeKeys.DOUB) {\n// return {\n// itemValue: parseDouble(dataView, offset),\n// itemSize: 8\n// };\n// }\n// if (osTypeKey === OsTypeKeys.UNTF) {\n// const unit = getStringFromDataView(dataView, offset, 4);\n// return {\n// itemValue: {unit, value: parseDouble(dataView, offset + 4)},\n// itemSize: unit.length + 8\n// };\n// }\n// if (osTypeKey === OsTypeKeys.TEXT) {\n// const length = 2 * Types.getLongAt(dataView, offset);\n// offset += 4;\n// const text = getUnicodeStringFromDataView(dataView, offset, length);\n// return {\n// itemValue: text,\n// itemSize: 4 + length\n// };\n// }\n// if (osTypeKey === OsTypeKeys.BOOL) {\n// return {\n// itemValue: Types.getByteAt(dataView, offset) === 1,\n// itemSize: 1\n// };\n// }\n// if (osTypeKey === OsTypeKeys.ENUM) {\n// const [type, typeSize] = getBlockValue(dataView, offset);\n// offset += typeSize;\n// const [enumName, enumSize] = getBlockValue(dataView, offset);\n// return {\n// itemValue: {[type]: enumName},\n// itemSize: typeSize + enumSize\n// };\n// }\n// if (osTypeKey === OsTypeKeys.LONG) {\n// return {\n// itemValue: Types.getLongAt(dataView, offset),\n// itemSize: 4\n// };\n// }\n// throw new Error(`Unknown OS type key: ${osTypeKey}`);\n// }\n\n// function parseDouble(dataView, offset) {\n// const BIAS = 1023;\n// const sign = (Types.getByteAt(dataView, offset) & parseInt('10000000', 2)) === 0 ? 1 : -1;\n// const exponent = ((Types.getShortAt(dataView, offset) & parseInt('0111111111110000', 2)) >> 4) - BIAS;\n// const fractionHigh = padStart((Types.getLongAt(dataView, offset) & parseInt('00000000000011111111111111111111', 2)).toString(2), 20, '0');\n// const fractionLow = padStart(Types.getLongAt(dataView, offset + 4).toString(2), 32, '0');\n// const fraction = parseFloatRadix('1.' + fractionHigh + fractionLow, 2);\n// return sign * fraction * Math.pow(2, exponent);\n// }\n\nfunction pathResource(dataView) {\n const TYPE_SIZE = 2;\n const types = {};\n const paths = [];\n\n for (let offset = 0; offset < dataView.byteLength; offset += TYPE_SIZE + PATH_RECORD_SIZE) {\n const type = Types.getShortAt(dataView, offset);\n if (PATH_RECORD_TYPES[type]) {\n if (!types[type]) {\n types[type] = PATH_RECORD_TYPES[type].description;\n }\n paths.push({\n type,\n path: PATH_RECORD_TYPES[type].path(dataView, offset + TYPE_SIZE)\n });\n }\n }\n return JSON.stringify({types, paths});\n}\n\nconst PATH_RECORD_TYPES = {\n [PathRecordTypes.CLOSED_SUBPATH_LENGTH]: {\n description: 'Closed subpath length',\n path: (dataView, offset) => [Types.getShortAt(dataView, offset)]\n },\n [PathRecordTypes.CLOSED_SUBPATH_BEZIER_LINKED]: {\n description: 'Closed subpath Bezier knot, linked',\n path: parseBezierKnot\n },\n [PathRecordTypes.CLOSED_SUBPATH_BEZIER_UNLINKED]: {\n description: 'Closed subpath Bezier knot, unlinked',\n path: parseBezierKnot\n },\n [PathRecordTypes.OPEN_SUBPATH_LENGTH]: {\n description: 'Open subpath length',\n path: (dataView, offset) => [Types.getShortAt(dataView, offset)]\n },\n [PathRecordTypes.OPEN_SUBPATH_BEZIER_LINKED]: {\n description: 'Open subpath Bezier knot, linked',\n path: parseBezierKnot\n },\n [PathRecordTypes.OPEN_SUBPATH_BEZIER_UNLINKED]: {\n description: 'Open subpath Bezier knot, unlinked',\n path: parseBezierKnot\n },\n [PathRecordTypes.FILL_RULE]: {\n description: 'Path fill rule',\n path: () => []\n },\n [PathRecordTypes.INITIAL_FILL_RULE]: {\n description: 'Initial fill rule',\n path: (dataView, offset) => [Types.getShortAt(dataView, offset)]\n },\n [PathRecordTypes.CLIPBOARD]: {\n description: 'Clipboard',\n path: parseClipboard\n }\n};\n\nfunction parseBezierKnot(dataView, offset) {\n const PATH_POINT_SIZE = 8;\n const path = [];\n for (let i = 0; i < PATH_RECORD_SIZE; i += PATH_POINT_SIZE) {\n path.push(parsePathPoint(dataView, offset + i));\n }\n return path;\n}\n\nfunction parsePathPoint(dataView, offset) {\n const vertical = getFixedPointNumber(dataView, offset, 8);\n const horizontal = getFixedPointNumber(dataView, offset + 4, 8);\n return [horizontal, vertical];\n}\n\nfunction parseClipboard(dataView, offset) {\n return [\n [\n getFixedPointNumber(dataView, offset, 8), // Top\n getFixedPointNumber(dataView, offset + 4, 8), // Left\n getFixedPointNumber(dataView, offset + 8, 8), // Botton\n getFixedPointNumber(dataView, offset + 12, 8), // Right\n ],\n getFixedPointNumber(dataView, offset + 16, 8) // Resolution\n ];\n}\n\nfunction getFixedPointNumber(dataView, offset, binaryPoint) {\n const number = Types.getLongAt(dataView, offset);\n\n const sign = (number >>> 31) === 0 ? 1 : -1;\n const integer = (number & 0x7f000000) >>> (32 - binaryPoint);\n const fraction = number & parseInt(strRepeat('1', 32 - binaryPoint), 2);\n\n return sign * parseFloatRadix(integer.toString(2) + '.' + padStart(fraction.toString(2), 32 - binaryPoint, '0'), 2);\n}\n\n// Item key terminology: https://psd-tools.readthedocs.io/en/latest/reference/psd_tools.terminology.html\n// Are these correct? There are collisions that are commented out. A lot of code for little gain?\n// const ITEM_KEY_TERMS = {\n// 'A ': 'A',\n// 'Adjs': 'Adjustment',\n// 'Algd': 'Aligned',\n// 'Algn': 'Alignment',\n// 'AllE': 'AllExcept',\n// 'All ': 'AllPS',\n// 'AlTl': 'AllToolOptions',\n// 'AChn': 'AlphaChannelOptions',\n// 'AlpC': 'AlphaChannels',\n// 'AmbB': 'AmbientBrightness',\n// 'AmbC': 'AmbientColor',\n// 'Amnt': 'Amount',\n// 'AmMx': 'AmplitudeMax',\n// 'AmMn': 'AmplitudeMin',\n// 'Anch': 'Anchor',\n// 'Angl': 'Angle',\n// 'Ang1': 'Angle1',\n// 'Ang2': 'Angle2',\n// 'Ang3': 'Angle3',\n// 'Ang4': 'Angle4',\n// 'AntA': 'AntiAlias',\n// 'Appe': 'Append',\n// 'Aply': 'Apply',\n// 'Ar ': 'Area',\n// 'Arrw': 'Arrowhead',\n// 'As ': 'As',\n// 'Asst': 'AssetBin',\n// 'AssC': 'AssumedCMYK',\n// 'AssG': 'AssumedGray',\n// 'AssR': 'AssumedRGB',\n// 'At ': 'At',\n// 'Auto': 'Auto',\n// 'AuCo': 'AutoContrast',\n// 'Atrs': 'AutoErase',\n// 'AtKr': 'AutoKern',\n// 'AtUp': 'AutoUpdate',\n// 'Axis': 'Axis',\n// 'B ': 'B',\n// 'Bckg': 'Background',\n// 'BckC': 'BackgroundColor',\n// 'BckL': 'BackgroundLevel',\n// 'Bwd ': 'Backward',\n// 'Blnc': 'Balance',\n// 'Bsln': 'BaselineShift',\n// 'BpWh': 'BeepWhenDone',\n// 'BgnR': 'BeginRamp',\n// 'BgnS': 'BeginSustain',\n// 'bvlD': 'BevelDirection',\n// 'ebbl': 'BevelEmboss',\n// 'bvlS': 'BevelStyle',\n// 'bvlT': 'BevelTechnique',\n// 'BgNH': 'BigNudgeH',\n// 'BgNV': 'BigNudgeV',\n// 'BtDp': 'BitDepth',\n// 'Blck': 'Black',\n// 'BlcC': 'BlackClip',\n// 'Blcn': 'BlackGeneration',\n// 'BlcG': 'BlackGenerationCurve',\n// 'BlcI': 'BlackIntensity',\n// 'BlcL': 'BlackLevel',\n// // 'BlcL': 'BlackLimit',\n// 'Bld ': 'Bleed',\n// 'Blnd': 'BlendRange',\n// 'Bl ': 'Blue',\n// 'BlBl': 'BlueBlackPoint',\n// 'blueFloat': 'BlueFloat',\n// 'BlGm': 'BlueGamma',\n// 'BlWh': 'BlueWhitePoint',\n// 'BlX ': 'BlueX',\n// 'BlY ': 'BlueY',\n// 'blur': 'Blur',\n// 'BlrM': 'BlurMethod',\n// 'BlrQ': 'BlurQuality',\n// 'Bk ': 'Book',\n// 'BrdT': 'BorderThickness',\n// 'Btom': 'Bottom',\n// 'Brgh': 'Brightness',\n// 'BrsD': 'BrushDetail',\n// 'BrsS': 'BrushSize',\n// 'BrsT': 'BrushType',\n// 'Brsh': 'Brushes',\n// 'BmpA': 'BumpAmplitude',\n// 'BmpC': 'BumpChannel',\n// 'By ': 'By',\n// 'Byln': 'Byline',\n// 'BylT': 'BylineTitle',\n// 'BytO': 'ByteOrder',\n// 'CMYS': 'CMYKSetup',\n// 'CchP': 'CachePrefs',\n// 'Clcl': 'Calculation',\n// 'Clbr': 'CalibrationBars',\n// 'Cptn': 'Caption',\n// 'CptW': 'CaptionWriter',\n// 'Ctgr': 'Category',\n// 'ClSz': 'CellSize',\n// 'Cntr': 'Center',\n// 'CntC': 'CenterCropMarks',\n// 'ChlA': 'ChalkArea',\n// 'Chnl': 'Channel',\n// 'ChMx': 'ChannelMatrix',\n// 'ChnN': 'ChannelName',\n// 'Chns': 'Channels',\n// 'ChnI': 'ChannelsInterleaved',\n// 'ChAm': 'CharcoalAmount',\n// 'ChrA': 'CharcoalArea',\n// 'Ckmt': 'ChokeMatte',\n// 'ChFX': 'ChromeFX',\n// 'City': 'City',\n// 'ClrA': 'ClearAmount',\n// 'ClPt': 'ClippingPath',\n// 'ClpP': 'ClippingPathEPS',\n// 'ClpF': 'ClippingPathFlatness',\n// 'ClpI': 'ClippingPathIndex',\n// 'Clpg': 'ClippingPathInfo',\n// 'ClnS': 'CloneSource',\n// 'Clsp': 'ClosedSubpath',\n// 'Clr ': 'Color',\n// 'Clrh': 'ColorChannels',\n// 'ClrC': 'ColorCorrection',\n// 'ClrI': 'ColorIndicates',\n// 'ClMg': 'ColorManagement',\n// 'Clrr': 'ColorPickerPrefs',\n// 'ClrS': 'ColorSpace',\n// 'ClrT': 'ColorTable',\n// 'Clrz': 'Colorize',\n// 'Clrs': 'Colors',\n// 'ClrL': 'ColorsList',\n// 'ClmW': 'ColumnWidth',\n// 'CmdK': 'CommandKey',\n// 'Cmpn': 'Compensation',\n// 'Cmpr': 'Compression',\n// 'Cncv': 'Concavity',\n// 'Cndt': 'Condition',\n// 'Cnst': 'Constant',\n// // 'Cnst': 'Constrain',\n// 'CnsP': 'ConstrainProportions',\n// 'Cfov': 'ConstructionFOV',\n// 'Cntg': 'Contiguous',\n// 'Cntn': 'Continue',\n// 'Cnty': 'Continuity',\n// 'ShpC': 'ContourType',\n// // 'Cntr': 'Contrast',\n// 'Cnvr': 'Convert',\n// 'Cpy ': 'Copy',\n// 'Cpyr': 'Copyright',\n// 'CprN': 'CopyrightNotice',\n// 'CrnC': 'CornerCropMarks',\n// 'Cnt ': 'Count',\n// 'CntN': 'CountryName',\n// 'CrcB': 'CrackBrightness',\n// 'CrcD': 'CrackDepth',\n// 'CrcS': 'CrackSpacing',\n// 'blfl': 'CreateLayersFromLayerFX',\n// 'Crdt': 'Credit',\n// 'Crss': 'Crossover',\n// 'Crnt': 'Current',\n// 'CrnH': 'CurrentHistoryState',\n// 'CrnL': 'CurrentLight',\n// 'CrnT': 'CurrentToolOptions',\n// 'Crv ': 'Curve',\n// 'CrvF': 'CurveFile',\n// 'Cstm': 'Custom',\n// 'CstF': 'CustomForced',\n// 'CstM': 'CustomMatte',\n// 'CstP': 'CustomPalette',\n// 'Cyn ': 'Cyan',\n// 'DCS ': 'DCS',\n// 'DPXf': 'DPXFormat',\n// 'DrkI': 'DarkIntensity',\n// 'Drkn': 'Darkness',\n// 'DtCr': 'DateCreated',\n// 'Dt ': 'Datum',\n// 'Dfnt': 'Definition',\n// 'Dnst': 'Density',\n// 'Dpth': 'Depth',\n// 'Dstl': 'DestBlackMax',\n// 'DstB': 'DestBlackMin',\n// 'Dstt': 'DestWhiteMax',\n// 'DstW': 'DestWhiteMin',\n// 'DstM': 'DestinationMode',\n// 'Dtl ': 'Detail',\n// 'Dmtr': 'Diameter',\n// 'DffD': 'DiffusionDither',\n// 'Drct': 'Direction',\n// 'DrcB': 'DirectionBalance',\n// 'DspF': 'DisplaceFile',\n// 'DspM': 'DisplacementMap',\n// 'DspP': 'DisplayPrefs',\n// 'Dstn': 'Distance',\n// // 'Dstr': 'Distortion',\n// // 'Dstr': 'Distribution',\n// 'Dthr': 'Dither',\n// 'DthA': 'DitherAmount',\n// 'Dthp': 'DitherPreserve',\n// 'Dthq': 'DitherQuality',\n// 'DocI': 'DocumentID',\n// 'DtGn': 'DotGain',\n// 'DtGC': 'DotGainCurves',\n// 'DrSh': 'DropShadow',\n// 'Dplc': 'Duplicate',\n// 'DnmC': 'DynamicColorSliders',\n// 'Edg ': 'Edge',\n// 'EdgB': 'EdgeBrightness',\n// 'EdgF': 'EdgeFidelity',\n// 'EdgI': 'EdgeIntensity',\n// 'EdgS': 'EdgeSimplicity',\n// 'EdgT': 'EdgeThickness',\n// 'EdgW': 'EdgeWidth',\n// 'Effc': 'Effect',\n// 'EmbC': 'EmbedCMYK',\n// 'EmbG': 'EmbedGray',\n// 'EmbL': 'EmbedLab',\n// 'EmbP': 'EmbedProfiles',\n// 'EmbR': 'EmbedRGB',\n// 'EmlD': 'EmulsionDown',\n// 'EGst': 'EnableGestures',\n// 'enab': 'Enabled',\n// 'Encd': 'Encoding',\n// 'End ': 'End',\n// 'EndA': 'EndArrowhead',\n// 'EndR': 'EndRamp',\n// 'EndS': 'EndSustain',\n// 'Engn': 'Engine',\n// 'ErsT': 'EraseToHistory',\n// 'ErsK': 'EraserKind',\n// 'ExcP': 'ExactPoints',\n// 'Expr': 'Export',\n// 'ExpC': 'ExportClipboard',\n// 'Exps': 'Exposure',\n// 'Extd': 'Extend',\n// 'EQlt': 'ExtendedQuality',\n// 'Extn': 'Extension',\n// 'ExtQ': 'ExtensionsQuery',\n// 'ExtD': 'ExtrudeDepth',\n// 'ExtM': 'ExtrudeMaskIncomplete',\n// 'ExtR': 'ExtrudeRandom',\n// 'ExtS': 'ExtrudeSize',\n// 'ExtF': 'ExtrudeSolidFace',\n// 'ExtT': 'ExtrudeType',\n// 'EyDr': 'EyeDropperSample',\n// 'FxCm': 'FPXCompress',\n// 'FxQl': 'FPXQuality',\n// 'FxSz': 'FPXSize',\n// 'FxVw': 'FPXView',\n// 'FdT ': 'FadeTo',\n// 'FdtS': 'FadeoutSteps',\n// 'FlOf': 'Falloff',\n// 'Fthr': 'Feather',\n// 'FbrL': 'FiberLength',\n// 'File': 'File',\n// 'FlCr': 'FileCreator',\n// 'FlIn': 'FileInfo',\n// 'FilR': 'FileReference',\n// 'FlSP': 'FileSavePrefs',\n// 'FlTy': 'FileType',\n// 'flst': 'FilesList',\n// 'Fl ': 'Fill',\n// 'FlCl': 'FillColor',\n// 'FlNt': 'FillNeutral',\n// 'FlPd': 'FilterLayerPersistentData',\n// 'FlRs': 'FilterLayerRandomSeed',\n// 'Fngr': 'Fingerpainting',\n// 'FlrC': 'FlareCenter',\n// 'Fltn': 'Flatness',\n// 'Fltt': 'Flatten',\n// 'FlpV': 'FlipVertical',\n// 'Fcs ': 'Focus',\n// 'Fldr': 'Folders',\n// 'FntD': 'FontDesignAxes',\n// 'FntV': 'FontDesignAxesVectors',\n// 'FntN': 'FontName',\n// 'Scrp': 'FontScript',\n// 'FntS': 'FontStyleName',\n// 'FntT': 'FontTechnology',\n// 'FrcC': 'ForcedColors',\n// 'FrgC': 'ForegroundColor',\n// 'FrgL': 'ForegroundLevel',\n// 'Fmt ': 'Format',\n// 'Fwd ': 'Forward',\n// 'FrFX': 'FrameFX',\n// 'FrmW': 'FrameWidth',\n// 'FTcs': 'FreeTransformCenterState',\n// 'Frqn': 'Frequency',\n// 'From': 'From',\n// 'FrmB': 'FromBuiltin',\n// 'FrmM': 'FromMode',\n// 'FncK': 'FunctionKey',\n// 'Fzns': 'Fuzziness',\n// 'GCR ': 'GCR',\n// 'GFPT': 'GIFColorFileType',\n// 'GFCL': 'GIFColorLimit',\n// 'GFEC': 'GIFExportCaption',\n// 'GFMI': 'GIFMaskChannelIndex',\n// 'GFMV': 'GIFMaskChannelInverted',\n// 'GFPF': 'GIFPaletteFile',\n// 'GFPL': 'GIFPaletteType',\n// 'GFCS': 'GIFRequiredColorSpaceType',\n// 'GFIT': 'GIFRowOrderType',\n// 'GFTC': 'GIFTransparentColor',\n// 'GFTB': 'GIFTransparentIndexBlue',\n// 'GFTG': 'GIFTransparentIndexGreen',\n// 'GFTR': 'GIFTransparentIndexRed',\n// 'GFBM': 'GIFUseBestMatch',\n// 'Gmm ': 'Gamma',\n// 'GmtW': 'GamutWarning',\n// 'GnrP': 'GeneralPrefs',\n// 'gblA': 'GlobalAngle',\n// 'gagl': 'GlobalLightingAngle',\n// 'Glos': 'Gloss',\n// 'GlwA': 'GlowAmount',\n// 'GlwT': 'GlowTechnique',\n// 'Grad': 'Gradient',\n// 'Grdf': 'GradientFill',\n// // 'Grn ': 'Grain',\n// 'Grnt': 'GrainType',\n// 'Grns': 'Graininess',\n// 'Gry ': 'Gray',\n// 'GrBh': 'GrayBehavior',\n// 'GrSt': 'GraySetup',\n// 'Grn ': 'Green',\n// 'GrnB': 'GreenBlackPoint',\n// 'greenFloat': 'GreenFloat',\n// 'GrnG': 'GreenGamma',\n// 'GrnW': 'GreenWhitePoint',\n// 'GrnX': 'GreenX',\n// 'GrnY': 'GreenY',\n// 'GrdC': 'GridColor',\n// 'Grds': 'GridCustomColor',\n// 'GrdM': 'GridMajor',\n// 'Grdn': 'GridMinor',\n// 'GrdS': 'GridStyle',\n// 'Grdt': 'GridUnits',\n// 'Grup': 'Group',\n// 'GrtW': 'GroutWidth',\n// 'GrwS': 'GrowSelection',\n// 'Gdes': 'Guides',\n// 'GdsC': 'GuidesColor',\n// 'Gdss': 'GuidesCustomColor',\n// 'GdPr': 'GuidesPrefs',\n// 'GdsS': 'GuidesStyle',\n// 'GttW': 'GutterWidth',\n// 'HlfF': 'HalftoneFile',\n// 'HlfS': 'HalftoneScreen',\n// 'HlSz': 'HalftoneSize',\n// 'Hlfp': 'HalftoneSpec',\n// 'Hrdn': 'Hardness',\n// 'HCdH': 'HasCmdHPreference',\n// 'Hdr ': 'Header',\n// 'Hdln': 'Headline',\n// 'Hght': 'Height',\n// 'HghA': 'HighlightArea',\n// 'hglC': 'HighlightColor',\n// 'HghL': 'HighlightLevels',\n// 'hglM': 'HighlightMode',\n// 'hglO': 'HighlightOpacity',\n// 'HghS': 'HighlightStrength',\n// 'HstB': 'HistoryBrushSource',\n// 'HstP': 'HistoryPrefs',\n// 'HsSS': 'HistoryStateSource',\n// 'HsSt': 'HistoryStates',\n// 'Hrzn': 'Horizontal',\n// 'HrzS': 'HorizontalScale',\n// 'HstN': 'HostName',\n// 'HstV': 'HostVersion',\n// 'H ': 'Hue',\n// 'ICCE': 'ICCEngine',\n// 'ICCt': 'ICCSetupName',\n// 'Idnt': 'ID',\n// 'Idle': 'Idle',\n// 'ImgB': 'ImageBalance',\n// 'Impr': 'Import',\n// 'Imps': 'Impressionist',\n// 'In ': 'In',\n// 'c@#^': 'Inherits',\n// 'InkC': 'InkColors',\n// 'Inks': 'Inks',\n// 'IrGl': 'InnerGlow',\n// 'glwS': 'InnerGlowSource',\n// 'IrSh': 'InnerShadow',\n// 'Inpt': 'Input',\n// 'kIBP': 'InputBlackPoint',\n// 'Inmr': 'InputMapRange',\n// 'Inpr': 'InputRange',\n// 'kIWP': 'InputWhitePoint',\n// 'Intn': 'Intensity',\n// 'Inte': 'Intent',\n// 'IntH': 'InterfaceBevelHighlight',\n// 'Intv': 'InterfaceBevelShadow',\n// 'IntB': 'InterfaceBlack',\n// 'Intd': 'InterfaceBorder',\n// 'Intk': 'InterfaceButtonDarkShadow',\n// 'Intt': 'InterfaceButtonDownFill',\n// 'InBF': 'InterfaceButtonUpFill',\n// 'ICBL': 'InterfaceColorBlue2',\n// 'ICBH': 'InterfaceColorBlue32',\n// 'ICGL': 'InterfaceColorGreen2',\n// 'ICGH': 'InterfaceColorGreen32',\n// 'ICRL': 'InterfaceColorRed2',\n// 'ICRH': 'InterfaceColorRed32',\n// 'IntI': 'InterfaceIconFillActive',\n// 'IntF': 'InterfaceIconFillDimmed',\n// 'Intc': 'InterfaceIconFillSelected',\n// 'Intm': 'InterfaceIconFrameActive',\n// // 'Intr': 'InterfaceIconFrameDimmed',\n// 'IntS': 'InterfaceIconFrameSelected',\n// 'IntP': 'InterfacePaletteFill',\n// 'IntR': 'InterfaceRed',\n// 'IntT': 'InterfaceToolTipBackground',\n// 'ITTT': 'InterfaceToolTipText',\n// 'ITBg': 'InterfaceTransparencyBackground',\n// 'ITFg': 'InterfaceTransparencyForeground',\n// 'IntW': 'InterfaceWhite',\n// // 'Intr': 'Interlace',\n// 'IntC': 'InterlaceCreateType',\n// 'IntE': 'InterlaceEliminateType',\n// // 'Intr': 'Interpolation',\n// 'IntM': 'InterpolationMethod',\n// 'Invr': 'Invert',\n// 'InvM': 'InvertMask',\n// 'InvS': 'InvertSource2',\n// 'InvT': 'InvertTexture',\n// 'IsDr': 'IsDirty',\n// 'ItmI': 'ItemIndex',\n// 'JPEQ': 'JPEGQuality',\n// 'Krng': 'Kerning',\n// 'Kywd': 'Keywords',\n// 'Knd ': 'Kind',\n// 'LTnm': 'LUTAnimation',\n// 'LZWC': 'LZWCompression',\n// 'Lbls': 'Labels',\n// 'Lnds': 'Landscape',\n// 'LstT': 'LastTransform',\n// 'Lyr ': 'Layer',\n// 'Lefx': 'LayerEffects',\n// 'lfxv': 'LayerFXVisible',\n// 'LyrI': 'LayerID',\n// 'LyrN': 'LayerName',\n// 'Lyrs': 'Layers',\n// 'Ldng': 'Leading',\n// 'Left': 'Left',\n// 'lSNs': 'LegacySerialString',\n// // 'Lngt': 'Length',\n// 'Lns ': 'Lens',\n// 'Lvl ': 'Level',\n// 'Lvls': 'Levels',\n// 'LgDr': 'LightDark',\n// 'LghD': 'LightDirection',\n// 'LghI': 'LightIntensity',\n// 'LghP': 'LightPosition',\n// 'LghS': 'LightSource',\n// 'LghT': 'LightType',\n// 'LghG': 'LightenGrout',\n// 'Lght': 'Lightness',\n// 'Line': 'Line',\n// 'lnkE': 'LinkEnable',\n// 'LnkL': 'LinkedLayerIDs',\n// 'Lald': 'LocalLightingAltitude',\n// 'lagl': 'LocalLightingAngle',\n// 'LclR': 'LocalRange',\n// 'Lctn': 'Location',\n// 'Log ': 'Log',\n// 'kLog': 'Logarithmic',\n// 'LwCs': 'LowerCase',\n// 'Lmnc': 'Luminance',\n// 'Mgnt': 'Magenta',\n// 'MkVs': 'MakeVisible',\n// 'Mfov': 'ManipulationFOV',\n// 'MpBl': 'MapBlack',\n// 'Mpng': 'Mapping',\n// 'MpgS': 'MappingShape',\n// 'Mtrl': 'Material',\n// 'Mtrx': 'Matrix',\n// 'MttC': 'MatteColor',\n// 'Mxm ': 'Maximum',\n// 'MxmS': 'MaximumStates',\n// 'MmrU': 'MemoryUsagePercent',\n// 'Mrge': 'Merge',\n// 'Mrgd': 'Merged',\n// 'Msge': 'Message',\n// 'Mthd': 'Method',\n// 'MztT': 'MezzotintType',\n// 'Mdpn': 'Midpoint',\n// 'MdtL': 'MidtoneLevels',\n// 'Mnm ': 'Minimum',\n// 'MsmC': 'MismatchCMYK',\n// 'MsmG': 'MismatchGray',\n// 'MsmR': 'MismatchRGB',\n// 'Md ': 'Mode',\n// 'Mnch': 'Monochromatic',\n// 'MvT ': 'MoveTo',\n// 'Nm ': 'Name',\n// 'Ngtv': 'Negative',\n// 'Nw ': 'New',\n// 'Nose': 'Noise',\n// 'NnIm': 'NonImageData',\n// 'NnLn': 'NonLinear',\n// 'null': 'Null',\n// 'Nm L': 'NumLights',\n// 'Nmbr': 'Number',\n// 'NCch': 'NumberOfCacheLevels',\n// 'NC64': 'NumberOfCacheLevels64',\n// 'NmbO': 'NumberOfChannels',\n// 'NmbC': 'NumberOfChildren',\n// 'NmbD': 'NumberOfDocuments',\n// 'NmbG': 'NumberOfGenerators',\n// // 'NmbL': 'NumberOfLayers',\n// // 'NmbL': 'NumberOfLevels',\n// 'NmbP': 'NumberOfPaths',\n// 'NmbR': 'NumberOfRipples',\n// 'NmbS': 'NumberOfSiblings',\n// 'ObjN': 'ObjectName',\n// 'Ofst': 'Offset',\n// 'Sftt': 'OldSmallFontType',\n// 'On ': 'On',\n// 'Opct': 'Opacity',\n// 'Optm': 'Optimized',\n// 'Ornt': 'Orientation',\n// 'OrgH': 'OriginalHeader',\n// 'OrgT': 'OriginalTransmissionReference',\n// 'OthC': 'OtherCursors',\n// 'OrGl': 'OuterGlow',\n// 'Otpt': 'Output',\n// 'kOBP': 'OutputBlackPoint',\n// 'kOWP': 'OutputWhitePoint',\n// 'OvrC': 'OverprintColors',\n// 'OvrO': 'OverrideOpen',\n// 'ObrP': 'OverridePrinter',\n// 'Ovrd': 'OverrideSave',\n// 'PNGf': 'PNGFilter',\n// 'PGIT': 'PNGInterlaceType',\n// 'PMpf': 'PageFormat',\n// 'PgNm': 'PageNumber',\n// 'PgPs': 'PagePosition',\n// 'PgSt': 'PageSetup',\n// 'PnCK': 'PaintCursorKind',\n// 'PntT': 'PaintType',\n// 'PntC': 'PaintingCursors',\n// 'Plt ': 'Palette',\n// 'PltF': 'PaletteFile',\n// 'PprB': 'PaperBrightness',\n// 'PrIn': 'ParentIndex',\n// 'PrNm': 'ParentName',\n// 'Path': 'Path',\n// 'PthC': 'PathContents',\n// 'PthN': 'PathName',\n// 'Pttn': 'Pattern',\n// 'Pncl': 'PencilWidth',\n// 'Prsp': 'PerspectiveIndex',\n// 'Phsp': 'Phosphors',\n// 'PckI': 'PickerID',\n// 'Pckr': 'PickerKind',\n// 'PPSz': 'PixelPaintSize',\n// 'Pltf': 'Platform',\n// 'PlgF': 'PluginFolder',\n// 'PlgP': 'PluginPrefs',\n// 'Pts ': 'Points',\n// 'Pstn': 'Position',\n// 'PstS': 'PostScriptColor',\n// 'Pstr': 'Posterization',\n// 'PrdC': 'PredefinedColors',\n// 'PrfB': 'PreferBuiltin',\n// 'Prfr': 'Preferences',\n// 'PrsA': 'PreserveAdditional',\n// 'PrsL': 'PreserveLuminosity',\n// 'PrsT': 'PreserveTransparency',\n// 'Prs ': 'Pressure',\n// 'Prvw': 'Preview',\n// 'PrvK': 'PreviewCMYK',\n// 'PrvF': 'PreviewFullSize',\n// 'PrvI': 'PreviewIcon',\n// 'PrvM': 'PreviewMacThumbnail',\n// 'PrvW': 'PreviewWinThumbnail',\n// 'PrvQ': 'PreviewsQuery',\n// 'PMps': 'PrintSettings',\n// 'PrfS': 'ProfileSetup',\n// 'PrvS': 'ProvinceState',\n// 'Qlty': 'Quality',\n// 'QucM': 'QuickMask',\n// 'RGBS': 'RGBSetup',\n// 'Rds ': 'Radius',\n// 'RndS': 'RandomSeed',\n// 'Rt ': 'Ratio',\n// 'Rcnf': 'RecentFiles',\n// 'Rd ': 'Red',\n// 'RdBl': 'RedBlackPoint',\n// 'redFloat': 'RedFloat',\n// 'RdGm': 'RedGamma',\n// 'RdWh': 'RedWhitePoint',\n// 'RdX ': 'RedX',\n// 'RdY ': 'RedY',\n// 'RgsM': 'RegistrationMarks',\n// 'Rltv': 'Relative',\n// 'Rlf ': 'Relief',\n// 'Rfid': 'RenderFidelity',\n// 'Rsmp': 'Resample',\n// 'RWOZ': 'ResizeWindowsOnZoom',\n// 'Rslt': 'Resolution',\n// 'RsrI': 'ResourceID',\n// 'Rspn': 'Response',\n// 'RtnH': 'RetainHeader',\n// 'Rvrs': 'Reverse',\n// 'Rght': 'Right',\n// 'RplM': 'RippleMagnitude',\n// 'RplS': 'RippleSize',\n// 'Rtt ': 'Rotate',\n// 'Rndn': 'Roundness',\n// 'RlrH': 'RulerOriginH',\n// 'RlrV': 'RulerOriginV',\n// 'RlrU': 'RulerUnits',\n// // 'Strt': 'Saturation',\n// 'SvAn': 'SaveAndClose',\n// 'SvCm': 'SaveComposite',\n// 'PltL': 'SavePaletteLocations',\n// 'SvPt': 'SavePaths',\n// 'SvPy': 'SavePyramids',\n// 'Svng': 'Saving',\n// 'Scl ': 'Scale',\n// 'SclH': 'ScaleHorizontal',\n// 'SclV': 'ScaleVertical',\n// 'Scln': 'Scaling',\n// 'Scns': 'Scans',\n// 'ScrD': 'ScratchDisks',\n// 'ScrF': 'ScreenFile',\n// 'ScrT': 'ScreenType',\n// 'Sprt': 'Separations',\n// 'SrlS': 'SerialString',\n// // 'ShdI': 'ShadingIntensity',\n// 'ShdN': 'ShadingNoise',\n// 'ShdS': 'ShadingShape',\n// 'sdwC': 'ShadowColor',\n// // 'ShdI': 'ShadowIntensity',\n// 'ShdL': 'ShadowLevels',\n// 'sdwM': 'ShadowMode',\n// 'sdwO': 'ShadowOpacity',\n// 'Shp ': 'Shape',\n// 'Shrp': 'Sharpness',\n// 'ShrE': 'ShearEd',\n// 'ShrP': 'ShearPoints',\n// 'ShrS': 'ShearSt',\n// 'ShfK': 'ShiftKey',\n// 'ShKT': 'ShiftKeyToolSwitch',\n// 'ShrN': 'ShortNames',\n// 'ShwE': 'ShowEnglishFontNames',\n// 'SwMC': 'ShowMenuColors',\n// 'ShwT': 'ShowToolTips',\n// 'ShTr': 'ShowTransparency',\n// 'Sz ': 'SizeKey',\n// 'Skew': 'Skew',\n// 'Sfts': 'SmallFontType',\n// 'SmBM': 'SmartBlurMode',\n// 'SmBQ': 'SmartBlurQuality',\n// 'Smoo': 'Smooth',\n// 'Smth': 'Smoothness',\n// 'SnpI': 'SnapshotInitial',\n// 'SfCl': 'SoftClip',\n// 'Sftn': 'Softness',\n// 'SoFi': 'SolidFill',\n// 'Srce': 'Source',\n// 'Src2': 'Source2',\n// 'SrcM': 'SourceMode',\n// 'Spcn': 'Spacing',\n// 'SpcI': 'SpecialInstructions',\n// 'SphM': 'SpherizeMode',\n// 'Spot': 'Spot',\n// 'SprR': 'SprayRadius',\n// 'SqrS': 'SquareSize',\n// 'Srcl': 'SrcBlackMax',\n// 'SrcB': 'SrcBlackMin',\n// 'Srcm': 'SrcWhiteMax',\n// 'SrcW': 'SrcWhiteMin',\n// // 'Strt': 'Start',\n// 'StrA': 'StartArrowhead',\n// 'Stte': 'State',\n// 'srgh': 'Strength',\n// 'srgR': 'StrengthRatio',\n// 'Strg': 'Strength_PLUGIN',\n// 'StDt': 'StrokeDetail',\n// 'SDir': 'StrokeDirection',\n// 'StrL': 'StrokeLength',\n// 'StrP': 'StrokePressure',\n// 'StrS': 'StrokeSize',\n// 'StrW': 'StrokeWidth',\n// 'Styl': 'Style',\n// 'Stys': 'Styles',\n// 'StlC': 'StylusIsColor',\n// 'StlO': 'StylusIsOpacity',\n// 'StlP': 'StylusIsPressure',\n// 'StlS': 'StylusIsSize',\n// 'SbpL': 'SubPathList',\n// 'SplC': 'SupplementalCategories',\n// 'SstI': 'SystemInfo',\n// 'SstP': 'SystemPalette',\n// // 'null': 'Target',\n// 'Trgp': 'TargetPath',\n// 'TrgP': 'TargetPathIndex',\n// // 'Lngt': 'TermLength',\n// 'Txt ': 'Text',\n// // 'TxtC': 'TextClickPoint',\n// 'TxtD': 'TextData',\n// 'TxtS': 'TextStyle',\n// 'Txtt': 'TextStyleRange',\n// 'Txtr': 'Texture',\n// // 'TxtC': 'TextureCoverage',\n// 'TxtF': 'TextureFile',\n// 'TxtT': 'TextureType',\n// 'Thsh': 'Threshold',\n// 'TlNm': 'TileNumber',\n// 'TlOf': 'TileOffset',\n// 'TlSz': 'TileSize',\n// 'Ttl ': 'Title',\n// 'T ': 'To',\n// 'TBl ': 'ToBuiltin',\n// 'ToLk': 'ToLinked',\n// 'TMd ': 'ToMode',\n// 'TglO': 'ToggleOthers',\n// 'Tlrn': 'Tolerance',\n// 'Top ': 'Top',\n// 'TtlL': 'TotalLimit',\n// 'Trck': 'Tracking',\n// 'TrnF': 'TransferFunction',\n// // 'TrnS': 'TransferSpec',\n// 'Trns': 'Transparency',\n// // 'TrnG': 'TransparencyGrid',\n// 'TrnC': 'TransparencyGridColors',\n// // 'TrnG': 'TransparencyGridSize',\n// 'TrnP': 'TransparencyPrefs',\n// // 'TrnS': 'TransparencyShape',\n// 'TrnI': 'TransparentIndex',\n// 'TrnW': 'TransparentWhites',\n// 'Twst': 'Twist',\n// 'Type': 'Type',\n// 'UC ': 'UCA',\n// 'URL ': 'URL',\n// 'UndA': 'UndefinedArea',\n// 'Undl': 'Underline',\n// 'UntP': 'UnitsPrefs',\n// 'Untl': 'Untitled',\n// 'UppY': 'UpperY',\n// 'Urgn': 'Urgency',\n// 'AcrS': 'UseAccurateScreens',\n// 'AdPl': 'UseAdditionalPlugins',\n// 'UsCc': 'UseCacheForHistograms',\n// 'UsCr': 'UseCurves',\n// 'UsDf': 'UseDefault',\n// 'uglg': 'UseGlobalAngle',\n// 'UsIC': 'UseICCProfile',\n// 'UsMs': 'UseMask',\n// 'UsrM': 'UserMaskEnabled',\n// 'Usrs': 'UserMaskLinked',\n// 'Usng': 'Using',\n// 'Vl ': 'Value',\n// 'Vrnc': 'Variance',\n// 'Vct0': 'Vector0',\n// 'Vct1': 'Vector1',\n// 'VctC': 'VectorColor',\n// 'VrsF': 'VersionFix',\n// 'VrsM': 'VersionMajor',\n// 'VrsN': 'VersionMinor',\n// 'Vrtc': 'Vertical',\n// 'VrtS': 'VerticalScale',\n// 'Vdlp': 'VideoAlpha',\n// 'Vsbl': 'Visible',\n// 'WtcS': 'WatchSuspension',\n// 'watr': 'Watermark',\n// 'Wvtp': 'WaveType',\n// 'WLMx': 'WavelengthMax',\n// 'WLMn': 'WavelengthMin',\n// 'WbdP': 'WebdavPrefs',\n// 'Wtdg': 'WetEdges',\n// 'What': 'What',\n// 'WhtC': 'WhiteClip',\n// 'WhtI': 'WhiteIntensity',\n// 'WhHi': 'WhiteIsHigh',\n// 'WhtL': 'WhiteLevel',\n// 'WhtP': 'WhitePoint',\n// 'WhPt': 'WholePath',\n// 'Wdth': 'Width',\n// 'WndM': 'WindMethod',\n// 'With': 'With',\n// 'WrPt': 'WorkPath',\n// 'WrkP': 'WorkPathIndex',\n// 'X ': 'X',\n// 'Y ': 'Y',\n// 'Ylw ': 'Yellow',\n// 'ZZTy': 'ZigZagType',\n// 'Alis': '_3DAntiAlias',\n// };\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// Specification: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/\n\nimport {getDataView, getStringFromDataView, getPascalStringFromDataView} from './utils.js';\nimport Types from './types.js';\nimport TagNames from './photoshop-tag-names.js';\n\nexport default {\n read\n};\n\nconst SIGNATURE = '8BIM';\nconst TAG_ID_SIZE = 2;\nconst RESOURCE_LENGTH_SIZE = 4;\n\nconst SIGNATURE_SIZE = SIGNATURE.length;\n\nfunction read(bytes, includeUnknown) {\n const dataView = getDataView(new Uint8Array(bytes).buffer);\n const tags = {};\n let offset = 0;\n\n while (offset < bytes.length) {\n const signature = getStringFromDataView(dataView, offset, SIGNATURE_SIZE);\n offset += SIGNATURE_SIZE;\n const tagId = Types.getShortAt(dataView, offset);\n offset += TAG_ID_SIZE;\n const {tagName, tagNameSize} = getTagName(dataView, offset);\n offset += tagNameSize;\n const resourceSize = Types.getLongAt(dataView, offset);\n offset += RESOURCE_LENGTH_SIZE;\n if (signature === SIGNATURE) {\n const valueDataView = getDataView(dataView.buffer, offset, resourceSize);\n const tag = {\n id: tagId,\n value: getStringFromDataView(valueDataView, 0, resourceSize),\n };\n if (TagNames[tagId]) {\n try {\n tag.description = TagNames[tagId].description(valueDataView);\n } catch (error) {\n tag.description = '<no description formatter>';\n }\n tags[tagName ? tagName : TagNames[tagId].name] = tag;\n } else if (includeUnknown) {\n tags[`undefined-${tagId}`] = tag;\n }\n }\n offset += resourceSize + (resourceSize % 2);\n }\n\n return tags;\n}\n\nfunction getTagName(dataView, offset) {\n // The name is encoded as a Pascal string (the string is prefixed with one\n // byte containing the length of the string) and everything is padded with a\n // null byte to make the size even.\n const [stringSize, string] = getPascalStringFromDataView(dataView, offset);\n return {\n tagName: string,\n tagNameSize: 1 + stringSize + (stringSize % 2 === 0 ? 1 : 0)\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\n\nexport const iccTags = {\n 'desc': {\n 'name': 'ICC Description',\n },\n 'cprt': {\n 'name': 'ICC Copyright',\n },\n 'dmdd': {\n 'name': 'ICC Device Model Description',\n },\n 'vued': {\n 'name': 'ICC Viewing Conditions Description',\n },\n 'dmnd': {\n 'name': 'ICC Device Manufacturer for Display',\n },\n 'tech': {\n 'name': 'Technology',\n },\n};\n\nexport const iccProfile = {\n 4: {\n 'name': 'Preferred CMM type',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => value !== null ? toCompany(value) : '',\n },\n 8: {\n 'name': 'Profile Version',\n 'value': (dataView, offset) => {\n return (dataView.getUint8(offset)).toString(10) + '.'\n + (dataView.getUint8(offset + 1) >> 4).toString(10) + '.'\n + (dataView.getUint8(offset + 1) % 16).toString(10);\n }\n },\n 12: {\n 'name': 'Profile/Device class',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => {\n switch (value.toLowerCase()) {\n case 'scnr': return 'Input Device profile';\n case 'mntr': return 'Display Device profile';\n case 'prtr': return 'Output Device profile';\n case 'link': return 'DeviceLink profile';\n case 'abst': return 'Abstract profile';\n case 'spac': return 'ColorSpace profile';\n case 'nmcl': return 'NamedColor profile';\n case 'cenc': return 'ColorEncodingSpace profile';\n case 'mid ': return 'MultiplexIdentification profile';\n case 'mlnk': return 'MultiplexLink profile';\n case 'mvis': return 'MultiplexVisualization profile';\n default: return value;\n }\n }\n },\n 16: {\n 'name': 'Color Space',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 20: {\n 'name': 'Connection Space',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 24: {\n 'name': 'ICC Profile Date',\n 'value': (dataView, offset) => parseDate(dataView, offset).toISOString()\n },\n 36: {\n 'name': 'ICC Signature',\n 'value': (dataView, offset) => sliceToString(dataView.buffer.slice(offset, offset + 4))\n },\n 40: {\n 'name': 'Primary Platform',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => toCompany(value)\n },\n 48: {\n 'name': 'Device Manufacturer',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => toCompany(value)\n },\n 52: {\n 'name': 'Device Model Number',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 64: {\n 'name': 'Rendering Intent',\n 'value': (dataView, offset) => dataView.getUint32(offset),\n 'description': (value) => {\n switch (value) {\n case 0: return 'Perceptual';\n case 1: return 'Relative Colorimetric';\n case 2: return 'Saturation';\n case 3: return 'Absolute Colorimetric';\n default: return value;\n }\n }\n },\n\n 80: {\n 'name': 'Profile Creator',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n};\n\nfunction parseDate(dataView, offset) {\n const year = dataView.getUint16(offset);\n const month = dataView.getUint16(offset + 2) - 1;\n const day = dataView.getUint16(offset + 4);\n const hours = dataView.getUint16(offset + 6);\n const minutes = dataView.getUint16(offset + 8);\n const seconds = dataView.getUint16(offset + 10);\n return new Date(Date.UTC(year, month, day, hours, minutes, seconds));\n}\n\nfunction sliceToString(slice) {\n return String.fromCharCode.apply(null, new Uint8Array(slice));\n}\n\nfunction toCompany(value) {\n switch (value.toLowerCase()) {\n case 'appl': return 'Apple';\n case 'adbe': return 'Adobe';\n case 'msft': return 'Microsoft';\n case 'sunw': return 'Sun Microsystems';\n case 'sgi': return 'Silicon Graphics';\n case 'tgnt': return 'Taligent';\n default: return value;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\nimport {iccTags, iccProfile} from './icc-tag-names.js';\nimport {getStringFromDataView, getUnicodeStringFromDataView, decompress, COMPRESSION_METHOD_NONE, COMPRESSION_METHOD_DEFLATE} from './utils.js';\n\nexport default {\n read\n};\n\nconst PROFILE_HEADER_LENGTH = 84;\nconst ICC_TAG_COUNT_OFFSET = 128;\nconst ICC_SIGNATURE = 'acsp';\nconst TAG_TYPE_DESC = 'desc';\nconst TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE = 'mluc';\nconst TAG_TYPE_TEXT = 'text';\nconst TAG_TYPE_SIGNATURE = 'sig ';\nconst TAG_TABLE_SINGLE_TAG_DATA = 12;\n\n// ICC profile data can be longer than application segment max length of ~64k.\n// so it can be split into multiple APP2 segments. Each segment includes\n// total chunk count and chunk number.\n// Here we read all chunks into single continuous array of bytes.\n// Compressed ICC profile data only has support for a single chunk.\nfunction read(dataView, iccData, async) {\n if (async && iccData[0].compressionMethod !== COMPRESSION_METHOD_NONE) {\n return readCompressedIcc(dataView, iccData);\n }\n\n return readIcc(dataView, iccData);\n}\n\nfunction readCompressedIcc(dataView, iccData) {\n if (!compressionMethodIsSupported(iccData[0].compressionMethod)) {\n return {};\n }\n const compressedDataView = new DataView(dataView.buffer.slice(iccData[0].offset, iccData[0].offset + iccData[0].length));\n return decompress(compressedDataView, iccData[0].compressionMethod, 'dataview')\n .then(parseTags)\n .catch(() => ({}));\n}\n\nfunction compressionMethodIsSupported(compressionMethod) {\n return compressionMethod === COMPRESSION_METHOD_DEFLATE;\n}\n\nfunction readIcc(dataView, iccData) {\n try {\n const totalIccProfileLength = iccData.reduce((sum, icc) => sum + icc.length, 0);\n\n const iccBinaryData = new Uint8Array(totalIccProfileLength);\n let offset = 0;\n const buffer = getBuffer(dataView);\n\n for (let chunkNumber = 1; chunkNumber <= iccData.length; chunkNumber++) {\n const iccDataChunk = iccData.find((x) => x.chunkNumber === chunkNumber);\n if (!iccDataChunk) {\n throw new Error(`ICC chunk ${chunkNumber} not found`);\n }\n\n const data = buffer.slice(iccDataChunk.offset, iccDataChunk.offset + iccDataChunk.length);\n const chunkData = new Uint8Array(data);\n\n iccBinaryData.set(chunkData, offset);\n offset += chunkData.length;\n }\n\n return parseTags(new DataView(iccBinaryData.buffer));\n } catch (error) {\n return {};\n }\n}\n\nfunction getBuffer(dataView) {\n if (Array.isArray(dataView)) {\n return (new DataView(Uint8Array.from(dataView).buffer)).buffer;\n }\n return dataView.buffer;\n}\n\nfunction iccDoesNotHaveTagCount(buffer) {\n return buffer.length < (ICC_TAG_COUNT_OFFSET + 4);\n}\n\nfunction hasTagsData(buffer, tagHeaderOffset) {\n return buffer.length < tagHeaderOffset + TAG_TABLE_SINGLE_TAG_DATA;\n}\n\nexport function parseTags(dataView) {\n const buffer = dataView.buffer;\n\n const length = dataView.getUint32();\n if (dataView.byteLength !== length) {\n throw new Error('ICC profile length not matching');\n }\n\n if (dataView.length < PROFILE_HEADER_LENGTH) {\n throw new Error('ICC profile too short');\n }\n\n const tags = {};\n\n const iccProfileKeys = Object.keys(iccProfile);\n for (let i = 0; i < iccProfileKeys.length; i++) {\n const offset = iccProfileKeys[i];\n const profileEntry = iccProfile[offset];\n const value = profileEntry.value(dataView, parseInt(offset, 10));\n let description = value;\n if (profileEntry.description) {\n description = profileEntry.description(value);\n }\n\n tags[profileEntry.name] = {\n value,\n description\n };\n }\n\n const signature = sliceToString(buffer.slice(36, 40));\n if (signature !== ICC_SIGNATURE) {\n throw new Error('ICC profile: missing signature');\n }\n\n /* ICC data is incomplete but we have header parsed so lets return it */\n if (iccDoesNotHaveTagCount(buffer)) {\n return tags;\n }\n\n const tagCount = dataView.getUint32(128);\n let tagHeaderOffset = 132;\n\n for (let i = 0; i < tagCount; i++) {\n if (hasTagsData(buffer, tagHeaderOffset)) {\n // Tags are corrupted (offset too far), return what we parsed until now\n return tags;\n }\n const tagSignature = getStringFromDataView(dataView, tagHeaderOffset, 4);\n const tagOffset = dataView.getUint32(tagHeaderOffset + 4);\n const tagSize = dataView.getUint32(tagHeaderOffset + 8);\n\n if (tagOffset > buffer.length) {\n // Tag data is invalid, lets return what we managed to parse\n return tags;\n }\n const tagType = getStringFromDataView(dataView, tagOffset, 4);\n\n if (tagType === TAG_TYPE_DESC) {\n const tagValueSize = dataView.getUint32(tagOffset + 8);\n if (tagValueSize > tagSize) {\n // Tag data is invalid, lets return what we managed to parse\n return tags;\n }\n\n const val = sliceToString(buffer.slice(tagOffset + 12, tagOffset + tagValueSize + 11));\n addTag(tags, tagSignature, val);\n } else if (tagType === TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE) {\n const numRecords = dataView.getUint32(tagOffset + 8);\n const recordSize = dataView.getUint32(tagOffset + 12);\n let offset = tagOffset + 16;\n const val = [];\n for (let recordNum = 0; recordNum < numRecords; recordNum++) {\n const languageCode = getStringFromDataView(dataView, offset + 0, 2);\n const countryCode = getStringFromDataView(dataView, offset + 2, 2);\n const textLength = dataView.getUint32(offset + 4);\n const textOffset = dataView.getUint32(offset + 8);\n\n const text = getUnicodeStringFromDataView(dataView, tagOffset + textOffset, textLength);\n val.push({languageCode, countryCode, text});\n offset += recordSize;\n }\n if (numRecords === 1) {\n addTag(tags, tagSignature, val[0].text);\n } else {\n const valObj = {};\n for (let valIndex = 0; valIndex < val.length; valIndex++) {\n valObj[`${val[valIndex].languageCode}-${val[valIndex].countryCode}`] = val[valIndex].text;\n }\n addTag(tags, tagSignature, valObj);\n }\n } else if (tagType === TAG_TYPE_TEXT) {\n const val = sliceToString(buffer.slice(tagOffset + 8, tagOffset + tagSize - 7));\n addTag(tags, tagSignature, val);\n } else if (tagType === TAG_TYPE_SIGNATURE) {\n const val = sliceToString(buffer.slice(tagOffset + 8, tagOffset + 12));\n addTag(tags, tagSignature, val);\n }\n tagHeaderOffset = tagHeaderOffset + 12;\n }\n\n return tags;\n}\n\nfunction sliceToString(slice) {\n return String.fromCharCode.apply(null, new Uint8Array(slice));\n}\n\nfunction addTag(tags, tagSignature, value) {\n if (iccTags[tagSignature]) {\n tags[iccTags[tagSignature].name] = {value, description: value};\n } else {\n tags[tagSignature] = {value, description: value};\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, fileDataOffset) {\n return {\n 'Image Width': getImageWidth(dataView, fileDataOffset),\n 'Image Height': getImageHeight(dataView, fileDataOffset),\n 'Bit Depth': getBitDepth(dataView, fileDataOffset),\n 'Color Type': getColorType(dataView, fileDataOffset),\n 'Compression': getCompression(dataView, fileDataOffset),\n 'Filter': getFilter(dataView, fileDataOffset),\n 'Interlace': getInterlace(dataView, fileDataOffset)\n };\n}\n\nfunction getImageWidth(dataView, fileDataOffset) {\n const OFFSET = 0;\n const SIZE = 4;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, fileDataOffset);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageHeight(dataView, fileDataOffset) {\n const OFFSET = 4;\n const SIZE = 4;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getBitDepth(dataView, fileDataOffset) {\n const OFFSET = 8;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}`\n };\n}\n\nfunction getColorType(dataView, fileDataOffset) {\n const OFFSET = 9;\n const SIZE = 1;\n const COLOR_TYPES = {\n 0: 'Grayscale',\n 2: 'RGB',\n 3: 'Palette',\n 4: 'Grayscale with Alpha',\n 6: 'RGB with Alpha'\n };\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: COLOR_TYPES[value] || 'Unknown'\n };\n}\n\nfunction getCompression(dataView, fileDataOffset) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: value === 0 ? 'Deflate/Inflate' : 'Unknown'\n };\n}\n\nfunction getFilter(dataView, fileDataOffset) {\n const OFFSET = 11;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: value === 0 ? 'Adaptive' : 'Unknown'\n };\n}\n\nfunction getInterlace(dataView, fileDataOffset) {\n const OFFSET = 12;\n const SIZE = 1;\n const INTERLACE_TYPES = {\n 0: 'Noninterlaced',\n 1: 'Adam7 Interlace'\n };\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: INTERLACE_TYPES[value] || 'Unknown'\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// Specification: http://www.libpng.org/pub/png/spec/1.2/\n\nimport {getStringValueFromArray, getStringFromDataView, decompress, COMPRESSION_METHOD_NONE} from './utils.js';\nimport TagDecoder from './tag-decoder.js';\nimport {TYPE_TEXT, TYPE_ITXT, TYPE_ZTXT} from './image-header-png.js';\nimport Tags from './tags.js';\nimport IptcTags from './iptc-tags.js';\nimport Constants from './constants.js';\n\nexport default {\n read\n};\n\nconst STATE_KEYWORD = 'STATE_KEYWORD';\nconst STATE_COMPRESSION = 'STATE_COMPRESSION';\nconst STATE_LANG = 'STATE_LANG';\nconst STATE_TRANSLATED_KEYWORD = 'STATE_TRANSLATED_KEYWORD';\nconst STATE_TEXT = 'STATE_TEXT';\nconst COMPRESSION_SECTION_ITXT_EXTRA_BYTE = 1;\nconst COMPRESSION_FLAG_COMPRESSED = 1;\nconst EXIF_OFFSET = 6;\n\nfunction read(dataView, pngTextChunks, async, includeUnknown) {\n const tags = {};\n const tagsPromises = [];\n for (let i = 0; i < pngTextChunks.length; i++) {\n const {offset, length, type} = pngTextChunks[i];\n const nameAndValue = getNameAndValue(dataView, offset, length, type, async);\n if (nameAndValue instanceof Promise) {\n tagsPromises.push(nameAndValue.then(({name, value, description}) => {\n try {\n if (Constants.USE_EXIF && isExifGroupTag(name, value)) {\n return {\n __exif: Tags.read(decodeRawData(value), EXIF_OFFSET, includeUnknown)\n };\n } else if (Constants.USE_IPTC && isIptcGroupTag(name, value)) {\n return {\n __iptc: IptcTags.read(decodeRawData(value), 0, includeUnknown)\n };\n } else if (name) {\n return {\n [name]: {\n value,\n description\n }\n };\n }\n } catch (error) {\n // Ignore the broken tag.\n }\n return {};\n }));\n } else {\n const {name, value, description} = nameAndValue;\n if (name) {\n tags[name] = {\n value,\n description\n };\n }\n }\n }\n\n return {\n readTags: tags,\n readTagsPromise: tagsPromises.length > 0 ? Promise.all(tagsPromises) : undefined\n };\n}\n\nfunction getNameAndValue(dataView, offset, length, type, async) {\n const keywordChars = [];\n const langChars = [];\n const translatedKeywordChars = [];\n let valueChars;\n let parsingState = STATE_KEYWORD;\n let compressionMethod = COMPRESSION_METHOD_NONE;\n\n for (let i = 0; i < length && offset + i < dataView.byteLength; i++) {\n if (parsingState === STATE_COMPRESSION) {\n compressionMethod = getCompressionMethod({type, dataView, offset: offset + i});\n if (type === TYPE_ITXT) {\n i += COMPRESSION_SECTION_ITXT_EXTRA_BYTE;\n }\n parsingState = moveToNextState(type, parsingState);\n continue;\n } else if (parsingState === STATE_TEXT) {\n valueChars = new DataView(dataView.buffer.slice(offset + i, offset + length));\n break;\n }\n const byte = dataView.getUint8(offset + i);\n if (byte === 0) {\n parsingState = moveToNextState(type, parsingState);\n } else if (parsingState === STATE_KEYWORD) {\n keywordChars.push(byte);\n } else if (parsingState === STATE_LANG) {\n langChars.push(byte);\n } else if (parsingState === STATE_TRANSLATED_KEYWORD) {\n translatedKeywordChars.push(byte);\n }\n }\n\n if (compressionMethod !== COMPRESSION_METHOD_NONE && !async) {\n return {};\n }\n const decompressedValueChars = decompress(valueChars, compressionMethod);\n if (decompressedValueChars instanceof Promise) {\n return decompressedValueChars\n .then((_decompressedValueChars) => constructTag(_decompressedValueChars, type, langChars, keywordChars))\n .catch(() => constructTag('<text using unknown compression>'.split(''), type, langChars, keywordChars));\n }\n return constructTag(decompressedValueChars, type, langChars, keywordChars);\n}\n\nfunction getCompressionMethod({type, dataView, offset}) {\n if (type === TYPE_ITXT) {\n if (dataView.getUint8(offset) === COMPRESSION_FLAG_COMPRESSED) {\n return dataView.getUint8(offset + 1);\n }\n } else if (type === TYPE_ZTXT) {\n return dataView.getUint8(offset);\n }\n return COMPRESSION_METHOD_NONE;\n}\n\nfunction moveToNextState(type, parsingState) {\n if (parsingState === STATE_KEYWORD && [TYPE_ITXT, TYPE_ZTXT].includes(type)) {\n return STATE_COMPRESSION;\n }\n if (parsingState === STATE_COMPRESSION) {\n if (type === TYPE_ITXT) {\n return STATE_LANG;\n }\n return STATE_TEXT;\n }\n if (parsingState === STATE_LANG) {\n return STATE_TRANSLATED_KEYWORD;\n }\n return STATE_TEXT;\n}\n\nfunction constructTag(valueChars, type, langChars, keywordChars) {\n const value = getValue(valueChars);\n return {\n name: getName(type, langChars, keywordChars),\n value,\n description: type === TYPE_ITXT ? getDescription(valueChars) : value\n };\n}\n\nfunction getName(type, langChars, keywordChars) {\n const name = getStringValueFromArray(keywordChars);\n if (type === TYPE_TEXT || langChars.length === 0) {\n return name;\n }\n const lang = getStringValueFromArray(langChars);\n return `${name} (${lang})`;\n}\n\nfunction getValue(valueChars) {\n if (valueChars instanceof DataView) {\n return getStringFromDataView(valueChars, 0, valueChars.byteLength);\n }\n return valueChars;\n}\n\nfunction getDescription(valueChars) {\n return TagDecoder.decode('UTF-8', valueChars);\n}\n\nfunction isExifGroupTag(name, value) {\n return name.toLowerCase() === 'raw profile type exif' && value.substring(1, 5) === 'exif';\n}\n\nfunction isIptcGroupTag(name, value) {\n return name.toLowerCase() === 'raw profile type iptc' && value.substring(1, 5) === 'iptc';\n}\n\nfunction decodeRawData(value) {\n const parts = value.match(/\\n(exif|iptc)\\n\\s*\\d+\\n([\\s\\S]*)$/);\n return hexToDataView(parts[2].replace(/\\n/g, ''));\n}\n\nfunction hexToDataView(hex) {\n const dataView = new DataView(new ArrayBuffer(hex.length / 2));\n for (let i = 0; i < hex.length; i += 2) {\n dataView.setUint8(i / 2, parseInt(hex.substring(i, i + 2), 16));\n }\n return dataView;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\nimport {PNG_CHUNK_LENGTH_OFFSET, PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_DATA_OFFSET, PNG_CHUNK_TYPE_SIZE, TYPE_PHYS, TYPE_TIME} from './image-header-png.js';\nimport {getStringFromDataView} from './utils.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, chunkOffsets) {\n const tags = {};\n\n for (let i = 0; i < chunkOffsets.length; i++) {\n const chunkLength = Types.getLongAt(dataView, chunkOffsets[i] + PNG_CHUNK_LENGTH_OFFSET);\n const chunkType = getStringFromDataView(dataView, chunkOffsets[i] + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE);\n\n if (chunkType === TYPE_PHYS) {\n tags['Pixels Per Unit X'] = getPixelsPerUnitX(dataView, chunkOffsets[i], chunkLength);\n tags['Pixels Per Unit Y'] = getPixelsPerUnitY(dataView, chunkOffsets[i], chunkLength);\n tags['Pixel Units'] = getPixelUnits(dataView, chunkOffsets[i], chunkLength);\n } else if (chunkType === TYPE_TIME) {\n tags['Modify Date'] = getModifyDate(dataView, chunkOffsets[i], chunkLength);\n }\n }\n\n return tags;\n}\n\nfunction getPixelsPerUnitX(dataView, chunkOffset, chunkLength) {\n const TAG_OFFSET = 0;\n const TAG_SIZE = 4;\n\n if (!tagFitsInBuffer(dataView, chunkOffset, chunkLength, TAG_OFFSET, TAG_SIZE)) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + TAG_OFFSET);\n\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getPixelsPerUnitY(dataView, chunkOffset, chunkLength) {\n const TAG_OFFSET = 4;\n const TAG_SIZE = 4;\n\n if (!tagFitsInBuffer(dataView, chunkOffset, chunkLength, TAG_OFFSET, TAG_SIZE)) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + TAG_OFFSET);\n\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getPixelUnits(dataView, chunkOffset, chunkLength) {\n const TAG_OFFSET = 8;\n const TAG_SIZE = 1;\n\n if (!tagFitsInBuffer(dataView, chunkOffset, chunkLength, TAG_OFFSET, TAG_SIZE)) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + TAG_OFFSET);\n\n return {\n value,\n description: value === 1 ? 'meters' : 'Unknown'\n };\n}\n\nfunction getModifyDate(dataView, chunkOffset, chunkLength) {\n const TIME_TAG_SIZE = 7;\n\n if (!tagFitsInBuffer(dataView, chunkOffset, chunkLength, 0, TIME_TAG_SIZE)) {\n return undefined;\n }\n\n const year = Types.getShortAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET);\n const month = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 2);\n const day = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 3);\n const hours = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 4);\n const minutes = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 5);\n const seconds = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 6);\n\n return {\n value: [year, month, day, hours, minutes, seconds],\n description: `${pad(year, 4)}-${pad(month, 2)}-${pad(day, 2)} ${pad(hours, 2)}:${pad(minutes, 2)}:${pad(seconds, 2)}`\n };\n}\n\nfunction tagFitsInBuffer(dataView, chunkOffset, chunkLength, tagOffset, tagSize) {\n return tagOffset + tagSize <= chunkLength && chunkOffset + PNG_CHUNK_DATA_OFFSET + tagOffset + tagSize <= dataView.byteLength;\n}\n\nfunction pad(number, size) {\n return `${'0'.repeat(size - ('' + number).length)}${number}`;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nconst IMAGE_WIDTH_OFFSET = 4;\nconst IMAGE_HEIGHT_OFFSET = 7;\n\n// https://developers.google.com/speed/webp/docs/riff_container#extended_file_format\nfunction read(dataView, chunkOffset) {\n const tags = {};\n\n const flags = Types.getByteAt(dataView, chunkOffset);\n\n tags['Alpha'] = getAlpha(flags);\n tags['Animation'] = getAnimation(flags);\n tags['ImageWidth'] = getThreeByteValue(dataView, chunkOffset + IMAGE_WIDTH_OFFSET);\n tags['ImageHeight'] = getThreeByteValue(dataView, chunkOffset + IMAGE_HEIGHT_OFFSET);\n\n return tags;\n}\n\nfunction getAlpha(flags) {\n const value = flags & 0x10;\n return {\n value: value ? 1 : 0,\n description: value ? 'Yes' : 'No'\n };\n}\n\nfunction getAnimation(flags) {\n const value = flags & 0x02;\n return {\n value: value ? 1 : 0,\n description: value ? 'Yes' : 'No'\n };\n}\n\nfunction getThreeByteValue(dataView, offset) {\n // Values are stored little-endian.\n const value = Types.getByteAt(dataView, offset)\n + 256 * Types.getByteAt(dataView, offset + 1)\n + 256 * 256 * Types.getByteAt(dataView, offset + 2)\n + 1; // Value is 1-based, i.e. a value of 7 means 8px.\n\n return {\n value,\n description: value + 'px'\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// https://www.w3.org/Graphics/GIF/spec-gif87.txt\n// https://www.w3.org/Graphics/GIF/spec-gif89a.txt\n\nimport {getStringFromDataView} from './utils.js';\n\nexport default {\n read\n};\n\nfunction read(dataView) {\n return {\n 'GIF Version': getGifVersion(dataView),\n 'Image Width': getImageWidth(dataView),\n 'Image Height': getImageHeight(dataView),\n 'Global Color Map': getGlobalColorMap(dataView),\n 'Bits Per Pixel': getBitDepth(dataView),\n 'Color Resolution Depth': getColorResolution(dataView)\n };\n}\n\nfunction getGifVersion(dataView) {\n const OFFSET = 3;\n const SIZE = 3;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = getStringFromDataView(dataView, OFFSET, SIZE);\n return {\n value,\n description: value\n };\n}\n\nfunction getImageWidth(dataView) {\n const OFFSET = 6;\n const SIZE = 2;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = dataView.getUint16(OFFSET, true);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageHeight(dataView) {\n const OFFSET = 8;\n const SIZE = 2;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = dataView.getUint16(OFFSET, true);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getGlobalColorMap(dataView) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const byteValue = dataView.getUint8(OFFSET);\n const value = (byteValue & 0b10000000) >>> 7;\n return {\n value,\n description: value === 1 ? 'Yes' : 'No'\n };\n}\n\nfunction getColorResolution(dataView) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const byteValue = dataView.getUint8(OFFSET);\n const value = ((byteValue & 0b01110000) >>> 4) + 1; // Zero-based.\n return {\n value,\n description: `${value} ${value === 1 ? 'bit' : 'bits'}`\n };\n}\n\nfunction getBitDepth(dataView) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const byteValue = dataView.getUint8(OFFSET);\n const value = (byteValue & 0b00000111) + 1; // Zero-based.\n return {\n value,\n description: `${value} ${value === 1 ? 'bit' : 'bits'}`\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {deferInit, getBase64Image} from './utils.js';\n\n// https://exiftool.org/TagNames/EXIF.html#Compression\nconst COMPRESSION_JPEG = [6, 7, 99];\n\nexport default {\n get,\n};\n\nfunction get(dataView, thumbnailTags, tiffHeaderOffset) {\n if (hasJpegThumbnail(thumbnailTags)) {\n thumbnailTags.type = 'image/jpeg';\n const offset = tiffHeaderOffset + thumbnailTags.JPEGInterchangeFormat.value;\n thumbnailTags.image = dataView.buffer.slice(offset, offset + thumbnailTags.JPEGInterchangeFormatLength.value);\n deferInit(thumbnailTags, 'base64', function () {\n return getBase64Image(this.image);\n });\n }\n\n // There is a small possibility of thumbnails in TIFF format but they are\n // not stored as a self-contained image file and would be much more\n // difficult to extract.\n // https://exiftool.org/forum/index.php?topic=3273.msg14778#msg14778\n\n return thumbnailTags;\n}\n\nfunction hasJpegThumbnail(tags) {\n return tags && ((tags.Compression === undefined) || (COMPRESSION_JPEG.includes(tags.Compression.value)))\n && tags.JPEGInterchangeFormat && tags.JPEGInterchangeFormat.value\n && tags.JPEGInterchangeFormatLength && tags.JPEGInterchangeFormatLength.value;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n/**\n * Thrown when no Exif metadata was found for the given image.\n *\n * @param {string} message The error message.\n */\nfunction MetadataMissingError(message) {\n this.name = 'MetadataMissingError';\n this.message = message || 'No Exif data';\n this.stack = (new Error()).stack;\n}\n\nMetadataMissingError.prototype = new Error;\n\nexport default {\n MetadataMissingError,\n};\n","/**\n * ExifReader\n * http://github.com/mattiasw/exifreader\n * Copyright (C) 2011-2023 Mattias Wallander <mattias@wallander.eu>\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n/* global Buffer, __non_webpack_require__ */\n\nimport {objectAssign, dataUriToBuffer} from './utils.js';\nimport DataViewWrapper from './dataview.js';\nimport Constants from './constants.js';\nimport {getStringValueFromArray} from './utils.js';\nimport {getCalculatedGpsValue} from './tag-names-utils.js';\nimport ImageHeader from './image-header.js';\nimport Tags from './tags.js';\nimport MpfTags from './mpf-tags.js';\nimport FileTags from './file-tags.js';\nimport JfifTags from './jfif-tags.js';\nimport IptcTags from './iptc-tags.js';\nimport XmpTags from './xmp-tags.js';\nimport PhotoshopTags from './photoshop-tags.js';\nimport IccTags from './icc-tags.js';\nimport PngFileTags from './png-file-tags.js';\nimport PngTextTags from './png-text-tags.js';\nimport PngTags from './png-tags.js';\nimport Vp8xTags from './vp8x-tags.js';\nimport GifFileTags from './gif-file-tags.js';\nimport Thumbnail from './thumbnail.js';\nimport exifErrors from './errors.js';\n\nexport default {\n load,\n loadView,\n errors: exifErrors,\n};\n\nexport const errors = exifErrors;\n\nexport function load(data, options = {}) {\n if (isFilePathOrURL(data)) {\n options.async = true;\n return loadFile(data, options).then((fileContents) => loadFromData(fileContents, options));\n }\n if (isBrowserFileObject(data)) {\n options.async = true;\n return loadFileObject(data).then((fileContents) => loadFromData(fileContents, options));\n }\n return loadFromData(data, options);\n}\n\nfunction isFilePathOrURL(data) {\n return typeof data === 'string';\n}\n\nfunction loadFile(filename, options) {\n if (/^\\w+:\\/\\//.test(filename)) {\n if (typeof fetch !== 'undefined') {\n return fetchRemoteFile(filename, options);\n }\n\n return nodeGetRemoteFile(filename, options);\n }\n\n if (isDataUri(filename)) {\n return Promise.resolve(dataUriToBuffer(filename));\n }\n\n return loadLocalFile(filename, options);\n}\n\nfunction fetchRemoteFile(url, {length} = {}) {\n const options = {method: 'GET'};\n if (Number.isInteger(length) && length >= 0) {\n options.headers = {\n range: `bytes=0-${length - 1}`,\n };\n }\n return fetch(url, options).then((response) => response.arrayBuffer());\n}\n\nfunction nodeGetRemoteFile(url, {length} = {}) {\n return new Promise((resolve, reject) => {\n const options = {};\n if (Number.isInteger(length) && length >= 0) {\n options.headers = {\n range: `bytes=0-${length - 1}`,\n };\n }\n\n const get = requireNodeGet(url);\n get(url, options, (response) => {\n if ((response.statusCode >= 200) && (response.statusCode <= 299)) {\n const data = [];\n response.on('data', (chunk) => data.push(Buffer.from(chunk)));\n response.on('error', (error) => reject(error));\n response.on('end', () => resolve(Buffer.concat(data)));\n } else {\n reject(`Could not fetch file: ${response.statusCode} ${response.statusMessage}`);\n response.resume();\n }\n }).on('error', (error) => reject(error));\n });\n}\n\nfunction requireNodeGet(url) {\n if (/^https:\\/\\//.test(url)) {\n return __non_webpack_require__('https').get;\n }\n return __non_webpack_require__('http').get;\n}\n\nfunction isDataUri(filename) {\n return /^data:[^;,]*(;base64)?,/.test(filename);\n}\n\nfunction loadLocalFile(filename, {length} = {}) {\n return new Promise((resolve, reject) => {\n const fs = requireNodeFs();\n fs.open(filename, (error, fd) => {\n if (error) {\n reject(error);\n } else {\n fs.stat(filename, (error, stat) => {\n if (error) {\n reject(error);\n } else {\n const size = Math.min(stat.size, length !== undefined ? length : stat.size);\n const buffer = Buffer.alloc(size);\n const options = {\n buffer,\n length: size\n };\n fs.read(fd, options, (error) => {\n if (error) {\n reject(error);\n } else {\n fs.close(fd, (error) => {\n if (error) {\n console.warn(`Could not close file ${filename}:`, error); // eslint-disable-line no-console\n }\n resolve(buffer);\n });\n }\n });\n }\n });\n }\n });\n });\n}\n\nfunction requireNodeFs() {\n try {\n return __non_webpack_require__('fs');\n } catch (error) {\n return undefined;\n }\n}\n\nfunction isBrowserFileObject(data) {\n return (typeof window !== 'undefined') && (typeof File !== 'undefined') && (data instanceof File);\n}\n\nfunction loadFileObject(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (readerEvent) => resolve(readerEvent.target.result);\n reader.onerror = () => reject(reader.error);\n reader.readAsArrayBuffer(file);\n });\n}\n\nfunction loadFromData(data, options) {\n if (isNodeBuffer(data)) {\n // File data read in Node can share the underlying buffer with other\n // data. Therefore it's safest to get a new one to avoid weird bugs.\n data = (new Uint8Array(data)).buffer;\n }\n return loadView(getDataView(data), options);\n}\n\nfunction isNodeBuffer(data) {\n try {\n return Buffer.isBuffer(data);\n } catch (error) {\n return false;\n }\n}\n\nfunction getDataView(data) {\n try {\n return new DataView(data);\n } catch (error) {\n return new DataViewWrapper(data);\n }\n}\n\nexport function loadView(\n dataView,\n {expanded = false, async = false, includeUnknown = false} = {expanded: false, async: false, includeUnknown: false}\n) {\n let foundMetaData = false;\n let tags = {};\n const tagsPromises = [];\n\n const {\n fileType,\n fileDataOffset,\n jfifDataOffset,\n tiffHeaderOffset,\n iptcDataOffset,\n xmpChunks,\n iccChunks,\n mpfDataOffset,\n pngHeaderOffset,\n pngTextChunks,\n pngChunkOffsets,\n vp8xChunkOffset,\n gifHeaderOffset\n } = ImageHeader.parseAppMarkers(dataView, async);\n\n if (Constants.USE_JPEG && Constants.USE_FILE && hasFileData(fileDataOffset)) {\n foundMetaData = true;\n const readTags = FileTags.read(dataView, fileDataOffset);\n if (expanded) {\n tags.file = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_JPEG && Constants.USE_JFIF && hasJfifData(jfifDataOffset)) {\n foundMetaData = true;\n const readTags = JfifTags.read(dataView, jfifDataOffset);\n if (expanded) {\n tags.jfif = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_EXIF && hasExifData(tiffHeaderOffset)) {\n foundMetaData = true;\n const readTags = Tags.read(dataView, tiffHeaderOffset, includeUnknown);\n if (readTags.Thumbnail) {\n tags.Thumbnail = readTags.Thumbnail;\n delete readTags.Thumbnail;\n }\n\n if (expanded) {\n tags.exif = readTags;\n addGpsGroup(tags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n\n if (Constants.USE_TIFF && Constants.USE_IPTC && readTags['IPTC-NAA'] && !hasIptcData(iptcDataOffset)) {\n const readIptcTags = IptcTags.read(readTags['IPTC-NAA'].value, 0, includeUnknown);\n if (expanded) {\n tags.iptc = readIptcTags;\n } else {\n tags = objectAssign({}, tags, readIptcTags);\n }\n }\n\n if (Constants.USE_TIFF && Constants.USE_XMP && readTags['ApplicationNotes'] && !hasXmpData(xmpChunks)) {\n const readXmpTags = XmpTags.read(getStringValueFromArray(readTags['ApplicationNotes'].value));\n if (expanded) {\n tags.xmp = readXmpTags;\n } else {\n delete readXmpTags._raw;\n tags = objectAssign({}, tags, readXmpTags);\n }\n }\n\n if (Constants.USE_PHOTOSHOP && readTags['ImageSourceData']) {\n const readPhotoshopTags = PhotoshopTags.read(readTags['PhotoshopSettings'].value, includeUnknown);\n if (expanded) {\n tags.photoshop = readPhotoshopTags;\n } else {\n tags = objectAssign({}, tags, readPhotoshopTags);\n }\n }\n\n if (Constants.USE_TIFF && Constants.USE_ICC && readTags['ICC_Profile'] && !hasIccData(iccChunks)) {\n const readIccTags = IccTags.read(\n readTags['ICC_Profile'].value,\n [{\n offset: 0,\n length: readTags['ICC_Profile'].value.length,\n chunkNumber: 1,\n chunksTotal: 1\n }]\n );\n if (expanded) {\n tags.icc = readIccTags;\n } else {\n tags = objectAssign({}, tags, readIccTags);\n }\n }\n }\n\n if (Constants.USE_JPEG && Constants.USE_IPTC && hasIptcData(iptcDataOffset)) {\n foundMetaData = true;\n const readTags = IptcTags.read(dataView, iptcDataOffset, includeUnknown);\n if (expanded) {\n tags.iptc = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_XMP && hasXmpData(xmpChunks)) {\n foundMetaData = true;\n const readTags = XmpTags.read(dataView, xmpChunks);\n if (expanded) {\n tags.xmp = readTags;\n } else {\n delete readTags._raw;\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if ((Constants.USE_JPEG || Constants.USE_WEBP) && Constants.USE_ICC && hasIccData(iccChunks)) {\n foundMetaData = true;\n const readTags = IccTags.read(dataView, iccChunks, async);\n if (readTags instanceof Promise) {\n tagsPromises.push(readTags.then(addIccTags));\n } else {\n addIccTags(readTags);\n }\n }\n\n if (Constants.USE_MPF && hasMpfData(mpfDataOffset)) {\n foundMetaData = true;\n const readMpfTags = MpfTags.read(dataView, mpfDataOffset, includeUnknown);\n if (expanded) {\n tags.mpf = readMpfTags;\n } else {\n tags = objectAssign({}, tags, readMpfTags);\n }\n }\n\n if (Constants.USE_PNG && Constants.USE_PNG_FILE && hasPngFileData(pngHeaderOffset)) {\n foundMetaData = true;\n const readTags = PngFileTags.read(dataView, pngHeaderOffset);\n if (expanded) {\n tags.png = !tags.png ? readTags : objectAssign({}, tags.png, readTags);\n tags.pngFile = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_PNG && hasPngTextData(pngTextChunks)) {\n foundMetaData = true;\n const {readTags, readTagsPromise} = PngTextTags.read(dataView, pngTextChunks, async, includeUnknown);\n addPngTextTags(readTags);\n if (readTagsPromise) {\n tagsPromises.push(readTagsPromise.then((tagList) => tagList.forEach(addPngTextTags)));\n }\n }\n\n if (Constants.USE_PNG && hasPngData(pngChunkOffsets)) {\n foundMetaData = true;\n const readTags = PngTags.read(dataView, pngChunkOffsets);\n if (expanded) {\n tags.png = !tags.png ? readTags : objectAssign({}, tags.png, readTags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_WEBP && hasVp8xData(vp8xChunkOffset)) {\n foundMetaData = true;\n const readTags = Vp8xTags.read(dataView, vp8xChunkOffset);\n if (expanded) {\n tags.riff = !tags.riff ? readTags : objectAssign({}, tags.riff, readTags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_GIF && hasGifFileData(gifHeaderOffset)) {\n foundMetaData = true;\n const readTags = GifFileTags.read(dataView, gifHeaderOffset);\n if (expanded) {\n tags.gif = !tags.gif ? readTags : objectAssign({}, tags.gif, readTags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n const thumbnail = (Constants.USE_JPEG || Constants.USE_WEBP)\n && Constants.USE_EXIF\n && Constants.USE_THUMBNAIL\n && Thumbnail.get(dataView, tags.Thumbnail, tiffHeaderOffset);\n if (thumbnail) {\n foundMetaData = true;\n tags.Thumbnail = thumbnail;\n } else {\n delete tags.Thumbnail;\n }\n\n if (fileType) {\n if (expanded) {\n if (!tags.file) {\n tags.file = {};\n }\n tags.file.FileType = fileType;\n } else {\n tags.FileType = fileType;\n }\n foundMetaData = true;\n }\n\n if (!foundMetaData) {\n throw new exifErrors.MetadataMissingError();\n }\n\n if (async) {\n return Promise.all(tagsPromises).then(() => tags);\n }\n return tags;\n\n function addIccTags(readTags) {\n if (expanded) {\n tags.icc = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n function addPngTextTags(readTags) {\n if (expanded) {\n for (const group of ['exif', 'iptc']) {\n const groupKey = `__${group}`;\n if (readTags[groupKey]) {\n tags[group] = !tags[group] ? readTags[groupKey] : objectAssign({}, tags.exif, readTags[groupKey]);\n delete readTags[groupKey];\n }\n }\n tags.png = !tags.png ? readTags : objectAssign({}, tags.png, readTags);\n tags.pngText = !tags.pngText ? readTags : objectAssign({}, tags.png, readTags);\n } else {\n tags = objectAssign(\n {},\n tags,\n readTags.__exif ? readTags.__exif : {},\n readTags.__iptc ? readTags.__iptc : {},\n readTags\n );\n }\n }\n}\n\nfunction hasFileData(fileDataOffset) {\n return fileDataOffset !== undefined;\n}\n\nfunction hasJfifData(jfifDataOffset) {\n return jfifDataOffset !== undefined;\n}\n\nfunction hasExifData(tiffHeaderOffset) {\n return tiffHeaderOffset !== undefined;\n}\n\nfunction addGpsGroup(tags) {\n if (tags.exif) {\n if (tags.exif.GPSLatitude && tags.exif.GPSLatitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Latitude = getCalculatedGpsValue(tags.exif.GPSLatitude.value);\n if (tags.exif.GPSLatitudeRef.value.join('') === 'S') {\n tags.gps.Latitude = -tags.gps.Latitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n\n if (tags.exif.GPSLongitude && tags.exif.GPSLongitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Longitude = getCalculatedGpsValue(tags.exif.GPSLongitude.value);\n if (tags.exif.GPSLongitudeRef.value.join('') === 'W') {\n tags.gps.Longitude = -tags.gps.Longitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n\n if (tags.exif.GPSAltitude && tags.exif.GPSAltitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Altitude = tags.exif.GPSAltitude.value[0] / tags.exif.GPSAltitude.value[1];\n if (tags.exif.GPSAltitudeRef.value === 1) {\n tags.gps.Altitude = -tags.gps.Altitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n }\n}\n\nfunction hasIptcData(iptcDataOffset) {\n return iptcDataOffset !== undefined;\n}\n\nfunction hasXmpData(xmpChunks) {\n return Array.isArray(xmpChunks) && xmpChunks.length > 0;\n}\n\nfunction hasIccData(iccDataOffsets) {\n return Array.isArray(iccDataOffsets) && iccDataOffsets.length > 0;\n}\n\nfunction hasMpfData(mpfDataOffset) {\n return mpfDataOffset !== undefined;\n}\n\nfunction hasPngFileData(pngFileDataOffset) {\n return pngFileDataOffset !== undefined;\n}\n\nfunction hasPngTextData(pngTextChunks) {\n return pngTextChunks !== undefined;\n}\n\nfunction hasPngData(pngChunkOffsets) {\n return pngChunkOffsets !== undefined;\n}\n\nfunction hasVp8xData(vp8xChunkOffset) {\n return vp8xChunkOffset !== undefined;\n}\n\nfunction hasGifFileData(gifHeaderOffset) {\n return gifHeaderOffset !== undefined;\n}\n","import { watch } from \"vue\";\n\nexport class FlashMessages {\n static notify;\n\n static PROP_DEFINITIONS = {\n successMsg: {\n type: String,\n default: \"\"\n },\n errorMsg: {\n type: String,\n default: \"\"\n },\n warningMsg: {\n type: String,\n default: \"\"\n }\n };\n\n static enable(msgProps) {\n FlashMessages.success(msgProps.successMsg);\n FlashMessages.error(msgProps.errorMsg);\n FlashMessages.warning(msgProps.warningMsg);\n watch(() => msgProps.successMsg, FlashMessages.success);\n watch(() => msgProps.errorMsg, FlashMessages.error);\n watch(() => msgProps.warningMsg, FlashMessages.warning);\n }\n\n static send(message, options = {}) {\n if (message) {\n FlashMessages.notify({\n message,\n timeout: 10000,\n color: \"gray-base\",\n textColor: \"white\",\n position: \"top\",\n closeBtn: \"X\",\n ...options\n });\n }\n }\n\n static success(message, options = {}) {\n FlashMessages.send(message, {\n color: \"green-light\",\n textColor: \"green-dark\",\n icon: \"hero:check-circle\",\n ...options\n });\n }\n\n static error(message, options = {}) {\n FlashMessages.send(message, {\n color: \"red-light\",\n textColor: \"red-dark\",\n icon: \"hero:alert\",\n ...options\n });\n }\n\n static warning(message, options = {}) {\n FlashMessages.send(message, {\n color: \"yellow-lighter\",\n textColor: \"yellow-base\",\n icon: \"hero:alert\",\n ...options\n });\n }\n\n static combine(type, messages, options = {}) {\n FlashMessages[type](messages.map(m => typeof m === \"string\" ? m : (m.message || m.Message)).join(\"<br/>\"), {\n ...options,\n html: true\n });\n }\n}\n\nexport const notify = new FlashMessages();\n","import ExifReader from \"exifreader\";\nimport { useCompatibility } from \"./compatibility\";\nimport { FlashMessages } from \"./FlashMessages\";\n\nexport async function resolveFileLocation(file, waitMessage = null) {\n if (file.location) {\n return file.location;\n }\n\n try {\n const tags = await ExifReader.load(file.blobUrl || file.url, {\n expanded: true\n });\n if (tags.gps) {\n return {\n latitude: tags.gps.Latitude,\n longitude: tags.gps.Longitude\n };\n }\n\n const { waitForLocation, location } = useCompatibility();\n\n // Show a waiting for location message if we have not returned within 1 second\n if (waitMessage) {\n setTimeout(() => {\n if (!location.value && waitMessage) {\n FlashMessages.warning(waitMessage);\n }\n }, 1000);\n }\n\n // Wait for the browser to return the location (https only as http will not return a location)\n if (window.location.protocol === \"https:\") {\n await waitForLocation();\n }\n // Ignore the wait message if we already returned\n waitMessage = false;\n if (!location.value) {\n return null;\n }\n\n return {\n latitude: location.value.latitude,\n longitude: location.value.longitude,\n accuracy: location.value.accuracy,\n altitude: location.value.altitude,\n altitudeAccuracy: location.value.altitudeAccuracy\n };\n } catch (error) {\n console.error(error);\n return null;\n }\n}\n","import { uid } from \"quasar\";\nimport { danxOptions } from \"../config\";\nimport { resolveFileLocation } from \"./files\";\nimport { FlashMessages } from \"./FlashMessages\";\n\nexport type FileUploadOptions = {\n directory?: string,\n presignedUploadUrl?: (...params: any) => \"\",\n uploadCompletedUrl?: (...params: any) => \"\",\n};\n\nexport type UploadedFile = {\n id: string,\n name: string,\n size: number,\n type: string,\n progress: number,\n location: string,\n blobUrl: string\n}\n\nexport class FileUpload {\n files: UploadedFile[] = [];\n fileUploads = [];\n onErrorCb = null;\n onProgressCb = null;\n onCompleteCb = null;\n onAllCompleteCb = null;\n options: FileUploadOptions = {};\n\n constructor(files: UploadedFile[] | UploadedFile, options: FileUploadOptions = {}) {\n if (!Array.isArray(files) && !(files instanceof FileList)) {\n files = [files];\n }\n this.files = files;\n this.fileUploads = [];\n this.onErrorCb = null;\n this.onProgressCb = null;\n this.onCompleteCb = null;\n this.onAllCompleteCb = null;\n\n this.options = {\n ...danxOptions.fileUpload,\n ...options\n };\n\n if (!this.options.presignedUploadUrl) {\n throw new Error(\"Please configure the danxOptions: import { configure } from 'quasar-ui-danx';\");\n }\n this.prepare();\n }\n\n /**\n * Prepares all files for upload and provides an id and blobUrl for each file\n */\n prepare() {\n // Prepare required attributes\n for (const file of this.files) {\n if (!(file instanceof File)) {\n throw Error(\n \"FileUpload constructor requires a File object or a list of File objects\"\n );\n }\n\n file.id = uid();\n file.blobUrl = URL.createObjectURL(file);\n\n // Prepare FormData\n const formData = new FormData();\n formData.append(\"file\", file);\n\n this.fileUploads.push({\n file,\n xhr: null, // NOTE: The XHR will be setup asynchronously right before sending file uploads\n formData,\n isComplete: false\n });\n }\n }\n\n /**\n * Callback for when all files have been uploaded\n */\n onAllComplete(cb) {\n this.onAllCompleteCb = cb;\n return this;\n }\n\n /**\n * Callback fired once for each file upon successful completion of upload\n * @param cb\n * @returns {FileUpload}\n */\n onComplete(cb) {\n this.onCompleteCb = cb;\n return this;\n }\n\n /**\n * Callback fired each time there is an upload progress update for a file\n * @param cb\n * @returns {FileUpload}\n */\n onProgress(cb) {\n this.onProgressCb = cb;\n return this;\n }\n\n /**\n * Callback fired when an error occurs during upload\n * @param cb\n * @returns {FileUpload}\n */\n onError(cb) {\n this.onErrorCb = cb;\n return this;\n }\n\n /**\n * Handles the error events / fires the callback if it is set\n * @param e\n * @param file\n * @param error\n */\n errorHandler(e, file, error = null) {\n if (this.onErrorCb) {\n this.onErrorCb({ e, file, error });\n }\n }\n\n /**\n * Resolve the locations of all the files\n * @returns {Promise<FileUpload>}\n */\n async resolveLocation(waitMessage = null) {\n for (const fileUpload of this.fileUploads) {\n fileUpload.file.location = await resolveFileLocation(\n fileUpload.file,\n waitMessage\n );\n fileUpload.formData.append(\n \"meta\",\n JSON.stringify(fileUpload.file.location)\n );\n }\n return this;\n }\n\n /**\n * Fires the progress callback\n * @param fileUpload\n * @param progress\n */\n fireProgressCallback(fileUpload, progress) {\n fileUpload.file.progress = progress;\n this.onProgressCb && this.onProgressCb({ file: this.wrapFile(fileUpload.file), progress });\n }\n\n /**\n * Fires the complete callback\n * @param fileUpload\n * @param uploadedFile\n */\n fireCompleteCallback(fileUpload, uploadedFile) {\n fileUpload.isComplete = true;\n fileUpload.file.progress = 1;\n this.onCompleteCb && this.onCompleteCb({ file: this.wrapFile(fileUpload.file), uploadedFile });\n }\n\n /**\n * Check if all files have been uploaded and call the callback if they have\n */\n checkAllComplete() {\n if (this.onAllCompleteCb) {\n if (this.fileUploads.every((fileUpload) => fileUpload.isComplete)) {\n this.onAllCompleteCb({ files: this.fileUploads });\n }\n }\n }\n\n /**\n * Returns a native JS object that is easier to work with than the File objects (no weird behavior of missing\n * properties, easily printable, etc.)\n * @param file\n * @returns {{size, name, progress, location, blobUrl: *, id, type}}\n */\n wrapFile(file) {\n return {\n id: file.id,\n name: file.name,\n size: file.size,\n type: file.type,\n progress: file.progress,\n location: file.location,\n blobUrl: file.blobUrl\n };\n }\n\n /**\n * Registers all the callbacks requested for the XHR / post-processing of file uploads\n */\n setXhrCallbacks() {\n // Set the error callbacks\n for (const fileUpload of this.fileUploads) {\n fileUpload.xhr.addEventListener(\n \"error\",\n (e) => this.errorHandler(e, fileUpload.file),\n false\n );\n }\n\n // Set the progress callbacks\n if (this.onProgressCb) {\n for (const fileUpload of this.fileUploads) {\n fileUpload.xhr.upload.addEventListener(\n \"progress\",\n (e) => {\n // Max of 95%, so we can indicate we are completing the signed URL process\n const progress = Math.min(.95, e.loaded / e.total);\n this.fireProgressCallback(fileUpload, progress);\n },\n false\n );\n }\n }\n\n // Set the load callbacks which registers the Complete / All Complete callbacks and handles non-xhr related\n // errors\n for (const fileUpload of this.fileUploads) {\n fileUpload.xhr.addEventListener(\n \"load\",\n async (e) => {\n try {\n // First complete the presigned upload to get the updated file resource data\n const uploadedFile = await this.completePresignedUpload(fileUpload);\n\n // Fire the file complete callbacks\n this.fireCompleteCallback(fileUpload, uploadedFile);\n this.checkAllComplete();\n } catch (error) {\n this.errorHandler(e, fileUpload.file, error);\n }\n },\n false\n );\n }\n }\n\n /**\n * Mark the presigned upload as completed and return the file resource from the platform server\n * @param fileUpload\n * @returns {Promise<void>}\n */\n async completePresignedUpload(fileUpload) {\n // Show 95% as the last 5% will be to complete the presigned upload\n this.fireProgressCallback(fileUpload, .95);\n\n // Let the platform know the presigned upload is complete\n return await fetch(this.options.uploadCompletedUrl(fileUpload.file.resource_id), { method: \"POST\" }).then(r => r.json());\n }\n\n /**\n * Start uploading all files\n */\n async upload() {\n for (const fileUpload of this.fileUploads) {\n const mimeType = fileUpload.file.mimeType || fileUpload.file.type;\n const presignedUrl = this.options.presignedUploadUrl(this.options.directory, fileUpload.file.name, mimeType);\n\n // Fetch presigned upload URL\n const fileResource = await fetch(presignedUrl).then(r => r.json());\n\n if (!fileResource.url) {\n FlashMessages.error(\"Could not fetch presigned upload URL for file \" + fileUpload.file.name);\n continue;\n }\n\n const isS3Upload = !fileResource.url.match(\"upload-presigned-url-contents\");\n\n // We need the file resource ID to complete the presigned upload\n fileUpload.file.resource_id = fileResource.id;\n\n // Prepare XHR request\n const xhr = new XMLHttpRequest();\n\n // The XHR request is different based on weather we're sending to S3 or the platform server\n if (isS3Upload) {\n xhr.open(\"PUT\", fileResource.url);\n xhr.setRequestHeader(\"Content-Type\", mimeType);\n fileUpload.body = fileUpload.file;\n } else {\n xhr.open(\"POST\", fileResource.url);\n fileUpload.body = fileUpload.formData;\n }\n\n fileUpload.xhr = xhr;\n }\n\n // Set all the callbacks on the XHR requests\n this.setXhrCallbacks();\n\n // Send all the XHR file uploads\n for (const fileUpload of this.fileUploads) {\n fileUpload.xhr.send(fileUpload.body);\n }\n }\n}\n","export const request = {\n async get(url, options = {}) {\n return fetch(url, {\n method: \"get\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n ...options\n }).then((r) => r.json());\n },\n\n async post(url, data = {}, options = {}) {\n return fetch(url, {\n method: \"post\",\n body: JSON.stringify(data),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n ...options\n }).then((r) => r.json());\n }\n};\n\n/**\n * Fetches a resource list applying the filter. If there is a selected resource,\n * stores that resource from the already populated list. If that resource does not exist\n * also fetches that resource record from the endpoint, then adds it to the list if it\n * does not exist in the filtered list\n *\n * @param fetchFn\n * @param list\n * @param id\n * @param filter\n * @returns {Promise<void>}\n */\nexport async function fetchResourceListWithSelected(fetchFn, list, id, filter) {\n // First make sure we have the selected record, so we can always add it to the list\n let selectedResource;\n if (id) {\n selectedResource = list.value.find((c) => c.id === id) || (await fetchFn({ id }))[0];\n }\n\n // Get the filtered campaign list\n list.value = await fetchFn(filter);\n\n // If our selected campaign is not in the filtered list, add it\n if (selectedResource && !list.value.find((c) => c.id === id)) {\n list.value.push(selectedResource);\n }\n}\n\n/**\n * Returns the value of the URL parameter (if it is set)\n * @param key\n * @param url\n */\nexport function getUrlParam(key, url = undefined) {\n const params = new URLSearchParams(url?.replace(/.*\\?/, \"\") || window.location.search);\n return params.get(key);\n}\n","import { ref } from \"vue\";\nimport { FileUpload, FileUploadOptions } from \"./FileUpload\";\n\nexport function useMultiFileUpload(options: FileUploadOptions) {\n const uploadedFiles = ref([]);\n const onCompleteCb = ref(null);\n const onFilesChangeCb = ref(null);\n const onFilesSelected = (e) => {\n uploadedFiles.value = [...uploadedFiles.value, ...e.target.files];\n new FileUpload(e.target.files, options)\n .onProgress(({ file }) => {\n updateFileInList(file);\n })\n .onComplete(({ file, uploadedFile }) => {\n updateFileInList(file, uploadedFile);\n })\n .onAllComplete(() => {\n onCompleteCb.value && onCompleteCb.value();\n onFilesChangeCb.value && onFilesChangeCb.value(uploadedFiles.value);\n })\n .upload();\n };\n\n function updateFileInList(file, replace = null) {\n const index = uploadedFiles.value.findIndex(f => f.id === file.id);\n if (index !== -1) {\n uploadedFiles.value.splice(index, 1, replace || file);\n }\n onFilesChangeCb.value && onFilesChangeCb.value(uploadedFiles.value);\n }\n\n const onDrop = (e) => {\n onFilesSelected({ target: { files: e.dataTransfer.files } });\n };\n\n const onFilesChange = (cb) => {\n onFilesChangeCb.value = cb;\n };\n\n const onComplete = (cb) => {\n onCompleteCb.value = cb;\n };\n\n const onClear = () => {\n uploadedFiles.value = [];\n onFilesChangeCb.value && onFilesChangeCb.value(uploadedFiles.value);\n onCompleteCb.value && onCompleteCb.value();\n };\n\n const onRemove = (file) => {\n const index = uploadedFiles.value.findIndex(f => f.id === file.id);\n if (index !== -1) {\n uploadedFiles.value.splice(index, 1);\n }\n onFilesChangeCb.value && onFilesChangeCb.value(uploadedFiles.value);\n onCompleteCb.value && onCompleteCb.value();\n };\n\n return {\n onClear,\n onRemove,\n onComplete,\n onFilesChange,\n onDrop,\n onFilesSelected,\n uploadedFiles\n };\n}\n","import { ref, shallowRef, VNode } from \"vue\";\nimport { FlashMessages } from \"./FlashMessages\";\n\ntype ActionTarget = object[] | object;\n\ninterface ActionOptions {\n name?: string;\n label?: string;\n menu?: boolean;\n batch?: boolean;\n category?: string;\n class?: string;\n trigger?: (target: ActionTarget, input: any) => Promise<any>;\n activeTarget?: any;\n vnode?: (target: ActionTarget) => VNode;\n enabled?: (target: object) => boolean;\n batchEnabled?: (targets: object[]) => boolean;\n optimistic?: (action: ActionOptions, target: object, input: any) => void;\n onAction?: (action: string | null | undefined, target: object, input: any) => Promise<any>;\n onBatchAction?: (action: string | null | undefined, targets: object[], input: any) => Promise<any>;\n onStart?: (action: ActionOptions | null, targets: ActionTarget, input: any) => boolean;\n onSuccess?: (result: any, targets: ActionTarget, input: any) => any;\n onError?: (result: any, targets: ActionTarget, input: any) => any;\n onFinish?: (result: any, targets: ActionTarget, input: any) => any;\n}\n\nexport const activeActionVnode: object = shallowRef(null);\n\n/**\n * Hook to perform an action on a set of targets\n * This helper allows you to perform actions by name on a set of targets using a provided list of actions\n *\n * @param actions\n * @param {ActionOptions | null} globalOptions\n */\nexport function useActions(actions: ActionOptions[], globalOptions: ActionOptions | null = null) {\n const mappedActions = actions.map(action => {\n const mappedAction: ActionOptions = { ...globalOptions, ...action };\n if (!mappedAction.trigger) {\n mappedAction.trigger = (target, input) => performAction(mappedAction, target, input);\n mappedAction.activeTarget = ref(null);\n }\n return mappedAction;\n });\n\n /**\n * Check if the provided target is currently being saved by any of the actions\n */\n function isSavingTarget(target: any): boolean {\n if (!target) return false;\n\n for (const action of mappedActions) {\n const activeTargets = (Array.isArray(action.activeTarget.value) ? action.activeTarget.value : [action.activeTarget.value]).filter(t => t);\n if (activeTargets.length === 0) continue;\n\n for (const activeTarget of activeTargets) {\n if (activeTarget === target || (activeTarget.id && activeTarget.id === target.id)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Perform an action on a set of targets\n *\n * @param {string} name - can either be a string or an action object\n * @param {object[]|object} target - an array of targets or a single target object\n * @param {any} input - The input data to pass to the action handler\n */\n async function performAction(name: string | object, target: ActionTarget, input: any = null) {\n const action: ActionOptions = typeof name === \"string\" ? mappedActions.find(a => a.name === name) : name;\n if (!action) {\n throw new Error(`Unknown action: ${name}`);\n }\n\n if (!action.activeTarget) {\n throw new Error(`Action ${action.name} does not have an activeTarget ref. Please use useActions() or manually set the activeTarget ref`);\n }\n\n const vnode = action.vnode && action.vnode(target);\n let result: any;\n\n action.activeTarget.value = target;\n\n // Run the onStart handler if it exists and quit the operation if it returns false\n if (action.onStart) {\n if (!action.onStart(action, target, input)) {\n return;\n }\n }\n\n // If additional input is required, first render the vnode and wait for the confirm or cancel action\n if (vnode) {\n // If the action requires an input, we set the activeActionVnode to the input component.\n // This will tell the ActionVnode to render the input component, and confirm or cancel the\n // action The confirm function has the input from the component passed and will resolve the promise\n // with the result of the action\n result = await new Promise((resolve, reject) => {\n activeActionVnode.value = {\n vnode,\n confirm: async (confirmInput: any) => {\n const result = await onConfirmAction(action, target, { ...input, ...confirmInput });\n\n // Only resolve when we have a non-error response, so we can show the error message w/o\n // hiding the dialog / vnode\n if (result === undefined || result === true || result?.success) {\n resolve(result);\n }\n },\n cancel: resolve\n };\n });\n\n activeActionVnode.value = null;\n } else {\n result = await onConfirmAction(action, target, input);\n }\n\n action.activeTarget.value = null;\n return result;\n }\n\n /**\n * Filter the list of actions based on the provided filters in key-value pairs\n * You can filter on any ActionOptions property by matching the value exactly or by providing an array of values\n *\n * @param filters\n * @returns {ActionOptions[]}\n */\n function filterActions(filters: object): ActionOptions[] {\n let filteredActions = [...mappedActions];\n\n for (const filter of Object.keys(filters)) {\n const filterValue = filters[filter];\n filteredActions = filteredActions.filter(a => a[filter] === filterValue || (Array.isArray(filterValue) && filterValue.includes(a[filter])));\n }\n return filteredActions;\n }\n\n return {\n actions: mappedActions,\n isSavingTarget,\n filterActions,\n performAction\n };\n}\n\nasync function onConfirmAction(action: ActionOptions, target: ActionTarget, input: any = null) {\n if (!action.onAction) {\n throw new Error(\"No onAction handler found for the selected action:\" + action.name);\n }\n\n let result: any;\n try {\n if (Array.isArray(target)) {\n if (action.onBatchAction) {\n result = await action.onBatchAction(action.name, target, input);\n } else {\n result = { error: `Action ${action.name} does not support batch actions` };\n }\n } else {\n // If the action has an optimistic callback, we call it before the actual action to immediately\n // update the UI\n if (action.optimistic) {\n action.optimistic(action, target, input);\n }\n\n result = await action.onAction(action.name, target, input);\n }\n } catch (e) {\n console.error(e);\n result = { error: `An error occurred while performing the action ${action.label}. Please try again later.` };\n }\n\n // If there is no return value or the result marks it as successful, we show a success message\n if (result === undefined || result === true || result?.success) {\n if (result?.success && Array.isArray(target)) {\n FlashMessages.success(`Successfully performed action ${action.label} on ${target.length} items`);\n }\n\n if (action.onSuccess) {\n action.onSuccess(result, target, input);\n }\n } else {\n const errors = [];\n if (result.errors) {\n errors.push(...result.errors);\n } else if (result.error) {\n errors.push(typeof result.error === \"string\" ? result.error : result.error.message);\n } else {\n errors.push(\"An unknown error occurred. Please try again later.\");\n }\n\n FlashMessages.combine(\"error\", errors);\n\n if (action.onError) {\n action.onError(result, target, input);\n }\n }\n\n if (action.onFinish) {\n action.onFinish(result, target, input);\n }\n\n return result;\n}\n","import { computed, ref } from \"vue\";\nimport { FileUpload, FileUploadOptions } from \"./FileUpload\";\n\nexport function useSingleFileUpload(options: FileUploadOptions = null) {\n const uploadedFile = ref(null);\n const onCompleteCb = ref(null);\n const onFileChangeCb = ref(null);\n\n const onFileSelected = (e) => {\n uploadedFile.value = null;\n new FileUpload(e.target.files[0], options)\n .onProgress(({ file }) => {\n uploadedFile.value = file;\n onFileChangeCb.value && onFileChangeCb.value(uploadedFile.value);\n })\n .onComplete(({ uploadedFile: completedFile }) => {\n uploadedFile.value = completedFile;\n onCompleteCb.value && onCompleteCb.value(uploadedFile.value);\n onFileChangeCb.value && onFileChangeCb.value(uploadedFile.value);\n })\n .upload();\n };\n\n const onDrop = (e) => {\n onFileSelected({ target: { files: e.dataTransfer.files } });\n };\n\n const isFileUploaded = computed(() => {\n return uploadedFile.value && uploadedFile.value.url;\n });\n\n const onFileChange = (cb) => {\n onFileChangeCb.value = cb;\n };\n\n const onComplete = (cb) => {\n onCompleteCb.value = cb;\n };\n\n const onClear = () => {\n uploadedFile.value = null;\n onFileChangeCb.value && onFileChangeCb.value(uploadedFile.value);\n };\n\n return {\n isFileUploaded,\n onClear,\n onComplete,\n onFileChange,\n onDrop,\n onFileSelected,\n uploadedFile\n };\n}\n","export function setItem(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n}\n\nexport function getItem(key, defaultValue = null) {\n const item = localStorage.getItem(key);\n return item ? JSON.parse(item) : defaultValue;\n}\n","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M19 9l-7 7-7-7\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M15 19l-7-7 7-7\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M15 12a3 3 0 11-6 0 3 3 0 016 0z\"\n }),\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M7 20l4-16m2 16l4-16M6 9h14M4 15h14\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z\"\n }),\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M12 4v16m8-8H4\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M6 18L18 6M6 6l12 12\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", { d: \"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z\" })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", { d: \"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z\" })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","/**\n * Drag and Drop basic functionality for dragging elements and firing events on drag start, drag over and drag end\n */\nexport class DragAndDrop {\n options: {\n direction?: string,\n hideDragImage?: boolean,\n showPlaceholder?: boolean,\n } = { direction: \"vertical\", hideDragImage: false };\n\n // State\n startY = 0;\n startX = 0;\n startSize = 0;\n cursorY = 0;\n cursorX = 0;\n onStartCb = null;\n onEndCb = null;\n onDropCb = null;\n onDraggingCb = null;\n dropZoneResolver = null;\n currentDropZone = null;\n draggableData = null;\n // Used to abort dragging event listeners on the element\n abortController = null;\n\n constructor(options = {}) {\n // Options\n options = {\n direction: \"vertical\",\n hideDragImage: false,\n ...options,\n };\n\n this.setOptions(options);\n }\n\n /**\n * Set the options for the drag and drop instance\n * @param options\n * @returns {DragAndDrop}\n */\n setOptions(options = {}) {\n this.options = { ...this.options, ...options };\n return this;\n }\n\n /**\n * Returns if the list is stacked vertically or horizontally\n * @returns {boolean}\n */\n isVertical() {\n return this.options.direction === \"vertical\";\n }\n\n /**\n * Set the target drop zone for draggable elements\n * @param dropZone\n * @returns {DragAndDrop}\n */\n setDropZone(dropZone) {\n this.dropZoneResolver = dropZone;\n return this;\n }\n\n /**\n * Callback that fires when an element has started dragging\n * @param cb\n * @returns {DragAndDrop}\n */\n onStart(cb) {\n this.onStartCb = cb;\n return this;\n }\n\n /**\n * Callback that fires when an element has stopped dragging\n * @param cb\n * @returns {DragAndDrop}\n */\n onEnd(cb) {\n this.onEndCb = cb;\n return this;\n }\n\n /**\n * Callback that fires when the dragging element is moved\n * @param cb\n * @returns {DragAndDrop}\n */\n onDragging(cb) {\n this.onDraggingCb = cb;\n return this;\n }\n\n /**\n * Callback that fires when the dragging element has been dropped\n * @param cb\n * @returns {DragAndDrop}\n */\n onDrop(cb) {\n this.onDropCb = cb;\n return this;\n }\n\n /**\n * Start listening for drag events and prepare an element for drag/drop\n * @param e\n * @param data\n */\n dragStart(e, data) {\n this.currentDropZone = this.getDropZone(e);\n\n if (this.currentDropZone) {\n this.startY = e.clientY;\n this.startX = e.clientX;\n this.startSize = this.getDropZoneSize();\n e.dataTransfer.effectAllowed = \"move\";\n e.dataTransfer.dropEffect = \"move\";\n this.draggableData = data;\n this.abortController = new AbortController();\n const options = { signal: this.abortController.signal };\n document.addEventListener(\"dragenter\", (e) => this.dragEnter(e), options);\n document.addEventListener(\"dragover\", (e) => this.dragOver(e), options);\n document.addEventListener(\"drop\", (e) => this.drop(e), options);\n this.onStartCb && this.onStartCb(e);\n\n if (this.options.hideDragImage) {\n e.dataTransfer.setDragImage(new Image(), 0, 0);\n }\n } else {\n console.error(\"Drop zone was not found\", e, data);\n }\n }\n\n /**\n * Clean up event listeners after dragging is done\n */\n dragEnd(e) {\n this.currentDropZone = null;\n this.abortController.abort();\n this.draggableData = null;\n this.onEndCb && this.onEndCb(e);\n }\n\n /**\n * The dragging element has entered a new target\n * @param e\n */\n dragEnter(e) {\n e.preventDefault();\n }\n\n /**\n * The dragging element is moving\n * @param e\n */\n dragOver(e) {\n e.preventDefault();\n this.cursorY = e.clientY;\n this.cursorX = e.clientX;\n this.onDraggingCb && this.onDraggingCb(e);\n }\n\n /**\n * Handle dropping the element into its correct position\n * @param e\n */\n drop(e) {\n e.dataTransfer.dropEffect = \"move\";\n e.preventDefault();\n this.onDropCb && this.onDropCb(e, this.draggableData);\n }\n\n /**\n * Returns the drop zone if the current target element is or is inside the drop zone\n * @param e\n * @returns {HTMLElement|null}\n */\n getDropZone(e) {\n if (typeof this.dropZoneResolver === \"string\") {\n let target = e.target;\n while (target) {\n if (target.dataset?.dropZone === this.dropZoneResolver) {\n return target;\n }\n target = target.parentNode;\n }\n return null;\n } else if (typeof this.dropZoneResolver === \"function\") {\n return this.dropZoneResolver(e);\n } else {\n return document.body;\n }\n }\n\n /**\n * Returns the distance between the start and current cursor position\n * @returns {number}\n */\n getDistance() {\n return this.isVertical()\n ? this.cursorY - this.startY\n : this.cursorX - this.startX;\n }\n\n /**\n * Returns the size of the drop zone\n */\n getDropZoneSize() {\n return this.isVertical()\n ? this.currentDropZone?.offsetHeight\n : this.currentDropZone?.offsetWidth;\n }\n\n /**\n * Returns the percent change between the start and current cursor position relative to the drop zone size\n *\n * @returns {number}\n */\n getPercentChange() {\n const distance = this.getDistance();\n return (distance / this.startSize) * 100;\n }\n}\n","<template>\n <div\n :class=\"{\n 'cursor-ew-resize': direction === 'horizontal',\n 'cursor-ns-resize': direction === 'vertical',\n }\"\n class=\"flex justify-center items-center w-full h-full\"\n draggable=\"true\"\n @dragstart=\"dragAndDrop.dragStart\"\n @dragend=\"dragAndDrop.dragEnd\"\n >\n <slot />\n </div>\n</template>\n<script setup>\nimport { useDebounceFn } from '@vueuse/core';\nimport { DragAndDrop } from './dragAndDrop';\n\nconst emit = defineEmits(['start', 'end', 'resize']);\nconst props = defineProps({\n initialValue: {\n type: Number,\n default: null\n },\n dropZone: {\n type: [Function, String],\n required: true\n },\n direction: {\n type: String,\n default: 'horizontal',\n validator: (value) => ['vertical', 'horizontal'].includes(value)\n }\n});\n\nconst dragAndDrop = new DragAndDrop()\n .setDropZone(props.dropZone)\n .setOptions({\n showPlaceholder: true,\n direction: props.direction,\n hideDragImage: true\n })\n .onDragging(useDebounceFn(() => {\n emit('resize', {\n distance: dragAndDrop.getDistance(),\n percent: dragAndDrop.getPercentChange(),\n startDropZoneSize: dragAndDrop.startSize,\n dropZoneSize: dragAndDrop.getDropZoneSize()\n });\n }, 20, { maxWait: 30 }))\n .onStart(() => emit('start'))\n .onEnd(() => emit('end'));\n</script>\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M10 12 6 8h8z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M7.5 16q-.625 0-1.062-.438A1.44 1.44 0 0 1 6 14.5q0-.625.438-1.062A1.44 1.44 0 0 1 7.5 13q.625 0 1.062.438Q9 13.875 9 14.5t-.438 1.062A1.44 1.44 0 0 1 7.5 16m5 0q-.625 0-1.062-.438A1.44 1.44 0 0 1 11 14.5q0-.625.438-1.062A1.44 1.44 0 0 1 12.5 13q.625 0 1.062.438.438.437.438 1.062t-.438 1.062A1.44 1.44 0 0 1 12.5 16m-5-4.5q-.625 0-1.062-.438A1.44 1.44 0 0 1 6 10q0-.625.438-1.062A1.44 1.44 0 0 1 7.5 8.5q.625 0 1.062.438Q9 9.375 9 10t-.438 1.062A1.44 1.44 0 0 1 7.5 11.5m5 0q-.625 0-1.062-.438A1.44 1.44 0 0 1 11 10q0-.625.438-1.062A1.44 1.44 0 0 1 12.5 8.5q.625 0 1.062.438Q14 9.375 14 10t-.438 1.062a1.44 1.44 0 0 1-1.062.438M7.5 7q-.625 0-1.062-.438A1.44 1.44 0 0 1 6 5.5q0-.625.438-1.062A1.44 1.44 0 0 1 7.5 4q.625 0 1.062.438Q9 4.875 9 5.5t-.438 1.062A1.44 1.44 0 0 1 7.5 7m5 0q-.625 0-1.062-.438A1.44 1.44 0 0 1 11 5.5q0-.625.438-1.062A1.44 1.44 0 0 1 12.5 4q.625 0 1.062.438Q14 4.875 14 5.5t-.438 1.062A1.44 1.44 0 0 1 12.5 7\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 7 16\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M.5 1v14c0 .55.45 1 1 1s1-.45 1-1V1c0-.55-.45-1-1-1S.5.45.5 1m6 14V1c0-.55-.45-1-1-1s-1 .45-1 1v14c0 .55.45 1 1 1s1-.45 1-1\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M9.167 17.5v-5h1.666v1.667H17.5v1.666h-6.667V17.5zM2.5 15.833v-1.666h5v1.666zM5.833 12.5v-1.667H2.5V9.167h3.333V7.5H7.5v5zm3.334-1.667V9.167H17.5v1.666zM12.5 7.5v-5h1.667v1.667H17.5v1.666h-3.333V7.5zm-10-1.667V4.167h8.333v1.666z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M17.859 18.558c.394 0 .713-.32.713-.714V2.141a.714.714 0 0 0-.713-.713H2.156a.714.714 0 0 0-.714.713v15.703c0 .394.32.714.714.714zM20 17.844a2.14 2.14 0 0 1-2.141 2.141H2.156a2.14 2.14 0 0 1-2.141-2.14V2.14C.015.96.973.001 2.156.001h15.703C19.04 0 20 .958 20 2.14z\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M13.205 4.996a1.784 1.784 0 1 0 0 3.569 1.784 1.784 0 0 0 0-3.57M9.993 6.78a3.212 3.212 0 1 1 6.424 0 3.212 3.212 0 0 1-6.424 0M2.848 9.993A11.22 11.22 0 0 1 14.12 19.14a.714.714 0 0 1-1.403.264 9.79 9.79 0 0 0-9.846-7.984h-.018c-.673-.001-1.344.061-2.005.188a.714.714 0 1 1-.268-1.402 12 12 0 0 1 2.268-.213\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M10.954 13.82c1.5-.645 3.117-.976 4.75-.972 1.29 0 2.573.21 3.796.622a.714.714 0 1 1-.456 1.353 10.4 10.4 0 0 0-3.34-.548h-.002a10.55 10.55 0 0 0-4.185.856.714.714 0 1 1-.563-1.312\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_5 = [\n _hoisted_2,\n _hoisted_3,\n _hoisted_4\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_5]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 550.801 550.801\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M160.381 282.225c0-14.832-10.299-23.684-28.474-23.684-7.414 0-12.437.715-15.071 1.432V307.6c3.114.707 6.942.949 12.192.949 19.391 0 31.353-9.809 31.353-26.324M272.875 259.019c-8.145 0-13.397.717-16.519 1.435v105.523c3.116.729 8.142.729 12.69.729 33.017.231 54.554-17.946 54.554-56.474.242-33.513-19.385-51.213-50.725-51.213\" }, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M488.426 197.019H475.2v-63.816c0-.398-.063-.799-.116-1.202-.021-2.534-.827-5.023-2.562-6.995L366.325 3.694c-.032-.031-.063-.042-.085-.076-.633-.707-1.371-1.295-2.151-1.804a10 10 0 0 0-.706-.419 11 11 0 0 0-2.131-.896c-.2-.056-.38-.138-.58-.19A10.8 10.8 0 0 0 358.193 0H97.2C85.282 0 75.6 9.693 75.6 21.601v175.413H62.377c-17.049 0-30.873 13.818-30.873 30.873v160.545c0 17.043 13.824 30.87 30.873 30.87h13.224V529.2c0 11.907 9.682 21.601 21.6 21.601h356.4c11.907 0 21.6-9.693 21.6-21.601V419.302h13.226c17.044 0 30.871-13.827 30.871-30.87v-160.54c-.001-17.054-13.828-30.873-30.872-30.873M97.2 21.605h250.193v110.513c0 5.967 4.841 10.8 10.8 10.8H453.6v54.108H97.2zm265.159 287.418c0 30.876-11.243 52.165-26.82 65.333-16.971 14.117-42.82 20.814-74.396 20.814-18.9 0-32.297-1.197-41.401-2.389V234.365c13.399-2.149 30.878-3.346 49.304-3.346 30.612 0 50.478 5.508 66.039 17.226 16.743 12.445 27.274 32.302 27.274 60.778M80.7 393.499V234.365c11.241-1.904 27.042-3.346 49.296-3.346 22.491 0 38.527 4.308 49.291 12.928 10.292 8.131 17.215 21.534 17.215 37.328 0 15.799-5.25 29.198-14.829 38.285-12.442 11.728-30.865 16.996-52.407 16.996-4.778 0-9.1-.243-12.435-.723v57.67H80.7zm372.901 129.854H97.2V419.302h356.4v104.051zm31.297-261.226h-61.989v36.851h57.913v29.674h-57.913V393.5h-36.593V232.216h98.582z\" }, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_4]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n \"xml:space\": \"preserve\",\n fill: \"currentColor\",\n viewBox: \"0 0 394.4 394.4\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M37.4 377.4a20.33 20.33 0 0 1-14.423-5.977c-7.97-7.963-7.97-20.883 0-28.846l319.6-319.601c7.97-7.97 20.876-7.97 28.846 0 7.97 7.962 7.97 20.882 0 28.845l-319.6 319.601A20.32 20.32 0 0 1 37.4 377.4m357-78.201c0-52.496-42.704-95.199-95.2-95.199S204 246.703 204 299.199s42.704 95.201 95.2 95.201 95.2-42.705 95.2-95.201m-40.799 0c0 29.996-24.405 54.4-54.4 54.4s-54.4-24.404-54.4-54.4c0-29.994 24.405-54.398 54.4-54.398s54.4 24.404 54.4 54.398M190.4 95.2C190.4 42.704 147.696 0 95.2 0S0 42.704 0 95.2s42.704 95.2 95.2 95.2 95.2-42.704 95.2-95.2m-40.8 0c0 29.995-24.405 54.4-54.4 54.4s-54.4-24.405-54.4-54.4 24.405-54.4 54.4-54.4 54.4 24.406 54.4 54.4\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M16.5 18V6h2v12zm-11 0V6l9 6z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M5.5 18V6h2v12zm13 0-9-6 9-6z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"20\",\n fill: \"none\",\n viewBox: \"0 0 16 18\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n stroke: \"currentColor\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"stroke-width\": \"2\",\n d: \"m13.833 4.833-.722 10.119a1.667 1.667 0 0 1-1.663 1.548H4.552a1.667 1.667 0 0 1-1.663-1.548L2.167 4.833m4.166 3.334v5m3.334-5v5m.833-8.334v-2.5a.833.833 0 0 0-.833-.833H6.333a.833.833 0 0 0-.833.833v2.5m-4.167 0h13.334\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M0 18.273 10 1l10 17.273zm3.136-1.819h13.728L10 4.637zM10 15.545a.88.88 0 0 0 .648-.261.88.88 0 0 0 .261-.648.88.88 0 0 0-.26-.647.88.88 0 0 0-.649-.262.88.88 0 0 0-.647.262.88.88 0 0 0-.262.647q0 .387.262.648.261.261.647.261m-.91-2.727h1.82V8.273H9.09z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 17 17\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M16.822.178a.607.607 0 0 1 0 .858L1.036 16.822a.607.607 0 1 1-.858-.858L15.964.178a.607.607 0 0 1 .858 0\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M.178.178a.607.607 0 0 1 .858 0l15.786 15.786a.607.607 0 0 1-.858.858L.178 1.036a.607.607 0 0 1 0-.858\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_4]))\n}\nexport default { render: render }","<template>\n <QBtn class=\"bg-slate-200\" :loading=\"isExporting\" @click=\"onExport\">\n <ExportIcon class=\"w-5\" />\n </QBtn>\n</template>\n<script setup>\nimport { DownloadIcon as ExportIcon } from '@heroicons/vue/solid';\nimport { ref } from 'vue';\nimport { FlashMessages } from '../../../helpers';\n\nconst props = defineProps({\n exporter: {\n type: Function,\n required: true\n }\n});\nconst isExporting = ref(false);\nasync function onExport() {\n isExporting.value = true;\n try {\n await props.exporter();\n } catch (error) {\n console.error(error);\n FlashMessages.error('Failed to export data');\n }\n isExporting.value = false;\n}\n</script>\n","<template>\n <QDialog\n :full-height=\"fullHeight\"\n :full-width=\"fullWidth\"\n :model-value=\"!!modelValue\"\n :no-backdrop-dismiss=\"!backdropDismiss\"\n :maximized=\"maximized\"\n @update:model-value=\"onClose\"\n >\n <QCard class=\"flex flex-col flex-nowrap\">\n <QCardSection\n v-if=\"title || $slots.title\"\n class=\"pl-6 pr-10 border-b border-gray-medium\"\n >\n <h3\n class=\"font-normal flex items-center\"\n :class=\"titleClass\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h3>\n <div\n v-if=\"subtitle\"\n class=\"mt-1 text-sm\"\n >{{ subtitle }}\n </div>\n </QCardSection>\n <QCardSection v-if=\"$slots.toolbar\">\n <slot name=\"toolbar\" />\n </QCardSection>\n <QCardSection\n v-if=\"content || $slots.default\"\n class=\"px-6 bg-neutral-plus-7 flex-grow max-h-full overflow-y-auto\"\n :class=\"contentClass\"\n >\n <slot>{{ content }}</slot>\n </QCardSection>\n <div class=\"flex px-6 py-4 border-t border-gray-medium\">\n <div class=\"flex-grow\">\n <QBtn\n :label=\"cancelText\"\n class=\"action-btn btn-white-gray\"\n @click=\"onClose\"\n >\n <slot name=\"cancel-text\" />\n </QBtn>\n </div>\n <slot name=\"actions\" />\n <div v-if=\"!hideConfirm\">\n <QBtn\n :label=\"$slots['confirm-text'] ? '' : confirmText\"\n class=\"action-btn ml-4\"\n :class=\"confirmClass\"\n :loading=\"isSaving\"\n :disable=\"disabled\"\n data-testid=\"confirm-button\"\n @click=\"onConfirm\"\n >\n <slot name=\"confirm-text\" />\n </QBtn>\n </div>\n </div>\n <a\n class=\"absolute top-0 right-0 p-4 text-black\"\n @click=\"onClose\"\n >\n <CloseIcon class=\"w-5\" />\n </a>\n </QCard>\n </QDialog>\n</template>\n\n<script setup>\nimport { XIcon as CloseIcon } from '@heroicons/vue/outline';\n\nconst emit = defineEmits(['update:model-value', 'confirm', 'close']);\nconst props = defineProps({\n modelValue: { type: [String, Boolean, Object], default: true },\n title: {\n type: String,\n default: ''\n },\n titleClass: {\n type: String,\n default: ''\n },\n subtitle: {\n type: String,\n default: ''\n },\n content: {\n type: String,\n default: ''\n },\n backdropDismiss: Boolean,\n maximized: Boolean,\n fullWidth: Boolean,\n fullHeight: Boolean,\n disabled: Boolean,\n isSaving: Boolean,\n closeOnConfirm: Boolean,\n hideConfirm: Boolean,\n confirmText: {\n type: String,\n default: 'Confirm'\n },\n cancelText: {\n type: String,\n default: 'Cancel'\n },\n confirmClass: {\n type: String,\n default: 'bg-blue-600 text-white'\n },\n contentClass: {\n type: String,\n default: ''\n }\n});\n\nfunction onConfirm() {\n emit('confirm');\n\n if (props.closeOnConfirm) {\n emit('close');\n }\n}\n\nfunction onClose() {\n emit('update:model-value', false);\n emit('close');\n}\n</script>\n","<template>\n <QDialog\n :model-value=\"true\"\n maximized\n @update:model-value=\"$emit('close')\"\n @keyup.left=\"carousel.previous()\"\n @keyup.right=\"carousel.next()\"\n >\n <div class=\"absolute top-0 left-0 w-full h-full\">\n <QCarousel\n ref=\"carousel\"\n v-model=\"currentSlide\"\n height=\"100%\"\n swipeable\n animated\n :thumbnails=\"files.length > 1\"\n infinite\n class=\"carousel\"\n >\n <QCarouselSlide\n v-for=\"file in files\"\n :key=\"'file-' + file.id\"\n :name=\"file.id\"\n :img-src=\"getThumbUrl(file)\"\n >\n <div class=\"slide-image\">\n <template v-if=\"isVideo(file)\">\n <video\n class=\"max-h-full w-full\"\n controls\n >\n <source\n :src=\"file.url + '#t=0.1'\"\n :type=\"file.mime\"\n />\n </video>\n </template>\n <img v-else :alt=\"file.filename\" :src=\"file.url\" />\n </div>\n </QCarouselSlide>\n </QCarousel>\n <CloseIcon\n class=\"absolute top-4 right-4 cursor-pointer text-white w-8 h-8\"\n @click=\"$emit('close')\"\n />\n </div>\n </QDialog>\n</template>\n<script setup>\nimport { ref } from 'vue';\nimport { XIcon as CloseIcon } from '../../../svg';\n\ndefineEmits(['close']);\nconst props = defineProps({\n files: {\n type: Array,\n default: () => []\n },\n defaultSlide: {\n type: String,\n default: ''\n }\n});\n\nconst carousel = ref(null);\nconst currentSlide = ref(props.defaultSlide);\nfunction isVideo(file) {\n return file.mime?.startsWith('video');\n}\nfunction getThumbUrl(file) {\n if (file.thumb) {\n return file.thumb.url;\n } else if (isVideo(file)) {\n // Base64 encode a PlayIcon for the placeholder image\n return `data:image/svg+xml;base64,${btoa(\n `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"white\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M8 5v14l11-7z\"/></svg>`\n )}`;\n } else {\n return file.url;\n }\n}\n</script>\n<style scoped lang=\"scss\">\n.slide-image {\n width: 100%;\n height: 100%;\n background: black;\n display: flex;\n justify-content: center;\n align-items: center;\n\n img {\n max-height: 100%;\n max-width: 100%;\n object-fit: contain;\n }\n}\n\n.carousel {\n :deep(.q-carousel__navigation--bottom) {\n position: relative;\n bottom: 8em;\n }\n}\n</style>\n","<template>\n <QDialog\n :model-value=\"modelValue\"\n maximized\n transition-show=\"slide-up\"\n transition-hide=\"slide-down\"\n @update:model-value=\"onClose\"\n >\n <div class=\"flex justify-center min-w-xs\" :class=\"computedClass\">\n <div\n v-if=\"closeable\"\n v-close-popup\n class=\"p-4 m-4 absolute-top-right top right cursor-pointer\"\n >\n <XIcon class=\"w-5 h-5\" />\n </div>\n <slot />\n </div>\n </QDialog>\n</template>\n\n<script setup>\nimport { computed } from 'vue';\nimport { XIcon } from '../../../svg';\n\nconst emit = defineEmits(['update:model-value', 'close']);\nconst props = defineProps({\n modelValue: Boolean,\n center: Boolean,\n blue: Boolean,\n closeable: Boolean\n});\n\nlet computedClass = computed(() => {\n return {\n 'bg-blue-600 text-white': props.blue,\n 'bg-white text-gray-base': !props.blue,\n 'items-center': props.center\n };\n});\n\nfunction onClose() {\n emit('update:model-value', false);\n emit('close');\n}\n</script>\n","<template>\n <QDialog\n :full-height=\"fullHeight\"\n :full-width=\"fullWidth\"\n :model-value=\"!!modelValue\"\n :no-backdrop-dismiss=\"!backdropDismiss\"\n :maximized=\"maximized\"\n @update:model-value=\"onClose\"\n >\n <QCard class=\"flex flex-col flex-nowrap\">\n <QCardSection\n v-if=\"title || $slots.title\"\n class=\"pl-6 pr-10 border-b border-gray-medium\"\n >\n <h3\n class=\"font-normal flex items-center\"\n :class=\"titleClass\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h3>\n <div\n v-if=\"subtitle\"\n class=\"mt-1 text-sm\"\n >{{ subtitle }}\n </div>\n </QCardSection>\n <QCardSection\n v-if=\"content || $slots.default\"\n class=\"px-6 bg-neutral-plus-7 flex-grow max-h-full overflow-y-auto\"\n >\n <slot>{{ content }}</slot>\n </QCardSection>\n <div\n class=\"flex items-center justify-center px-6 py-4 border-t border-gray-medium\"\n >\n <div class=\"flex-grow text-right\">\n <QBtn\n :label=\"doneText\"\n class=\"action-btn btn-white-gray\"\n @click=\"onClose\"\n >\n <slot name=\"done-text\" />\n </QBtn>\n </div>\n </div>\n <a\n class=\"absolute top-0 right-0 p-4 text-black\"\n @click=\"onClose\"\n >\n <CloseIcon class=\"w-5\" />\n </a>\n </QCard>\n </QDialog>\n</template>\n\n<script setup>\nimport { XIcon as CloseIcon } from '@heroicons/vue/outline';\n\nconst emit = defineEmits(['update:model-value', 'close']);\ndefineProps({\n modelValue: { type: [Boolean, Object], default: true },\n title: {\n type: String,\n default: ''\n },\n titleClass: {\n type: String,\n default: ''\n },\n subtitle: {\n type: String,\n default: ''\n },\n content: {\n type: String,\n default: ''\n },\n backdropDismiss: Boolean,\n maximized: Boolean,\n fullWidth: Boolean,\n fullHeight: Boolean,\n doneText: {\n type: String,\n default: 'Done'\n }\n});\n\nfunction onClose() {\n emit('update:model-value', false);\n emit('close');\n}\n</script>\n","<template>\n <ConfirmDialog\n v-bind=\"$props\"\n @confirm=\"$emit('confirm', newInput)\"\n @close=\"$emit('close', $event)\"\n >\n <slot>\n <QInput\n v-model=\"newInput\"\n type=\"number\"\n class=\"w-full\"\n @input=\"$emit('update:input', $event)\"\n />\n </slot>\n </ConfirmDialog>\n</template>\n<script setup>\nimport { ref } from 'vue';\nimport ConfirmDialog from './ConfirmDialog';\n\ndefineEmits(['confirm', 'close', 'update:input']);\nconst props = defineProps({\n ...ConfirmDialog.props,\n title: {\n type: String,\n default: 'Enter Value'\n },\n input: {\n type: [Number, String],\n default: ''\n }\n});\n\nconst newInput = ref(props.input);\n</script>\n","<template>\n <div class=\"relative flex justify-center bg-neutral-plus-7\" :class=\"{'rounded-2xl': !square}\">\n <template v-if=\"computedImage\">\n <div\n class=\"grow h-full overflow-hidden\"\n :class=\"{'rounded-2xl': !square}\"\n @click=\"showPreview = true\"\n >\n <div\n v-if=\"isVideo\"\n class=\"relative max-h-full max-w-full w-full flex justify-center\"\n >\n <video\n class=\"max-h-full\"\n preload=\"auto\"\n >\n <source\n :src=\"previewUrl + '#t=0.1'\"\n :type=\"mimeType\"\n />\n </video>\n <button class=\"play-button text-blue-lighter\">\n <PlayIcon class=\"w-16\" />\n </button>\n </div>\n <QImg\n v-if=\"thumbUrl || isPreviewable\"\n fit=\"scale-down\"\n class=\"non-selectable max-h-full max-w-full h-full\"\n :src=\"(thumbUrl || previewUrl) + '#t=0.1'\"\n preload=\"auto\"\n data-testid=\"previewed-image\"\n />\n <div\n v-else\n class=\"flex items-center justify-center h-full\"\n >\n <PdfIcon v-if=\"isPdf\" class=\"w-24\" />\n <TextFileIcon v-else class=\"w-24\" />\n </div>\n </div>\n <div\n v-if=\"$slots['action-button']\"\n class=\"action-button\"\n >\n <slot name=\"action-button\" />\n </div>\n <div\n v-if=\"image && image.progress !== undefined\"\n class=\"absolute-bottom w-full\"\n >\n <QLinearProgress\n :value=\"image.progress\"\n size=\"15px\"\n color=\"green-base\"\n stripe\n />\n </div>\n </template>\n <template v-else>\n <slot name=\"missing\">\n <component\n :is=\"missingIcon\"\n class=\"w-full h-full p-2 text-gray-medium\"\n />\n </slot>\n </template>\n\n <div class=\"absolute top-1 right-1 flex items-center justify-between space-x-1\">\n <QBtn\n v-if=\"downloadable && computedImage?.url\"\n size=\"sm\"\n class=\"!p-1 opacity-70 hover:opacity-100\"\n :class=\"downloadButtonClass\"\n @click.stop=\"download(computedImage.url)\"\n >\n <DownloadIcon class=\"w-4 h-5\" />\n </QBtn>\n\n <QBtn\n v-if=\"removable\"\n size=\"sm\"\n class=\"bg-red-dark text-white !p-1 opacity-50 hover:opacity-100\"\n @click.stop=\"onRemove\"\n >\n <div v-if=\"isConfirmingRemove\" class=\"font-bold text-[1rem] leading-[1.2rem]\">?</div>\n <RemoveIcon v-else class=\"w-3\" />\n </QBtn>\n </div>\n\n <FullScreenCarouselDialog\n v-if=\"showPreview && !disabled\"\n :files=\"relatedFiles || [computedImage]\"\n :default-slide=\"computedImage.id\"\n @close=\"showPreview = false\"\n />\n </div>\n</template>\n\n<script setup>\nimport { DocumentTextIcon as TextFileIcon, DownloadIcon, PlayIcon } from '@heroicons/vue/outline';\nimport { computed, ref } from 'vue';\nimport { download } from '../../../helpers';\nimport { ImageIcon, PdfIcon, TrashIcon as RemoveIcon } from '../../../svg';\nimport { FullScreenCarouselDialog } from '../Dialogs';\n\nconst emit = defineEmits(['remove']);\nconst props = defineProps({\n src: {\n type: String,\n default: ''\n },\n image: {\n type: Object,\n default: null\n },\n relatedFiles: {\n type: Array,\n default: null\n },\n missingIcon: {\n type: [Function, Object],\n default: ImageIcon\n },\n downloadButtonClass: {\n type: String,\n default: 'bg-blue-600 text-white'\n },\n downloadable: Boolean,\n removable: Boolean,\n disabled: Boolean,\n square: Boolean\n});\n\nconst showPreview = ref(false);\nconst computedImage = computed(() => {\n if (props.image) {\n return props.image;\n } else if (props.src) {\n return {\n id: props.src,\n url: props.src,\n type: 'image/' + props.src.split('.').pop().toLowerCase()\n };\n }\n return null;\n});\nconst mimeType = computed(\n () => computedImage.value.type || computedImage.value.mime\n);\nconst isImage = computed(() => mimeType.value.match(/^image\\//));\nconst isVideo = computed(() => mimeType.value.match(/^video\\//));\nconst isPdf = computed(() => mimeType.value.match(/^application\\/pdf/));\nconst previewUrl = computed(\n () => computedImage.value.transcodes?.compress?.url || computedImage.value.blobUrl || computedImage.value.url\n);\nconst thumbUrl = computed(() => {\n return computedImage.value.transcodes?.thumb?.url;\n});\nconst isPreviewable = computed(() => {\n return !!thumbUrl.value || isVideo.value || isImage.value;\n});\nconst isConfirmingRemove = ref(false);\nfunction onRemove() {\n if (!isConfirmingRemove.value) {\n isConfirmingRemove.value = true;\n setTimeout(() => {\n isConfirmingRemove.value = false;\n }, 2000);\n } else {\n emit('remove');\n }\n}\n</script>\n\n<style scoped lang=\"scss\">\n.action-button {\n position: absolute;\n bottom: 1.5em;\n right: 1em;\n z-index: 1;\n}\n\n.play-button {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n</style>\n","<template>\n <img\n v-if=\"isString\"\n :src=\"resolvedSvg\"\n :alt=\"alt\"\n />\n <component :is=\"resolvedSvg\" v-else />\n</template>\n<script setup>\nimport { computed } from \"vue\";\n\nconst props = defineProps({\n svg: {\n type: [String, Object, Function],\n required: true\n },\n alt: {\n type: String,\n default: \"\"\n }\n});\n\nconst resolvedSvg = computed(() => props.svg.default ? props.svg.default : props.svg);\nconst isString = computed(() => typeof resolvedSvg.value === \"string\");\n</script>\n","<template>\n <div\n class=\"collapsable-sidebar overflow-x-hidden overflow-y-scroll relative\"\n :class=\"{\n 'is-collapsed': isCollapsed,\n 'is-right-side': rightSide,\n [displayClass]: true,\n }\"\n :style=\"style\"\n >\n <div class=\"flex-grow max-w-full\">\n <slot :is-collapsed=\"isCollapsed\" />\n </div>\n <template v-if=\"!disabled && (!hideToggleOnCollapse || !isCollapsed)\">\n <div\n v-if=\"!toggleAtTop\"\n class=\"flex w-full p-4\"\n :class=\"rightSide ? 'justify-start' : 'justify-end'\"\n >\n <slot name=\"toggle\">\n <QBtn\n class=\"btn-secondary\"\n @click=\"toggleCollapse\"\n >\n <ToggleIcon\n class=\"w-5 transition-all\"\n :class=\"{ 'rotate-180': rightSide ? !isCollapsed : isCollapsed }\"\n />\n </QBtn>\n </slot>\n </div>\n <div\n v-else\n class=\"absolute top-0 right-0 cursor-pointer p-2\"\n :class=\"toggleClass\"\n @click=\"toggleCollapse\"\n >\n <ToggleIcon\n class=\"w-5 transition-all\"\n :class=\"{ 'rotate-180': rightSide ? !isCollapsed : isCollapsed }\"\n />\n </div>\n </template>\n </div>\n</template>\n<script setup>\nimport { ChevronLeftIcon as ToggleIcon } from '@heroicons/vue/outline';\nimport { computed, onMounted, ref, watch } from 'vue';\n\nconst emit = defineEmits(['collapse', 'update:collapse']);\nconst props = defineProps({\n rightSide: Boolean,\n displayClass: {\n type: String,\n default: 'flex flex-col'\n },\n maxWidth: {\n type: String,\n default: '13.5rem'\n },\n minWidth: {\n type: String,\n default: '5.5rem'\n },\n disabled: Boolean,\n collapse: Boolean,\n name: {\n type: String,\n default: 'sidebar'\n },\n toggleAtTop: Boolean,\n toggleClass: {\n type: String,\n default: ''\n },\n hideToggleOnCollapse: Boolean\n});\n\nconst isCollapsed = ref(props.collapse);\n\nconst stored = localStorage.getItem(props.name + '-is-collapsed');\n\nif (stored !== null) {\n isCollapsed.value = stored === '1';\n}\nfunction toggleCollapse() {\n setCollapse(!isCollapsed.value);\n emit('collapse', isCollapsed.value);\n emit('update:collapse', isCollapsed.value);\n}\n\nfunction setCollapse(state) {\n isCollapsed.value = state;\n localStorage.setItem(props.name + '-is-collapsed', isCollapsed.value ? '1' : '');\n}\n\nonMounted(() => {\n emit('collapse', isCollapsed.value);\n emit('update:collapse', isCollapsed.value);\n});\nconst style = computed(() => {\n return {\n width: isCollapsed.value ? props.minWidth : props.maxWidth\n };\n});\n\nwatch(() => props.collapse, () => {\n setCollapse(props.collapse);\n});\n</script>\n\n<style\n scoped\n lang=\"scss\"\n>\n.collapsable-sidebar {\n @apply overflow-y-auto scroll-smooth flex-shrink-0 border-r border-gray-200 transition-all;\n}\n</style>\n","<template>\n <QDialog\n v-model=\"isShowing\"\n maximized\n :position=\"position\"\n :seamless=\"seamless\"\n :class=\"{'hide-backdrop': !overlay}\"\n >\n <div>\n <div\n v-if=\"title\"\n class=\"dialog-title bg-slate-100 text-gray-500 border-gray-200\"\n @click.stop.prevent\n >\n {{ title }}\n </div>\n <div\n class=\"dialog-content bg-white\"\n :class=\"{ [contentClass]: true }\"\n >\n <slot />\n </div>\n </div>\n </QDialog>\n</template>\n\n<script setup>\nimport { computed } from 'vue';\n\nconst emit = defineEmits(['update:show']);\n\nconst props = defineProps({\n show: Boolean,\n seamless: Boolean,\n overlay: Boolean,\n position: {\n type: String,\n default: 'bottom'\n },\n contentClass: {\n type: String,\n default: 'py-8 px-12'\n },\n title: {\n type: String,\n default: 'Edit'\n }\n});\n\nconst isShowing = computed({\n get: () => props.show,\n set: (value) => emit('update:show', value)\n});\n</script>\n\n<style\n lang=\"scss\"\n scoped\n>\n.dialog-title {\n @apply font-medium uppercase text-xs px-6 py-3 border-b rounded-t-md;\n font-family: \"Roboto\", sans-serif;\n letter-spacing: 0.05em;\n box-shadow: 0px -4px 12px rgba(0, 0, 0, 0.25);\n}\n\n.dialog-content {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);\n}\n</style>\n","<script>\nconst RenderVnode = (props) => props.vnode;\nRenderVnode.props = { vnode: { type: Object, required: true } };\nexport default RenderVnode;\n</script>\n","<template>\n <div>\n <RenderVnode\n v-if=\"activeActionVnode\"\n :vnode=\"activeActionVnode.vnode\"\n :is-saving=\"isSaving\"\n @confirm=\"onConfirm\"\n @close=\"activeActionVnode.cancel\"\n />\n </div>\n</template>\n<script setup>\nimport { ref } from 'vue';\nimport { activeActionVnode } from '../../../helpers';\nimport RenderVnode from './RenderVnode';\n\nconst isSaving = ref(false);\nasync function onConfirm(input) {\n isSaving.value = true;\n await activeActionVnode.value.confirm(input);\n isSaving.value = false;\n}\n</script>\n","<template>\n <Component\n v-if=\"content\"\n :is=\"resolvedComponent.is\"\n v-bind=\"{...resolvedComponent.props, ...overrideProps}\"\n @action=\"$emit('action', $event)\"\n >{{ content }}</Component>\n <Component\n v-else\n :is=\"resolvedComponent.is\"\n v-bind=\"{...resolvedComponent.props, ...overrideProps}\"\n @action=\"$emit('action', $event)\"\n />\n</template>\n<script setup>\nimport { computed } from 'vue';\n\ndefineEmits(['action']);\nconst props = defineProps({\n component: {\n type: [Function, Object],\n required: true\n },\n params: {\n type: Array,\n default: () => []\n },\n overrideProps: {\n type: Object,\n default: () => ({})\n }\n});\n\nconst content = computed(() => resolvedComponent.value?.value || resolvedComponent.value?.props?.text);\nconst resolvedComponent = computed(() => {\n if (typeof props.component === 'function') {\n return props.component(...props.params);\n }\n return props.component;\n});\n</script>\n","<template>\n <a\n class=\"p-3 actionable\"\n :class=\"{'opacity-50 cursor-not-allowed': disabled}\"\n >\n <QTooltip v-if=\"$slots.tooltip || tooltip\">\n <slot name=\"tooltip\">{{ tooltip }}</slot>\n </QTooltip>\n <Transition\n mode=\"out-in\"\n :duration=\"150\"\n >\n <RenderComponent\n v-if=\"loading\"\n :component=\"loadingComponent\"\n />\n <MenuIcon\n v-else\n class=\"w-4 text-black\"\n />\n </Transition>\n <QMenu\n v-if=\"!disabled\"\n auto-close\n >\n <QList>\n <template v-for=\"item in items\">\n <a\n v-if=\"item.url\"\n :key=\"item.url\"\n class=\"q-item\"\n target=\"_blank\"\n :href=\"item.url\"\n :class=\"item.class\"\n >\n {{ item.label }}\n </a>\n <QItem\n v-else\n :key=\"item.name || item.action\"\n clickable\n :class=\"item.class\"\n @click=\"onAction(item)\"\n >\n {{ item.label }}\n </QItem>\n </template>\n </QList>\n </QMenu>\n </a>\n</template>\n<script setup>\nimport { DotsVerticalIcon as MenuIcon } from '@heroicons/vue/outline';\nimport { QSpinner } from 'quasar';\nimport { RenderComponent } from '../Tools';\n\nconst emit = defineEmits(['action', 'action-item']);\ndefineProps({\n items: {\n type: Array,\n required: true,\n validator(items) {\n return items.every((item) => item.url || item.action || item.name);\n }\n },\n tooltip: {\n type: String,\n default: null\n },\n disabled: Boolean,\n loading: Boolean,\n loadingComponent: {\n type: [Function, Object],\n default: () => ({\n is: QSpinner,\n props: { class: 'w-4 h-4 text-black' }\n })\n }\n});\n\nfunction onAction(item) {\n emit('action', item.name || item.action);\n emit('action-item', item);\n}\n</script>\n","<template>\n <QTooltip\n class=\"interactive-tooltip\"\n ref=\"tooltipBox\"\n v-model=\"show\"\n no-parent-event\n @mouseenter=\"onEnterTooltip\"\n @mouseleave=\"onLeaveTooltip\"\n :transition-duration=\"200\"\n >\n <slot>{{ tooltip }}</slot>\n </QTooltip>\n</template>\n<script setup>\nimport { onMounted, ref } from 'vue';\n\ndefineProps({ tooltip: { type: String, default: '' } });\nconst show = ref(false);\nconst tooltipBox = ref(null);\nconst isHovering = ref(false);\nconst isHoveringParent = ref(false);\nlet timeout = null;\nonMounted(() => {\n tooltipBox.value.$el.parentNode.addEventListener('mouseover', onEnterParent);\n tooltipBox.value.$el.parentNode.addEventListener('mouseleave', onLeaveParent);\n});\nfunction onEnterParent() {\n show.value = true;\n isHoveringParent.value = true;\n if (timeout) clearTimeout(timeout);\n}\nfunction onLeaveParent() {\n isHoveringParent.value = false;\n if (show.value) delayClose();\n}\nfunction onEnterTooltip() {\n isHovering.value = true;\n show.value = true;\n if (timeout) clearTimeout(timeout);\n}\nfunction onLeaveTooltip() {\n isHovering.value = false;\n if (show.value) delayClose();\n}\nfunction delayClose() {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n if (isHovering.value || isHoveringParent.value) {\n delayClose();\n } else {\n show.value = false;\n }\n }, 200);\n}\n\n</script>\n<style lang=\"scss\">\nbody .q-tooltip {\n &.interactive-tooltip {\n pointer-events: auto !important;\n background: white;\n color: inherit;\n box-shadow: 0 0 10px 3px rgba(0, 0, 0, 0.2);\n }\n}\n</style>\n","function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\n/*!\n * GSAP 3.12.5\n * https://gsap.com\n *\n * @license Copyright 2008-2024, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license or for\n * Club GSAP members, the agreement issued with that membership.\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nvar _config = {\n autoSleep: 120,\n force3D: \"auto\",\n nullTargetWarn: 1,\n units: {\n lineHeight: \"\"\n }\n},\n _defaults = {\n duration: .5,\n overwrite: false,\n delay: 0\n},\n _suppressOverwrites,\n _reverting,\n _context,\n _bigNum = 1e8,\n _tinyNum = 1 / _bigNum,\n _2PI = Math.PI * 2,\n _HALF_PI = _2PI / 4,\n _gsID = 0,\n _sqrt = Math.sqrt,\n _cos = Math.cos,\n _sin = Math.sin,\n _isString = function _isString(value) {\n return typeof value === \"string\";\n},\n _isFunction = function _isFunction(value) {\n return typeof value === \"function\";\n},\n _isNumber = function _isNumber(value) {\n return typeof value === \"number\";\n},\n _isUndefined = function _isUndefined(value) {\n return typeof value === \"undefined\";\n},\n _isObject = function _isObject(value) {\n return typeof value === \"object\";\n},\n _isNotFalse = function _isNotFalse(value) {\n return value !== false;\n},\n _windowExists = function _windowExists() {\n return typeof window !== \"undefined\";\n},\n _isFuncOrString = function _isFuncOrString(value) {\n return _isFunction(value) || _isString(value);\n},\n _isTypedArray = typeof ArrayBuffer === \"function\" && ArrayBuffer.isView || function () {},\n // note: IE10 has ArrayBuffer, but NOT ArrayBuffer.isView().\n_isArray = Array.isArray,\n _strictNumExp = /(?:-?\\.?\\d|\\.)+/gi,\n //only numbers (including negatives and decimals) but NOT relative values.\n_numExp = /[-+=.]*\\d+[.e\\-+]*\\d*[e\\-+]*\\d*/g,\n //finds any numbers, including ones that start with += or -=, negative numbers, and ones in scientific notation like 1e-8.\n_numWithUnitExp = /[-+=.]*\\d+[.e-]*\\d*[a-z%]*/g,\n _complexStringNumExp = /[-+=.]*\\d+\\.?\\d*(?:e-|e\\+)?\\d*/gi,\n //duplicate so that while we're looping through matches from exec(), it doesn't contaminate the lastIndex of _numExp which we use to search for colors too.\n_relExp = /[+-]=-?[.\\d]+/,\n _delimitedValueExp = /[^,'\"\\[\\]\\s]+/gi,\n // previously /[#\\-+.]*\\b[a-z\\d\\-=+%.]+/gi but didn't catch special characters.\n_unitExp = /^[+\\-=e\\s\\d]*\\d+[.\\d]*([a-z]*|%)\\s*$/i,\n _globalTimeline,\n _win,\n _coreInitted,\n _doc,\n _globals = {},\n _installScope = {},\n _coreReady,\n _install = function _install(scope) {\n return (_installScope = _merge(scope, _globals)) && gsap;\n},\n _missingPlugin = function _missingPlugin(property, value) {\n return console.warn(\"Invalid property\", property, \"set to\", value, \"Missing plugin? gsap.registerPlugin()\");\n},\n _warn = function _warn(message, suppress) {\n return !suppress && console.warn(message);\n},\n _addGlobal = function _addGlobal(name, obj) {\n return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals;\n},\n _emptyFunc = function _emptyFunc() {\n return 0;\n},\n _startAtRevertConfig = {\n suppressEvents: true,\n isStart: true,\n kill: false\n},\n _revertConfigNoKill = {\n suppressEvents: true,\n kill: false\n},\n _revertConfig = {\n suppressEvents: true\n},\n _reservedProps = {},\n _lazyTweens = [],\n _lazyLookup = {},\n _lastRenderedFrame,\n _plugins = {},\n _effects = {},\n _nextGCFrame = 30,\n _harnessPlugins = [],\n _callbackNames = \"\",\n _harness = function _harness(targets) {\n var target = targets[0],\n harnessPlugin,\n i;\n _isObject(target) || _isFunction(target) || (targets = [targets]);\n\n if (!(harnessPlugin = (target._gsap || {}).harness)) {\n // find the first target with a harness. We assume targets passed into an animation will be of similar type, meaning the same kind of harness can be used for them all (performance optimization)\n i = _harnessPlugins.length;\n\n while (i-- && !_harnessPlugins[i].targetTest(target)) {}\n\n harnessPlugin = _harnessPlugins[i];\n }\n\n i = targets.length;\n\n while (i--) {\n targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1);\n }\n\n return targets;\n},\n _getCache = function _getCache(target) {\n return target._gsap || _harness(toArray(target))[0]._gsap;\n},\n _getProperty = function _getProperty(target, property, v) {\n return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v;\n},\n _forEachName = function _forEachName(names, func) {\n return (names = names.split(\",\")).forEach(func) || names;\n},\n //split a comma-delimited list of names into an array, then run a forEach() function and return the split array (this is just a way to consolidate/shorten some code).\n_round = function _round(value) {\n return Math.round(value * 100000) / 100000 || 0;\n},\n _roundPrecise = function _roundPrecise(value) {\n return Math.round(value * 10000000) / 10000000 || 0;\n},\n // increased precision mostly for timing values.\n_parseRelative = function _parseRelative(start, value) {\n var operator = value.charAt(0),\n end = parseFloat(value.substr(2));\n start = parseFloat(start);\n return operator === \"+\" ? start + end : operator === \"-\" ? start - end : operator === \"*\" ? start * end : start / end;\n},\n _arrayContainsAny = function _arrayContainsAny(toSearch, toFind) {\n //searches one array to find matches for any of the items in the toFind array. As soon as one is found, it returns true. It does NOT return all the matches; it's simply a boolean search.\n var l = toFind.length,\n i = 0;\n\n for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l;) {}\n\n return i < l;\n},\n _lazyRender = function _lazyRender() {\n var l = _lazyTweens.length,\n a = _lazyTweens.slice(0),\n i,\n tween;\n\n _lazyLookup = {};\n _lazyTweens.length = 0;\n\n for (i = 0; i < l; i++) {\n tween = a[i];\n tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0);\n }\n},\n _lazySafeRender = function _lazySafeRender(animation, time, suppressEvents, force) {\n _lazyTweens.length && !_reverting && _lazyRender();\n animation.render(time, suppressEvents, force || _reverting && time < 0 && (animation._initted || animation._startAt));\n _lazyTweens.length && !_reverting && _lazyRender(); //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.\n},\n _numericIfPossible = function _numericIfPossible(value) {\n var n = parseFloat(value);\n return (n || n === 0) && (value + \"\").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value;\n},\n _passThrough = function _passThrough(p) {\n return p;\n},\n _setDefaults = function _setDefaults(obj, defaults) {\n for (var p in defaults) {\n p in obj || (obj[p] = defaults[p]);\n }\n\n return obj;\n},\n _setKeyframeDefaults = function _setKeyframeDefaults(excludeDuration) {\n return function (obj, defaults) {\n for (var p in defaults) {\n p in obj || p === \"duration\" && excludeDuration || p === \"ease\" || (obj[p] = defaults[p]);\n }\n };\n},\n _merge = function _merge(base, toMerge) {\n for (var p in toMerge) {\n base[p] = toMerge[p];\n }\n\n return base;\n},\n _mergeDeep = function _mergeDeep(base, toMerge) {\n for (var p in toMerge) {\n p !== \"__proto__\" && p !== \"constructor\" && p !== \"prototype\" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]);\n }\n\n return base;\n},\n _copyExcluding = function _copyExcluding(obj, excluding) {\n var copy = {},\n p;\n\n for (p in obj) {\n p in excluding || (copy[p] = obj[p]);\n }\n\n return copy;\n},\n _inheritDefaults = function _inheritDefaults(vars) {\n var parent = vars.parent || _globalTimeline,\n func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults;\n\n if (_isNotFalse(vars.inherit)) {\n while (parent) {\n func(vars, parent.vars.defaults);\n parent = parent.parent || parent._dp;\n }\n }\n\n return vars;\n},\n _arraysMatch = function _arraysMatch(a1, a2) {\n var i = a1.length,\n match = i === a2.length;\n\n while (match && i-- && a1[i] === a2[i]) {}\n\n return i < 0;\n},\n _addLinkedListItem = function _addLinkedListItem(parent, child, firstProp, lastProp, sortBy) {\n if (firstProp === void 0) {\n firstProp = \"_first\";\n }\n\n if (lastProp === void 0) {\n lastProp = \"_last\";\n }\n\n var prev = parent[lastProp],\n t;\n\n if (sortBy) {\n t = child[sortBy];\n\n while (prev && prev[sortBy] > t) {\n prev = prev._prev;\n }\n }\n\n if (prev) {\n child._next = prev._next;\n prev._next = child;\n } else {\n child._next = parent[firstProp];\n parent[firstProp] = child;\n }\n\n if (child._next) {\n child._next._prev = child;\n } else {\n parent[lastProp] = child;\n }\n\n child._prev = prev;\n child.parent = child._dp = parent;\n return child;\n},\n _removeLinkedListItem = function _removeLinkedListItem(parent, child, firstProp, lastProp) {\n if (firstProp === void 0) {\n firstProp = \"_first\";\n }\n\n if (lastProp === void 0) {\n lastProp = \"_last\";\n }\n\n var prev = child._prev,\n next = child._next;\n\n if (prev) {\n prev._next = next;\n } else if (parent[firstProp] === child) {\n parent[firstProp] = next;\n }\n\n if (next) {\n next._prev = prev;\n } else if (parent[lastProp] === child) {\n parent[lastProp] = prev;\n }\n\n child._next = child._prev = child.parent = null; // don't delete the _dp just so we can revert if necessary. But parent should be null to indicate the item isn't in a linked list.\n},\n _removeFromParent = function _removeFromParent(child, onlyIfParentHasAutoRemove) {\n child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove && child.parent.remove(child);\n child._act = 0;\n},\n _uncache = function _uncache(animation, child) {\n if (animation && (!child || child._end > animation._dur || child._start < 0)) {\n // performance optimization: if a child animation is passed in we should only uncache if that child EXTENDS the animation (its end time is beyond the end)\n var a = animation;\n\n while (a) {\n a._dirty = 1;\n a = a.parent;\n }\n }\n\n return animation;\n},\n _recacheAncestors = function _recacheAncestors(animation) {\n var parent = animation.parent;\n\n while (parent && parent.parent) {\n //sometimes we must force a re-sort of all children and update the duration/totalDuration of all ancestor timelines immediately in case, for example, in the middle of a render loop, one tween alters another tween's timeScale which shoves its startTime before 0, forcing the parent timeline to shift around and shiftChildren() which could affect that next tween's render (startTime). Doesn't matter for the root timeline though.\n parent._dirty = 1;\n parent.totalDuration();\n parent = parent.parent;\n }\n\n return animation;\n},\n _rewindStartAt = function _rewindStartAt(tween, totalTime, suppressEvents, force) {\n return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force));\n},\n _hasNoPausedAncestors = function _hasNoPausedAncestors(animation) {\n return !animation || animation._ts && _hasNoPausedAncestors(animation.parent);\n},\n _elapsedCycleDuration = function _elapsedCycleDuration(animation) {\n return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0;\n},\n // feed in the totalTime and cycleDuration and it'll return the cycle (iteration minus 1) and if the playhead is exactly at the very END, it will NOT bump up to the next cycle.\n_animationCycle = function _animationCycle(tTime, cycleDuration) {\n var whole = Math.floor(tTime /= cycleDuration);\n return tTime && whole === tTime ? whole - 1 : whole;\n},\n _parentToChildTotalTime = function _parentToChildTotalTime(parentTime, child) {\n return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur);\n},\n _setEnd = function _setEnd(animation) {\n return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0));\n},\n _alignPlayhead = function _alignPlayhead(animation, totalTime) {\n // adjusts the animation's _start and _end according to the provided totalTime (only if the parent's smoothChildTiming is true and the animation isn't paused). It doesn't do any rendering or forcing things back into parent timelines, etc. - that's what totalTime() is for.\n var parent = animation._dp;\n\n if (parent && parent.smoothChildTiming && animation._ts) {\n animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts));\n\n _setEnd(animation);\n\n parent._dirty || _uncache(parent, animation); //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here.\n }\n\n return animation;\n},\n\n/*\n_totalTimeToTime = (clampedTotalTime, duration, repeat, repeatDelay, yoyo) => {\n\tlet cycleDuration = duration + repeatDelay,\n\t\ttime = _round(clampedTotalTime % cycleDuration);\n\tif (time > duration) {\n\t\ttime = duration;\n\t}\n\treturn (yoyo && (~~(clampedTotalTime / cycleDuration) & 1)) ? duration - time : time;\n},\n*/\n_postAddChecks = function _postAddChecks(timeline, child) {\n var t;\n\n if (child._time || !child._dur && child._initted || child._start < timeline._time && (child._dur || !child.add)) {\n // in case, for example, the _start is moved on a tween that has already rendered, or if it's being inserted into a timeline BEFORE where the playhead is currently. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. Special case: if it's a timeline (has .add() method) and no duration, we can skip rendering because the user may be populating it AFTER adding it to a parent timeline (unconventional, but possible, and we wouldn't want it to get removed if the parent's autoRemoveChildren is true).\n t = _parentToChildTotalTime(timeline.rawTime(), child);\n\n if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) {\n child.render(t, true);\n }\n } //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.\n\n\n if (_uncache(timeline, child)._dp && timeline._initted && timeline._time >= timeline._dur && timeline._ts) {\n //in case any of the ancestors had completed but should now be enabled...\n if (timeline._dur < timeline.duration()) {\n t = timeline;\n\n while (t._dp) {\n t.rawTime() >= 0 && t.totalTime(t._tTime); //moves the timeline (shifts its startTime) if necessary, and also enables it. If it's currently zero, though, it may not be scheduled to render until later so there's no need to force it to align with the current playhead position. Only move to catch up with the playhead.\n\n t = t._dp;\n }\n }\n\n timeline._zTime = -_tinyNum; // helps ensure that the next render() will be forced (crossingStart = true in render()), even if the duration hasn't changed (we're adding a child which would need to get rendered). Definitely an edge case. Note: we MUST do this AFTER the loop above where the totalTime() might trigger a render() because this _addToTimeline() method gets called from the Animation constructor, BEFORE tweens even record their targets, etc. so we wouldn't want things to get triggered in the wrong order.\n }\n},\n _addToTimeline = function _addToTimeline(timeline, child, position, skipChecks) {\n child.parent && _removeFromParent(child);\n child._start = _roundPrecise((_isNumber(position) ? position : position || timeline !== _globalTimeline ? _parsePosition(timeline, position, child) : timeline._time) + child._delay);\n child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0));\n\n _addLinkedListItem(timeline, child, \"_first\", \"_last\", timeline._sort ? \"_start\" : 0);\n\n _isFromOrFromStart(child) || (timeline._recent = child);\n skipChecks || _postAddChecks(timeline, child);\n timeline._ts < 0 && _alignPlayhead(timeline, timeline._tTime); // if the timeline is reversed and the new child makes it longer, we may need to adjust the parent's _start (push it back)\n\n return timeline;\n},\n _scrollTrigger = function _scrollTrigger(animation, trigger) {\n return (_globals.ScrollTrigger || _missingPlugin(\"scrollTrigger\", trigger)) && _globals.ScrollTrigger.create(trigger, animation);\n},\n _attemptInitTween = function _attemptInitTween(tween, time, force, suppressEvents, tTime) {\n _initTween(tween, time, tTime);\n\n if (!tween._initted) {\n return 1;\n }\n\n if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) {\n _lazyTweens.push(tween);\n\n tween._lazy = [tTime, suppressEvents];\n return 1;\n }\n},\n _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart(_ref) {\n var parent = _ref.parent;\n return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart(parent));\n},\n // check parent's _lock because when a timeline repeats/yoyos and does its artificial wrapping, we shouldn't force the ratio back to 0\n_isFromOrFromStart = function _isFromOrFromStart(_ref2) {\n var data = _ref2.data;\n return data === \"isFromStart\" || data === \"isStart\";\n},\n _renderZeroDurationTween = function _renderZeroDurationTween(tween, totalTime, suppressEvents, force) {\n var prevRatio = tween.ratio,\n ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1,\n // if the tween or its parent is reversed and the totalTime is 0, we should go to a ratio of 0. Edge case: if a from() or fromTo() stagger tween is placed later in a timeline, the \"startAt\" zero-duration tween could initially render at a time when the parent timeline's playhead is technically BEFORE where this tween is, so make sure that any \"from\" and \"fromTo\" startAt tweens are rendered the first time at a ratio of 1.\n repeatDelay = tween._rDelay,\n tTime = 0,\n pt,\n iteration,\n prevIteration;\n\n if (repeatDelay && tween._repeat) {\n // in case there's a zero-duration tween that has a repeat with a repeatDelay\n tTime = _clamp(0, tween._tDur, totalTime);\n iteration = _animationCycle(tTime, repeatDelay);\n tween._yoyo && iteration & 1 && (ratio = 1 - ratio);\n\n if (iteration !== _animationCycle(tween._tTime, repeatDelay)) {\n // if iteration changed\n prevRatio = 1 - ratio;\n tween.vars.repeatRefresh && tween._initted && tween.invalidate();\n }\n }\n\n if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) {\n if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) {\n // if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.\n return;\n }\n\n prevIteration = tween._zTime;\n tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0); // when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.\n\n suppressEvents || (suppressEvents = totalTime && !prevIteration); // if it was rendered previously at exactly 0 (_zTime) and now the playhead is moving away, DON'T fire callbacks otherwise they'll seem like duplicates.\n\n tween.ratio = ratio;\n tween._from && (ratio = 1 - ratio);\n tween._time = 0;\n tween._tTime = tTime;\n pt = tween._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n\n totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true);\n tween._onUpdate && !suppressEvents && _callback(tween, \"onUpdate\");\n tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, \"onRepeat\");\n\n if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) {\n ratio && _removeFromParent(tween, 1);\n\n if (!suppressEvents && !_reverting) {\n _callback(tween, ratio ? \"onComplete\" : \"onReverseComplete\", true);\n\n tween._prom && tween._prom();\n }\n }\n } else if (!tween._zTime) {\n tween._zTime = totalTime;\n }\n},\n _findNextPauseTween = function _findNextPauseTween(animation, prevTime, time) {\n var child;\n\n if (time > prevTime) {\n child = animation._first;\n\n while (child && child._start <= time) {\n if (child.data === \"isPause\" && child._start > prevTime) {\n return child;\n }\n\n child = child._next;\n }\n } else {\n child = animation._last;\n\n while (child && child._start >= time) {\n if (child.data === \"isPause\" && child._start < prevTime) {\n return child;\n }\n\n child = child._prev;\n }\n }\n},\n _setDuration = function _setDuration(animation, duration, skipUncache, leavePlayhead) {\n var repeat = animation._repeat,\n dur = _roundPrecise(duration) || 0,\n totalProgress = animation._tTime / animation._tDur;\n totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur);\n animation._dur = dur;\n animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat);\n totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress);\n animation.parent && _setEnd(animation);\n skipUncache || _uncache(animation.parent, animation);\n return animation;\n},\n _onUpdateTotalDuration = function _onUpdateTotalDuration(animation) {\n return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur);\n},\n _zeroPosition = {\n _start: 0,\n endTime: _emptyFunc,\n totalDuration: _emptyFunc\n},\n _parsePosition = function _parsePosition(animation, position, percentAnimation) {\n var labels = animation.labels,\n recent = animation._recent || _zeroPosition,\n clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur,\n //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead.\n i,\n offset,\n isPercent;\n\n if (_isString(position) && (isNaN(position) || position in labels)) {\n //if the string is a number like \"1\", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).\n offset = position.charAt(0);\n isPercent = position.substr(-1) === \"%\";\n i = position.indexOf(\"=\");\n\n if (offset === \"<\" || offset === \">\") {\n i >= 0 && (position = position.replace(/=/, \"\"));\n return (offset === \"<\" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1);\n }\n\n if (i < 0) {\n position in labels || (labels[position] = clippedDuration);\n return labels[position];\n }\n\n offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1));\n\n if (isPercent && percentAnimation) {\n offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration();\n }\n\n return i > 1 ? _parsePosition(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset;\n }\n\n return position == null ? clippedDuration : +position;\n},\n _createTweenType = function _createTweenType(type, params, timeline) {\n var isLegacy = _isNumber(params[1]),\n varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1),\n vars = params[varsIndex],\n irVars,\n parent;\n\n isLegacy && (vars.duration = params[1]);\n vars.parent = timeline;\n\n if (type) {\n irVars = vars;\n parent = timeline;\n\n while (parent && !(\"immediateRender\" in irVars)) {\n // inheritance hasn't happened yet, but someone may have set a default in an ancestor timeline. We could do vars.immediateRender = _isNotFalse(_inheritDefaults(vars).immediateRender) but that'd exact a slight performance penalty because _inheritDefaults() also runs in the Tween constructor. We're paying a small kb price here to gain speed.\n irVars = parent.vars.defaults || {};\n parent = _isNotFalse(parent.vars.inherit) && parent.parent;\n }\n\n vars.immediateRender = _isNotFalse(irVars.immediateRender);\n type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1]; // \"from\" vars\n }\n\n return new Tween(params[0], vars, params[varsIndex + 1]);\n},\n _conditionalReturn = function _conditionalReturn(value, func) {\n return value || value === 0 ? func(value) : func;\n},\n _clamp = function _clamp(min, max, value) {\n return value < min ? min : value > max ? max : value;\n},\n getUnit = function getUnit(value, v) {\n return !_isString(value) || !(v = _unitExp.exec(value)) ? \"\" : v[1];\n},\n // note: protect against padded numbers as strings, like \"100.100\". That shouldn't return \"00\" as the unit. If it's numeric, return no unit.\nclamp = function clamp(min, max, value) {\n return _conditionalReturn(value, function (v) {\n return _clamp(min, max, v);\n });\n},\n _slice = [].slice,\n _isArrayLike = function _isArrayLike(value, nonEmpty) {\n return value && _isObject(value) && \"length\" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win;\n},\n _flatten = function _flatten(ar, leaveStrings, accumulator) {\n if (accumulator === void 0) {\n accumulator = [];\n }\n\n return ar.forEach(function (value) {\n var _accumulator;\n\n return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value);\n }) || accumulator;\n},\n //takes any value and returns an array. If it's a string (and leaveStrings isn't true), it'll use document.querySelectorAll() and convert that to an array. It'll also accept iterables like jQuery objects.\ntoArray = function toArray(value, scope, leaveStrings) {\n return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : [];\n},\n selector = function selector(value) {\n value = toArray(value)[0] || _warn(\"Invalid scope\") || {};\n return function (v) {\n var el = value.current || value.nativeElement || value;\n return toArray(v, el.querySelectorAll ? el : el === value ? _warn(\"Invalid scope\") || _doc.createElement(\"div\") : value);\n };\n},\n shuffle = function shuffle(a) {\n return a.sort(function () {\n return .5 - Math.random();\n });\n},\n // alternative that's a bit faster and more reliably diverse but bigger: for (let j, v, i = a.length; i; j = Math.floor(Math.random() * i), v = a[--i], a[i] = a[j], a[j] = v); return a;\n//for distributing values across an array. Can accept a number, a function or (most commonly) a function which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array. Recognizes the following\ndistribute = function distribute(v) {\n if (_isFunction(v)) {\n return v;\n }\n\n var vars = _isObject(v) ? v : {\n each: v\n },\n //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total \"amount\" that's chunked out among them all.\n ease = _parseEase(vars.ease),\n from = vars.from || 0,\n base = parseFloat(vars.base) || 0,\n cache = {},\n isDecimal = from > 0 && from < 1,\n ratios = isNaN(from) || isDecimal,\n axis = vars.axis,\n ratioX = from,\n ratioY = from;\n\n if (_isString(from)) {\n ratioX = ratioY = {\n center: .5,\n edges: .5,\n end: 1\n }[from] || 0;\n } else if (!isDecimal && ratios) {\n ratioX = from[0];\n ratioY = from[1];\n }\n\n return function (i, target, a) {\n var l = (a || vars).length,\n distances = cache[l],\n originX,\n originY,\n x,\n y,\n d,\n j,\n max,\n min,\n wrapAt;\n\n if (!distances) {\n wrapAt = vars.grid === \"auto\" ? 0 : (vars.grid || [1, _bigNum])[1];\n\n if (!wrapAt) {\n max = -_bigNum;\n\n while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {}\n\n wrapAt < l && wrapAt--;\n }\n\n distances = cache[l] = [];\n originX = ratios ? Math.min(wrapAt, l) * ratioX - .5 : from % wrapAt;\n originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - .5 : from / wrapAt | 0;\n max = 0;\n min = _bigNum;\n\n for (j = 0; j < l; j++) {\n x = j % wrapAt - originX;\n y = originY - (j / wrapAt | 0);\n distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === \"y\" ? y : x);\n d > max && (max = d);\n d < min && (min = d);\n }\n\n from === \"random\" && shuffle(distances);\n distances.max = max - min;\n distances.min = min;\n distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === \"y\" ? l / wrapAt : wrapAt) || 0) * (from === \"edges\" ? -1 : 1);\n distances.b = l < 0 ? base - l : base;\n distances.u = getUnit(vars.amount || vars.each) || 0; //unit\n\n ease = ease && l < 0 ? _invertEase(ease) : ease;\n }\n\n l = (distances[i] - distances.min) / distances.max || 0;\n return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u; //round in order to work around floating point errors\n };\n},\n _roundModifier = function _roundModifier(v) {\n //pass in 0.1 get a function that'll round to the nearest tenth, or 5 to round to the closest 5, or 0.001 to the closest 1000th, etc.\n var p = Math.pow(10, ((v + \"\").split(\".\")[1] || \"\").length); //to avoid floating point math errors (like 24 * 0.1 == 2.4000000000000004), we chop off at a specific number of decimal places (much faster than toFixed())\n\n return function (raw) {\n var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p);\n\n return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw)); // n - n % 1 replaces Math.floor() in order to handle negative values properly. For example, Math.floor(-150.00000000000003) is 151!\n };\n},\n snap = function snap(snapTo, value) {\n var isArray = _isArray(snapTo),\n radius,\n is2D;\n\n if (!isArray && _isObject(snapTo)) {\n radius = isArray = snapTo.radius || _bigNum;\n\n if (snapTo.values) {\n snapTo = toArray(snapTo.values);\n\n if (is2D = !_isNumber(snapTo[0])) {\n radius *= radius; //performance optimization so we don't have to Math.sqrt() in the loop.\n }\n } else {\n snapTo = _roundModifier(snapTo.increment);\n }\n }\n\n return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function (raw) {\n is2D = snapTo(raw);\n return Math.abs(is2D - raw) <= radius ? is2D : raw;\n } : function (raw) {\n var x = parseFloat(is2D ? raw.x : raw),\n y = parseFloat(is2D ? raw.y : 0),\n min = _bigNum,\n closest = 0,\n i = snapTo.length,\n dx,\n dy;\n\n while (i--) {\n if (is2D) {\n dx = snapTo[i].x - x;\n dy = snapTo[i].y - y;\n dx = dx * dx + dy * dy;\n } else {\n dx = Math.abs(snapTo[i] - x);\n }\n\n if (dx < min) {\n min = dx;\n closest = i;\n }\n }\n\n closest = !radius || min <= radius ? snapTo[closest] : raw;\n return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw);\n });\n},\n random = function random(min, max, roundingIncrement, returnFunction) {\n return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function () {\n return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + \"\").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * .99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction;\n });\n},\n pipe = function pipe() {\n for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) {\n functions[_key] = arguments[_key];\n }\n\n return function (value) {\n return functions.reduce(function (v, f) {\n return f(v);\n }, value);\n };\n},\n unitize = function unitize(func, unit) {\n return function (value) {\n return func(parseFloat(value)) + (unit || getUnit(value));\n };\n},\n normalize = function normalize(min, max, value) {\n return mapRange(min, max, 0, 1, value);\n},\n _wrapArray = function _wrapArray(a, wrapper, value) {\n return _conditionalReturn(value, function (index) {\n return a[~~wrapper(index)];\n });\n},\n wrap = function wrap(min, max, value) {\n // NOTE: wrap() CANNOT be an arrow function! A very odd compiling bug causes problems (unrelated to GSAP).\n var range = max - min;\n return _isArray(min) ? _wrapArray(min, wrap(0, min.length), max) : _conditionalReturn(value, function (value) {\n return (range + (value - min) % range) % range + min;\n });\n},\n wrapYoyo = function wrapYoyo(min, max, value) {\n var range = max - min,\n total = range * 2;\n return _isArray(min) ? _wrapArray(min, wrapYoyo(0, min.length - 1), max) : _conditionalReturn(value, function (value) {\n value = (total + (value - min) % total) % total || 0;\n return min + (value > range ? total - value : value);\n });\n},\n _replaceRandom = function _replaceRandom(value) {\n //replaces all occurrences of random(...) in a string with the calculated random value. can be a range like random(-100, 100, 5) or an array like random([0, 100, 500])\n var prev = 0,\n s = \"\",\n i,\n nums,\n end,\n isArray;\n\n while (~(i = value.indexOf(\"random(\", prev))) {\n end = value.indexOf(\")\", i);\n isArray = value.charAt(i + 7) === \"[\";\n nums = value.substr(i + 7, end - i - 7).match(isArray ? _delimitedValueExp : _strictNumExp);\n s += value.substr(prev, i - prev) + random(isArray ? nums : +nums[0], isArray ? 0 : +nums[1], +nums[2] || 1e-5);\n prev = end + 1;\n }\n\n return s + value.substr(prev, value.length - prev);\n},\n mapRange = function mapRange(inMin, inMax, outMin, outMax, value) {\n var inRange = inMax - inMin,\n outRange = outMax - outMin;\n return _conditionalReturn(value, function (value) {\n return outMin + ((value - inMin) / inRange * outRange || 0);\n });\n},\n interpolate = function interpolate(start, end, progress, mutate) {\n var func = isNaN(start + end) ? 0 : function (p) {\n return (1 - p) * start + p * end;\n };\n\n if (!func) {\n var isString = _isString(start),\n master = {},\n p,\n i,\n interpolators,\n l,\n il;\n\n progress === true && (mutate = 1) && (progress = null);\n\n if (isString) {\n start = {\n p: start\n };\n end = {\n p: end\n };\n } else if (_isArray(start) && !_isArray(end)) {\n interpolators = [];\n l = start.length;\n il = l - 2;\n\n for (i = 1; i < l; i++) {\n interpolators.push(interpolate(start[i - 1], start[i])); //build the interpolators up front as a performance optimization so that when the function is called many times, it can just reuse them.\n }\n\n l--;\n\n func = function func(p) {\n p *= l;\n var i = Math.min(il, ~~p);\n return interpolators[i](p - i);\n };\n\n progress = end;\n } else if (!mutate) {\n start = _merge(_isArray(start) ? [] : {}, start);\n }\n\n if (!interpolators) {\n for (p in end) {\n _addPropTween.call(master, start, p, \"get\", end[p]);\n }\n\n func = function func(p) {\n return _renderPropTweens(p, master) || (isString ? start.p : start);\n };\n }\n }\n\n return _conditionalReturn(progress, func);\n},\n _getLabelInDirection = function _getLabelInDirection(timeline, fromTime, backward) {\n //used for nextLabel() and previousLabel()\n var labels = timeline.labels,\n min = _bigNum,\n p,\n distance,\n label;\n\n for (p in labels) {\n distance = labels[p] - fromTime;\n\n if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) {\n label = p;\n min = distance;\n }\n }\n\n return label;\n},\n _callback = function _callback(animation, type, executeLazyFirst) {\n var v = animation.vars,\n callback = v[type],\n prevContext = _context,\n context = animation._ctx,\n params,\n scope,\n result;\n\n if (!callback) {\n return;\n }\n\n params = v[type + \"Params\"];\n scope = v.callbackScope || animation;\n executeLazyFirst && _lazyTweens.length && _lazyRender(); //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values.\n\n context && (_context = context);\n result = params ? callback.apply(scope, params) : callback.call(scope);\n _context = prevContext;\n return result;\n},\n _interrupt = function _interrupt(animation) {\n _removeFromParent(animation);\n\n animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting);\n animation.progress() < 1 && _callback(animation, \"onInterrupt\");\n return animation;\n},\n _quickTween,\n _registerPluginQueue = [],\n _createPlugin = function _createPlugin(config) {\n if (!config) return;\n config = !config.name && config[\"default\"] || config; // UMD packaging wraps things oddly, so for example MotionPathHelper becomes {MotionPathHelper:MotionPathHelper, default:MotionPathHelper}.\n\n if (_windowExists() || config.headless) {\n // edge case: some build tools may pass in a null/undefined value\n var name = config.name,\n isFunc = _isFunction(config),\n Plugin = name && !isFunc && config.init ? function () {\n this._props = [];\n } : config,\n //in case someone passes in an object that's not a plugin, like CustomEase\n instanceDefaults = {\n init: _emptyFunc,\n render: _renderPropTweens,\n add: _addPropTween,\n kill: _killPropTweensOf,\n modifier: _addPluginModifier,\n rawVars: 0\n },\n statics = {\n targetTest: 0,\n get: 0,\n getSetter: _getSetter,\n aliases: {},\n register: 0\n };\n\n _wake();\n\n if (config !== Plugin) {\n if (_plugins[name]) {\n return;\n }\n\n _setDefaults(Plugin, _setDefaults(_copyExcluding(config, instanceDefaults), statics)); //static methods\n\n\n _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config, statics))); //instance methods\n\n\n _plugins[Plugin.prop = name] = Plugin;\n\n if (config.targetTest) {\n _harnessPlugins.push(Plugin);\n\n _reservedProps[name] = 1;\n }\n\n name = (name === \"css\" ? \"CSS\" : name.charAt(0).toUpperCase() + name.substr(1)) + \"Plugin\"; //for the global name. \"motionPath\" should become MotionPathPlugin\n }\n\n _addGlobal(name, Plugin);\n\n config.register && config.register(gsap, Plugin, PropTween);\n } else {\n _registerPluginQueue.push(config);\n }\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * COLORS\n * --------------------------------------------------------------------------------------\n */\n_255 = 255,\n _colorLookup = {\n aqua: [0, _255, _255],\n lime: [0, _255, 0],\n silver: [192, 192, 192],\n black: [0, 0, 0],\n maroon: [128, 0, 0],\n teal: [0, 128, 128],\n blue: [0, 0, _255],\n navy: [0, 0, 128],\n white: [_255, _255, _255],\n olive: [128, 128, 0],\n yellow: [_255, _255, 0],\n orange: [_255, 165, 0],\n gray: [128, 128, 128],\n purple: [128, 0, 128],\n green: [0, 128, 0],\n red: [_255, 0, 0],\n pink: [_255, 192, 203],\n cyan: [0, _255, _255],\n transparent: [_255, _255, _255, 0]\n},\n // possible future idea to replace the hard-coded color name values - put this in the ticker.wake() where we set the _doc:\n// let ctx = _doc.createElement(\"canvas\").getContext(\"2d\");\n// _forEachName(\"aqua,lime,silver,black,maroon,teal,blue,navy,white,olive,yellow,orange,gray,purple,green,red,pink,cyan\", color => {ctx.fillStyle = color; _colorLookup[color] = splitColor(ctx.fillStyle)});\n_hue = function _hue(h, m1, m2) {\n h += h < 0 ? 1 : h > 1 ? -1 : 0;\n return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < .5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + .5 | 0;\n},\n splitColor = function splitColor(v, toHSL, forceAlpha) {\n var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0,\n r,\n g,\n b,\n h,\n s,\n l,\n max,\n min,\n d,\n wasHSL;\n\n if (!a) {\n if (v.substr(-1) === \",\") {\n //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:\"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)\" - in this example \"blue,\" has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value.\n v = v.substr(0, v.length - 1);\n }\n\n if (_colorLookup[v]) {\n a = _colorLookup[v];\n } else if (v.charAt(0) === \"#\") {\n if (v.length < 6) {\n //for shorthand like #9F0 or #9F0F (could have alpha)\n r = v.charAt(1);\n g = v.charAt(2);\n b = v.charAt(3);\n v = \"#\" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : \"\");\n }\n\n if (v.length === 9) {\n // hex with alpha, like #fd5e53ff\n a = parseInt(v.substr(1, 6), 16);\n return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255];\n }\n\n v = parseInt(v.substr(1), 16);\n a = [v >> 16, v >> 8 & _255, v & _255];\n } else if (v.substr(0, 3) === \"hsl\") {\n a = wasHSL = v.match(_strictNumExp);\n\n if (!toHSL) {\n h = +a[0] % 360 / 360;\n s = +a[1] / 100;\n l = +a[2] / 100;\n g = l <= .5 ? l * (s + 1) : l + s - l * s;\n r = l * 2 - g;\n a.length > 3 && (a[3] *= 1); //cast as number\n\n a[0] = _hue(h + 1 / 3, r, g);\n a[1] = _hue(h, r, g);\n a[2] = _hue(h - 1 / 3, r, g);\n } else if (~v.indexOf(\"=\")) {\n //if relative values are found, just return the raw strings with the relative prefixes in place.\n a = v.match(_numExp);\n forceAlpha && a.length < 4 && (a[3] = 1);\n return a;\n }\n } else {\n a = v.match(_strictNumExp) || _colorLookup.transparent;\n }\n\n a = a.map(Number);\n }\n\n if (toHSL && !wasHSL) {\n r = a[0] / _255;\n g = a[1] / _255;\n b = a[2] / _255;\n max = Math.max(r, g, b);\n min = Math.min(r, g, b);\n l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0;\n } else {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4;\n h *= 60;\n }\n\n a[0] = ~~(h + .5);\n a[1] = ~~(s * 100 + .5);\n a[2] = ~~(l * 100 + .5);\n }\n\n forceAlpha && a.length < 4 && (a[3] = 1);\n return a;\n},\n _colorOrderData = function _colorOrderData(v) {\n // strips out the colors from the string, finds all the numeric slots (with units) and returns an array of those. The Array also has a \"c\" property which is an Array of the index values where the colors belong. This is to help work around issues where there's a mis-matched order of color/numeric data like drop-shadow(#f00 0px 1px 2px) and drop-shadow(0x 1px 2px #f00). This is basically a helper function used in _formatColors()\n var values = [],\n c = [],\n i = -1;\n v.split(_colorExp).forEach(function (v) {\n var a = v.match(_numWithUnitExp) || [];\n values.push.apply(values, a);\n c.push(i += a.length + 1);\n });\n values.c = c;\n return values;\n},\n _formatColors = function _formatColors(s, toHSL, orderMatchData) {\n var result = \"\",\n colors = (s + result).match(_colorExp),\n type = toHSL ? \"hsla(\" : \"rgba(\",\n i = 0,\n c,\n shell,\n d,\n l;\n\n if (!colors) {\n return s;\n }\n\n colors = colors.map(function (color) {\n return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + \",\" + color[1] + \"%,\" + color[2] + \"%,\" + color[3] : color.join(\",\")) + \")\";\n });\n\n if (orderMatchData) {\n d = _colorOrderData(s);\n c = orderMatchData.c;\n\n if (c.join(result) !== d.c.join(result)) {\n shell = s.replace(_colorExp, \"1\").split(_numWithUnitExp);\n l = shell.length - 1;\n\n for (; i < l; i++) {\n result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + \"0,0,0,0)\" : (d.length ? d : colors.length ? colors : orderMatchData).shift());\n }\n }\n }\n\n if (!shell) {\n shell = s.split(_colorExp);\n l = shell.length - 1;\n\n for (; i < l; i++) {\n result += shell[i] + colors[i];\n }\n }\n\n return result + shell[l];\n},\n _colorExp = function () {\n var s = \"(?:\\\\b(?:(?:rgb|rgba|hsl|hsla)\\\\(.+?\\\\))|\\\\B#(?:[0-9a-f]{3,4}){1,2}\\\\b\",\n //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc.,\n p;\n\n for (p in _colorLookup) {\n s += \"|\" + p + \"\\\\b\";\n }\n\n return new RegExp(s + \")\", \"gi\");\n}(),\n _hslExp = /hsl[a]?\\(/,\n _colorStringFilter = function _colorStringFilter(a) {\n var combined = a.join(\" \"),\n toHSL;\n _colorExp.lastIndex = 0;\n\n if (_colorExp.test(combined)) {\n toHSL = _hslExp.test(combined);\n a[1] = _formatColors(a[1], toHSL);\n a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1])); // make sure the order of numbers/colors match with the END value.\n\n return true;\n }\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * TICKER\n * --------------------------------------------------------------------------------------\n */\n_tickerActive,\n _ticker = function () {\n var _getTime = Date.now,\n _lagThreshold = 500,\n _adjustedLag = 33,\n _startTime = _getTime(),\n _lastUpdate = _startTime,\n _gap = 1000 / 240,\n _nextTime = _gap,\n _listeners = [],\n _id,\n _req,\n _raf,\n _self,\n _delta,\n _i,\n _tick = function _tick(v) {\n var elapsed = _getTime() - _lastUpdate,\n manual = v === true,\n overlap,\n dispatch,\n time,\n frame;\n\n (elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag);\n _lastUpdate += elapsed;\n time = _lastUpdate - _startTime;\n overlap = time - _nextTime;\n\n if (overlap > 0 || manual) {\n frame = ++_self.frame;\n _delta = time - _self.time * 1000;\n _self.time = time = time / 1000;\n _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap);\n dispatch = 1;\n }\n\n manual || (_id = _req(_tick)); //make sure the request is made before we dispatch the \"tick\" event so that timing is maintained. Otherwise, if processing the \"tick\" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise.\n\n if (dispatch) {\n for (_i = 0; _i < _listeners.length; _i++) {\n // use _i and check _listeners.length instead of a variable because a listener could get removed during the loop, and if that happens to an element less than the current index, it'd throw things off in the loop.\n _listeners[_i](time, _delta, frame, v);\n }\n }\n };\n\n _self = {\n time: 0,\n frame: 0,\n tick: function tick() {\n _tick(true);\n },\n deltaRatio: function deltaRatio(fps) {\n return _delta / (1000 / (fps || 60));\n },\n wake: function wake() {\n if (_coreReady) {\n if (!_coreInitted && _windowExists()) {\n _win = _coreInitted = window;\n _doc = _win.document || {};\n _globals.gsap = gsap;\n (_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version);\n\n _install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {});\n\n _registerPluginQueue.forEach(_createPlugin);\n }\n\n _raf = typeof requestAnimationFrame !== \"undefined\" && requestAnimationFrame;\n _id && _self.sleep();\n\n _req = _raf || function (f) {\n return setTimeout(f, _nextTime - _self.time * 1000 + 1 | 0);\n };\n\n _tickerActive = 1;\n\n _tick(2);\n }\n },\n sleep: function sleep() {\n (_raf ? cancelAnimationFrame : clearTimeout)(_id);\n _tickerActive = 0;\n _req = _emptyFunc;\n },\n lagSmoothing: function lagSmoothing(threshold, adjustedLag) {\n _lagThreshold = threshold || Infinity; // zero should be interpreted as basically unlimited\n\n _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold);\n },\n fps: function fps(_fps) {\n _gap = 1000 / (_fps || 240);\n _nextTime = _self.time * 1000 + _gap;\n },\n add: function add(callback, once, prioritize) {\n var func = once ? function (t, d, f, v) {\n callback(t, d, f, v);\n\n _self.remove(func);\n } : callback;\n\n _self.remove(callback);\n\n _listeners[prioritize ? \"unshift\" : \"push\"](func);\n\n _wake();\n\n return func;\n },\n remove: function remove(callback, i) {\n ~(i = _listeners.indexOf(callback)) && _listeners.splice(i, 1) && _i >= i && _i--;\n },\n _listeners: _listeners\n };\n return _self;\n}(),\n _wake = function _wake() {\n return !_tickerActive && _ticker.wake();\n},\n //also ensures the core classes are initialized.\n\n/*\n* -------------------------------------------------\n* EASING\n* -------------------------------------------------\n*/\n_easeMap = {},\n _customEaseExp = /^[\\d.\\-M][\\d.\\-,\\s]/,\n _quotesExp = /[\"']/g,\n _parseObjectInString = function _parseObjectInString(value) {\n //takes a string like \"{wiggles:10, type:anticipate})\" and turns it into a real object. Notice it ends in \")\" and includes the {} wrappers. This is because we only use this function for parsing ease configs and prioritized optimization rather than reusability.\n var obj = {},\n split = value.substr(1, value.length - 3).split(\":\"),\n key = split[0],\n i = 1,\n l = split.length,\n index,\n val,\n parsedVal;\n\n for (; i < l; i++) {\n val = split[i];\n index = i !== l - 1 ? val.lastIndexOf(\",\") : val.length;\n parsedVal = val.substr(0, index);\n obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, \"\").trim() : +parsedVal;\n key = val.substr(index + 1).trim();\n }\n\n return obj;\n},\n _valueInParentheses = function _valueInParentheses(value) {\n var open = value.indexOf(\"(\") + 1,\n close = value.indexOf(\")\"),\n nested = value.indexOf(\"(\", open);\n return value.substring(open, ~nested && nested < close ? value.indexOf(\")\", close + 1) : close);\n},\n _configEaseFromString = function _configEaseFromString(name) {\n //name can be a string like \"elastic.out(1,0.5)\", and pass in _easeMap as obj and it'll parse it out and call the actual function like _easeMap.Elastic.easeOut.config(1,0.5). It will also parse custom ease strings as long as CustomEase is loaded and registered (internally as _easeMap._CE).\n var split = (name + \"\").split(\"(\"),\n ease = _easeMap[split[0]];\n return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf(\"{\") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(\",\").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE(\"\", name) : ease;\n},\n _invertEase = function _invertEase(ease) {\n return function (p) {\n return 1 - ease(1 - p);\n };\n},\n // allow yoyoEase to be set in children and have those affected when the parent/ancestor timeline yoyos.\n_propagateYoyoEase = function _propagateYoyoEase(timeline, isYoyo) {\n var child = timeline._first,\n ease;\n\n while (child) {\n if (child instanceof Timeline) {\n _propagateYoyoEase(child, isYoyo);\n } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) {\n if (child.timeline) {\n _propagateYoyoEase(child.timeline, isYoyo);\n } else {\n ease = child._ease;\n child._ease = child._yEase;\n child._yEase = ease;\n child._yoyo = isYoyo;\n }\n }\n\n child = child._next;\n }\n},\n _parseEase = function _parseEase(ease, defaultEase) {\n return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase;\n},\n _insertEase = function _insertEase(names, easeIn, easeOut, easeInOut) {\n if (easeOut === void 0) {\n easeOut = function easeOut(p) {\n return 1 - easeIn(1 - p);\n };\n }\n\n if (easeInOut === void 0) {\n easeInOut = function easeInOut(p) {\n return p < .5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2;\n };\n }\n\n var ease = {\n easeIn: easeIn,\n easeOut: easeOut,\n easeInOut: easeInOut\n },\n lowercaseName;\n\n _forEachName(names, function (name) {\n _easeMap[name] = _globals[name] = ease;\n _easeMap[lowercaseName = name.toLowerCase()] = easeOut;\n\n for (var p in ease) {\n _easeMap[lowercaseName + (p === \"easeIn\" ? \".in\" : p === \"easeOut\" ? \".out\" : \".inOut\")] = _easeMap[name + \".\" + p] = ease[p];\n }\n });\n\n return ease;\n},\n _easeInOutFromOut = function _easeInOutFromOut(easeOut) {\n return function (p) {\n return p < .5 ? (1 - easeOut(1 - p * 2)) / 2 : .5 + easeOut((p - .5) * 2) / 2;\n };\n},\n _configElastic = function _configElastic(type, amplitude, period) {\n var p1 = amplitude >= 1 ? amplitude : 1,\n //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1.\n p2 = (period || (type ? .3 : .45)) / (amplitude < 1 ? amplitude : 1),\n p3 = p2 / _2PI * (Math.asin(1 / p1) || 0),\n easeOut = function easeOut(p) {\n return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1;\n },\n ease = type === \"out\" ? easeOut : type === \"in\" ? function (p) {\n return 1 - easeOut(1 - p);\n } : _easeInOutFromOut(easeOut);\n\n p2 = _2PI / p2; //precalculate to optimize\n\n ease.config = function (amplitude, period) {\n return _configElastic(type, amplitude, period);\n };\n\n return ease;\n},\n _configBack = function _configBack(type, overshoot) {\n if (overshoot === void 0) {\n overshoot = 1.70158;\n }\n\n var easeOut = function easeOut(p) {\n return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0;\n },\n ease = type === \"out\" ? easeOut : type === \"in\" ? function (p) {\n return 1 - easeOut(1 - p);\n } : _easeInOutFromOut(easeOut);\n\n ease.config = function (overshoot) {\n return _configBack(type, overshoot);\n };\n\n return ease;\n}; // a cheaper (kb and cpu) but more mild way to get a parameterized weighted ease by feeding in a value between -1 (easeIn) and 1 (easeOut) where 0 is linear.\n// _weightedEase = ratio => {\n// \tlet y = 0.5 + ratio / 2;\n// \treturn p => (2 * (1 - p) * p * y + p * p);\n// },\n// a stronger (but more expensive kb/cpu) parameterized weighted ease that lets you feed in a value between -1 (easeIn) and 1 (easeOut) where 0 is linear.\n// _weightedEaseStrong = ratio => {\n// \tratio = .5 + ratio / 2;\n// \tlet o = 1 / 3 * (ratio < .5 ? ratio : 1 - ratio),\n// \t\tb = ratio - o,\n// \t\tc = ratio + o;\n// \treturn p => p === 1 ? p : 3 * b * (1 - p) * (1 - p) * p + 3 * c * (1 - p) * p * p + p * p * p;\n// };\n\n\n_forEachName(\"Linear,Quad,Cubic,Quart,Quint,Strong\", function (name, i) {\n var power = i < 5 ? i + 1 : i;\n\n _insertEase(name + \",Power\" + (power - 1), i ? function (p) {\n return Math.pow(p, power);\n } : function (p) {\n return p;\n }, function (p) {\n return 1 - Math.pow(1 - p, power);\n }, function (p) {\n return p < .5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2;\n });\n});\n\n_easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn;\n\n_insertEase(\"Elastic\", _configElastic(\"in\"), _configElastic(\"out\"), _configElastic());\n\n(function (n, c) {\n var n1 = 1 / c,\n n2 = 2 * n1,\n n3 = 2.5 * n1,\n easeOut = function easeOut(p) {\n return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + .75 : p < n3 ? n * (p -= 2.25 / c) * p + .9375 : n * Math.pow(p - 2.625 / c, 2) + .984375;\n };\n\n _insertEase(\"Bounce\", function (p) {\n return 1 - easeOut(1 - p);\n }, easeOut);\n})(7.5625, 2.75);\n\n_insertEase(\"Expo\", function (p) {\n return p ? Math.pow(2, 10 * (p - 1)) : 0;\n});\n\n_insertEase(\"Circ\", function (p) {\n return -(_sqrt(1 - p * p) - 1);\n});\n\n_insertEase(\"Sine\", function (p) {\n return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1;\n});\n\n_insertEase(\"Back\", _configBack(\"in\"), _configBack(\"out\"), _configBack());\n\n_easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = {\n config: function config(steps, immediateStart) {\n if (steps === void 0) {\n steps = 1;\n }\n\n var p1 = 1 / steps,\n p2 = steps + (immediateStart ? 0 : 1),\n p3 = immediateStart ? 1 : 0,\n max = 1 - _tinyNum;\n return function (p) {\n return ((p2 * _clamp(0, max, p) | 0) + p3) * p1;\n };\n }\n};\n_defaults.ease = _easeMap[\"quad.out\"];\n\n_forEachName(\"onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt\", function (name) {\n return _callbackNames += name + \",\" + name + \"Params,\";\n});\n/*\n * --------------------------------------------------------------------------------------\n * CACHE\n * --------------------------------------------------------------------------------------\n */\n\n\nexport var GSCache = function GSCache(target, harness) {\n this.id = _gsID++;\n target._gsap = this;\n this.target = target;\n this.harness = harness;\n this.get = harness ? harness.get : _getProperty;\n this.set = harness ? harness.getSetter : _getSetter;\n};\n/*\n * --------------------------------------------------------------------------------------\n * ANIMATION\n * --------------------------------------------------------------------------------------\n */\n\nexport var Animation = /*#__PURE__*/function () {\n function Animation(vars) {\n this.vars = vars;\n this._delay = +vars.delay || 0;\n\n if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) {\n // TODO: repeat: Infinity on a timeline's children must flag that timeline internally and affect its totalDuration, otherwise it'll stop in the negative direction when reaching the start.\n this._rDelay = vars.repeatDelay || 0;\n this._yoyo = !!vars.yoyo || !!vars.yoyoEase;\n }\n\n this._ts = 1;\n\n _setDuration(this, +vars.duration, 1, 1);\n\n this.data = vars.data;\n\n if (_context) {\n this._ctx = _context;\n\n _context.data.push(this);\n }\n\n _tickerActive || _ticker.wake();\n }\n\n var _proto = Animation.prototype;\n\n _proto.delay = function delay(value) {\n if (value || value === 0) {\n this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);\n this._delay = value;\n return this;\n }\n\n return this._delay;\n };\n\n _proto.duration = function duration(value) {\n return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur;\n };\n\n _proto.totalDuration = function totalDuration(value) {\n if (!arguments.length) {\n return this._tDur;\n }\n\n this._dirty = 0;\n return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1));\n };\n\n _proto.totalTime = function totalTime(_totalTime, suppressEvents) {\n _wake();\n\n if (!arguments.length) {\n return this._tTime;\n }\n\n var parent = this._dp;\n\n if (parent && parent.smoothChildTiming && this._ts) {\n _alignPlayhead(this, _totalTime);\n\n !parent._dp || parent.parent || _postAddChecks(parent, this); // edge case: if this is a child of a timeline that already completed, for example, we must re-activate the parent.\n //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The start of that child would get pushed out, but one of the ancestors may have completed.\n\n while (parent && parent.parent) {\n if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) {\n parent.totalTime(parent._tTime, true);\n }\n\n parent = parent.parent;\n }\n\n if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) {\n //if the animation doesn't have a parent, put it back into its last parent (recorded as _dp for exactly cases like this). Limit to parents with autoRemoveChildren (like globalTimeline) so that if the user manually removes an animation from a timeline and then alters its playhead, it doesn't get added back in.\n _addToTimeline(this._dp, this, this._start - this._delay);\n }\n }\n\n if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) {\n // check for _ptLookup on a Tween instance to ensure it has actually finished being instantiated, otherwise if this.reverse() gets called in the Animation constructor, it could trigger a render() here even though the _targets weren't populated, thus when _init() is called there won't be any PropTweens (it'll act like the tween is non-functional)\n this._ts || (this._pTime = _totalTime); // otherwise, if an animation is paused, then the playhead is moved back to zero, then resumed, it'd revert back to the original time at the pause\n //if (!this._lock) { // avoid endless recursion (not sure we need this yet or if it's worth the performance hit)\n // this._lock = 1;\n\n _lazySafeRender(this, _totalTime, suppressEvents); // this._lock = 0;\n //}\n\n }\n\n return this;\n };\n\n _proto.time = function time(value, suppressEvents) {\n return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time; // note: if the modulus results in 0, the playhead could be exactly at the end or the beginning, and we always defer to the END with a non-zero value, otherwise if you set the time() to the very end (duration()), it would render at the START!\n };\n\n _proto.totalProgress = function totalProgress(value, suppressEvents) {\n return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() > 0 ? 1 : 0;\n };\n\n _proto.progress = function progress(value, suppressEvents) {\n return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0;\n };\n\n _proto.iteration = function iteration(value, suppressEvents) {\n var cycleDuration = this.duration() + this._rDelay;\n\n return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1;\n } // potential future addition:\n // isPlayingBackwards() {\n // \tlet animation = this,\n // \t\torientation = 1; // 1 = forward, -1 = backward\n // \twhile (animation) {\n // \t\torientation *= animation.reversed() || (animation.repeat() && !(animation.iteration() & 1)) ? -1 : 1;\n // \t\tanimation = animation.parent;\n // \t}\n // \treturn orientation < 0;\n // }\n ;\n\n _proto.timeScale = function timeScale(value, suppressEvents) {\n if (!arguments.length) {\n return this._rts === -_tinyNum ? 0 : this._rts; // recorded timeScale. Special case: if someone calls reverse() on an animation with timeScale of 0, we assign it -_tinyNum to remember it's reversed.\n }\n\n if (this._rts === value) {\n return this;\n }\n\n var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; // make sure to do the parentToChildTotalTime() BEFORE setting the new _ts because the old one must be used in that calculation.\n // future addition? Up side: fast and minimal file size. Down side: only works on this animation; if a timeline is reversed, for example, its childrens' onReverse wouldn't get called.\n //(+value < 0 && this._rts >= 0) && _callback(this, \"onReverse\", true);\n // prioritize rendering where the parent's playhead lines up instead of this._tTime because there could be a tween that's animating another tween's timeScale in the same rendering loop (same parent), thus if the timeScale tween renders first, it would alter _start BEFORE _tTime was set on that tick (in the rendering loop), effectively freezing it until the timeScale tween finishes.\n\n this._rts = +value || 0;\n this._ts = this._ps || value === -_tinyNum ? 0 : this._rts; // _ts is the functional timeScale which would be 0 if the animation is paused.\n\n this.totalTime(_clamp(-Math.abs(this._delay), this._tDur, tTime), suppressEvents !== false);\n\n _setEnd(this); // if parent.smoothChildTiming was false, the end time didn't get updated in the _alignPlayhead() method, so do it here.\n\n\n return _recacheAncestors(this);\n };\n\n _proto.paused = function paused(value) {\n if (!arguments.length) {\n return this._ps;\n }\n\n if (this._ps !== value) {\n this._ps = value;\n\n if (value) {\n this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()); // if the pause occurs during the delay phase, make sure that's factored in when resuming.\n\n this._ts = this._act = 0; // _ts is the functional timeScale, so a paused tween would effectively have a timeScale of 0. We record the \"real\" timeScale as _rts (recorded time scale)\n } else {\n _wake();\n\n this._ts = this._rts; //only defer to _pTime (pauseTime) if tTime is zero. Remember, someone could pause() an animation, then scrub the playhead and resume(). If the parent doesn't have smoothChildTiming, we render at the rawTime() because the startTime won't get updated.\n\n this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum)); // edge case: animation.progress(1).pause().play() wouldn't render again because the playhead is already at the end, but the call to totalTime() below will add it back to its parent...and not remove it again (since removing only happens upon rendering at a new time). Offsetting the _tTime slightly is done simply to cause the final render in totalTime() that'll pop it off its timeline (if autoRemoveChildren is true, of course). Check to make sure _zTime isn't -_tinyNum to avoid an edge case where the playhead is pushed to the end but INSIDE a tween/callback, the timeline itself is paused thus halting rendering and leaving a few unrendered. When resuming, it wouldn't render those otherwise.\n }\n }\n\n return this;\n };\n\n _proto.startTime = function startTime(value) {\n if (arguments.length) {\n this._start = value;\n var parent = this.parent || this._dp;\n parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay);\n return this;\n }\n\n return this._start;\n };\n\n _proto.endTime = function endTime(includeRepeats) {\n return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1);\n };\n\n _proto.rawTime = function rawTime(wrapRepeats) {\n var parent = this.parent || this._dp; // _dp = detached parent\n\n return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this);\n };\n\n _proto.revert = function revert(config) {\n if (config === void 0) {\n config = _revertConfig;\n }\n\n var prevIsReverting = _reverting;\n _reverting = config;\n\n if (this._initted || this._startAt) {\n this.timeline && this.timeline.revert(config);\n this.totalTime(-0.01, config.suppressEvents);\n }\n\n this.data !== \"nested\" && config.kill !== false && this.kill();\n _reverting = prevIsReverting;\n return this;\n };\n\n _proto.globalTime = function globalTime(rawTime) {\n var animation = this,\n time = arguments.length ? rawTime : animation.rawTime();\n\n while (animation) {\n time = animation._start + time / (Math.abs(animation._ts) || 1);\n animation = animation._dp;\n }\n\n return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time; // the _startAt tweens for .fromTo() and .from() that have immediateRender should always be FIRST in the timeline (important for context.revert()). \"_sat\" stands for _startAtTween, referring to the parent tween that created the _startAt. We must discern if that tween had immediateRender so that we can know whether or not to prioritize it in revert().\n };\n\n _proto.repeat = function repeat(value) {\n if (arguments.length) {\n this._repeat = value === Infinity ? -2 : value;\n return _onUpdateTotalDuration(this);\n }\n\n return this._repeat === -2 ? Infinity : this._repeat;\n };\n\n _proto.repeatDelay = function repeatDelay(value) {\n if (arguments.length) {\n var time = this._time;\n this._rDelay = value;\n\n _onUpdateTotalDuration(this);\n\n return time ? this.time(time) : this;\n }\n\n return this._rDelay;\n };\n\n _proto.yoyo = function yoyo(value) {\n if (arguments.length) {\n this._yoyo = value;\n return this;\n }\n\n return this._yoyo;\n };\n\n _proto.seek = function seek(position, suppressEvents) {\n return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents));\n };\n\n _proto.restart = function restart(includeDelay, suppressEvents) {\n return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));\n };\n\n _proto.play = function play(from, suppressEvents) {\n from != null && this.seek(from, suppressEvents);\n return this.reversed(false).paused(false);\n };\n\n _proto.reverse = function reverse(from, suppressEvents) {\n from != null && this.seek(from || this.totalDuration(), suppressEvents);\n return this.reversed(true).paused(false);\n };\n\n _proto.pause = function pause(atTime, suppressEvents) {\n atTime != null && this.seek(atTime, suppressEvents);\n return this.paused(true);\n };\n\n _proto.resume = function resume() {\n return this.paused(false);\n };\n\n _proto.reversed = function reversed(value) {\n if (arguments.length) {\n !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0)); // in case timeScale is zero, reversing would have no effect so we use _tinyNum.\n\n return this;\n }\n\n return this._rts < 0;\n };\n\n _proto.invalidate = function invalidate() {\n this._initted = this._act = 0;\n this._zTime = -_tinyNum;\n return this;\n };\n\n _proto.isActive = function isActive() {\n var parent = this.parent || this._dp,\n start = this._start,\n rawTime;\n return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum);\n };\n\n _proto.eventCallback = function eventCallback(type, callback, params) {\n var vars = this.vars;\n\n if (arguments.length > 1) {\n if (!callback) {\n delete vars[type];\n } else {\n vars[type] = callback;\n params && (vars[type + \"Params\"] = params);\n type === \"onUpdate\" && (this._onUpdate = callback);\n }\n\n return this;\n }\n\n return vars[type];\n };\n\n _proto.then = function then(onFulfilled) {\n var self = this;\n return new Promise(function (resolve) {\n var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough,\n _resolve = function _resolve() {\n var _then = self.then;\n self.then = null; // temporarily null the then() method to avoid an infinite loop (see https://github.com/greensock/GSAP/issues/322)\n\n _isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then);\n resolve(f);\n self.then = _then;\n };\n\n if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) {\n _resolve();\n } else {\n self._prom = _resolve;\n }\n });\n };\n\n _proto.kill = function kill() {\n _interrupt(this);\n };\n\n return Animation;\n}();\n\n_setDefaults(Animation.prototype, {\n _time: 0,\n _start: 0,\n _end: 0,\n _tTime: 0,\n _tDur: 0,\n _dirty: 0,\n _repeat: 0,\n _yoyo: false,\n parent: null,\n _initted: false,\n _rDelay: 0,\n _ts: 1,\n _dp: 0,\n ratio: 0,\n _zTime: -_tinyNum,\n _prom: 0,\n _ps: false,\n _rts: 1\n});\n/*\n * -------------------------------------------------\n * TIMELINE\n * -------------------------------------------------\n */\n\n\nexport var Timeline = /*#__PURE__*/function (_Animation) {\n _inheritsLoose(Timeline, _Animation);\n\n function Timeline(vars, position) {\n var _this;\n\n if (vars === void 0) {\n vars = {};\n }\n\n _this = _Animation.call(this, vars) || this;\n _this.labels = {};\n _this.smoothChildTiming = !!vars.smoothChildTiming;\n _this.autoRemoveChildren = !!vars.autoRemoveChildren;\n _this._sort = _isNotFalse(vars.sortChildren);\n _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position);\n vars.reversed && _this.reverse();\n vars.paused && _this.paused(true);\n vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger);\n return _this;\n }\n\n var _proto2 = Timeline.prototype;\n\n _proto2.to = function to(targets, vars, position) {\n _createTweenType(0, arguments, this);\n\n return this;\n };\n\n _proto2.from = function from(targets, vars, position) {\n _createTweenType(1, arguments, this);\n\n return this;\n };\n\n _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) {\n _createTweenType(2, arguments, this);\n\n return this;\n };\n\n _proto2.set = function set(targets, vars, position) {\n vars.duration = 0;\n vars.parent = this;\n _inheritDefaults(vars).repeatDelay || (vars.repeat = 0);\n vars.immediateRender = !!vars.immediateRender;\n new Tween(targets, vars, _parsePosition(this, position), 1);\n return this;\n };\n\n _proto2.call = function call(callback, params, position) {\n return _addToTimeline(this, Tween.delayedCall(0, callback, params), position);\n } //ONLY for backward compatibility! Maybe delete?\n ;\n\n _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {\n vars.duration = duration;\n vars.stagger = vars.stagger || stagger;\n vars.onComplete = onCompleteAll;\n vars.onCompleteParams = onCompleteAllParams;\n vars.parent = this;\n new Tween(targets, vars, _parsePosition(this, position));\n return this;\n };\n\n _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {\n vars.runBackwards = 1;\n _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender);\n return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams);\n };\n\n _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) {\n toVars.startAt = fromVars;\n _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender);\n return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams);\n };\n\n _proto2.render = function render(totalTime, suppressEvents, force) {\n var prevTime = this._time,\n tDur = this._dirty ? this.totalDuration() : this._tDur,\n dur = this._dur,\n tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime),\n // if a paused timeline is resumed (or its _start is updated for another reason...which rounds it), that could result in the playhead shifting a **tiny** amount and a zero-duration child at that spot may get rendered at a different ratio, like its totalTime in render() may be 1e-17 instead of 0, for example.\n crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur),\n time,\n child,\n next,\n iteration,\n cycleDuration,\n prevPaused,\n pauseTween,\n timeScale,\n prevStart,\n prevIteration,\n yoyo,\n isYoyo;\n this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur);\n\n if (tTime !== this._tTime || force || crossingStart) {\n if (prevTime !== this._time && dur) {\n //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump).\n tTime += this._time - prevTime;\n totalTime += this._time - prevTime;\n }\n\n time = tTime;\n prevStart = this._start;\n timeScale = this._ts;\n prevPaused = !timeScale;\n\n if (crossingStart) {\n dur || (prevTime = this._zTime); //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.\n\n (totalTime || !suppressEvents) && (this._zTime = totalTime);\n }\n\n if (this._repeat) {\n //adjust the time for repeats and yoyos\n yoyo = this._yoyo;\n cycleDuration = dur + this._rDelay;\n\n if (this._repeat < -1 && totalTime < 0) {\n return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);\n }\n\n time = _roundPrecise(tTime % cycleDuration); //round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)\n\n if (tTime === tDur) {\n // the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)\n iteration = this._repeat;\n time = dur;\n } else {\n iteration = ~~(tTime / cycleDuration);\n\n if (iteration && iteration === tTime / cycleDuration) {\n time = dur;\n iteration--;\n }\n\n time > dur && (time = dur);\n }\n\n prevIteration = _animationCycle(this._tTime, cycleDuration);\n !prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration); // edge case - if someone does addPause() at the very beginning of a repeating timeline, that pause is technically at the same spot as the end which causes this._time to get set to 0 when the totalTime would normally place the playhead at the end. See https://gsap.com/forums/topic/23823-closing-nav-animation-not-working-on-ie-and-iphone-6-maybe-other-older-browser/?tab=comments#comment-113005 also, this._tTime - prevIteration * cycleDuration - this._dur <= 0 just checks to make sure it wasn't previously in the \"repeatDelay\" portion\n\n if (yoyo && iteration & 1) {\n time = dur - time;\n isYoyo = 1;\n }\n /*\n make sure children at the end/beginning of the timeline are rendered properly. If, for example,\n a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which\n would get translated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there\n could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So\n we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must\n ensure that zero-duration tweens at the very beginning or end of the Timeline work.\n */\n\n\n if (iteration !== prevIteration && !this._lock) {\n var rewinding = yoyo && prevIteration & 1,\n doesWrap = rewinding === (yoyo && iteration & 1);\n iteration < prevIteration && (rewinding = !rewinding);\n prevTime = rewinding ? 0 : tTime % dur ? dur : tTime; // if the playhead is landing exactly at the end of an iteration, use that totalTime rather than only the duration, otherwise it'll skip the 2nd render since it's effectively at the same time.\n\n this._lock = 1;\n this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0;\n this._tTime = tTime; // if a user gets the iteration() inside the onRepeat, for example, it should be accurate.\n\n !suppressEvents && this.parent && _callback(this, \"onRepeat\");\n this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1);\n\n if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) {\n // if prevTime is 0 and we render at the very end, _time will be the end, thus won't match. So in this edge case, prevTime won't match _time but that's okay. If it gets killed in the onRepeat, eject as well.\n return this;\n }\n\n dur = this._dur; // in case the duration changed in the onRepeat\n\n tDur = this._tDur;\n\n if (doesWrap) {\n this._lock = 2;\n prevTime = rewinding ? dur : -0.0001;\n this.render(prevTime, true);\n this.vars.repeatRefresh && !isYoyo && this.invalidate();\n }\n\n this._lock = 0;\n\n if (!this._ts && !prevPaused) {\n return this;\n } //in order for yoyoEase to work properly when there's a stagger, we must swap out the ease in each sub-tween.\n\n\n _propagateYoyoEase(this, isYoyo);\n }\n }\n\n if (this._hasPause && !this._forcing && this._lock < 2) {\n pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time));\n\n if (pauseTween) {\n tTime -= time - (time = pauseTween._start);\n }\n }\n\n this._tTime = tTime;\n this._time = time;\n this._act = !timeScale; //as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.\n\n if (!this._initted) {\n this._onUpdate = this.vars.onUpdate;\n this._initted = 1;\n this._zTime = totalTime;\n prevTime = 0; // upon init, the playhead should always go forward; someone could invalidate() a completed timeline and then if they restart(), that would make child tweens render in reverse order which could lock in the wrong starting values if they build on each other, like tl.to(obj, {x: 100}).to(obj, {x: 0}).\n }\n\n if (!prevTime && time && !suppressEvents && !iteration) {\n _callback(this, \"onStart\");\n\n if (this._tTime !== tTime) {\n // in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.\n return this;\n }\n }\n\n if (time >= prevTime && totalTime >= 0) {\n child = this._first;\n\n while (child) {\n next = child._next;\n\n if ((child._act || time >= child._start) && child._ts && pauseTween !== child) {\n if (child.parent !== this) {\n // an extreme edge case - the child's render could do something like kill() the \"next\" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.\n return this.render(totalTime, suppressEvents, force);\n }\n\n child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force);\n\n if (time !== this._time || !this._ts && !prevPaused) {\n //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete\n pauseTween = 0;\n next && (tTime += this._zTime = -_tinyNum); // it didn't finish rendering, so flag zTime as negative so that so that the next time render() is called it'll be forced (to render any remaining children)\n\n break;\n }\n }\n\n child = next;\n }\n } else {\n child = this._last;\n var adjustedTime = totalTime < 0 ? totalTime : time; //when the playhead goes backward beyond the start of this timeline, we must pass that information down to the child animations so that zero-duration tweens know whether to render their starting or ending values.\n\n while (child) {\n next = child._prev;\n\n if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) {\n if (child.parent !== this) {\n // an extreme edge case - the child's render could do something like kill() the \"next\" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.\n return this.render(totalTime, suppressEvents, force);\n }\n\n child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting && (child._initted || child._startAt)); // if reverting, we should always force renders of initted tweens (but remember that .fromTo() or .from() may have a _startAt but not _initted yet). If, for example, a .fromTo() tween with a stagger (which creates an internal timeline) gets reverted BEFORE some of its child tweens render for the first time, it may not properly trigger them to revert.\n\n if (time !== this._time || !this._ts && !prevPaused) {\n //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete\n pauseTween = 0;\n next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum); // it didn't finish rendering, so adjust zTime so that so that the next time render() is called it'll be forced (to render any remaining children)\n\n break;\n }\n }\n\n child = next;\n }\n }\n\n if (pauseTween && !suppressEvents) {\n this.pause();\n pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1;\n\n if (this._ts) {\n //the callback resumed playback! So since we may have held back the playhead due to where the pause is positioned, go ahead and jump to where it's SUPPOSED to be (if no pause happened).\n this._start = prevStart; //if the pause was at an earlier time and the user resumed in the callback, it could reposition the timeline (changing its startTime), throwing things off slightly, so we make sure the _start doesn't shift.\n\n _setEnd(this);\n\n return this.render(totalTime, suppressEvents, force);\n }\n }\n\n this._onUpdate && !suppressEvents && _callback(this, \"onUpdate\", true);\n if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) if (!this._lock) {\n // remember, a child's callback may alter this timeline's playhead or timeScale which is why we need to add some of these checks.\n (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); // don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.\n\n if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) {\n _callback(this, tTime === tDur && totalTime >= 0 ? \"onComplete\" : \"onReverseComplete\", true);\n\n this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();\n }\n }\n }\n\n return this;\n };\n\n _proto2.add = function add(child, position) {\n var _this2 = this;\n\n _isNumber(position) || (position = _parsePosition(this, position, child));\n\n if (!(child instanceof Animation)) {\n if (_isArray(child)) {\n child.forEach(function (obj) {\n return _this2.add(obj, position);\n });\n return this;\n }\n\n if (_isString(child)) {\n return this.addLabel(child, position);\n }\n\n if (_isFunction(child)) {\n child = Tween.delayedCall(0, child);\n } else {\n return this;\n }\n }\n\n return this !== child ? _addToTimeline(this, child, position) : this; //don't allow a timeline to be added to itself as a child!\n };\n\n _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) {\n if (nested === void 0) {\n nested = true;\n }\n\n if (tweens === void 0) {\n tweens = true;\n }\n\n if (timelines === void 0) {\n timelines = true;\n }\n\n if (ignoreBeforeTime === void 0) {\n ignoreBeforeTime = -_bigNum;\n }\n\n var a = [],\n child = this._first;\n\n while (child) {\n if (child._start >= ignoreBeforeTime) {\n if (child instanceof Tween) {\n tweens && a.push(child);\n } else {\n timelines && a.push(child);\n nested && a.push.apply(a, child.getChildren(true, tweens, timelines));\n }\n }\n\n child = child._next;\n }\n\n return a;\n };\n\n _proto2.getById = function getById(id) {\n var animations = this.getChildren(1, 1, 1),\n i = animations.length;\n\n while (i--) {\n if (animations[i].vars.id === id) {\n return animations[i];\n }\n }\n };\n\n _proto2.remove = function remove(child) {\n if (_isString(child)) {\n return this.removeLabel(child);\n }\n\n if (_isFunction(child)) {\n return this.killTweensOf(child);\n }\n\n _removeLinkedListItem(this, child);\n\n if (child === this._recent) {\n this._recent = this._last;\n }\n\n return _uncache(this);\n };\n\n _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) {\n if (!arguments.length) {\n return this._tTime;\n }\n\n this._forcing = 1;\n\n if (!this._dp && this._ts) {\n //special case for the global timeline (or any other that has no parent or detached parent).\n this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts));\n }\n\n _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents);\n\n this._forcing = 0;\n return this;\n };\n\n _proto2.addLabel = function addLabel(label, position) {\n this.labels[label] = _parsePosition(this, position);\n return this;\n };\n\n _proto2.removeLabel = function removeLabel(label) {\n delete this.labels[label];\n return this;\n };\n\n _proto2.addPause = function addPause(position, callback, params) {\n var t = Tween.delayedCall(0, callback || _emptyFunc, params);\n t.data = \"isPause\";\n this._hasPause = 1;\n return _addToTimeline(this, t, _parsePosition(this, position));\n };\n\n _proto2.removePause = function removePause(position) {\n var child = this._first;\n position = _parsePosition(this, position);\n\n while (child) {\n if (child._start === position && child.data === \"isPause\") {\n _removeFromParent(child);\n }\n\n child = child._next;\n }\n };\n\n _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) {\n var tweens = this.getTweensOf(targets, onlyActive),\n i = tweens.length;\n\n while (i--) {\n _overwritingTween !== tweens[i] && tweens[i].kill(targets, props);\n }\n\n return this;\n };\n\n _proto2.getTweensOf = function getTweensOf(targets, onlyActive) {\n var a = [],\n parsedTargets = toArray(targets),\n child = this._first,\n isGlobalTime = _isNumber(onlyActive),\n // a number is interpreted as a global time. If the animation spans\n children;\n\n while (child) {\n if (child instanceof Tween) {\n if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) {\n // note: if this is for overwriting, it should only be for tweens that aren't paused and are initted.\n a.push(child);\n }\n } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) {\n a.push.apply(a, children);\n }\n\n child = child._next;\n }\n\n return a;\n } // potential future feature - targets() on timelines\n // targets() {\n // \tlet result = [];\n // \tthis.getChildren(true, true, false).forEach(t => result.push(...t.targets()));\n // \treturn result.filter((v, i) => result.indexOf(v) === i);\n // }\n ;\n\n _proto2.tweenTo = function tweenTo(position, vars) {\n vars = vars || {};\n\n var tl = this,\n endTime = _parsePosition(tl, position),\n _vars = vars,\n startAt = _vars.startAt,\n _onStart = _vars.onStart,\n onStartParams = _vars.onStartParams,\n immediateRender = _vars.immediateRender,\n initted,\n tween = Tween.to(tl, _setDefaults({\n ease: vars.ease || \"none\",\n lazy: false,\n immediateRender: false,\n time: endTime,\n overwrite: \"auto\",\n duration: vars.duration || Math.abs((endTime - (startAt && \"time\" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum,\n onStart: function onStart() {\n tl.pause();\n\n if (!initted) {\n var duration = vars.duration || Math.abs((endTime - (startAt && \"time\" in startAt ? startAt.time : tl._time)) / tl.timeScale());\n tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true);\n initted = 1;\n }\n\n _onStart && _onStart.apply(tween, onStartParams || []); //in case the user had an onStart in the vars - we don't want to overwrite it.\n }\n }, vars));\n\n return immediateRender ? tween.render(0) : tween;\n };\n\n _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) {\n return this.tweenTo(toPosition, _setDefaults({\n startAt: {\n time: _parsePosition(this, fromPosition)\n }\n }, vars));\n };\n\n _proto2.recent = function recent() {\n return this._recent;\n };\n\n _proto2.nextLabel = function nextLabel(afterTime) {\n if (afterTime === void 0) {\n afterTime = this._time;\n }\n\n return _getLabelInDirection(this, _parsePosition(this, afterTime));\n };\n\n _proto2.previousLabel = function previousLabel(beforeTime) {\n if (beforeTime === void 0) {\n beforeTime = this._time;\n }\n\n return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1);\n };\n\n _proto2.currentLabel = function currentLabel(value) {\n return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum);\n };\n\n _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) {\n if (ignoreBeforeTime === void 0) {\n ignoreBeforeTime = 0;\n }\n\n var child = this._first,\n labels = this.labels,\n p;\n\n while (child) {\n if (child._start >= ignoreBeforeTime) {\n child._start += amount;\n child._end += amount;\n }\n\n child = child._next;\n }\n\n if (adjustLabels) {\n for (p in labels) {\n if (labels[p] >= ignoreBeforeTime) {\n labels[p] += amount;\n }\n }\n }\n\n return _uncache(this);\n };\n\n _proto2.invalidate = function invalidate(soft) {\n var child = this._first;\n this._lock = 0;\n\n while (child) {\n child.invalidate(soft);\n child = child._next;\n }\n\n return _Animation.prototype.invalidate.call(this, soft);\n };\n\n _proto2.clear = function clear(includeLabels) {\n if (includeLabels === void 0) {\n includeLabels = true;\n }\n\n var child = this._first,\n next;\n\n while (child) {\n next = child._next;\n this.remove(child);\n child = next;\n }\n\n this._dp && (this._time = this._tTime = this._pTime = 0);\n includeLabels && (this.labels = {});\n return _uncache(this);\n };\n\n _proto2.totalDuration = function totalDuration(value) {\n var max = 0,\n self = this,\n child = self._last,\n prevStart = _bigNum,\n prev,\n start,\n parent;\n\n if (arguments.length) {\n return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value));\n }\n\n if (self._dirty) {\n parent = self.parent;\n\n while (child) {\n prev = child._prev; //record it here in case the tween changes position in the sequence...\n\n child._dirty && child.totalDuration(); //could change the tween._startTime, so make sure the animation's cache is clean before analyzing it.\n\n start = child._start;\n\n if (start > prevStart && self._sort && child._ts && !self._lock) {\n //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence\n self._lock = 1; //prevent endless recursive calls - there are methods that get triggered that check duration/totalDuration when we add().\n\n _addToTimeline(self, child, start - child._delay, 1)._lock = 0;\n } else {\n prevStart = start;\n }\n\n if (start < 0 && child._ts) {\n //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found.\n max -= start;\n\n if (!parent && !self._dp || parent && parent.smoothChildTiming) {\n self._start += start / self._ts;\n self._time -= start;\n self._tTime -= start;\n }\n\n self.shiftChildren(-start, false, -1e999);\n prevStart = 0;\n }\n\n child._end > max && child._ts && (max = child._end);\n child = prev;\n }\n\n _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1);\n\n self._dirty = 0;\n }\n\n return self._tDur;\n };\n\n Timeline.updateRoot = function updateRoot(time) {\n if (_globalTimeline._ts) {\n _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline));\n\n _lastRenderedFrame = _ticker.frame;\n }\n\n if (_ticker.frame >= _nextGCFrame) {\n _nextGCFrame += _config.autoSleep || 120;\n var child = _globalTimeline._first;\n if (!child || !child._ts) if (_config.autoSleep && _ticker._listeners.length < 2) {\n while (child && !child._ts) {\n child = child._next;\n }\n\n child || _ticker.sleep();\n }\n }\n };\n\n return Timeline;\n}(Animation);\n\n_setDefaults(Timeline.prototype, {\n _lock: 0,\n _hasPause: 0,\n _forcing: 0\n});\n\nvar _addComplexStringPropTween = function _addComplexStringPropTween(target, prop, start, end, setter, stringFilter, funcParam) {\n //note: we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter),\n index = 0,\n matchIndex = 0,\n result,\n startNums,\n color,\n endNum,\n chunk,\n startNum,\n hasRandom,\n a;\n pt.b = start;\n pt.e = end;\n start += \"\"; //ensure values are strings\n\n end += \"\";\n\n if (hasRandom = ~end.indexOf(\"random(\")) {\n end = _replaceRandom(end);\n }\n\n if (stringFilter) {\n a = [start, end];\n stringFilter(a, target, prop); //pass an array with the starting and ending values and let the filter do whatever it needs to the values.\n\n start = a[0];\n end = a[1];\n }\n\n startNums = start.match(_complexStringNumExp) || [];\n\n while (result = _complexStringNumExp.exec(end)) {\n endNum = result[0];\n chunk = end.substring(index, result.index);\n\n if (color) {\n color = (color + 1) % 5;\n } else if (chunk.substr(-5) === \"rgba(\") {\n color = 1;\n }\n\n if (endNum !== startNums[matchIndex++]) {\n startNum = parseFloat(startNums[matchIndex - 1]) || 0; //these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.\n\n pt._pt = {\n _next: pt._pt,\n p: chunk || matchIndex === 1 ? chunk : \",\",\n //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n s: startNum,\n c: endNum.charAt(1) === \"=\" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum,\n m: color && color < 4 ? Math.round : 0\n };\n index = _complexStringNumExp.lastIndex;\n }\n }\n\n pt.c = index < end.length ? end.substring(index, end.length) : \"\"; //we use the \"c\" of the PropTween to store the final part of the string (after the last number)\n\n pt.fp = funcParam;\n\n if (_relExp.test(end) || hasRandom) {\n pt.e = 0; //if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).\n }\n\n this._pt = pt; //start the linked list with this new PropTween. Remember, we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n\n return pt;\n},\n _addPropTween = function _addPropTween(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) {\n _isFunction(end) && (end = end(index || 0, target, targets));\n var currentValue = target[prop],\n parsedStart = start !== \"get\" ? start : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf(\"set\") || !_isFunction(target[\"get\" + prop.substr(3)]) ? prop : \"get\" + prop.substr(3)](funcParam) : target[prop](),\n setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc,\n pt;\n\n if (_isString(end)) {\n if (~end.indexOf(\"random(\")) {\n end = _replaceRandom(end);\n }\n\n if (end.charAt(1) === \"=\") {\n pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0);\n\n if (pt || pt === 0) {\n // to avoid isNaN, like if someone passes in a value like \"!= whatever\"\n end = pt;\n }\n }\n }\n\n if (!optional || parsedStart !== end || _forceAllPropTweens) {\n if (!isNaN(parsedStart * end) && end !== \"\") {\n // fun fact: any number multiplied by \"\" is evaluated as the number 0!\n pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === \"boolean\" ? _renderBoolean : _renderPlain, 0, setter);\n funcParam && (pt.fp = funcParam);\n modifier && pt.modifier(modifier, this, target);\n return this._pt = pt;\n }\n\n !currentValue && !(prop in target) && _missingPlugin(prop, end);\n return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam);\n }\n},\n //creates a copy of the vars object and processes any function-based values (putting the resulting values directly into the copy) as well as strings with \"random()\" in them. It does NOT process relative values.\n_processVars = function _processVars(vars, index, target, targets, tween) {\n _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets));\n\n if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) {\n return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars;\n }\n\n var copy = {},\n p;\n\n for (p in vars) {\n copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets);\n }\n\n return copy;\n},\n _checkPlugin = function _checkPlugin(property, vars, tween, index, target, targets) {\n var plugin, pt, ptLookup, i;\n\n if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) {\n tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority);\n\n if (tween !== _quickTween) {\n ptLookup = tween._ptLookup[tween._targets.indexOf(target)]; //note: we can't use tween._ptLookup[index] because for staggered tweens, the index from the fullTargets array won't match what it is in each individual tween that spawns from the stagger.\n\n i = plugin._props.length;\n\n while (i--) {\n ptLookup[plugin._props[i]] = pt;\n }\n }\n }\n\n return plugin;\n},\n _overwritingTween,\n //store a reference temporarily so we can avoid overwriting itself.\n_forceAllPropTweens,\n _initTween = function _initTween(tween, time, tTime) {\n var vars = tween.vars,\n ease = vars.ease,\n startAt = vars.startAt,\n immediateRender = vars.immediateRender,\n lazy = vars.lazy,\n onUpdate = vars.onUpdate,\n runBackwards = vars.runBackwards,\n yoyoEase = vars.yoyoEase,\n keyframes = vars.keyframes,\n autoRevert = vars.autoRevert,\n dur = tween._dur,\n prevStartAt = tween._startAt,\n targets = tween._targets,\n parent = tween.parent,\n fullTargets = parent && parent.data === \"nested\" ? parent.vars.targets : targets,\n autoOverwrite = tween._overwrite === \"auto\" && !_suppressOverwrites,\n tl = tween.timeline,\n cleanVars,\n i,\n p,\n pt,\n target,\n hasPriority,\n gsData,\n harness,\n plugin,\n ptLookup,\n index,\n harnessVars,\n overwritten;\n tl && (!keyframes || !ease) && (ease = \"none\");\n tween._ease = _parseEase(ease, _defaults.ease);\n tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0;\n\n if (yoyoEase && tween._yoyo && !tween._repeat) {\n //there must have been a parent timeline with yoyo:true that is currently in its yoyo phase, so flip the eases.\n yoyoEase = tween._yEase;\n tween._yEase = tween._ease;\n tween._ease = yoyoEase;\n }\n\n tween._from = !tl && !!vars.runBackwards; //nested timelines should never run backwards - the backwards-ness is in the child tweens.\n\n if (!tl || keyframes && !vars.stagger) {\n //if there's an internal timeline, skip all the parsing because we passed that task down the chain.\n harness = targets[0] ? _getCache(targets[0]).harness : 0;\n harnessVars = harness && vars[harness.prop]; //someone may need to specify CSS-specific values AND non-CSS values, like if the element has an \"x\" property plus it's a standard DOM element. We allow people to distinguish by wrapping plugin-specific stuff in a css:{} object for example.\n\n cleanVars = _copyExcluding(vars, _reservedProps);\n\n if (prevStartAt) {\n prevStartAt._zTime < 0 && prevStartAt.progress(1); // in case it's a lazy startAt that hasn't rendered yet.\n\n time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig); // if it's a \"startAt\" (not \"from()\" or runBackwards: true), we only need to do a shallow revert (keep transforms cached in CSSPlugin)\n // don't just _removeFromParent(prevStartAt.render(-1, true)) because that'll leave inline styles. We're creating a new _startAt for \"startAt\" tweens that re-capture things to ensure that if the pre-tween values changed since the tween was created, they're recorded.\n\n prevStartAt._lazy = 0;\n }\n\n if (startAt) {\n _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({\n data: \"isStart\",\n overwrite: false,\n parent: parent,\n immediateRender: true,\n lazy: !prevStartAt && _isNotFalse(lazy),\n startAt: null,\n delay: 0,\n onUpdate: onUpdate && function () {\n return _callback(tween, \"onUpdate\");\n },\n stagger: 0\n }, startAt))); //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, from, to).fromTo(e, to, from);\n\n\n tween._startAt._dp = 0; // don't allow it to get put back into root timeline! Like when revert() is called and totalTime() gets set.\n\n tween._startAt._sat = tween; // used in globalTime(). _sat stands for _startAtTween\n\n time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill); // rare edge case, like if a render is forced in the negative direction of a non-initted tween.\n\n if (immediateRender) {\n if (dur && time <= 0 && tTime <= 0) {\n // check tTime here because in the case of a yoyo tween whose playhead gets pushed to the end like tween.progress(1), we should allow it through so that the onComplete gets fired properly.\n time && (tween._zTime = time);\n return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a Timeline, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting.\n }\n }\n } else if (runBackwards && dur) {\n //from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards)\n if (!prevStartAt) {\n time && (immediateRender = false); //in rare cases (like if a from() tween runs and then is invalidate()-ed), immediateRender could be true but the initial forced-render gets skipped, so there's no need to force the render in this context when the _time is greater than 0\n\n p = _setDefaults({\n overwrite: false,\n data: \"isFromStart\",\n //we tag the tween with as \"isFromStart\" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a \"from()\" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:\"height\", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.\n lazy: immediateRender && !prevStartAt && _isNotFalse(lazy),\n immediateRender: immediateRender,\n //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)\n stagger: 0,\n parent: parent //ensures that nested tweens that had a stagger are handled properly, like gsap.from(\".class\", {y: gsap.utils.wrap([-100,100]), stagger: 0.5})\n\n }, cleanVars);\n harnessVars && (p[harness.prop] = harnessVars); // in case someone does something like .from(..., {css:{}})\n\n _removeFromParent(tween._startAt = Tween.set(targets, p));\n\n tween._startAt._dp = 0; // don't allow it to get put back into root timeline!\n\n tween._startAt._sat = tween; // used in globalTime()\n\n time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true));\n tween._zTime = time;\n\n if (!immediateRender) {\n _initTween(tween._startAt, _tinyNum, _tinyNum); //ensures that the initial values are recorded\n\n } else if (!time) {\n return;\n }\n }\n }\n\n tween._pt = tween._ptCache = 0;\n lazy = dur && _isNotFalse(lazy) || lazy && !dur;\n\n for (i = 0; i < targets.length; i++) {\n target = targets[i];\n gsData = target._gsap || _harness(targets)[i]._gsap;\n tween._ptLookup[i] = ptLookup = {};\n _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender(); //if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end)\n\n index = fullTargets === targets ? i : fullTargets.indexOf(target);\n\n if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) {\n tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority);\n\n plugin._props.forEach(function (name) {\n ptLookup[name] = pt;\n });\n\n plugin.priority && (hasPriority = 1);\n }\n\n if (!harness || harnessVars) {\n for (p in cleanVars) {\n if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) {\n plugin.priority && (hasPriority = 1);\n } else {\n ptLookup[p] = pt = _addPropTween.call(tween, target, p, \"get\", cleanVars[p], index, fullTargets, 0, vars.stringFilter);\n }\n }\n }\n\n tween._op && tween._op[i] && tween.kill(target, tween._op[i]);\n\n if (autoOverwrite && tween._pt) {\n _overwritingTween = tween;\n\n _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time)); // make sure the overwriting doesn't overwrite THIS tween!!!\n\n\n overwritten = !tween.parent;\n _overwritingTween = 0;\n }\n\n tween._pt && lazy && (_lazyLookup[gsData.id] = 1);\n }\n\n hasPriority && _sortPropTweensByPriority(tween);\n tween._onInit && tween._onInit(tween); //plugins like RoundProps must wait until ALL of the PropTweens are instantiated. In the plugin's init() function, it sets the _onInit on the tween instance. May not be pretty/intuitive, but it's fast and keeps file size down.\n }\n\n tween._onUpdate = onUpdate;\n tween._initted = (!tween._op || tween._pt) && !overwritten; // if overwrittenProps resulted in the entire tween being killed, do NOT flag it as initted or else it may render for one tick.\n\n keyframes && time <= 0 && tl.render(_bigNum, true, true); // if there's a 0% keyframe, it'll render in the \"before\" state for any staggered/delayed animations thus when the following tween initializes, it'll use the \"before\" state instead of the \"after\" state as the initial values.\n},\n _updatePropTweens = function _updatePropTweens(tween, property, value, start, startIsRelative, ratio, time, skipRecursion) {\n var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property],\n pt,\n rootPT,\n lookup,\n i;\n\n if (!ptCache) {\n ptCache = tween._ptCache[property] = [];\n lookup = tween._ptLookup;\n i = tween._targets.length;\n\n while (i--) {\n pt = lookup[i][property];\n\n if (pt && pt.d && pt.d._pt) {\n // it's a plugin, so find the nested PropTween\n pt = pt.d._pt;\n\n while (pt && pt.p !== property && pt.fp !== property) {\n // \"fp\" is functionParam for things like setting CSS variables which require .setProperty(\"--var-name\", value)\n pt = pt._next;\n }\n }\n\n if (!pt) {\n // there is no PropTween associated with that property, so we must FORCE one to be created and ditch out of this\n // if the tween has other properties that already rendered at new positions, we'd normally have to rewind to put them back like tween.render(0, true) before forcing an _initTween(), but that can create another edge case like tweening a timeline's progress would trigger onUpdates to fire which could move other things around. It's better to just inform users that .resetTo() should ONLY be used for tweens that already have that property. For example, you can't gsap.to(...{ y: 0 }) and then tween.restTo(\"x\", 200) for example.\n _forceAllPropTweens = 1; // otherwise, when we _addPropTween() and it finds no change between the start and end values, it skips creating a PropTween (for efficiency...why tween when there's no difference?) but in this case we NEED that PropTween created so we can edit it.\n\n tween.vars[property] = \"+=0\";\n\n _initTween(tween, time);\n\n _forceAllPropTweens = 0;\n return skipRecursion ? _warn(property + \" not eligible for reset\") : 1; // if someone tries to do a quickTo() on a special property like borderRadius which must get split into 4 different properties, that's not eligible for .resetTo().\n }\n\n ptCache.push(pt);\n }\n }\n\n i = ptCache.length;\n\n while (i--) {\n rootPT = ptCache[i];\n pt = rootPT._pt || rootPT; // complex values may have nested PropTweens. We only accommodate the FIRST value.\n\n pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c;\n pt.c = value - pt.s;\n rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e)); // mainly for CSSPlugin (end value)\n\n rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b)); // (beginning value)\n }\n},\n _addAliasesToVars = function _addAliasesToVars(targets, vars) {\n var harness = targets[0] ? _getCache(targets[0]).harness : 0,\n propertyAliases = harness && harness.aliases,\n copy,\n p,\n i,\n aliases;\n\n if (!propertyAliases) {\n return vars;\n }\n\n copy = _merge({}, vars);\n\n for (p in propertyAliases) {\n if (p in copy) {\n aliases = propertyAliases[p].split(\",\");\n i = aliases.length;\n\n while (i--) {\n copy[aliases[i]] = copy[p];\n }\n }\n }\n\n return copy;\n},\n // parses multiple formats, like {\"0%\": {x: 100}, {\"50%\": {x: -20}} and { x: {\"0%\": 100, \"50%\": -20} }, and an \"ease\" can be set on any object. We populate an \"allProps\" object with an Array for each property, like {x: [{}, {}], y:[{}, {}]} with data for each property tween. The objects have a \"t\" (time), \"v\", (value), and \"e\" (ease) property. This allows us to piece together a timeline later.\n_parseKeyframe = function _parseKeyframe(prop, obj, allProps, easeEach) {\n var ease = obj.ease || easeEach || \"power1.inOut\",\n p,\n a;\n\n if (_isArray(obj)) {\n a = allProps[prop] || (allProps[prop] = []); // t = time (out of 100), v = value, e = ease\n\n obj.forEach(function (value, i) {\n return a.push({\n t: i / (obj.length - 1) * 100,\n v: value,\n e: ease\n });\n });\n } else {\n for (p in obj) {\n a = allProps[p] || (allProps[p] = []);\n p === \"ease\" || a.push({\n t: parseFloat(prop),\n v: obj[p],\n e: ease\n });\n }\n }\n},\n _parseFuncOrString = function _parseFuncOrString(value, tween, i, target, targets) {\n return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf(\"random(\") ? _replaceRandom(value) : value;\n},\n _staggerTweenProps = _callbackNames + \"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert\",\n _staggerPropsToSkip = {};\n\n_forEachName(_staggerTweenProps + \",id,stagger,delay,duration,paused,scrollTrigger\", function (name) {\n return _staggerPropsToSkip[name] = 1;\n});\n/*\n * --------------------------------------------------------------------------------------\n * TWEEN\n * --------------------------------------------------------------------------------------\n */\n\n\nexport var Tween = /*#__PURE__*/function (_Animation2) {\n _inheritsLoose(Tween, _Animation2);\n\n function Tween(targets, vars, position, skipInherit) {\n var _this3;\n\n if (typeof vars === \"number\") {\n position.duration = vars;\n vars = position;\n position = null;\n }\n\n _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this;\n var _this3$vars = _this3.vars,\n duration = _this3$vars.duration,\n delay = _this3$vars.delay,\n immediateRender = _this3$vars.immediateRender,\n stagger = _this3$vars.stagger,\n overwrite = _this3$vars.overwrite,\n keyframes = _this3$vars.keyframes,\n defaults = _this3$vars.defaults,\n scrollTrigger = _this3$vars.scrollTrigger,\n yoyoEase = _this3$vars.yoyoEase,\n parent = vars.parent || _globalTimeline,\n parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : \"length\" in vars) ? [targets] : toArray(targets),\n tl,\n i,\n copy,\n l,\n p,\n curTarget,\n staggerFunc,\n staggerVarsToMerge;\n _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn(\"GSAP target \" + targets + \" not found. https://gsap.com\", !_config.nullTargetWarn) || [];\n _this3._ptLookup = []; //PropTween lookup. An array containing an object for each target, having keys for each tweening property\n\n _this3._overwrite = overwrite;\n\n if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {\n vars = _this3.vars;\n tl = _this3.timeline = new Timeline({\n data: \"nested\",\n defaults: defaults || {},\n targets: parent && parent.data === \"nested\" ? parent.vars.targets : parsedTargets\n }); // we need to store the targets because for staggers and keyframes, we end up creating an individual tween for each but function-based values need to know the index and the whole Array of targets.\n\n tl.kill();\n tl.parent = tl._dp = _assertThisInitialized(_this3);\n tl._start = 0;\n\n if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {\n l = parsedTargets.length;\n staggerFunc = stagger && distribute(stagger);\n\n if (_isObject(stagger)) {\n //users can pass in callbacks like onStart/onComplete in the stagger object. These should fire with each individual tween.\n for (p in stagger) {\n if (~_staggerTweenProps.indexOf(p)) {\n staggerVarsToMerge || (staggerVarsToMerge = {});\n staggerVarsToMerge[p] = stagger[p];\n }\n }\n }\n\n for (i = 0; i < l; i++) {\n copy = _copyExcluding(vars, _staggerPropsToSkip);\n copy.stagger = 0;\n yoyoEase && (copy.yoyoEase = yoyoEase);\n staggerVarsToMerge && _merge(copy, staggerVarsToMerge);\n curTarget = parsedTargets[i]; //don't just copy duration or delay because if they're a string or function, we'd end up in an infinite loop because _isFuncOrString() would evaluate as true in the child tweens, entering this loop, etc. So we parse the value straight from vars and default to 0.\n\n copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets);\n copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay;\n\n if (!stagger && l === 1 && copy.delay) {\n // if someone does delay:\"random(1, 5)\", repeat:-1, for example, the delay shouldn't be inside the repeat.\n _this3._delay = delay = copy.delay;\n _this3._start += delay;\n copy.delay = 0;\n }\n\n tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0);\n tl._ease = _easeMap.none;\n }\n\n tl.duration() ? duration = delay = 0 : _this3.timeline = 0; // if the timeline's duration is 0, we don't need a timeline internally!\n } else if (keyframes) {\n _inheritDefaults(_setDefaults(tl.vars.defaults, {\n ease: \"none\"\n }));\n\n tl._ease = _parseEase(keyframes.ease || vars.ease || \"none\");\n var time = 0,\n a,\n kf,\n v;\n\n if (_isArray(keyframes)) {\n keyframes.forEach(function (frame) {\n return tl.to(parsedTargets, frame, \">\");\n });\n tl.duration(); // to ensure tl._dur is cached because we tap into it for performance purposes in the render() method.\n } else {\n copy = {};\n\n for (p in keyframes) {\n p === \"ease\" || p === \"easeEach\" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach);\n }\n\n for (p in copy) {\n a = copy[p].sort(function (a, b) {\n return a.t - b.t;\n });\n time = 0;\n\n for (i = 0; i < a.length; i++) {\n kf = a[i];\n v = {\n ease: kf.e,\n duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration\n };\n v[p] = kf.v;\n tl.to(parsedTargets, v, time);\n time += v.duration;\n }\n }\n\n tl.duration() < duration && tl.to({}, {\n duration: duration - tl.duration()\n }); // in case keyframes didn't go to 100%\n }\n }\n\n duration || _this3.duration(duration = tl.duration());\n } else {\n _this3.timeline = 0; //speed optimization, faster lookups (no going up the prototype chain)\n }\n\n if (overwrite === true && !_suppressOverwrites) {\n _overwritingTween = _assertThisInitialized(_this3);\n\n _globalTimeline.killTweensOf(parsedTargets);\n\n _overwritingTween = 0;\n }\n\n _addToTimeline(parent, _assertThisInitialized(_this3), position);\n\n vars.reversed && _this3.reverse();\n vars.paused && _this3.paused(true);\n\n if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== \"nested\") {\n _this3._tTime = -_tinyNum; //forces a render without having to set the render() \"force\" parameter to true because we want to allow lazying by default (using the \"force\" parameter always forces an immediate full render)\n\n _this3.render(Math.max(0, -delay) || 0); //in case delay is negative\n\n }\n\n scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger);\n return _this3;\n }\n\n var _proto3 = Tween.prototype;\n\n _proto3.render = function render(totalTime, suppressEvents, force) {\n var prevTime = this._time,\n tDur = this._tDur,\n dur = this._dur,\n isNegative = totalTime < 0,\n tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime,\n time,\n pt,\n iteration,\n cycleDuration,\n prevIteration,\n isYoyo,\n ratio,\n timeline,\n yoyoEase;\n\n if (!dur) {\n _renderZeroDurationTween(this, totalTime, suppressEvents, force);\n } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) {\n //this senses if we're crossing over the start time, in which case we must record _zTime and force the render, but we do it in this lengthy conditional way for performance reasons (usually we can skip the calculations): this._initted && (this._zTime < 0) !== (totalTime < 0)\n time = tTime;\n timeline = this.timeline;\n\n if (this._repeat) {\n //adjust the time for repeats and yoyos\n cycleDuration = dur + this._rDelay;\n\n if (this._repeat < -1 && isNegative) {\n return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);\n }\n\n time = _roundPrecise(tTime % cycleDuration); //round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)\n\n if (tTime === tDur) {\n // the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)\n iteration = this._repeat;\n time = dur;\n } else {\n iteration = ~~(tTime / cycleDuration);\n\n if (iteration && iteration === _roundPrecise(tTime / cycleDuration)) {\n time = dur;\n iteration--;\n }\n\n time > dur && (time = dur);\n }\n\n isYoyo = this._yoyo && iteration & 1;\n\n if (isYoyo) {\n yoyoEase = this._yEase;\n time = dur - time;\n }\n\n prevIteration = _animationCycle(this._tTime, cycleDuration);\n\n if (time === prevTime && !force && this._initted && iteration === prevIteration) {\n //could be during the repeatDelay part. No need to render and fire callbacks.\n this._tTime = tTime;\n return this;\n }\n\n if (iteration !== prevIteration) {\n timeline && this._yEase && _propagateYoyoEase(timeline, isYoyo); //repeatRefresh functionality\n\n if (this.vars.repeatRefresh && !isYoyo && !this._lock && this._time !== cycleDuration && this._initted) {\n // this._time will === cycleDuration when we render at EXACTLY the end of an iteration. Without this condition, it'd often do the repeatRefresh render TWICE (again on the very next tick).\n this._lock = force = 1; //force, otherwise if lazy is true, the _attemptInitTween() will return and we'll jump out and get caught bouncing on each tick.\n\n this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;\n }\n }\n }\n\n if (!this._initted) {\n if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) {\n this._tTime = 0; // in constructor if immediateRender is true, we set _tTime to -_tinyNum to have the playhead cross the starting point but we can't leave _tTime as a negative number.\n\n return this;\n }\n\n if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) {\n // rare edge case - during initialization, an onUpdate in the _startAt (.fromTo()) might force this tween to render at a different spot in which case we should ditch this render() call so that it doesn't revert the values. But we also don't want to dump if we're doing a repeatRefresh render!\n return this;\n }\n\n if (dur !== this._dur) {\n // while initting, a plugin like InertiaPlugin might alter the duration, so rerun from the start to ensure everything renders as it should.\n return this.render(totalTime, suppressEvents, force);\n }\n }\n\n this._tTime = tTime;\n this._time = time;\n\n if (!this._act && this._ts) {\n this._act = 1; //as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.\n\n this._lazy = 0;\n }\n\n this.ratio = ratio = (yoyoEase || this._ease)(time / dur);\n\n if (this._from) {\n this.ratio = ratio = 1 - ratio;\n }\n\n if (time && !prevTime && !suppressEvents && !iteration) {\n _callback(this, \"onStart\");\n\n if (this._tTime !== tTime) {\n // in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.\n return this;\n }\n }\n\n pt = this._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n\n timeline && timeline.render(totalTime < 0 ? totalTime : timeline._dur * timeline._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime);\n\n if (this._onUpdate && !suppressEvents) {\n isNegative && _rewindStartAt(this, totalTime, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.\n\n _callback(this, \"onUpdate\");\n }\n\n this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, \"onRepeat\");\n\n if ((tTime === this._tDur || !tTime) && this._tTime === tTime) {\n isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true);\n (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); // don't remove if we're rendering at exactly a time of 0, as there could be autoRevert values that should get set on the next tick (if the playhead goes backward beyond the startTime, negative totalTime). Don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.\n\n if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) {\n // if prevTime and tTime are zero, we shouldn't fire the onReverseComplete. This could happen if you gsap.to(... {paused:true}).play();\n _callback(this, tTime === tDur ? \"onComplete\" : \"onReverseComplete\", true);\n\n this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();\n }\n }\n }\n\n return this;\n };\n\n _proto3.targets = function targets() {\n return this._targets;\n };\n\n _proto3.invalidate = function invalidate(soft) {\n // \"soft\" gives us a way to clear out everything EXCEPT the recorded pre-\"from\" portion of from() tweens. Otherwise, for example, if you tween.progress(1).render(0, true true).invalidate(), the \"from\" values would persist and then on the next render, the from() tweens would initialize and the current value would match the \"from\" values, thus animate from the same value to the same value (no animation). We tap into this in ScrollTrigger's refresh() where we must push a tween to completion and then back again but honor its init state in case the tween is dependent on another tween further up on the page.\n (!soft || !this.vars.runBackwards) && (this._startAt = 0);\n this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0;\n this._ptLookup = [];\n this.timeline && this.timeline.invalidate(soft);\n return _Animation2.prototype.invalidate.call(this, soft);\n };\n\n _proto3.resetTo = function resetTo(property, value, start, startIsRelative, skipRecursion) {\n _tickerActive || _ticker.wake();\n this._ts || this.play();\n var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts),\n ratio;\n this._initted || _initTween(this, time);\n ratio = this._ease(time / this._dur); // don't just get tween.ratio because it may not have rendered yet.\n // possible future addition to allow an object with multiple values to update, like tween.resetTo({x: 100, y: 200}); At this point, it doesn't seem worth the added kb given the fact that most users will likely opt for the convenient gsap.quickTo() way of interacting with this method.\n // if (_isObject(property)) { // performance optimization\n // \tfor (p in property) {\n // \t\tif (_updatePropTweens(this, p, property[p], value ? value[p] : null, start, ratio, time)) {\n // \t\t\treturn this.resetTo(property, value, start, startIsRelative); // if a PropTween wasn't found for the property, it'll get forced with a re-initialization so we need to jump out and start over again.\n // \t\t}\n // \t}\n // } else {\n\n if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time, skipRecursion)) {\n return this.resetTo(property, value, start, startIsRelative, 1); // if a PropTween wasn't found for the property, it'll get forced with a re-initialization so we need to jump out and start over again.\n } //}\n\n\n _alignPlayhead(this, 0);\n\n this.parent || _addLinkedListItem(this._dp, this, \"_first\", \"_last\", this._dp._sort ? \"_start\" : 0);\n return this.render(0);\n };\n\n _proto3.kill = function kill(targets, vars) {\n if (vars === void 0) {\n vars = \"all\";\n }\n\n if (!targets && (!vars || vars === \"all\")) {\n this._lazy = this._pt = 0;\n return this.parent ? _interrupt(this) : this;\n }\n\n if (this.timeline) {\n var tDur = this.timeline.totalDuration();\n this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this); // if nothing is left tweening, interrupt.\n\n this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1); // if a nested tween is killed that changes the duration, it should affect this tween's duration. We must use the ratio, though, because sometimes the internal timeline is stretched like for keyframes where they don't all add up to whatever the parent tween's duration was set to.\n\n return this;\n }\n\n var parsedTargets = this._targets,\n killingTargets = targets ? toArray(targets) : parsedTargets,\n propTweenLookup = this._ptLookup,\n firstPT = this._pt,\n overwrittenProps,\n curLookup,\n curOverwriteProps,\n props,\n p,\n pt,\n i;\n\n if ((!vars || vars === \"all\") && _arraysMatch(parsedTargets, killingTargets)) {\n vars === \"all\" && (this._pt = 0);\n return _interrupt(this);\n }\n\n overwrittenProps = this._op = this._op || [];\n\n if (vars !== \"all\") {\n //so people can pass in a comma-delimited list of property names\n if (_isString(vars)) {\n p = {};\n\n _forEachName(vars, function (name) {\n return p[name] = 1;\n });\n\n vars = p;\n }\n\n vars = _addAliasesToVars(parsedTargets, vars);\n }\n\n i = parsedTargets.length;\n\n while (i--) {\n if (~killingTargets.indexOf(parsedTargets[i])) {\n curLookup = propTweenLookup[i];\n\n if (vars === \"all\") {\n overwrittenProps[i] = vars;\n props = curLookup;\n curOverwriteProps = {};\n } else {\n curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {};\n props = vars;\n }\n\n for (p in props) {\n pt = curLookup && curLookup[p];\n\n if (pt) {\n if (!(\"kill\" in pt.d) || pt.d.kill(p) === true) {\n _removeLinkedListItem(this, pt, \"_pt\");\n }\n\n delete curLookup[p];\n }\n\n if (curOverwriteProps !== \"all\") {\n curOverwriteProps[p] = 1;\n }\n }\n }\n }\n\n this._initted && !this._pt && firstPT && _interrupt(this); //if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening.\n\n return this;\n };\n\n Tween.to = function to(targets, vars) {\n return new Tween(targets, vars, arguments[2]);\n };\n\n Tween.from = function from(targets, vars) {\n return _createTweenType(1, arguments);\n };\n\n Tween.delayedCall = function delayedCall(delay, callback, params, scope) {\n return new Tween(callback, 0, {\n immediateRender: false,\n lazy: false,\n overwrite: false,\n delay: delay,\n onComplete: callback,\n onReverseComplete: callback,\n onCompleteParams: params,\n onReverseCompleteParams: params,\n callbackScope: scope\n }); // we must use onReverseComplete too for things like timeline.add(() => {...}) which should be triggered in BOTH directions (forward and reverse)\n };\n\n Tween.fromTo = function fromTo(targets, fromVars, toVars) {\n return _createTweenType(2, arguments);\n };\n\n Tween.set = function set(targets, vars) {\n vars.duration = 0;\n vars.repeatDelay || (vars.repeat = 0);\n return new Tween(targets, vars);\n };\n\n Tween.killTweensOf = function killTweensOf(targets, props, onlyActive) {\n return _globalTimeline.killTweensOf(targets, props, onlyActive);\n };\n\n return Tween;\n}(Animation);\n\n_setDefaults(Tween.prototype, {\n _targets: [],\n _lazy: 0,\n _startAt: 0,\n _op: 0,\n _onInit: 0\n}); //add the pertinent timeline methods to Tween instances so that users can chain conveniently and create a timeline automatically. (removed due to concerns that it'd ultimately add to more confusion especially for beginners)\n// _forEachName(\"to,from,fromTo,set,call,add,addLabel,addPause\", name => {\n// \tTween.prototype[name] = function() {\n// \t\tlet tl = new Timeline();\n// \t\treturn _addToTimeline(tl, this)[name].apply(tl, toArray(arguments));\n// \t}\n// });\n//for backward compatibility. Leverage the timeline calls.\n\n\n_forEachName(\"staggerTo,staggerFrom,staggerFromTo\", function (name) {\n Tween[name] = function () {\n var tl = new Timeline(),\n params = _slice.call(arguments, 0);\n\n params.splice(name === \"staggerFromTo\" ? 5 : 4, 0, 0);\n return tl[name].apply(tl, params);\n };\n});\n/*\n * --------------------------------------------------------------------------------------\n * PROPTWEEN\n * --------------------------------------------------------------------------------------\n */\n\n\nvar _setterPlain = function _setterPlain(target, property, value) {\n return target[property] = value;\n},\n _setterFunc = function _setterFunc(target, property, value) {\n return target[property](value);\n},\n _setterFuncWithParam = function _setterFuncWithParam(target, property, value, data) {\n return target[property](data.fp, value);\n},\n _setterAttribute = function _setterAttribute(target, property, value) {\n return target.setAttribute(property, value);\n},\n _getSetter = function _getSetter(target, property) {\n return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain;\n},\n _renderPlain = function _renderPlain(ratio, data) {\n return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1000000) / 1000000, data);\n},\n _renderBoolean = function _renderBoolean(ratio, data) {\n return data.set(data.t, data.p, !!(data.s + data.c * ratio), data);\n},\n _renderComplexString = function _renderComplexString(ratio, data) {\n var pt = data._pt,\n s = \"\";\n\n if (!ratio && data.b) {\n //b = beginning string\n s = data.b;\n } else if (ratio === 1 && data.e) {\n //e = ending string\n s = data.e;\n } else {\n while (pt) {\n s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 10000) / 10000) + s; //we use the \"p\" property for the text inbetween (like a suffix). And in the context of a complex string, the modifier (m) is typically just Math.round(), like for RGB colors.\n\n pt = pt._next;\n }\n\n s += data.c; //we use the \"c\" of the PropTween to store the final chunk of non-numeric text.\n }\n\n data.set(data.t, data.p, s, data);\n},\n _renderPropTweens = function _renderPropTweens(ratio, data) {\n var pt = data._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n},\n _addPluginModifier = function _addPluginModifier(modifier, tween, target, property) {\n var pt = this._pt,\n next;\n\n while (pt) {\n next = pt._next;\n pt.p === property && pt.modifier(modifier, tween, target);\n pt = next;\n }\n},\n _killPropTweensOf = function _killPropTweensOf(property) {\n var pt = this._pt,\n hasNonDependentRemaining,\n next;\n\n while (pt) {\n next = pt._next;\n\n if (pt.p === property && !pt.op || pt.op === property) {\n _removeLinkedListItem(this, pt, \"_pt\");\n } else if (!pt.dep) {\n hasNonDependentRemaining = 1;\n }\n\n pt = next;\n }\n\n return !hasNonDependentRemaining;\n},\n _setterWithModifier = function _setterWithModifier(target, property, value, data) {\n data.mSet(target, property, data.m.call(data.tween, value, data.mt), data);\n},\n _sortPropTweensByPriority = function _sortPropTweensByPriority(parent) {\n var pt = parent._pt,\n next,\n pt2,\n first,\n last; //sorts the PropTween linked list in order of priority because some plugins need to do their work after ALL of the PropTweens were created (like RoundPropsPlugin and ModifiersPlugin)\n\n while (pt) {\n next = pt._next;\n pt2 = first;\n\n while (pt2 && pt2.pr > pt.pr) {\n pt2 = pt2._next;\n }\n\n if (pt._prev = pt2 ? pt2._prev : last) {\n pt._prev._next = pt;\n } else {\n first = pt;\n }\n\n if (pt._next = pt2) {\n pt2._prev = pt;\n } else {\n last = pt;\n }\n\n pt = next;\n }\n\n parent._pt = first;\n}; //PropTween key: t = target, p = prop, r = renderer, d = data, s = start, c = change, op = overwriteProperty (ONLY populated when it's different than p), pr = priority, _next/_prev for the linked list siblings, set = setter, m = modifier, mSet = modifierSetter (the original setter, before a modifier was added)\n\n\nexport var PropTween = /*#__PURE__*/function () {\n function PropTween(next, target, prop, start, change, renderer, data, setter, priority) {\n this.t = target;\n this.s = start;\n this.c = change;\n this.p = prop;\n this.r = renderer || _renderPlain;\n this.d = data || this;\n this.set = setter || _setterPlain;\n this.pr = priority || 0;\n this._next = next;\n\n if (next) {\n next._prev = this;\n }\n }\n\n var _proto4 = PropTween.prototype;\n\n _proto4.modifier = function modifier(func, tween, target) {\n this.mSet = this.mSet || this.set; //in case it was already set (a PropTween can only have one modifier)\n\n this.set = _setterWithModifier;\n this.m = func;\n this.mt = target; //modifier target\n\n this.tween = tween;\n };\n\n return PropTween;\n}(); //Initialization tasks\n\n_forEachName(_callbackNames + \"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger\", function (name) {\n return _reservedProps[name] = 1;\n});\n\n_globals.TweenMax = _globals.TweenLite = Tween;\n_globals.TimelineLite = _globals.TimelineMax = Timeline;\n_globalTimeline = new Timeline({\n sortChildren: false,\n defaults: _defaults,\n autoRemoveChildren: true,\n id: \"root\",\n smoothChildTiming: true\n});\n_config.stringFilter = _colorStringFilter;\n\nvar _media = [],\n _listeners = {},\n _emptyArray = [],\n _lastMediaTime = 0,\n _contextID = 0,\n _dispatch = function _dispatch(type) {\n return (_listeners[type] || _emptyArray).map(function (f) {\n return f();\n });\n},\n _onMediaChange = function _onMediaChange() {\n var time = Date.now(),\n matches = [];\n\n if (time - _lastMediaTime > 2) {\n _dispatch(\"matchMediaInit\");\n\n _media.forEach(function (c) {\n var queries = c.queries,\n conditions = c.conditions,\n match,\n p,\n anyMatch,\n toggled;\n\n for (p in queries) {\n match = _win.matchMedia(queries[p]).matches; // Firefox doesn't update the \"matches\" property of the MediaQueryList object correctly - it only does so as it calls its change handler - so we must re-create a media query here to ensure it's accurate.\n\n match && (anyMatch = 1);\n\n if (match !== conditions[p]) {\n conditions[p] = match;\n toggled = 1;\n }\n }\n\n if (toggled) {\n c.revert();\n anyMatch && matches.push(c);\n }\n });\n\n _dispatch(\"matchMediaRevert\");\n\n matches.forEach(function (c) {\n return c.onMatch(c, function (func) {\n return c.add(null, func);\n });\n });\n _lastMediaTime = time;\n\n _dispatch(\"matchMedia\");\n }\n};\n\nvar Context = /*#__PURE__*/function () {\n function Context(func, scope) {\n this.selector = scope && selector(scope);\n this.data = [];\n this._r = []; // returned/cleanup functions\n\n this.isReverted = false;\n this.id = _contextID++; // to work around issues that frameworks like Vue cause by making things into Proxies which make it impossible to do something like _media.indexOf(this) because \"this\" would no longer refer to the Context instance itself - it'd refer to a Proxy! We needed a way to identify the context uniquely\n\n func && this.add(func);\n }\n\n var _proto5 = Context.prototype;\n\n _proto5.add = function add(name, func, scope) {\n // possible future addition if we need the ability to add() an animation to a context and for whatever reason cannot create that animation inside of a context.add(() => {...}) function.\n // if (name && _isFunction(name.revert)) {\n // \tthis.data.push(name);\n // \treturn (name._ctx = this);\n // }\n if (_isFunction(name)) {\n scope = func;\n func = name;\n name = _isFunction;\n }\n\n var self = this,\n f = function f() {\n var prev = _context,\n prevSelector = self.selector,\n result;\n prev && prev !== self && prev.data.push(self);\n scope && (self.selector = selector(scope));\n _context = self;\n result = func.apply(self, arguments);\n _isFunction(result) && self._r.push(result);\n _context = prev;\n self.selector = prevSelector;\n self.isReverted = false;\n return result;\n };\n\n self.last = f;\n return name === _isFunction ? f(self, function (func) {\n return self.add(null, func);\n }) : name ? self[name] = f : f;\n };\n\n _proto5.ignore = function ignore(func) {\n var prev = _context;\n _context = null;\n func(this);\n _context = prev;\n };\n\n _proto5.getTweens = function getTweens() {\n var a = [];\n this.data.forEach(function (e) {\n return e instanceof Context ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === \"nested\") && a.push(e);\n });\n return a;\n };\n\n _proto5.clear = function clear() {\n this._r.length = this.data.length = 0;\n };\n\n _proto5.kill = function kill(revert, matchMedia) {\n var _this4 = this;\n\n if (revert) {\n (function () {\n var tweens = _this4.getTweens(),\n i = _this4.data.length,\n t;\n\n while (i--) {\n // Flip plugin tweens are very different in that they should actually be pushed to their end. The plugin replaces the timeline's .revert() method to do exactly that. But we also need to remove any of those nested tweens inside the flip timeline so that they don't get individually reverted.\n t = _this4.data[i];\n\n if (t.data === \"isFlip\") {\n t.revert();\n t.getChildren(true, true, false).forEach(function (tween) {\n return tweens.splice(tweens.indexOf(tween), 1);\n });\n }\n } // save as an object so that we can cache the globalTime for each tween to optimize performance during the sort\n\n\n tweens.map(function (t) {\n return {\n g: t._dur || t._delay || t._sat && !t._sat.vars.immediateRender ? t.globalTime(0) : -Infinity,\n t: t\n };\n }).sort(function (a, b) {\n return b.g - a.g || -Infinity;\n }).forEach(function (o) {\n return o.t.revert(revert);\n }); // note: all of the _startAt tweens should be reverted in reverse order that they were created, and they'll all have the same globalTime (-1) so the \" || -1\" in the sort keeps the order properly.\n\n i = _this4.data.length;\n\n while (i--) {\n // make sure we loop backwards so that, for example, SplitTexts that were created later on the same element get reverted first\n t = _this4.data[i];\n\n if (t instanceof Timeline) {\n if (t.data !== \"nested\") {\n t.scrollTrigger && t.scrollTrigger.revert();\n t.kill(); // don't revert() the timeline because that's duplicating efforts since we already reverted all the tweens\n }\n } else {\n !(t instanceof Tween) && t.revert && t.revert(revert);\n }\n }\n\n _this4._r.forEach(function (f) {\n return f(revert, _this4);\n });\n\n _this4.isReverted = true;\n })();\n } else {\n this.data.forEach(function (e) {\n return e.kill && e.kill();\n });\n }\n\n this.clear();\n\n if (matchMedia) {\n var i = _media.length;\n\n while (i--) {\n // previously, we checked _media.indexOf(this), but some frameworks like Vue enforce Proxy objects that make it impossible to get the proper result that way, so we must use a unique ID number instead.\n _media[i].id === this.id && _media.splice(i, 1);\n }\n }\n };\n\n _proto5.revert = function revert(config) {\n this.kill(config || {});\n };\n\n return Context;\n}();\n\nvar MatchMedia = /*#__PURE__*/function () {\n function MatchMedia(scope) {\n this.contexts = [];\n this.scope = scope;\n _context && _context.data.push(this);\n }\n\n var _proto6 = MatchMedia.prototype;\n\n _proto6.add = function add(conditions, func, scope) {\n _isObject(conditions) || (conditions = {\n matches: conditions\n });\n var context = new Context(0, scope || this.scope),\n cond = context.conditions = {},\n mq,\n p,\n active;\n _context && !context.selector && (context.selector = _context.selector); // in case a context is created inside a context. Like a gsap.matchMedia() that's inside a scoped gsap.context()\n\n this.contexts.push(context);\n func = context.add(\"onMatch\", func);\n context.queries = conditions;\n\n for (p in conditions) {\n if (p === \"all\") {\n active = 1;\n } else {\n mq = _win.matchMedia(conditions[p]);\n\n if (mq) {\n _media.indexOf(context) < 0 && _media.push(context);\n (cond[p] = mq.matches) && (active = 1);\n mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener(\"change\", _onMediaChange);\n }\n }\n }\n\n active && func(context, function (f) {\n return context.add(null, f);\n });\n return this;\n } // refresh() {\n // \tlet time = _lastMediaTime,\n // \t\tmedia = _media;\n // \t_lastMediaTime = -1;\n // \t_media = this.contexts;\n // \t_onMediaChange();\n // \t_lastMediaTime = time;\n // \t_media = media;\n // }\n ;\n\n _proto6.revert = function revert(config) {\n this.kill(config || {});\n };\n\n _proto6.kill = function kill(revert) {\n this.contexts.forEach(function (c) {\n return c.kill(revert, true);\n });\n };\n\n return MatchMedia;\n}();\n/*\n * --------------------------------------------------------------------------------------\n * GSAP\n * --------------------------------------------------------------------------------------\n */\n\n\nvar _gsap = {\n registerPlugin: function registerPlugin() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n args.forEach(function (config) {\n return _createPlugin(config);\n });\n },\n timeline: function timeline(vars) {\n return new Timeline(vars);\n },\n getTweensOf: function getTweensOf(targets, onlyActive) {\n return _globalTimeline.getTweensOf(targets, onlyActive);\n },\n getProperty: function getProperty(target, property, unit, uncache) {\n _isString(target) && (target = toArray(target)[0]); //in case selector text or an array is passed in\n\n var getter = _getCache(target || {}).get,\n format = unit ? _passThrough : _numericIfPossible;\n\n unit === \"native\" && (unit = \"\");\n return !target ? target : !property ? function (property, unit, uncache) {\n return format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));\n } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));\n },\n quickSetter: function quickSetter(target, property, unit) {\n target = toArray(target);\n\n if (target.length > 1) {\n var setters = target.map(function (t) {\n return gsap.quickSetter(t, property, unit);\n }),\n l = setters.length;\n return function (value) {\n var i = l;\n\n while (i--) {\n setters[i](value);\n }\n };\n }\n\n target = target[0] || {};\n\n var Plugin = _plugins[property],\n cache = _getCache(target),\n p = cache.harness && (cache.harness.aliases || {})[property] || property,\n // in case it's an alias, like \"rotate\" for \"rotation\".\n setter = Plugin ? function (value) {\n var p = new Plugin();\n _quickTween._pt = 0;\n p.init(target, unit ? value + unit : value, _quickTween, 0, [target]);\n p.render(1, p);\n _quickTween._pt && _renderPropTweens(1, _quickTween);\n } : cache.set(target, p);\n\n return Plugin ? setter : function (value) {\n return setter(target, p, unit ? value + unit : value, cache, 1);\n };\n },\n quickTo: function quickTo(target, property, vars) {\n var _merge2;\n\n var tween = gsap.to(target, _merge((_merge2 = {}, _merge2[property] = \"+=0.1\", _merge2.paused = true, _merge2), vars || {})),\n func = function func(value, start, startIsRelative) {\n return tween.resetTo(property, value, start, startIsRelative);\n };\n\n func.tween = tween;\n return func;\n },\n isTweening: function isTweening(targets) {\n return _globalTimeline.getTweensOf(targets, true).length > 0;\n },\n defaults: function defaults(value) {\n value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease));\n return _mergeDeep(_defaults, value || {});\n },\n config: function config(value) {\n return _mergeDeep(_config, value || {});\n },\n registerEffect: function registerEffect(_ref3) {\n var name = _ref3.name,\n effect = _ref3.effect,\n plugins = _ref3.plugins,\n defaults = _ref3.defaults,\n extendTimeline = _ref3.extendTimeline;\n (plugins || \"\").split(\",\").forEach(function (pluginName) {\n return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + \" effect requires \" + pluginName + \" plugin.\");\n });\n\n _effects[name] = function (targets, vars, tl) {\n return effect(toArray(targets), _setDefaults(vars || {}, defaults), tl);\n };\n\n if (extendTimeline) {\n Timeline.prototype[name] = function (targets, vars, position) {\n return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position);\n };\n }\n },\n registerEase: function registerEase(name, ease) {\n _easeMap[name] = _parseEase(ease);\n },\n parseEase: function parseEase(ease, defaultEase) {\n return arguments.length ? _parseEase(ease, defaultEase) : _easeMap;\n },\n getById: function getById(id) {\n return _globalTimeline.getById(id);\n },\n exportRoot: function exportRoot(vars, includeDelayedCalls) {\n if (vars === void 0) {\n vars = {};\n }\n\n var tl = new Timeline(vars),\n child,\n next;\n tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming);\n\n _globalTimeline.remove(tl);\n\n tl._dp = 0; //otherwise it'll get re-activated when adding children and be re-introduced into _globalTimeline's linked list (then added to itself).\n\n tl._time = tl._tTime = _globalTimeline._time;\n child = _globalTimeline._first;\n\n while (child) {\n next = child._next;\n\n if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) {\n _addToTimeline(tl, child, child._start - child._delay);\n }\n\n child = next;\n }\n\n _addToTimeline(_globalTimeline, tl, 0);\n\n return tl;\n },\n context: function context(func, scope) {\n return func ? new Context(func, scope) : _context;\n },\n matchMedia: function matchMedia(scope) {\n return new MatchMedia(scope);\n },\n matchMediaRefresh: function matchMediaRefresh() {\n return _media.forEach(function (c) {\n var cond = c.conditions,\n found,\n p;\n\n for (p in cond) {\n if (cond[p]) {\n cond[p] = false;\n found = 1;\n }\n }\n\n found && c.revert();\n }) || _onMediaChange();\n },\n addEventListener: function addEventListener(type, callback) {\n var a = _listeners[type] || (_listeners[type] = []);\n ~a.indexOf(callback) || a.push(callback);\n },\n removeEventListener: function removeEventListener(type, callback) {\n var a = _listeners[type],\n i = a && a.indexOf(callback);\n i >= 0 && a.splice(i, 1);\n },\n utils: {\n wrap: wrap,\n wrapYoyo: wrapYoyo,\n distribute: distribute,\n random: random,\n snap: snap,\n normalize: normalize,\n getUnit: getUnit,\n clamp: clamp,\n splitColor: splitColor,\n toArray: toArray,\n selector: selector,\n mapRange: mapRange,\n pipe: pipe,\n unitize: unitize,\n interpolate: interpolate,\n shuffle: shuffle\n },\n install: _install,\n effects: _effects,\n ticker: _ticker,\n updateRoot: Timeline.updateRoot,\n plugins: _plugins,\n globalTimeline: _globalTimeline,\n core: {\n PropTween: PropTween,\n globals: _addGlobal,\n Tween: Tween,\n Timeline: Timeline,\n Animation: Animation,\n getCache: _getCache,\n _removeLinkedListItem: _removeLinkedListItem,\n reverting: function reverting() {\n return _reverting;\n },\n context: function context(toAdd) {\n if (toAdd && _context) {\n _context.data.push(toAdd);\n\n toAdd._ctx = _context;\n }\n\n return _context;\n },\n suppressOverwrites: function suppressOverwrites(value) {\n return _suppressOverwrites = value;\n }\n }\n};\n\n_forEachName(\"to,from,fromTo,delayedCall,set,killTweensOf\", function (name) {\n return _gsap[name] = Tween[name];\n});\n\n_ticker.add(Timeline.updateRoot);\n\n_quickTween = _gsap.to({}, {\n duration: 0\n}); // ---- EXTRA PLUGINS --------------------------------------------------------\n\nvar _getPluginPropTween = function _getPluginPropTween(plugin, prop) {\n var pt = plugin._pt;\n\n while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) {\n pt = pt._next;\n }\n\n return pt;\n},\n _addModifiers = function _addModifiers(tween, modifiers) {\n var targets = tween._targets,\n p,\n i,\n pt;\n\n for (p in modifiers) {\n i = targets.length;\n\n while (i--) {\n pt = tween._ptLookup[i][p];\n\n if (pt && (pt = pt.d)) {\n if (pt._pt) {\n // is a plugin\n pt = _getPluginPropTween(pt, p);\n }\n\n pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p);\n }\n }\n }\n},\n _buildModifierPlugin = function _buildModifierPlugin(name, modifier) {\n return {\n name: name,\n rawVars: 1,\n //don't pre-process function-based values or \"random()\" strings.\n init: function init(target, vars, tween) {\n tween._onInit = function (tween) {\n var temp, p;\n\n if (_isString(vars)) {\n temp = {};\n\n _forEachName(vars, function (name) {\n return temp[name] = 1;\n }); //if the user passes in a comma-delimited list of property names to roundProps, like \"x,y\", we round to whole numbers.\n\n\n vars = temp;\n }\n\n if (modifier) {\n temp = {};\n\n for (p in vars) {\n temp[p] = modifier(vars[p]);\n }\n\n vars = temp;\n }\n\n _addModifiers(tween, vars);\n };\n }\n };\n}; //register core plugins\n\n\nexport var gsap = _gsap.registerPlugin({\n name: \"attr\",\n init: function init(target, vars, tween, index, targets) {\n var p, pt, v;\n this.tween = tween;\n\n for (p in vars) {\n v = target.getAttribute(p) || \"\";\n pt = this.add(target, \"setAttribute\", (v || 0) + \"\", vars[p], index, targets, 0, 0, p);\n pt.op = p;\n pt.b = v; // record the beginning value so we can revert()\n\n this._props.push(p);\n }\n },\n render: function render(ratio, data) {\n var pt = data._pt;\n\n while (pt) {\n _reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d); // if reverting, go back to the original (pt.b)\n\n pt = pt._next;\n }\n }\n}, {\n name: \"endArray\",\n init: function init(target, value) {\n var i = value.length;\n\n while (i--) {\n this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1);\n }\n }\n}, _buildModifierPlugin(\"roundProps\", _roundModifier), _buildModifierPlugin(\"modifiers\"), _buildModifierPlugin(\"snap\", snap)) || _gsap; //to prevent the core plugins from being dropped via aggressive tree shaking, we must include them in the variable declaration in this way.\n\nTween.version = Timeline.version = gsap.version = \"3.12.5\";\n_coreReady = 1;\n_windowExists() && _wake();\nvar Power0 = _easeMap.Power0,\n Power1 = _easeMap.Power1,\n Power2 = _easeMap.Power2,\n Power3 = _easeMap.Power3,\n Power4 = _easeMap.Power4,\n Linear = _easeMap.Linear,\n Quad = _easeMap.Quad,\n Cubic = _easeMap.Cubic,\n Quart = _easeMap.Quart,\n Quint = _easeMap.Quint,\n Strong = _easeMap.Strong,\n Elastic = _easeMap.Elastic,\n Back = _easeMap.Back,\n SteppedEase = _easeMap.SteppedEase,\n Bounce = _easeMap.Bounce,\n Sine = _easeMap.Sine,\n Expo = _easeMap.Expo,\n Circ = _easeMap.Circ;\nexport { Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ };\nexport { Tween as TweenMax, Tween as TweenLite, Timeline as TimelineMax, Timeline as TimelineLite, gsap as default, wrap, wrapYoyo, distribute, random, snap, normalize, getUnit, clamp, splitColor, toArray, selector, mapRange, pipe, unitize, interpolate, shuffle }; //export some internal methods/orojects for use in CSSPlugin so that we can externalize that file and allow custom builds that exclude it.\n\nexport { _getProperty, _numExp, _numWithUnitExp, _isString, _isUndefined, _renderComplexString, _relExp, _setDefaults, _removeLinkedListItem, _forEachName, _sortPropTweensByPriority, _colorStringFilter, _replaceRandom, _checkPlugin, _plugins, _ticker, _config, _roundModifier, _round, _missingPlugin, _getSetter, _getCache, _colorExp, _parseRelative };","/*!\n * CSSPlugin 3.12.5\n * https://gsap.com\n *\n * Copyright 2008-2024, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license or for\n * Club GSAP members, the agreement issued with that membership.\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nimport { gsap, _getProperty, _numExp, _numWithUnitExp, getUnit, _isString, _isUndefined, _renderComplexString, _relExp, _forEachName, _sortPropTweensByPriority, _colorStringFilter, _checkPlugin, _replaceRandom, _plugins, GSCache, PropTween, _config, _ticker, _round, _missingPlugin, _getSetter, _getCache, _colorExp, _parseRelative, _setDefaults, _removeLinkedListItem //for the commented-out className feature.\n} from \"./gsap-core.js\";\n\nvar _win,\n _doc,\n _docElement,\n _pluginInitted,\n _tempDiv,\n _tempDivStyler,\n _recentSetterPlugin,\n _reverting,\n _windowExists = function _windowExists() {\n return typeof window !== \"undefined\";\n},\n _transformProps = {},\n _RAD2DEG = 180 / Math.PI,\n _DEG2RAD = Math.PI / 180,\n _atan2 = Math.atan2,\n _bigNum = 1e8,\n _capsExp = /([A-Z])/g,\n _horizontalExp = /(left|right|width|margin|padding|x)/i,\n _complexExp = /[\\s,\\(]\\S/,\n _propertyAliases = {\n autoAlpha: \"opacity,visibility\",\n scale: \"scaleX,scaleY\",\n alpha: \"opacity\"\n},\n _renderCSSProp = function _renderCSSProp(ratio, data) {\n return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data);\n},\n _renderPropWithEnd = function _renderPropWithEnd(ratio, data) {\n return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data);\n},\n _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning(ratio, data) {\n return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u : data.b, data);\n},\n //if units change, we need a way to render the original unit/value when the tween goes all the way back to the beginning (ratio:0)\n_renderRoundedCSSProp = function _renderRoundedCSSProp(ratio, data) {\n var value = data.s + data.c * ratio;\n data.set(data.t, data.p, ~~(value + (value < 0 ? -.5 : .5)) + data.u, data);\n},\n _renderNonTweeningValue = function _renderNonTweeningValue(ratio, data) {\n return data.set(data.t, data.p, ratio ? data.e : data.b, data);\n},\n _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd(ratio, data) {\n return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data);\n},\n _setterCSSStyle = function _setterCSSStyle(target, property, value) {\n return target.style[property] = value;\n},\n _setterCSSProp = function _setterCSSProp(target, property, value) {\n return target.style.setProperty(property, value);\n},\n _setterTransform = function _setterTransform(target, property, value) {\n return target._gsap[property] = value;\n},\n _setterScale = function _setterScale(target, property, value) {\n return target._gsap.scaleX = target._gsap.scaleY = value;\n},\n _setterScaleWithRender = function _setterScaleWithRender(target, property, value, data, ratio) {\n var cache = target._gsap;\n cache.scaleX = cache.scaleY = value;\n cache.renderTransform(ratio, cache);\n},\n _setterTransformWithRender = function _setterTransformWithRender(target, property, value, data, ratio) {\n var cache = target._gsap;\n cache[property] = value;\n cache.renderTransform(ratio, cache);\n},\n _transformProp = \"transform\",\n _transformOriginProp = _transformProp + \"Origin\",\n _saveStyle = function _saveStyle(property, isNotCSS) {\n var _this = this;\n\n var target = this.target,\n style = target.style,\n cache = target._gsap;\n\n if (property in _transformProps && style) {\n this.tfm = this.tfm || {};\n\n if (property !== \"transform\") {\n property = _propertyAliases[property] || property;\n ~property.indexOf(\",\") ? property.split(\",\").forEach(function (a) {\n return _this.tfm[a] = _get(target, a);\n }) : this.tfm[property] = cache.x ? cache[property] : _get(target, property); // note: scale would map to \"scaleX,scaleY\", thus we loop and apply them both.\n\n property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin);\n } else {\n return _propertyAliases.transform.split(\",\").forEach(function (p) {\n return _saveStyle.call(_this, p, isNotCSS);\n });\n }\n\n if (this.props.indexOf(_transformProp) >= 0) {\n return;\n }\n\n if (cache.svg) {\n this.svgo = target.getAttribute(\"data-svg-origin\");\n this.props.push(_transformOriginProp, isNotCSS, \"\");\n }\n\n property = _transformProp;\n }\n\n (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]);\n},\n _removeIndependentTransforms = function _removeIndependentTransforms(style) {\n if (style.translate) {\n style.removeProperty(\"translate\");\n style.removeProperty(\"scale\");\n style.removeProperty(\"rotate\");\n }\n},\n _revertStyle = function _revertStyle() {\n var props = this.props,\n target = this.target,\n style = target.style,\n cache = target._gsap,\n i,\n p;\n\n for (i = 0; i < props.length; i += 3) {\n // stored like this: property, isNotCSS, value\n props[i + 1] ? target[props[i]] = props[i + 2] : props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].substr(0, 2) === \"--\" ? props[i] : props[i].replace(_capsExp, \"-$1\").toLowerCase());\n }\n\n if (this.tfm) {\n for (p in this.tfm) {\n cache[p] = this.tfm[p];\n }\n\n if (cache.svg) {\n cache.renderTransform();\n target.setAttribute(\"data-svg-origin\", this.svgo || \"\");\n }\n\n i = _reverting();\n\n if ((!i || !i.isStart) && !style[_transformProp]) {\n _removeIndependentTransforms(style);\n\n if (cache.zOrigin && style[_transformOriginProp]) {\n style[_transformOriginProp] += \" \" + cache.zOrigin + \"px\"; // since we're uncaching, we must put the zOrigin back into the transformOrigin so that we can pull it out accurately when we parse again. Otherwise, we'd lose the z portion of the origin since we extract it to protect from Safari bugs.\n\n cache.zOrigin = 0;\n cache.renderTransform();\n }\n\n cache.uncache = 1; // if it's a startAt that's being reverted in the _initTween() of the core, we don't need to uncache transforms. This is purely a performance optimization.\n }\n }\n},\n _getStyleSaver = function _getStyleSaver(target, properties) {\n var saver = {\n target: target,\n props: [],\n revert: _revertStyle,\n save: _saveStyle\n };\n target._gsap || gsap.core.getCache(target); // just make sure there's a _gsap cache defined because we read from it in _saveStyle() and it's more efficient to just check it here once.\n\n properties && properties.split(\",\").forEach(function (p) {\n return saver.save(p);\n });\n return saver;\n},\n _supports3D,\n _createElement = function _createElement(type, ns) {\n var e = _doc.createElementNS ? _doc.createElementNS((ns || \"http://www.w3.org/1999/xhtml\").replace(/^https/, \"http\"), type) : _doc.createElement(type); //some servers swap in https for http in the namespace which can break things, making \"style\" inaccessible.\n\n return e && e.style ? e : _doc.createElement(type); //some environments won't allow access to the element's style when created with a namespace in which case we default to the standard createElement() to work around the issue. Also note that when GSAP is embedded directly inside an SVG file, createElement() won't allow access to the style object in Firefox (see https://gsap.com/forums/topic/20215-problem-using-tweenmax-in-standalone-self-containing-svg-file-err-cannot-set-property-csstext-of-undefined/).\n},\n _getComputedProperty = function _getComputedProperty(target, property, skipPrefixFallback) {\n var cs = getComputedStyle(target);\n return cs[property] || cs.getPropertyValue(property.replace(_capsExp, \"-$1\").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty(target, _checkPropPrefix(property) || property, 1) || \"\"; //css variables may not need caps swapped out for dashes and lowercase.\n},\n _prefixes = \"O,Moz,ms,Ms,Webkit\".split(\",\"),\n _checkPropPrefix = function _checkPropPrefix(property, element, preferPrefix) {\n var e = element || _tempDiv,\n s = e.style,\n i = 5;\n\n if (property in s && !preferPrefix) {\n return property;\n }\n\n property = property.charAt(0).toUpperCase() + property.substr(1);\n\n while (i-- && !(_prefixes[i] + property in s)) {}\n\n return i < 0 ? null : (i === 3 ? \"ms\" : i >= 0 ? _prefixes[i] : \"\") + property;\n},\n _initCore = function _initCore() {\n if (_windowExists() && window.document) {\n _win = window;\n _doc = _win.document;\n _docElement = _doc.documentElement;\n _tempDiv = _createElement(\"div\") || {\n style: {}\n };\n _tempDivStyler = _createElement(\"div\");\n _transformProp = _checkPropPrefix(_transformProp);\n _transformOriginProp = _transformProp + \"Origin\";\n _tempDiv.style.cssText = \"border-width:0;line-height:0;position:absolute;padding:0\"; //make sure to override certain properties that may contaminate measurements, in case the user has overreaching style sheets.\n\n _supports3D = !!_checkPropPrefix(\"perspective\");\n _reverting = gsap.core.reverting;\n _pluginInitted = 1;\n }\n},\n _getBBoxHack = function _getBBoxHack(swapIfPossible) {\n //works around issues in some browsers (like Firefox) that don't correctly report getBBox() on SVG elements inside a <defs> element and/or <mask>. We try creating an SVG, adding it to the documentElement and toss the element in there so that it's definitely part of the rendering tree, then grab the bbox and if it works, we actually swap out the original getBBox() method for our own that does these extra steps whenever getBBox is needed. This helps ensure that performance is optimal (only do all these extra steps when absolutely necessary...most elements don't need it).\n var svg = _createElement(\"svg\", this.ownerSVGElement && this.ownerSVGElement.getAttribute(\"xmlns\") || \"http://www.w3.org/2000/svg\"),\n oldParent = this.parentNode,\n oldSibling = this.nextSibling,\n oldCSS = this.style.cssText,\n bbox;\n\n _docElement.appendChild(svg);\n\n svg.appendChild(this);\n this.style.display = \"block\";\n\n if (swapIfPossible) {\n try {\n bbox = this.getBBox();\n this._gsapBBox = this.getBBox; //store the original\n\n this.getBBox = _getBBoxHack;\n } catch (e) {}\n } else if (this._gsapBBox) {\n bbox = this._gsapBBox();\n }\n\n if (oldParent) {\n if (oldSibling) {\n oldParent.insertBefore(this, oldSibling);\n } else {\n oldParent.appendChild(this);\n }\n }\n\n _docElement.removeChild(svg);\n\n this.style.cssText = oldCSS;\n return bbox;\n},\n _getAttributeFallbacks = function _getAttributeFallbacks(target, attributesArray) {\n var i = attributesArray.length;\n\n while (i--) {\n if (target.hasAttribute(attributesArray[i])) {\n return target.getAttribute(attributesArray[i]);\n }\n }\n},\n _getBBox = function _getBBox(target) {\n var bounds;\n\n try {\n bounds = target.getBBox(); //Firefox throws errors if you try calling getBBox() on an SVG element that's not rendered (like in a <symbol> or <defs>). https://bugzilla.mozilla.org/show_bug.cgi?id=612118\n } catch (error) {\n bounds = _getBBoxHack.call(target, true);\n }\n\n bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true)); //some browsers (like Firefox) misreport the bounds if the element has zero width and height (it just assumes it's at x:0, y:0), thus we need to manually grab the position in that case.\n\n return bounds && !bounds.width && !bounds.x && !bounds.y ? {\n x: +_getAttributeFallbacks(target, [\"x\", \"cx\", \"x1\"]) || 0,\n y: +_getAttributeFallbacks(target, [\"y\", \"cy\", \"y1\"]) || 0,\n width: 0,\n height: 0\n } : bounds;\n},\n _isSVG = function _isSVG(e) {\n return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e));\n},\n //reports if the element is an SVG on which getBBox() actually works\n_removeProperty = function _removeProperty(target, property) {\n if (property) {\n var style = target.style,\n first2Chars;\n\n if (property in _transformProps && property !== _transformOriginProp) {\n property = _transformProp;\n }\n\n if (style.removeProperty) {\n first2Chars = property.substr(0, 2);\n\n if (first2Chars === \"ms\" || property.substr(0, 6) === \"webkit\") {\n //Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be \"ms-transform\" instead of \"-ms-transform\" for IE9, for example)\n property = \"-\" + property;\n }\n\n style.removeProperty(first2Chars === \"--\" ? property : property.replace(_capsExp, \"-$1\").toLowerCase());\n } else {\n //note: old versions of IE use \"removeAttribute()\" instead of \"removeProperty()\"\n style.removeAttribute(property);\n }\n }\n},\n _addNonTweeningPT = function _addNonTweeningPT(plugin, target, property, beginning, end, onlySetAtEnd) {\n var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue);\n plugin._pt = pt;\n pt.b = beginning;\n pt.e = end;\n\n plugin._props.push(property);\n\n return pt;\n},\n _nonConvertibleUnits = {\n deg: 1,\n rad: 1,\n turn: 1\n},\n _nonStandardLayouts = {\n grid: 1,\n flex: 1\n},\n //takes a single value like 20px and converts it to the unit specified, like \"%\", returning only the numeric amount.\n_convertToUnit = function _convertToUnit(target, property, value, unit) {\n var curValue = parseFloat(value) || 0,\n curUnit = (value + \"\").trim().substr((curValue + \"\").length) || \"px\",\n // some browsers leave extra whitespace at the beginning of CSS variables, hence the need to trim()\n style = _tempDiv.style,\n horizontal = _horizontalExp.test(property),\n isRootSVG = target.tagName.toLowerCase() === \"svg\",\n measureProperty = (isRootSVG ? \"client\" : \"offset\") + (horizontal ? \"Width\" : \"Height\"),\n amount = 100,\n toPixels = unit === \"px\",\n toPercent = unit === \"%\",\n px,\n parent,\n cache,\n isSVG;\n\n if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) {\n return curValue;\n }\n\n curUnit !== \"px\" && !toPixels && (curValue = _convertToUnit(target, property, value, \"px\"));\n isSVG = target.getCTM && _isSVG(target);\n\n if ((toPercent || curUnit === \"%\") && (_transformProps[property] || ~property.indexOf(\"adius\"))) {\n px = isSVG ? target.getBBox()[horizontal ? \"width\" : \"height\"] : target[measureProperty];\n return _round(toPercent ? curValue / px * amount : curValue / 100 * px);\n }\n\n style[horizontal ? \"width\" : \"height\"] = amount + (toPixels ? curUnit : unit);\n parent = ~property.indexOf(\"adius\") || unit === \"em\" && target.appendChild && !isRootSVG ? target : target.parentNode;\n\n if (isSVG) {\n parent = (target.ownerSVGElement || {}).parentNode;\n }\n\n if (!parent || parent === _doc || !parent.appendChild) {\n parent = _doc.body;\n }\n\n cache = parent._gsap;\n\n if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) {\n return _round(curValue / cache.width * amount);\n } else {\n if (toPercent && (property === \"height\" || property === \"width\")) {\n // if we're dealing with width/height that's inside a container with padding and/or it's a flexbox/grid container, we must apply it to the target itself rather than the _tempDiv in order to ensure complete accuracy, factoring in the parent's padding.\n var v = target.style[property];\n target.style[property] = amount + unit;\n px = target[measureProperty];\n v ? target.style[property] = v : _removeProperty(target, property);\n } else {\n (toPercent || curUnit === \"%\") && !_nonStandardLayouts[_getComputedProperty(parent, \"display\")] && (style.position = _getComputedProperty(target, \"position\"));\n parent === target && (style.position = \"static\"); // like for borderRadius, if it's a % we must have it relative to the target itself but that may not have position: relative or position: absolute in which case it'd go up the chain until it finds its offsetParent (bad). position: static protects against that.\n\n parent.appendChild(_tempDiv);\n px = _tempDiv[measureProperty];\n parent.removeChild(_tempDiv);\n style.position = \"absolute\";\n }\n\n if (horizontal && toPercent) {\n cache = _getCache(parent);\n cache.time = _ticker.time;\n cache.width = parent[measureProperty];\n }\n }\n\n return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0);\n},\n _get = function _get(target, property, unit, uncache) {\n var value;\n _pluginInitted || _initCore();\n\n if (property in _propertyAliases && property !== \"transform\") {\n property = _propertyAliases[property];\n\n if (~property.indexOf(\",\")) {\n property = property.split(\",\")[0];\n }\n }\n\n if (_transformProps[property] && property !== \"transform\") {\n value = _parseTransform(target, uncache);\n value = property !== \"transformOrigin\" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + \" \" + value.zOrigin + \"px\";\n } else {\n value = target.style[property];\n\n if (!value || value === \"auto\" || uncache || ~(value + \"\").indexOf(\"calc(\")) {\n value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === \"opacity\" ? 1 : 0); // note: some browsers, like Firefox, don't report borderRadius correctly! Instead, it only reports every corner like borderTopLeftRadius\n }\n }\n\n return unit && !~(value + \"\").trim().indexOf(\" \") ? _convertToUnit(target, property, value, unit) + unit : value;\n},\n _tweenComplexCSSString = function _tweenComplexCSSString(target, prop, start, end) {\n // note: we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n if (!start || start === \"none\") {\n // some browsers like Safari actually PREFER the prefixed property and mis-report the unprefixed value like clipPath (BUG). In other words, even though clipPath exists in the style (\"clipPath\" in target.style) and it's set in the CSS properly (along with -webkit-clip-path), Safari reports clipPath as \"none\" whereas WebkitClipPath reports accurately like \"ellipse(100% 0% at 50% 0%)\", so in this case we must SWITCH to using the prefixed property instead. See https://gsap.com/forums/topic/18310-clippath-doesnt-work-on-ios/\n var p = _checkPropPrefix(prop, target, 1),\n s = p && _getComputedProperty(target, p, 1);\n\n if (s && s !== start) {\n prop = p;\n start = s;\n } else if (prop === \"borderColor\") {\n start = _getComputedProperty(target, \"borderTopColor\"); // Firefox bug: always reports \"borderColor\" as \"\", so we must fall back to borderTopColor. See https://gsap.com/forums/topic/24583-how-to-return-colors-that-i-had-after-reverse/\n }\n }\n\n var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString),\n index = 0,\n matchIndex = 0,\n a,\n result,\n startValues,\n startNum,\n color,\n startValue,\n endValue,\n endNum,\n chunk,\n endUnit,\n startUnit,\n endValues;\n pt.b = start;\n pt.e = end;\n start += \"\"; // ensure values are strings\n\n end += \"\";\n\n if (end === \"auto\") {\n startValue = target.style[prop];\n target.style[prop] = end;\n end = _getComputedProperty(target, prop) || end;\n startValue ? target.style[prop] = startValue : _removeProperty(target, prop);\n }\n\n a = [start, end];\n\n _colorStringFilter(a); // pass an array with the starting and ending values and let the filter do whatever it needs to the values. If colors are found, it returns true and then we must match where the color shows up order-wise because for things like boxShadow, sometimes the browser provides the computed values with the color FIRST, but the user provides it with the color LAST, so flip them if necessary. Same for drop-shadow().\n\n\n start = a[0];\n end = a[1];\n startValues = start.match(_numWithUnitExp) || [];\n endValues = end.match(_numWithUnitExp) || [];\n\n if (endValues.length) {\n while (result = _numWithUnitExp.exec(end)) {\n endValue = result[0];\n chunk = end.substring(index, result.index);\n\n if (color) {\n color = (color + 1) % 5;\n } else if (chunk.substr(-5) === \"rgba(\" || chunk.substr(-5) === \"hsla(\") {\n color = 1;\n }\n\n if (endValue !== (startValue = startValues[matchIndex++] || \"\")) {\n startNum = parseFloat(startValue) || 0;\n startUnit = startValue.substr((startNum + \"\").length);\n endValue.charAt(1) === \"=\" && (endValue = _parseRelative(startNum, endValue) + startUnit);\n endNum = parseFloat(endValue);\n endUnit = endValue.substr((endNum + \"\").length);\n index = _numWithUnitExp.lastIndex - endUnit.length;\n\n if (!endUnit) {\n //if something like \"perspective:300\" is passed in and we must add a unit to the end\n endUnit = endUnit || _config.units[prop] || startUnit;\n\n if (index === end.length) {\n end += endUnit;\n pt.e += endUnit;\n }\n }\n\n if (startUnit !== endUnit) {\n startNum = _convertToUnit(target, prop, startValue, endUnit) || 0;\n } // these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.\n\n\n pt._pt = {\n _next: pt._pt,\n p: chunk || matchIndex === 1 ? chunk : \",\",\n //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n s: startNum,\n c: endNum - startNum,\n m: color && color < 4 || prop === \"zIndex\" ? Math.round : 0\n };\n }\n }\n\n pt.c = index < end.length ? end.substring(index, end.length) : \"\"; //we use the \"c\" of the PropTween to store the final part of the string (after the last number)\n } else {\n pt.r = prop === \"display\" && end === \"none\" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue;\n }\n\n _relExp.test(end) && (pt.e = 0); //if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).\n\n this._pt = pt; //start the linked list with this new PropTween. Remember, we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within another plugin too, thus \"this\" would refer to the plugin.\n\n return pt;\n},\n _keywordToPercent = {\n top: \"0%\",\n bottom: \"100%\",\n left: \"0%\",\n right: \"100%\",\n center: \"50%\"\n},\n _convertKeywordsToPercentages = function _convertKeywordsToPercentages(value) {\n var split = value.split(\" \"),\n x = split[0],\n y = split[1] || \"50%\";\n\n if (x === \"top\" || x === \"bottom\" || y === \"left\" || y === \"right\") {\n //the user provided them in the wrong order, so flip them\n value = x;\n x = y;\n y = value;\n }\n\n split[0] = _keywordToPercent[x] || x;\n split[1] = _keywordToPercent[y] || y;\n return split.join(\" \");\n},\n _renderClearProps = function _renderClearProps(ratio, data) {\n if (data.tween && data.tween._time === data.tween._dur) {\n var target = data.t,\n style = target.style,\n props = data.u,\n cache = target._gsap,\n prop,\n clearTransforms,\n i;\n\n if (props === \"all\" || props === true) {\n style.cssText = \"\";\n clearTransforms = 1;\n } else {\n props = props.split(\",\");\n i = props.length;\n\n while (--i > -1) {\n prop = props[i];\n\n if (_transformProps[prop]) {\n clearTransforms = 1;\n prop = prop === \"transformOrigin\" ? _transformOriginProp : _transformProp;\n }\n\n _removeProperty(target, prop);\n }\n }\n\n if (clearTransforms) {\n _removeProperty(target, _transformProp);\n\n if (cache) {\n cache.svg && target.removeAttribute(\"transform\");\n\n _parseTransform(target, 1); // force all the cached values back to \"normal\"/identity, otherwise if there's another tween that's already set to render transforms on this element, it could display the wrong values.\n\n\n cache.uncache = 1;\n\n _removeIndependentTransforms(style);\n }\n }\n }\n},\n // note: specialProps should return 1 if (and only if) they have a non-zero priority. It indicates we need to sort the linked list.\n_specialProps = {\n clearProps: function clearProps(plugin, target, property, endValue, tween) {\n if (tween.data !== \"isFromStart\") {\n var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps);\n pt.u = endValue;\n pt.pr = -10;\n pt.tween = tween;\n\n plugin._props.push(property);\n\n return 1;\n }\n }\n /* className feature (about 0.4kb gzipped).\n , className(plugin, target, property, endValue, tween) {\n \tlet _renderClassName = (ratio, data) => {\n \t\t\tdata.css.render(ratio, data.css);\n \t\t\tif (!ratio || ratio === 1) {\n \t\t\t\tlet inline = data.rmv,\n \t\t\t\t\ttarget = data.t,\n \t\t\t\t\tp;\n \t\t\t\ttarget.setAttribute(\"class\", ratio ? data.e : data.b);\n \t\t\t\tfor (p in inline) {\n \t\t\t\t\t_removeProperty(target, p);\n \t\t\t\t}\n \t\t\t}\n \t\t},\n \t\t_getAllStyles = (target) => {\n \t\t\tlet styles = {},\n \t\t\t\tcomputed = getComputedStyle(target),\n \t\t\t\tp;\n \t\t\tfor (p in computed) {\n \t\t\t\tif (isNaN(p) && p !== \"cssText\" && p !== \"length\") {\n \t\t\t\t\tstyles[p] = computed[p];\n \t\t\t\t}\n \t\t\t}\n \t\t\t_setDefaults(styles, _parseTransform(target, 1));\n \t\t\treturn styles;\n \t\t},\n \t\tstartClassList = target.getAttribute(\"class\"),\n \t\tstyle = target.style,\n \t\tcssText = style.cssText,\n \t\tcache = target._gsap,\n \t\tclassPT = cache.classPT,\n \t\tinlineToRemoveAtEnd = {},\n \t\tdata = {t:target, plugin:plugin, rmv:inlineToRemoveAtEnd, b:startClassList, e:(endValue.charAt(1) !== \"=\") ? endValue : startClassList.replace(new RegExp(\"(?:\\\\s|^)\" + endValue.substr(2) + \"(?![\\\\w-])\"), \"\") + ((endValue.charAt(0) === \"+\") ? \" \" + endValue.substr(2) : \"\")},\n \t\tchangingVars = {},\n \t\tstartVars = _getAllStyles(target),\n \t\ttransformRelated = /(transform|perspective)/i,\n \t\tendVars, p;\n \tif (classPT) {\n \t\tclassPT.r(1, classPT.d);\n \t\t_removeLinkedListItem(classPT.d.plugin, classPT, \"_pt\");\n \t}\n \ttarget.setAttribute(\"class\", data.e);\n \tendVars = _getAllStyles(target, true);\n \ttarget.setAttribute(\"class\", startClassList);\n \tfor (p in endVars) {\n \t\tif (endVars[p] !== startVars[p] && !transformRelated.test(p)) {\n \t\t\tchangingVars[p] = endVars[p];\n \t\t\tif (!style[p] && style[p] !== \"0\") {\n \t\t\t\tinlineToRemoveAtEnd[p] = 1;\n \t\t\t}\n \t\t}\n \t}\n \tcache.classPT = plugin._pt = new PropTween(plugin._pt, target, \"className\", 0, 0, _renderClassName, data, 0, -11);\n \tif (style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://gsap.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/.\n \t\tstyle.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity).\n \t}\n \t_parseTransform(target, true); //to clear the caching of transforms\n \tdata.css = new gsap.plugins.css();\n \tdata.css.init(target, changingVars, tween);\n \tplugin._props.push(...data.css._props);\n \treturn 1;\n }\n */\n\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * TRANSFORMS\n * --------------------------------------------------------------------------------------\n */\n_identity2DMatrix = [1, 0, 0, 1, 0, 0],\n _rotationalProperties = {},\n _isNullTransform = function _isNullTransform(value) {\n return value === \"matrix(1, 0, 0, 1, 0, 0)\" || value === \"none\" || !value;\n},\n _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray(target) {\n var matrixString = _getComputedProperty(target, _transformProp);\n\n return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round);\n},\n _getMatrix = function _getMatrix(target, force2D) {\n var cache = target._gsap || _getCache(target),\n style = target.style,\n matrix = _getComputedTransformMatrixAsArray(target),\n parent,\n nextSibling,\n temp,\n addedToDOM;\n\n if (cache.svg && target.getAttribute(\"transform\")) {\n temp = target.transform.baseVal.consolidate().matrix; //ensures that even complex values like \"translate(50,60) rotate(135,0,0)\" are parsed because it mashes it into a matrix.\n\n matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f];\n return matrix.join(\",\") === \"1,0,0,1,0,0\" ? _identity2DMatrix : matrix;\n } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) {\n //note: if offsetParent is null, that means the element isn't in the normal document flow, like if it has display:none or one of its ancestors has display:none). Firefox returns null for getComputedStyle() if the element is in an iframe that has display:none. https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not \"none\". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px).\n temp = style.display;\n style.display = \"block\";\n parent = target.parentNode;\n\n if (!parent || !target.offsetParent) {\n // note: in 3.3.0 we switched target.offsetParent to _doc.body.contains(target) to avoid [sometimes unnecessary] MutationObserver calls but that wasn't adequate because there are edge cases where nested position: fixed elements need to get reparented to accurately sense transforms. See https://github.com/greensock/GSAP/issues/388 and https://github.com/greensock/GSAP/issues/375\n addedToDOM = 1; //flag\n\n nextSibling = target.nextElementSibling;\n\n _docElement.appendChild(target); //we must add it to the DOM in order to get values properly\n\n }\n\n matrix = _getComputedTransformMatrixAsArray(target);\n temp ? style.display = temp : _removeProperty(target, \"display\");\n\n if (addedToDOM) {\n nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target);\n }\n }\n\n return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix;\n},\n _applySVGOrigin = function _applySVGOrigin(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) {\n var cache = target._gsap,\n matrix = matrixArray || _getMatrix(target, true),\n xOriginOld = cache.xOrigin || 0,\n yOriginOld = cache.yOrigin || 0,\n xOffsetOld = cache.xOffset || 0,\n yOffsetOld = cache.yOffset || 0,\n a = matrix[0],\n b = matrix[1],\n c = matrix[2],\n d = matrix[3],\n tx = matrix[4],\n ty = matrix[5],\n originSplit = origin.split(\" \"),\n xOrigin = parseFloat(originSplit[0]) || 0,\n yOrigin = parseFloat(originSplit[1]) || 0,\n bounds,\n determinant,\n x,\n y;\n\n if (!originIsAbsolute) {\n bounds = _getBBox(target);\n xOrigin = bounds.x + (~originSplit[0].indexOf(\"%\") ? xOrigin / 100 * bounds.width : xOrigin);\n yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf(\"%\") ? yOrigin / 100 * bounds.height : yOrigin); // if (!(\"xOrigin\" in cache) && (xOrigin || yOrigin)) { // added in 3.12.3, reverted in 3.12.4; requires more exploration\n // \txOrigin -= bounds.x;\n // \tyOrigin -= bounds.y;\n // }\n } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) {\n //if it's zero (like if scaleX and scaleY are zero), skip it to avoid errors with dividing by zero.\n x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant;\n y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant;\n xOrigin = x;\n yOrigin = y; // theory: we only had to do this for smoothing and it assumes that the previous one was not originIsAbsolute.\n }\n\n if (smooth || smooth !== false && cache.smooth) {\n tx = xOrigin - xOriginOld;\n ty = yOrigin - yOriginOld;\n cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx;\n cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty;\n } else {\n cache.xOffset = cache.yOffset = 0;\n }\n\n cache.xOrigin = xOrigin;\n cache.yOrigin = yOrigin;\n cache.smooth = !!smooth;\n cache.origin = origin;\n cache.originIsAbsolute = !!originIsAbsolute;\n target.style[_transformOriginProp] = \"0px 0px\"; //otherwise, if someone sets an origin via CSS, it will likely interfere with the SVG transform attribute ones (because remember, we're baking the origin into the matrix() value).\n\n if (pluginToAddPropTweensTo) {\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"xOrigin\", xOriginOld, xOrigin);\n\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"yOrigin\", yOriginOld, yOrigin);\n\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"xOffset\", xOffsetOld, cache.xOffset);\n\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"yOffset\", yOffsetOld, cache.yOffset);\n }\n\n target.setAttribute(\"data-svg-origin\", xOrigin + \" \" + yOrigin);\n},\n _parseTransform = function _parseTransform(target, uncache) {\n var cache = target._gsap || new GSCache(target);\n\n if (\"x\" in cache && !uncache && !cache.uncache) {\n return cache;\n }\n\n var style = target.style,\n invertedScaleX = cache.scaleX < 0,\n px = \"px\",\n deg = \"deg\",\n cs = getComputedStyle(target),\n origin = _getComputedProperty(target, _transformOriginProp) || \"0\",\n x,\n y,\n z,\n scaleX,\n scaleY,\n rotation,\n rotationX,\n rotationY,\n skewX,\n skewY,\n perspective,\n xOrigin,\n yOrigin,\n matrix,\n angle,\n cos,\n sin,\n a,\n b,\n c,\n d,\n a12,\n a22,\n t1,\n t2,\n t3,\n a13,\n a23,\n a33,\n a42,\n a43,\n a32;\n x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0;\n scaleX = scaleY = 1;\n cache.svg = !!(target.getCTM && _isSVG(target));\n\n if (cs.translate) {\n // accommodate independent transforms by combining them into normal ones.\n if (cs.translate !== \"none\" || cs.scale !== \"none\" || cs.rotate !== \"none\") {\n style[_transformProp] = (cs.translate !== \"none\" ? \"translate3d(\" + (cs.translate + \" 0 0\").split(\" \").slice(0, 3).join(\", \") + \") \" : \"\") + (cs.rotate !== \"none\" ? \"rotate(\" + cs.rotate + \") \" : \"\") + (cs.scale !== \"none\" ? \"scale(\" + cs.scale.split(\" \").join(\",\") + \") \" : \"\") + (cs[_transformProp] !== \"none\" ? cs[_transformProp] : \"\");\n }\n\n style.scale = style.rotate = style.translate = \"none\";\n }\n\n matrix = _getMatrix(target, cache.svg);\n\n if (cache.svg) {\n if (cache.uncache) {\n // if cache.uncache is true (and maybe if origin is 0,0), we need to set element.style.transformOrigin = (cache.xOrigin - bbox.x) + \"px \" + (cache.yOrigin - bbox.y) + \"px\". Previously we let the data-svg-origin stay instead, but when introducing revert(), it complicated things.\n t2 = target.getBBox();\n origin = cache.xOrigin - t2.x + \"px \" + (cache.yOrigin - t2.y) + \"px\";\n t1 = \"\";\n } else {\n t1 = !uncache && target.getAttribute(\"data-svg-origin\"); // Remember, to work around browser inconsistencies we always force SVG elements' transformOrigin to 0,0 and offset the translation accordingly.\n }\n\n _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix);\n }\n\n xOrigin = cache.xOrigin || 0;\n yOrigin = cache.yOrigin || 0;\n\n if (matrix !== _identity2DMatrix) {\n a = matrix[0]; //a11\n\n b = matrix[1]; //a21\n\n c = matrix[2]; //a31\n\n d = matrix[3]; //a41\n\n x = a12 = matrix[4];\n y = a22 = matrix[5]; //2D matrix\n\n if (matrix.length === 6) {\n scaleX = Math.sqrt(a * a + b * b);\n scaleY = Math.sqrt(d * d + c * c);\n rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist).\n\n skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0;\n skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD)));\n\n if (cache.svg) {\n x -= xOrigin - (xOrigin * a + yOrigin * c);\n y -= yOrigin - (xOrigin * b + yOrigin * d);\n } //3D matrix\n\n } else {\n a32 = matrix[6];\n a42 = matrix[7];\n a13 = matrix[8];\n a23 = matrix[9];\n a33 = matrix[10];\n a43 = matrix[11];\n x = matrix[12];\n y = matrix[13];\n z = matrix[14];\n angle = _atan2(a32, a33);\n rotationX = angle * _RAD2DEG; //rotationX\n\n if (angle) {\n cos = Math.cos(-angle);\n sin = Math.sin(-angle);\n t1 = a12 * cos + a13 * sin;\n t2 = a22 * cos + a23 * sin;\n t3 = a32 * cos + a33 * sin;\n a13 = a12 * -sin + a13 * cos;\n a23 = a22 * -sin + a23 * cos;\n a33 = a32 * -sin + a33 * cos;\n a43 = a42 * -sin + a43 * cos;\n a12 = t1;\n a22 = t2;\n a32 = t3;\n } //rotationY\n\n\n angle = _atan2(-c, a33);\n rotationY = angle * _RAD2DEG;\n\n if (angle) {\n cos = Math.cos(-angle);\n sin = Math.sin(-angle);\n t1 = a * cos - a13 * sin;\n t2 = b * cos - a23 * sin;\n t3 = c * cos - a33 * sin;\n a43 = d * sin + a43 * cos;\n a = t1;\n b = t2;\n c = t3;\n } //rotationZ\n\n\n angle = _atan2(b, a);\n rotation = angle * _RAD2DEG;\n\n if (angle) {\n cos = Math.cos(angle);\n sin = Math.sin(angle);\n t1 = a * cos + b * sin;\n t2 = a12 * cos + a22 * sin;\n b = b * cos - a * sin;\n a22 = a22 * cos - a12 * sin;\n a = t1;\n a12 = t2;\n }\n\n if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) {\n //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here.\n rotationX = rotation = 0;\n rotationY = 180 - rotationY;\n }\n\n scaleX = _round(Math.sqrt(a * a + b * b + c * c));\n scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32));\n angle = _atan2(a12, a22);\n skewX = Math.abs(angle) > 0.0002 ? angle * _RAD2DEG : 0;\n perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0;\n }\n\n if (cache.svg) {\n //sense if there are CSS transforms applied on an SVG element in which case we must overwrite them when rendering. The transform attribute is more reliable cross-browser, but we can't just remove the CSS ones because they may be applied in a CSS rule somewhere (not just inline).\n t1 = target.getAttribute(\"transform\");\n cache.forceCSS = target.setAttribute(\"transform\", \"\") || !_isNullTransform(_getComputedProperty(target, _transformProp));\n t1 && target.setAttribute(\"transform\", t1);\n }\n }\n\n if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {\n if (invertedScaleX) {\n scaleX *= -1;\n skewX += rotation <= 0 ? 180 : -180;\n rotation += rotation <= 0 ? 180 : -180;\n } else {\n scaleY *= -1;\n skewX += skewX <= 0 ? 180 : -180;\n }\n }\n\n uncache = uncache || cache.uncache;\n cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px;\n cache.y = y - ((cache.yPercent = y && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px;\n cache.z = z + px;\n cache.scaleX = _round(scaleX);\n cache.scaleY = _round(scaleY);\n cache.rotation = _round(rotation) + deg;\n cache.rotationX = _round(rotationX) + deg;\n cache.rotationY = _round(rotationY) + deg;\n cache.skewX = skewX + deg;\n cache.skewY = skewY + deg;\n cache.transformPerspective = perspective + px;\n\n if (cache.zOrigin = parseFloat(origin.split(\" \")[2]) || !uncache && cache.zOrigin || 0) {\n style[_transformOriginProp] = _firstTwoOnly(origin);\n }\n\n cache.xOffset = cache.yOffset = 0;\n cache.force3D = _config.force3D;\n cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms;\n cache.uncache = 0;\n return cache;\n},\n _firstTwoOnly = function _firstTwoOnly(value) {\n return (value = value.split(\" \"))[0] + \" \" + value[1];\n},\n //for handling transformOrigin values, stripping out the 3rd dimension\n_addPxTranslate = function _addPxTranslate(target, start, value) {\n var unit = getUnit(start);\n return _round(parseFloat(start) + parseFloat(_convertToUnit(target, \"x\", value + \"px\", unit))) + unit;\n},\n _renderNon3DTransforms = function _renderNon3DTransforms(ratio, cache) {\n cache.z = \"0px\";\n cache.rotationY = cache.rotationX = \"0deg\";\n cache.force3D = 0;\n\n _renderCSSTransforms(ratio, cache);\n},\n _zeroDeg = \"0deg\",\n _zeroPx = \"0px\",\n _endParenthesis = \") \",\n _renderCSSTransforms = function _renderCSSTransforms(ratio, cache) {\n var _ref = cache || this,\n xPercent = _ref.xPercent,\n yPercent = _ref.yPercent,\n x = _ref.x,\n y = _ref.y,\n z = _ref.z,\n rotation = _ref.rotation,\n rotationY = _ref.rotationY,\n rotationX = _ref.rotationX,\n skewX = _ref.skewX,\n skewY = _ref.skewY,\n scaleX = _ref.scaleX,\n scaleY = _ref.scaleY,\n transformPerspective = _ref.transformPerspective,\n force3D = _ref.force3D,\n target = _ref.target,\n zOrigin = _ref.zOrigin,\n transforms = \"\",\n use3D = force3D === \"auto\" && ratio && ratio !== 1 || force3D === true; // Safari has a bug that causes it not to render 3D transform-origin values properly, so we force the z origin to 0, record it in the cache, and then do the math here to offset the translate values accordingly (basically do the 3D transform-origin part manually)\n\n\n if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) {\n var angle = parseFloat(rotationY) * _DEG2RAD,\n a13 = Math.sin(angle),\n a33 = Math.cos(angle),\n cos;\n\n angle = parseFloat(rotationX) * _DEG2RAD;\n cos = Math.cos(angle);\n x = _addPxTranslate(target, x, a13 * cos * -zOrigin);\n y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin);\n z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin);\n }\n\n if (transformPerspective !== _zeroPx) {\n transforms += \"perspective(\" + transformPerspective + _endParenthesis;\n }\n\n if (xPercent || yPercent) {\n transforms += \"translate(\" + xPercent + \"%, \" + yPercent + \"%) \";\n }\n\n if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) {\n transforms += z !== _zeroPx || use3D ? \"translate3d(\" + x + \", \" + y + \", \" + z + \") \" : \"translate(\" + x + \", \" + y + _endParenthesis;\n }\n\n if (rotation !== _zeroDeg) {\n transforms += \"rotate(\" + rotation + _endParenthesis;\n }\n\n if (rotationY !== _zeroDeg) {\n transforms += \"rotateY(\" + rotationY + _endParenthesis;\n }\n\n if (rotationX !== _zeroDeg) {\n transforms += \"rotateX(\" + rotationX + _endParenthesis;\n }\n\n if (skewX !== _zeroDeg || skewY !== _zeroDeg) {\n transforms += \"skew(\" + skewX + \", \" + skewY + _endParenthesis;\n }\n\n if (scaleX !== 1 || scaleY !== 1) {\n transforms += \"scale(\" + scaleX + \", \" + scaleY + _endParenthesis;\n }\n\n target.style[_transformProp] = transforms || \"translate(0, 0)\";\n},\n _renderSVGTransforms = function _renderSVGTransforms(ratio, cache) {\n var _ref2 = cache || this,\n xPercent = _ref2.xPercent,\n yPercent = _ref2.yPercent,\n x = _ref2.x,\n y = _ref2.y,\n rotation = _ref2.rotation,\n skewX = _ref2.skewX,\n skewY = _ref2.skewY,\n scaleX = _ref2.scaleX,\n scaleY = _ref2.scaleY,\n target = _ref2.target,\n xOrigin = _ref2.xOrigin,\n yOrigin = _ref2.yOrigin,\n xOffset = _ref2.xOffset,\n yOffset = _ref2.yOffset,\n forceCSS = _ref2.forceCSS,\n tx = parseFloat(x),\n ty = parseFloat(y),\n a11,\n a21,\n a12,\n a22,\n temp;\n\n rotation = parseFloat(rotation);\n skewX = parseFloat(skewX);\n skewY = parseFloat(skewY);\n\n if (skewY) {\n //for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees.\n skewY = parseFloat(skewY);\n skewX += skewY;\n rotation += skewY;\n }\n\n if (rotation || skewX) {\n rotation *= _DEG2RAD;\n skewX *= _DEG2RAD;\n a11 = Math.cos(rotation) * scaleX;\n a21 = Math.sin(rotation) * scaleX;\n a12 = Math.sin(rotation - skewX) * -scaleY;\n a22 = Math.cos(rotation - skewX) * scaleY;\n\n if (skewX) {\n skewY *= _DEG2RAD;\n temp = Math.tan(skewX - skewY);\n temp = Math.sqrt(1 + temp * temp);\n a12 *= temp;\n a22 *= temp;\n\n if (skewY) {\n temp = Math.tan(skewY);\n temp = Math.sqrt(1 + temp * temp);\n a11 *= temp;\n a21 *= temp;\n }\n }\n\n a11 = _round(a11);\n a21 = _round(a21);\n a12 = _round(a12);\n a22 = _round(a22);\n } else {\n a11 = scaleX;\n a22 = scaleY;\n a21 = a12 = 0;\n }\n\n if (tx && !~(x + \"\").indexOf(\"px\") || ty && !~(y + \"\").indexOf(\"px\")) {\n tx = _convertToUnit(target, \"x\", x, \"px\");\n ty = _convertToUnit(target, \"y\", y, \"px\");\n }\n\n if (xOrigin || yOrigin || xOffset || yOffset) {\n tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset);\n ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset);\n }\n\n if (xPercent || yPercent) {\n //The SVG spec doesn't support percentage-based translation in the \"transform\" attribute, so we merge it into the translation to simulate it.\n temp = target.getBBox();\n tx = _round(tx + xPercent / 100 * temp.width);\n ty = _round(ty + yPercent / 100 * temp.height);\n }\n\n temp = \"matrix(\" + a11 + \",\" + a21 + \",\" + a12 + \",\" + a22 + \",\" + tx + \",\" + ty + \")\";\n target.setAttribute(\"transform\", temp);\n forceCSS && (target.style[_transformProp] = temp); //some browsers prioritize CSS transforms over the transform attribute. When we sense that the user has CSS transforms applied, we must overwrite them this way (otherwise some browser simply won't render the transform attribute changes!)\n},\n _addRotationalPropTween = function _addRotationalPropTween(plugin, target, property, startNum, endValue) {\n var cap = 360,\n isString = _isString(endValue),\n endNum = parseFloat(endValue) * (isString && ~endValue.indexOf(\"rad\") ? _RAD2DEG : 1),\n change = endNum - startNum,\n finalValue = startNum + change + \"deg\",\n direction,\n pt;\n\n if (isString) {\n direction = endValue.split(\"_\")[1];\n\n if (direction === \"short\") {\n change %= cap;\n\n if (change !== change % (cap / 2)) {\n change += change < 0 ? cap : -cap;\n }\n }\n\n if (direction === \"cw\" && change < 0) {\n change = (change + cap * _bigNum) % cap - ~~(change / cap) * cap;\n } else if (direction === \"ccw\" && change > 0) {\n change = (change - cap * _bigNum) % cap - ~~(change / cap) * cap;\n }\n }\n\n plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);\n pt.e = finalValue;\n pt.u = \"deg\";\n\n plugin._props.push(property);\n\n return pt;\n},\n _assign = function _assign(target, source) {\n // Internet Explorer doesn't have Object.assign(), so we recreate it here.\n for (var p in source) {\n target[p] = source[p];\n }\n\n return target;\n},\n _addRawTransformPTs = function _addRawTransformPTs(plugin, transforms, target) {\n //for handling cases where someone passes in a whole transform string, like transform: \"scale(2, 3) rotate(20deg) translateY(30em)\"\n var startCache = _assign({}, target._gsap),\n exclude = \"perspective,force3D,transformOrigin,svgOrigin\",\n style = target.style,\n endCache,\n p,\n startValue,\n endValue,\n startNum,\n endNum,\n startUnit,\n endUnit;\n\n if (startCache.svg) {\n startValue = target.getAttribute(\"transform\");\n target.setAttribute(\"transform\", \"\");\n style[_transformProp] = transforms;\n endCache = _parseTransform(target, 1);\n\n _removeProperty(target, _transformProp);\n\n target.setAttribute(\"transform\", startValue);\n } else {\n startValue = getComputedStyle(target)[_transformProp];\n style[_transformProp] = transforms;\n endCache = _parseTransform(target, 1);\n style[_transformProp] = startValue;\n }\n\n for (p in _transformProps) {\n startValue = startCache[p];\n endValue = endCache[p];\n\n if (startValue !== endValue && exclude.indexOf(p) < 0) {\n //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case.\n startUnit = getUnit(startValue);\n endUnit = getUnit(endValue);\n startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue);\n endNum = parseFloat(endValue);\n plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp);\n plugin._pt.u = endUnit || 0;\n\n plugin._props.push(p);\n }\n }\n\n _assign(endCache, startCache);\n}; // handle splitting apart padding, margin, borderWidth, and borderRadius into their 4 components. Firefox, for example, won't report borderRadius correctly - it will only do borderTopLeftRadius and the other corners. We also want to handle paddingTop, marginLeft, borderRightWidth, etc.\n\n\n_forEachName(\"padding,margin,Width,Radius\", function (name, index) {\n var t = \"Top\",\n r = \"Right\",\n b = \"Bottom\",\n l = \"Left\",\n props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function (side) {\n return index < 2 ? name + side : \"border\" + side + name;\n });\n\n _specialProps[index > 1 ? \"border\" + name : name] = function (plugin, target, property, endValue, tween) {\n var a, vars;\n\n if (arguments.length < 4) {\n // getter, passed target, property, and unit (from _get())\n a = props.map(function (prop) {\n return _get(plugin, prop, property);\n });\n vars = a.join(\" \");\n return vars.split(a[0]).length === 5 ? a[0] : vars;\n }\n\n a = (endValue + \"\").split(\" \");\n vars = {};\n props.forEach(function (prop, i) {\n return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0];\n });\n plugin.init(target, vars, tween);\n };\n});\n\nexport var CSSPlugin = {\n name: \"css\",\n register: _initCore,\n targetTest: function targetTest(target) {\n return target.style && target.nodeType;\n },\n init: function init(target, vars, tween, index, targets) {\n var props = this._props,\n style = target.style,\n startAt = tween.vars.startAt,\n startValue,\n endValue,\n endNum,\n startNum,\n type,\n specialProp,\n p,\n startUnit,\n endUnit,\n relative,\n isTransformRelated,\n transformPropTween,\n cache,\n smooth,\n hasPriority,\n inlineProps;\n _pluginInitted || _initCore(); // we may call init() multiple times on the same plugin instance, like when adding special properties, so make sure we don't overwrite the revert data or inlineProps\n\n this.styles = this.styles || _getStyleSaver(target);\n inlineProps = this.styles.props;\n this.tween = tween;\n\n for (p in vars) {\n if (p === \"autoRound\") {\n continue;\n }\n\n endValue = vars[p];\n\n if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) {\n // plugins\n continue;\n }\n\n type = typeof endValue;\n specialProp = _specialProps[p];\n\n if (type === \"function\") {\n endValue = endValue.call(tween, index, target, targets);\n type = typeof endValue;\n }\n\n if (type === \"string\" && ~endValue.indexOf(\"random(\")) {\n endValue = _replaceRandom(endValue);\n }\n\n if (specialProp) {\n specialProp(this, target, p, endValue, tween) && (hasPriority = 1);\n } else if (p.substr(0, 2) === \"--\") {\n //CSS variable\n startValue = (getComputedStyle(target).getPropertyValue(p) + \"\").trim();\n endValue += \"\";\n _colorExp.lastIndex = 0;\n\n if (!_colorExp.test(startValue)) {\n // colors don't have units\n startUnit = getUnit(startValue);\n endUnit = getUnit(endValue);\n }\n\n endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit);\n this.add(style, \"setProperty\", startValue, endValue, index, targets, 0, 0, p);\n props.push(p);\n inlineProps.push(p, 0, style[p]);\n } else if (type !== \"undefined\") {\n if (startAt && p in startAt) {\n // in case someone hard-codes a complex value as the start, like top: \"calc(2vh / 2)\". Without this, it'd use the computed value (always in px)\n startValue = typeof startAt[p] === \"function\" ? startAt[p].call(tween, index, target, targets) : startAt[p];\n _isString(startValue) && ~startValue.indexOf(\"random(\") && (startValue = _replaceRandom(startValue));\n getUnit(startValue + \"\") || startValue === \"auto\" || (startValue += _config.units[p] || getUnit(_get(target, p)) || \"\"); // for cases when someone passes in a unitless value like {x: 100}; if we try setting translate(100, 0px) it won't work.\n\n (startValue + \"\").charAt(1) === \"=\" && (startValue = _get(target, p)); // can't work with relative values\n } else {\n startValue = _get(target, p);\n }\n\n startNum = parseFloat(startValue);\n relative = type === \"string\" && endValue.charAt(1) === \"=\" && endValue.substr(0, 2);\n relative && (endValue = endValue.substr(2));\n endNum = parseFloat(endValue);\n\n if (p in _propertyAliases) {\n if (p === \"autoAlpha\") {\n //special case where we control the visibility along with opacity. We still allow the opacity value to pass through and get tweened.\n if (startNum === 1 && _get(target, \"visibility\") === \"hidden\" && endNum) {\n //if visibility is initially set to \"hidden\", we should interpret that as intent to make opacity 0 (a convenience)\n startNum = 0;\n }\n\n inlineProps.push(\"visibility\", 0, style.visibility);\n\n _addNonTweeningPT(this, style, \"visibility\", startNum ? \"inherit\" : \"hidden\", endNum ? \"inherit\" : \"hidden\", !endNum);\n }\n\n if (p !== \"scale\" && p !== \"transform\") {\n p = _propertyAliases[p];\n ~p.indexOf(\",\") && (p = p.split(\",\")[0]);\n }\n }\n\n isTransformRelated = p in _transformProps; //--- TRANSFORM-RELATED ---\n\n if (isTransformRelated) {\n this.styles.save(p);\n\n if (!transformPropTween) {\n cache = target._gsap;\n cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform); // if, for example, gsap.set(... {transform:\"translateX(50vw)\"}), the _get() call doesn't parse the transform, thus cache.renderTransform won't be set yet so force the parsing of the transform here.\n\n smooth = vars.smoothOrigin !== false && cache.smooth;\n transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1); //the first time through, create the rendering PropTween so that it runs LAST (in the linked list, we keep adding to the beginning)\n\n transformPropTween.dep = 1; //flag it as dependent so that if things get killed/overwritten and this is the only PropTween left, we can safely kill the whole tween.\n }\n\n if (p === \"scale\") {\n this._pt = new PropTween(this._pt, cache, \"scaleY\", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp);\n this._pt.u = 0;\n props.push(\"scaleY\", p);\n p += \"X\";\n } else if (p === \"transformOrigin\") {\n inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]);\n endValue = _convertKeywordsToPercentages(endValue); //in case something like \"left top\" or \"bottom right\" is passed in. Convert to percentages.\n\n if (cache.svg) {\n _applySVGOrigin(target, endValue, 0, smooth, 0, this);\n } else {\n endUnit = parseFloat(endValue.split(\" \")[2]) || 0; //handle the zOrigin separately!\n\n endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, \"zOrigin\", cache.zOrigin, endUnit);\n\n _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue));\n }\n\n continue;\n } else if (p === \"svgOrigin\") {\n _applySVGOrigin(target, endValue, 1, smooth, 0, this);\n\n continue;\n } else if (p in _rotationalProperties) {\n _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue);\n\n continue;\n } else if (p === \"smoothOrigin\") {\n _addNonTweeningPT(this, cache, \"smooth\", cache.smooth, endValue);\n\n continue;\n } else if (p === \"force3D\") {\n cache[p] = endValue;\n continue;\n } else if (p === \"transform\") {\n _addRawTransformPTs(this, endValue, target);\n\n continue;\n }\n } else if (!(p in style)) {\n p = _checkPropPrefix(p) || p;\n }\n\n if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) {\n startUnit = (startValue + \"\").substr((startNum + \"\").length);\n endNum || (endNum = 0); // protect against NaN\n\n endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit);\n startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit));\n this._pt = new PropTween(this._pt, isTransformRelated ? cache : style, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === \"px\" || p === \"zIndex\") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp);\n this._pt.u = endUnit || 0;\n\n if (startUnit !== endUnit && endUnit !== \"%\") {\n //when the tween goes all the way back to the beginning, we need to revert it to the OLD/ORIGINAL value (with those units). We record that as a \"b\" (beginning) property and point to a render method that handles that. (performance optimization)\n this._pt.b = startValue;\n this._pt.r = _renderCSSPropWithBeginning;\n }\n } else if (!(p in style)) {\n if (p in target) {\n //maybe it's not a style - it could be a property added directly to an element in which case we'll try to animate that.\n this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets);\n } else if (p !== \"parseTransform\") {\n _missingPlugin(p, endValue);\n\n continue;\n }\n } else {\n _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue);\n }\n\n isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : inlineProps.push(p, 1, startValue || target[p]));\n props.push(p);\n }\n }\n\n hasPriority && _sortPropTweensByPriority(this);\n },\n render: function render(ratio, data) {\n if (data.tween._time || !_reverting()) {\n var pt = data._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n } else {\n data.styles.revert();\n }\n },\n get: _get,\n aliases: _propertyAliases,\n getSetter: function getSetter(target, property, plugin) {\n //returns a setter function that accepts target, property, value and applies it accordingly. Remember, properties like \"x\" aren't as simple as target.style.property = value because they've got to be applied to a proxy object and then merged into a transform string in a renderer.\n var p = _propertyAliases[property];\n p && p.indexOf(\",\") < 0 && (property = p);\n return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get(target, \"x\")) ? plugin && _recentSetterPlugin === plugin ? property === \"scale\" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === \"scale\" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf(\"-\") ? _setterCSSProp : _getSetter(target, property);\n },\n core: {\n _removeProperty: _removeProperty,\n _getMatrix: _getMatrix\n }\n};\ngsap.utils.checkPrefix = _checkPropPrefix;\ngsap.core.getStyleSaver = _getStyleSaver;\n\n(function (positionAndScale, rotation, others, aliases) {\n var all = _forEachName(positionAndScale + \",\" + rotation + \",\" + others, function (name) {\n _transformProps[name] = 1;\n });\n\n _forEachName(rotation, function (name) {\n _config.units[name] = \"deg\";\n _rotationalProperties[name] = 1;\n });\n\n _propertyAliases[all[13]] = positionAndScale + \",\" + rotation;\n\n _forEachName(aliases, function (name) {\n var split = name.split(\":\");\n _propertyAliases[split[1]] = all[split[0]];\n });\n})(\"x,y,z,scale,scaleX,scaleY,xPercent,yPercent\", \"rotation,rotationX,rotationY,skewX,skewY\", \"transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective\", \"0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY\");\n\n_forEachName(\"x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective\", function (name) {\n _config.units[name] = \"px\";\n});\n\ngsap.registerPlugin(CSSPlugin);\nexport { CSSPlugin as default, _getBBox, _createElement, _checkPropPrefix as checkPrefix };","import { gsap, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ, TweenLite, TimelineLite, TimelineMax } from \"./gsap-core.js\";\nimport { CSSPlugin } from \"./CSSPlugin.js\";\nvar gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap,\n // to protect from tree shaking\nTweenMaxWithCSS = gsapWithCSS.core.Tween;\nexport { gsapWithCSS as gsap, gsapWithCSS as default, CSSPlugin, TweenMaxWithCSS as TweenMax, TweenLite, TimelineMax, TimelineLite, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ };","<template>\n <TransitionGroup\n ref=\"list\"\n tag=\"div\"\n appear\n :css=\"false\"\n @before-enter=\"onBeforeEnter\"\n @enter=\"onEnter\"\n @leave=\"onLeave\"\n >\n <slot />\n </TransitionGroup>\n</template>\n\n<script setup>\nimport gsap from 'gsap';\nimport { computed, ref } from 'vue';\n\nconst props = defineProps({\n height: {\n type: [String, Number],\n default: 'auto'\n },\n duration: {\n type: Number,\n default: 0.5\n },\n delayOffset: {\n type: Number,\n default: 0.5\n },\n disabled: Boolean\n});\n\nconst list = ref(null);\nconst indexDelay = computed(() => {\n return props.delayOffset / list.value.$el.children.length;\n});\n\nfunction onBeforeEnter(el) {\n if (props.disabled) {\n return;\n }\n el.style.opacity = 0;\n el.style.height = 0;\n}\n\nfunction onEnter(el, onComplete) {\n if (props.disabled) {\n onComplete();\n return;\n }\n\n gsap.to(el, {\n opacity: 1,\n duration: props.duration,\n height: props.height,\n delay: el.dataset.index * indexDelay.value,\n onComplete\n });\n}\n\nfunction onLeave(el, onComplete) {\n if (props.disabled) {\n onComplete();\n return;\n }\n\n gsap.to(el, {\n opacity: 0,\n height: 0,\n duration: props.duration,\n delay: el.dataset.index * indexDelay.value,\n onComplete\n });\n}\n</script>\n\n<style scoped lang=\"scss\">\n.list-move,\n.list-enter-active,\n.list-leave-active {\n transition: all 0.5s ease;\n}\n\n.list-enter-from,\n.list-leave-to {\n opacity: 0;\n transform: translateX(2em);\n}\n\n/* ensure leaving items are taken out of layout flow so that moving\n animations can be calculated correctly. */\n.list-leave-active {\n position: absolute;\n}\n</style>\n","import { DragAndDrop } from \"./dragAndDrop\";\n\n/**\n * ListDragAndDrop supports dragging elements in a list to new positions in the same list.\n * A placeholder is rendered to show the position the list item will be dropped.\n *\n * @class\n */\nexport class ListDragAndDrop extends DragAndDrop {\n listPosition = 0;\n cursorPosition = 0;\n initialPosition = 0;\n onPositionChangeCb = null;\n onDragPositionChangeCb = null;\n placeholder = null;\n\n constructor(options = {}) {\n super({\n showPlaceholder: true,\n ...options,\n });\n }\n\n /**\n * Callback that fires after dragging has ended and the list position has changed from the original\n * @param cb\n * @returns {ListDragAndDrop}\n */\n onPositionChange(cb) {\n this.onPositionChangeCb = cb;\n return this;\n }\n\n /**\n * Callback that fires while dragging the element when the cursor's position has changed in the list\n * @param cb\n * @returns {ListDragAndDrop}\n */\n onDragPositionChange(cb) {\n this.onDragPositionChangeCb = cb;\n return this;\n }\n\n /**\n * Start listening for drag events and prepare an element for drag/drop\n * @param e\n * @param data\n */\n dragStart(e, data) {\n super.dragStart(e, data);\n\n if (this.currentDropZone) {\n this.listPosition = this.getListPosition(e.target);\n this.initialPosition = this.listPosition;\n this.updateScrollPosition();\n }\n }\n\n /**\n * When dragging has ended, check for list position changes and fire the onPositionChange callback if it has\n */\n dragEnd(e) {\n const draggableData = this.draggableData;\n this.placeholder?.remove();\n super.dragEnd(e);\n\n // If our list position has changed, trigger the drop callback\n if (this.listPosition !== this.initialPosition) {\n this.onPositionChangeCb &&\n this.onPositionChangeCb(this.listPosition, this.initialPosition, draggableData);\n }\n }\n\n /**\n * The dragging element is moving\n * @param e\n */\n dragOver(e) {\n super.dragOver(e);\n this.updateListPosition(e);\n }\n\n /**\n * Notify if the targeted position of the cursor is different from the current position\n * @param e\n */\n updateListPosition(e) {\n const prevPosition = this.listPosition;\n const newPosition = this.getListPositionOfPoint({\n x: e.clientX,\n y: e.clientY,\n });\n\n // If the cursor position has changed, we should update the rendering and see if our actual list position has\n // changed\n if (this.cursorPosition !== newPosition) {\n this.cursorPosition = newPosition;\n this.listPosition =\n this.initialPosition < this.cursorPosition\n ? this.cursorPosition - 1\n : this.cursorPosition;\n if (this.options.showPlaceholder) {\n this.renderPlaceholder();\n }\n\n // The position has changed, trigger the callback\n if (this.listPosition !== prevPosition) {\n this.onDragPositionChangeCb &&\n this.onDragPositionChangeCb(this.listPosition, this.draggableData);\n }\n }\n }\n\n /**\n * Find the numeric position of the element in the children of the list\n * @returns {Number|null}\n * @param item\n */\n getListPosition(item) {\n let index = 0;\n for (const child of this.getChildren()) {\n if (child === item) {\n return index;\n }\n index++;\n }\n\n return null;\n }\n\n /**\n * Get all the children of the current drop zone, excluding the placeholder\n * @returns {*}\n */\n getChildren() {\n return [...this.currentDropZone.children].filter(\n (c) => c.className.match(/drag-placeholder/) === null\n );\n }\n\n /**\n * Find the element at the current cursor position in the given drop zone\n * @param point\n * @returns {null}\n */\n getListPositionOfPoint(point) {\n let index = 0;\n const children = this.getChildren();\n\n while (index < children.length) {\n const rect = children[index].getBoundingClientRect();\n if (this.isVertical()) {\n if (point.y < rect.top + rect.height / 2) {\n break;\n }\n } else {\n if (point.x < rect.left + rect.width / 2) {\n break;\n }\n }\n index++;\n }\n\n return index;\n }\n\n /**\n * Updates the scroll position while dragging an element so a user can navigate a longer list while dragging\n */\n updateScrollPosition() {\n if (this.currentDropZone) {\n const rect = this.currentDropZone.getBoundingClientRect();\n const threshold = 100;\n let velocity = 0;\n const velocityFn = (x) => x * 5;\n const cursorPos = this.isVertical() ? this.cursorY : this.cursorX;\n const rectStart = this.isVertical() ? rect.top : rect.left;\n const rectEnd = this.isVertical() ? rect.bottom : rect.right;\n const beforeDiff = rectStart + threshold - cursorPos;\n const afterDiff = cursorPos - (rectEnd - threshold);\n\n if (beforeDiff > 0) {\n velocity = -velocityFn(beforeDiff);\n } else if (afterDiff > 0) {\n velocity = velocityFn(afterDiff);\n }\n\n if (velocity) {\n if (this.isVertical()) {\n this.currentDropZone.scrollTo({\n top: this.currentDropZone.scrollTop + velocity,\n behavior: \"smooth\",\n });\n } else {\n this.currentDropZone.scrollTo({\n left: this.currentDropZone.scrollLeft + velocity,\n behavior: \"smooth\",\n });\n }\n }\n\n setTimeout(() => this.updateScrollPosition(), 500);\n }\n }\n\n /**\n * Render a placeholder element at the given position (in between the elements)\n */\n renderPlaceholder() {\n if (!this.placeholder) {\n this.placeholder = document.createElement(\"div\");\n this.placeholder.classList.add(\"drag-placeholder\");\n }\n\n // Make sure the placeholder is oriented correctly\n if (this.isVertical()) {\n this.placeholder.classList.add(\"direction-vertical\");\n this.placeholder.classList.remove(\"direction-horizontal\");\n this.placeholder.style.height = undefined;\n } else {\n this.placeholder.classList.add(\"direction-horizontal\");\n this.placeholder.classList.remove(\"direction-vertical\");\n this.placeholder.style.height =\n this.currentDropZone.getBoundingClientRect().height + \"px\";\n }\n\n const children = this.getChildren();\n if (this.cursorPosition < children.length) {\n this.currentDropZone.insertBefore(\n this.placeholder,\n children[this.cursorPosition]\n );\n } else {\n this.currentDropZone.appendChild(this.placeholder);\n }\n }\n}\n","<template>\n <div\n class=\"cursor-move\"\n draggable=\"true\"\n @dragstart=\"dragAndDrop.dragStart\"\n @dragend=\"dragAndDrop.dragEnd\"\n >\n <div class=\"flex items-center\">\n <div v-if=\"showHandle\">\n <SvgImg :svg=\"DragHandleIcon\" class=\"w-4 h-4\" alt=\"drag-handle\" />\n </div>\n <div class=\"flex-grow\">\n <slot />\n </div>\n </div>\n </div>\n</template>\n<script setup>\nimport { DragHandleDotsIcon as DragHandleIcon } from '../../svg';\nimport { SvgImg } from '../Utility';\nimport { ListDragAndDrop } from './listDragAndDrop';\n\nconst emit = defineEmits(['position', 'update:list-items']);\nconst props = defineProps({\n dropZone: {\n type: [Function, String],\n required: true\n },\n direction: {\n type: String,\n default: 'vertical',\n validator: (value) => ['vertical', 'horizontal'].includes(value)\n },\n showHandle: Boolean,\n listItems: {\n type: Array,\n default: null\n }\n});\n\nconst dragAndDrop = new ListDragAndDrop()\n .setDropZone(props.dropZone)\n .setOptions({ showPlaceholder: true, direction: props.direction })\n .onPositionChange((newPosition, oldPosition) => {\n emit('position', newPosition);\n\n if (props.listItems) {\n const items = [...props.listItems];\n items.splice(newPosition, 0, items.splice(oldPosition, 1)[0]);\n emit('update:list-items', items);\n }\n });\n</script>\n","<template>\n <InfoDialog\n title=\"Column Settings\"\n @close=\"$emit('close')\"\n >\n <div class=\"mb-4 text-sm\">\n Customize columns by visibility, order, or priority (maximum 3 additional).\n </div>\n <ColumnListItem\n v-for=\"column in lockedColumns\" :key=\"column.name\" locked visible :column=\"column\"\n class=\"px-2.5 border border-gray-200 bg-white rounded-t-lg\"\n />\n <ListTransition\n name=\"fade-down-list\"\n data-drop-zone=\"column-list\"\n >\n <ListItemDraggable\n v-for=\"(column, index) in sortableColumns\"\n :key=\"column.name\"\n :list-items=\"sortableColumns\"\n drop-zone=\"column-list\"\n class=\"px-2 border border-gray-200 bg-white\"\n :class=\"{'rounded-b-lg': index === sortableColumns.length - 1}\"\n show-handle\n @update:list-items=\"$emit('update:sortable-columns', $event)\"\n >\n <ColumnListItem\n :column=\"column\"\n :visible=\"isVisible(column)\"\n :is-title=\"isTitleColumn(column)\"\n @visible=\"onVisibilityChange(column, $event)\"\n @is-title=\"onTitleColumnChange(column, $event)\"\n />\n </ListItemDraggable>\n </ListTransition>\n </InfoDialog>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport { FlashMessages, remove } from '../../../helpers';\nimport { ListItemDraggable } from '../../DragAndDrop';\nimport { InfoDialog, ListTransition } from '../../Utility';\nimport ColumnListItem from './ColumnListItem';\n\nconst emit = defineEmits(['close', 'update:hidden-column-names', 'update:title-column-names', 'update:sortable-columns']);\nconst props = defineProps({\n hiddenColumnNames: {\n type: Array,\n required: true\n },\n titleColumnNames: {\n type: Array,\n required: true\n },\n lockedColumns: {\n type: Array,\n required: true\n },\n sortableColumns: {\n type: Array,\n required: true\n },\n titleColumnLimit: {\n type: Number,\n default: 3\n }\n});\n\nconst allowMoreTitleColumns = computed(() => {\n return props.titleColumnNames.length < props.titleColumnLimit;\n});\nfunction isVisible(column) {\n return !props.hiddenColumnNames.includes(column.name);\n}\nfunction onVisibilityChange(column, visible) {\n let hiddenColumnNames = [...props.hiddenColumnNames];\n\n if (visible && hiddenColumnNames.includes(column.name)) {\n hiddenColumnNames = remove(hiddenColumnNames, column.name);\n } else {\n hiddenColumnNames.push(column.name);\n }\n emit('update:hidden-column-names', [...new Set(hiddenColumnNames)]);\n}\n\nfunction isTitleColumn(column) {\n return props.titleColumnNames.includes(column.name);\n}\nfunction onTitleColumnChange(column, isTitle) {\n let titleColumnNames = [...props.titleColumnNames];\n if (isTitle && !titleColumnNames.includes(column.name)) {\n if (!allowMoreTitleColumns.value) {\n FlashMessages.warning(`You can only have ${props.titleColumnLimit} priority columns.`);\n return;\n }\n titleColumnNames.push(column.name);\n } else {\n titleColumnNames = remove(titleColumnNames, column.name);\n }\n emit('update:title-column-names', [...new Set(titleColumnNames)]);\n}\n</script>\n","<template>\n <div>\n <div\n v-for=\"column in columns\" :key=\"column.name\"\n class=\"overflow-hidden overflow-ellipsis text-xs text-gray-base\"\n >{{ format(row[column.name], column.format) }}\n </div>\n </div>\n</template>\n<script setup>\ndefineProps({\n row: {\n type: Object,\n required: true\n },\n columns: {\n type: Array,\n required: true\n }\n});\n\nfunction format(value, format) {\n if (typeof format === 'function') {\n return format(value);\n }\n return value;\n}\n</script>\n","<template>\n <div class=\"flex items-center flex-nowrap\">\n <div\n v-for=\"category in categories\"\n :key=\"category\"\n class=\"category-toggle border-gray-200\"\n :class=\"{'has-visible-columns text-white bg-blue-600': categoryHasVisibleColumns(category)}\"\n >\n <QCheckbox\n toggle-indeterminate\n size=\"20px\"\n :model-value=\"getCategoryCheckboxState(category)\"\n class=\"mr-2 cb-white-border\"\n @click=\"toggleColumns(columnsInCategory(category), !categoryHasVisibleColumns(category))\"\n />\n <div>\n {{ category }}\n </div>\n <CaretDownIcon\n class=\"ml-2 w-5 transition-all\"\n :class=\"{'rotate-180' : isShowingColumnToggle === category}\"\n />\n <QMenu\n @update:model-value=\"isShowingColumnToggle = $event ? category : ''\"\n >\n <QList>\n <div\n v-for=\"column in columnsInCategory(category)\"\n :key=\"column\"\n class=\"flex items-center flex-nowrap px-2 py-3 cursor-pointer\"\n @click=\"toggleColumn(column.name)\"\n >\n <QCheckbox\n :model-value=\"!hiddenColumnNames.includes(column.name)\"\n class=\"mr-3 cb-white-border\"\n size=\"20px\"\n :color=\"column.required ? 'gray-base': 'blue-600'\"\n :disable=\"column.required\"\n @click=\"toggleColumn(column.name)\"\n />\n <div class=\"text-xs\">{{ column.label }}</div>\n </div>\n </QList>\n </QMenu>\n </div>\n </div>\n</template>\n<script setup>\nimport { computed, ref } from 'vue';\nimport { remove } from '../../../helpers';\nimport { CaretDownIcon } from '../../../svg';\n\nconst emit = defineEmits(['update:hidden-column-names']);\nconst props = defineProps({\n columns: {\n type: Array,\n required: true\n },\n hiddenColumnNames: {\n type: Array,\n required: true\n }\n});\n\nconst isShowingColumnToggle = ref('');\nconst categories = computed(() => [...new Set(props.columns.map(c => c.category)).values()]);\n\n/**\n * Return a list of column names that belong to the category\n * @param category\n * @returns {(string|*)[]}\n */\nfunction columnsInCategory(category) {\n return props.columns.filter(c => c.category === category);\n}\n\n/**\n * Return true if any columns in the category are visible\n * @param category\n * @returns {boolean}\n */\nfunction categoryHasVisibleColumns(category) {\n // If there are any columns in the category that are not hidden, then the category has visible columns\n return columnsInCategory(category).filter(c => !c.required).map(c => c.name).some(c => !props.hiddenColumnNames.includes(c));\n}\n\n/**\n * Determines the state of the checkbox as either true, false or null (for the indeterminate state)\n * @param category\n * @returns {boolean|null}\n */\nfunction getCategoryCheckboxState(category) {\n let categoryColumns = columnsInCategory(category).filter(c => !c.required);\n const visibleColumns = categoryColumns.filter(c => !props.hiddenColumnNames.includes(c.name));\n if (visibleColumns.length === 0) {\n return false;\n } else if (visibleColumns.length === categoryColumns.length) {\n return true;\n }\n return null;\n}\n/**\n * Toggle all columns in a category\n * @param columns\n * @param showColumns\n */\nfunction toggleColumns(columns, showColumns) {\n // Ignore required columns\n columns = columns.filter(c => !c.required);\n\n let hiddenColumnNames = [...props.hiddenColumnNames];\n if (showColumns) {\n hiddenColumnNames = hiddenColumnNames.filter(c => !columns.map(c => c.name).includes(c));\n } else {\n hiddenColumnNames = [...new Set([...hiddenColumnNames, ...columns.map(c => c.name)])];\n }\n emit('update:hidden-column-names', hiddenColumnNames);\n}\n\n/**\n * Toggle a single column\n * @param columnName\n * @param showColumn\n */\nfunction toggleColumn(columnName, showColumn) {\n // Do not allow toggling required columns\n if (props.columns.find(c => c.name === columnName).required) return;\n\n // Determine weather to add (hide) or remove (show) the column\n showColumn = showColumn ?? props.hiddenColumnNames.includes(columnName);\n\n let hiddenColumnNames = [...props.hiddenColumnNames];\n\n // Add or remove the column from the hiddenColumnNames array\n if (showColumn) {\n hiddenColumnNames = remove(hiddenColumnNames, columnName);\n } else {\n hiddenColumnNames.push(columnName);\n hiddenColumnNames = [...new Set(hiddenColumnNames)];\n }\n\n emit('update:hidden-column-names', hiddenColumnNames);\n}\n</script>\n<style\n lang=\"scss\"\n scoped\n>\n.category-toggle {\n @apply text-xs font-bold rounded-lg border border-solid px-2 py-1 mx-1 cursor-pointer flex items-center;\n}\n</style>\n","<template>\n <span>\n <slot>\n {{ labelText }}\n <template v-if=\"showName\">({{ field?.name }})</template>\n </slot>\n <span\n v-if=\"requiredLabel\"\n class=\"text-red-dark ml-1 text-xs bottom-1 relative\"\n >{{ requiredLabel }}</span>\n </span>\n</template>\n\n<script setup>\nimport { computed } from \"vue\";\n\nconst props = defineProps({\n field: {\n type: Object,\n default: null\n },\n label: {\n type: String,\n default: null\n },\n showName: Boolean,\n required: Boolean\n});\n\nconst labelText = computed(() => props.label || props.field?.label);\nconst requiredLabel = computed(() => props.field?.required_group || (props.required || props.field?.required ? \"*\" : \"\"));\n</script>\n","<template>\n <LabeledInput\n type=\"password\"\n v-bind=\"props\"\n :name=\"name\"\n :model-value=\"modelValue\"\n :rules=\"rules\"\n @update:model-value=\"$emit('update:model-value', $event)\"\n />\n</template>\n\n<script setup>\nimport LabeledInput from './LabeledInput';\n\ndefineEmits(['update:model-value']);\nconst props = defineProps({\n name: {\n type: String,\n default: 'password_confirmation'\n },\n label: {\n type: String,\n default: 'Confirm Password'\n },\n placeholder: {\n type: String,\n default: 'Confirm Password'\n },\n modelValue: {\n type: [String, Number],\n required: true\n },\n error: {\n type: String,\n default: null\n },\n password: {\n type: String,\n default: ''\n },\n disabled: Boolean\n});\n\nconst rules = [\n (val) =>\n val === props.password || 'The password and confirmation do not match'\n];\n</script>\n","<template>\n <div>\n <div\n v-if=\"label\"\n class=\"font-bold text-xs mb-2\"\n >\n {{ label }}\n </div>\n <div class=\"flex items-center cursor-pointer\">\n <DateIcon class=\"w-5 text-blue-600\" />\n <div class=\"font-bold ml-3 hover:text-blue-600\">\n <template v-if=\"date\">\n {{ formattedDate }}\n </template>\n <template v-else>\n - -\n </template>\n </div>\n </div>\n <QPopupProxy>\n <QDate\n v-model=\"date\"\n @update:model-value=\"onSave\"\n />\n </QPopupProxy>\n </div>\n</template>\n\n<script setup>\nimport { CalendarIcon as DateIcon } from '@heroicons/vue/outline';\nimport { computed, ref, watch } from 'vue';\nimport { fDate, parseQDate } from '../../../../helpers';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: [String, Object],\n default: null\n },\n label: {\n type: String,\n default: null\n }\n});\n\nconst formattedDate = computed(() => {\n if (props.modelValue) {\n return fDate(parseQDate(props.modelValue || '0000-00-00'));\n }\n return null;\n});\n\nconst date = ref(props.modelValue);\nwatch(() => props.modelValue, val => date.value = val);\n\nfunction onSave() {\n emit('update:model-value', date.value);\n}\n</script>\n","<template>\n <div>\n <div\n v-if=\"label\"\n class=\"font-bold text-xs mb-2\"\n >\n {{ label }}\n </div>\n <template v-if=\"inline\">\n <QDate\n v-model=\"dateRange\"\n range\n class=\"reactive\"\n @update:model-value=\"onSave\"\n />\n </template>\n <template v-else>\n <div class=\"flex items-center cursor-pointer\">\n <DateIcon class=\"w-5 text-blue-600\" />\n <div class=\"font-bold ml-3 hover:text-blue-600\">\n <template v-if=\"dateRangeValue\">\n {{ formattedDates.from }} - {{ formattedDates.to }}\n </template>\n <template v-else>\n - -\n </template>\n </div>\n </div>\n <QPopupProxy>\n <QDate\n v-model=\"dateRange\"\n range\n @update:model-value=\"onSave\"\n />\n </QPopupProxy>\n </template>\n </div>\n</template>\n\n<script setup>\nimport { CalendarIcon as DateIcon } from '@heroicons/vue/outline';\nimport { computed, ref, watch } from 'vue';\nimport { fDate, parseQDate, parseQDateTime } from '../../../../helpers';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: Object,\n default: null\n },\n label: {\n type: String,\n default: null\n },\n inline: Boolean,\n withTime: Boolean\n});\n\nconst formattedDates = computed(() => {\n if (dateRangeValue.value) {\n if (props.withTime) {\n return {\n from: fDate(parseQDateTime(dateRangeValue.value.from || '0000-00-00')),\n to: fDate(parseQDateTime(dateRangeValue.value.to || '9999-12-31'))\n };\n }\n\n return {\n from: fDate(parseQDate(dateRangeValue.value.from || '0000-00-00')),\n to: fDate(parseQDate(dateRangeValue.value.to || '9999-12-31'))\n };\n }\n return {\n from: null,\n to: null\n };\n});\n\nconst dateRange = ref(toQDateValue(props.modelValue));\nwatch(() => props.modelValue, val => dateRange.value = toQDateValue(val));\n\nfunction toQDateValue(val) {\n if (val?.from && val?.to) {\n return fDate(val.from) === fDate(val.to) ? val.from : val;\n }\n return null;\n}\n\nconst dateRangeValue = computed(() => {\n let range;\n\n if (typeof dateRange.value === 'string') {\n range = {\n from: dateRange.value,\n to: dateRange.value\n };\n } else if (dateRange.value) {\n range = {\n from: dateRange.value.from,\n to: dateRange.value.to\n };\n }\n\n if (range?.from && range?.to && props.withTime && !range.from.includes('00:00:00')) {\n range.from += ' 00:00:00';\n range.to += ' 23:59:59';\n }\n\n return range;\n});\n\nfunction onSave() {\n emit('update:model-value', dateRangeValue.value);\n}\n</script>\n","<template>\n <QPopupProxy\n :model-value=\"true\"\n cover\n transition-show=\"scale\"\n transition-hide=\"scale\"\n class=\"bg-transparent shadow-none flex items-stretch\"\n >\n <QDate v-model=\"dateTime\" :mask=\"mask\" :color=\"color\">\n <div class=\"flex items-center justify-center\">\n <div v-if=\"nullable\" class=\"flex-grow\">\n <QBtn label=\"Clear\" color=\"blue-600\" flat @click=\"dateTime = null\" />\n </div>\n <div>\n <QBtn\n label=\"Cancel\"\n color=\"blue-600\"\n flat\n @click=\"$emit('cancel')\"\n />\n <QBtn label=\"Set\" color=\"blue-600\" flat @click=\"$emit('save')\" />\n </div>\n </div>\n </QDate>\n <QTime v-model=\"dateTime\" :mask=\"mask\" :color=\"color\" class=\"ml-3\" />\n </QPopupProxy>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport { dbDateTime, localizedDateTime, remoteDateTime } from '../../../../helpers';\n\nconst emit = defineEmits(['update:modelValue', 'save', 'cancel', 'clear']);\nconst props = defineProps({\n modelValue: {\n type: String,\n default: null\n },\n mask: {\n type: String,\n default: 'YYYY-MM-DD HH:mm'\n },\n color: {\n type: String,\n default: 'blue-600'\n },\n nullable: Boolean\n});\n\nconst dateTime = computed({\n get: () => dbDateTime(localizedDateTime(props.modelValue)),\n set(value) {\n const newValue = value ? dbDateTime(remoteDateTime(value)) : null;\n\n if (newValue || props.nullable) {\n emit('update:modelValue', newValue);\n }\n }\n});\n</script>\n","<template>\n <div>\n <QInput\n :model-value=\"fLocalizedDateTime(modelValue)\"\n :color=\"color\"\n class=\"bg-white rounded overflow-hidden px-2 w-48\"\n dense\n readonly\n @click=\"isShowing = true\"\n >\n <template #append>\n <QIcon name=\"event\" class=\"cursor-pointer\">\n <QPopupProxy v-model=\"isShowing\">\n <DateTimePicker\n v-model=\"dateTime\"\n @cancel=\"isShowing = false\"\n @save=\"onSave\"\n />\n </QPopupProxy>\n </QIcon>\n </template>\n </QInput>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue';\nimport { fLocalizedDateTime } from '../../../../helpers';\nimport DateTimePicker from './DateTimePicker';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: String,\n required: true\n },\n color: {\n type: String,\n default: 'blue-600'\n }\n});\n\nconst isShowing = ref(false);\nconst dateTime = ref(props.modelValue);\n\nfunction onSave() {\n emit('update:model-value', dateTime.value);\n isShowing.value = false;\n}\n</script>\n","<template>\n <div\n contenteditable\n class=\"inline-block hover:bg-blue-light focus:bg-blue-light transition duration-300 outline-none\"\n @input=\"onInput\"\n >\n {{ text }}\n </div>\n</template>\n\n<script setup>\nimport { useDebounceFn } from \"@vueuse/core\";\nimport { ref } from \"vue\";\n\nconst emit = defineEmits([\"update:model-value\", \"change\"]);\nconst props = defineProps({\n modelValue: {\n type: String,\n required: true\n },\n debounceDelay: {\n type: Number,\n default: 500\n }\n});\n\nconst text = ref(props.modelValue);\n\nconst debouncedChange = useDebounceFn(() => {\n emit(\"update:model-value\", text.value);\n emit(\"change\", text.value);\n}, props.debounceDelay);\n\nfunction onInput(e) {\n text.value = e.target.innerText;\n debouncedChange();\n}\n\n</script>\n","<template>\n <QBtn v-bind=\"$props\" @click=\"$refs.fileUpload.click()\">\n <slot>\n <PlusIcon class=\"w-5 mr-2\" />\n {{ text }}\n </slot>\n\n <input\n ref=\"fileUpload\"\n data-testid=\"file-upload\"\n type=\"file\"\n :accept=\"geolocation ? 'image/*;capture=camera' : undefined\"\n :capture=\"geolocation ? 'environment' : undefined\"\n class=\"hidden\"\n multiple\n @change=\"onAttachFiles\"\n />\n </QBtn>\n</template>\n<script setup>\nimport { PlusIcon } from '@heroicons/vue/outline';\nimport { QBtn } from 'quasar';\nimport { ref } from 'vue';\nimport { FileUpload } from '../../../../helpers';\n\ndefineExpose({ upload });\nconst emit = defineEmits([\n 'uploading',\n 'file-progress',\n 'file-complete',\n 'complete'\n]);\nconst props = defineProps({\n ...QBtn.props,\n text: {\n type: String,\n default: 'Add File'\n },\n locationWaitMessage: {\n type: String,\n default: 'Waiting for location...'\n },\n geolocation: Boolean\n});\n\nconst fileUpload = ref(null);\n\nfunction upload() {\n fileUpload.value.click();\n}\n\n/**\n * Upload newly attached files and emit events for progress / completion\n *\n * @param files\n * @returns {Promise<void>}\n */\nasync function onAttachFiles({ target: { files } }) {\n emit('uploading', files);\n let fileUpload = new FileUpload(files)\n .onProgress(({ file, progress }) => {\n file.progress = progress;\n emit('file-progress', file);\n })\n .onComplete(({ file, uploadedFile }) => {\n emit('file-complete', { file, uploadedFile });\n })\n .onAllComplete(() => {\n emit('complete', fileUpload.files);\n });\n\n if (props.geolocation) {\n await fileUpload.resolveLocation(props.locationWaitMessage);\n }\n\n fileUpload.upload();\n}\n</script>\n","<template>\n <div class=\"inline-block\">\n <div\n class=\"cursor-pointer py-2 hover:bg-blue-light flex items-center justify-end\"\n >\n {{ fLocalizedDateTime(modelValue, { empty: 'Never' }) }}\n <EditIcon class=\"w-4 font-bold ml-2 text-gray-base\" />\n <QPopupEdit\n v-slot=\"scope\"\n :model-value=\"modelValue\"\n touch-position\n :offset=\"[0, 20]\"\n class=\"bg-blue-600 text-white !min-w-0\"\n >\n <DateTimePicker\n v-model=\"scope.value\"\n :nullable=\"nullable\"\n @save=\"onSave(scope)\"\n @cancel=\"scope.cancel\"\n />\n </QPopupEdit>\n </div>\n </div>\n</template>\n<script setup>\nimport { PencilIcon as EditIcon } from '@heroicons/vue/solid';\nimport { fLocalizedDateTime } from '../../../../helpers';\nimport DateTimePicker from './DateTimePicker';\n\nconst emit = defineEmits(['close', 'save', 'update:model-value']);\ndefineProps({\n modelValue: {\n type: String,\n default: null\n },\n nullable: Boolean\n});\n\nfunction onSave(scope) {\n emit('update:model-value', scope.value);\n emit('save', scope.value);\n scope.set();\n}\n</script>\n","<template>\n <QInput\n :model-value=\"numberVal\"\n :data-testid=\"'number-field-' + fieldOptions.id\"\n :placeholder=\"fieldOptions.placeholder\"\n outlined\n dense\n inputmode=\"numeric\"\n :input-class=\"{[inputClass]: true, 'text-right bg-white': !hidePrependLabel, 'text-right !text-xs text-black font-normal': hidePrependLabel}\"\n :class=\"{'no-prepend-icon w-32': hidePrependLabel, 'prepend-label': !hidePrependLabel}\"\n @update:model-value=\"onInput\"\n >\n <template #prepend>\n <FieldLabel\n :field=\"fieldOptions\"\n :show-name=\"showName\"\n />\n </template>\n </QInput>\n</template>\n\n<script setup>\nimport { useDebounceFn } from '@vueuse/core';\nimport { computed, nextTick, ref, watch } from 'vue';\nimport { fNumber } from '../../../../helpers';\nimport FieldLabel from './FieldLabel';\n\nconst emit = defineEmits(['update:model-value', 'update']);\nconst props = defineProps({\n modelValue: {\n type: [String, Number],\n default: ''\n },\n precision: {\n type: Number,\n default: 2\n },\n label: {\n type: String,\n default: undefined\n },\n field: {\n type: Object,\n default: null\n },\n inputClass: {\n type: String,\n default: ''\n },\n delay: {\n type: Number,\n default: 1000\n },\n hidePrependLabel: Boolean,\n currency: Boolean,\n showName: Boolean\n});\n\nconst numberVal = ref(format(props.modelValue));\nwatch(() => props.modelValue, () => numberVal.value = format(props.modelValue));\n\nconst fieldOptions = computed(() => props.field || { label: props.label || '', placeholder: '', id: '' });\n\nfunction format(number) {\n if (!number && number !== 0 && number !== '0') return number;\n\n const minimumFractionDigits = Math.min(props.precision, ('' + number).split('.')[1]?.length || 0);\n let options = {\n minimumFractionDigits\n };\n\n if (props.currency) {\n options = {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits\n };\n }\n return fNumber(number, options);\n}\n\nconst onUpdateDebounced = useDebounceFn((val) => emit('update', val), props.delay);\n\nfunction onInput(value) {\n let number = '';\n\n // Prevent invalid characters\n if (value.match(/[^\\d.,$]/)) {\n const oldVal = numberVal.value;\n // XXX: To get QInput to show only the value we want\n numberVal.value += ' ';\n return nextTick(() => numberVal.value = oldVal);\n }\n\n if (value !== '') {\n value = value.replace(/[^\\d.]/g, '');\n number = Number(value);\n numberVal.value = format(number);\n }\n\n number = number === '' ? undefined : number;\n emit('update:model-value', number);\n\n // Delay the change event, so we only see the value after the user has finished\n onUpdateDebounced(number);\n}\n</script>\n","<template>\n <div\n class=\"max-w-full relative overflow-auto\"\n :class=\"{'p-4 border rounded border-gray-medium': !readonly}\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n >\n <FieldLabel\n :field=\"field\"\n :show-name=\"showName\"\n class=\"text-sm font-semibold\"\n />\n <div\n v-if=\"!disable && !readonly\"\n class=\"text-sm my-2\"\n >\n <a\n class=\"text-blue-600\"\n @click=\"$refs.file.click()\"\n >Upload</a>\n <a\n v-if=\"uploadedFiles.length > 0\"\n class=\"ml-3 text-red-dark\"\n @click=\"onClear\"\n >Clear</a>\n <input\n ref=\"file\"\n class=\"hidden\"\n type=\"file\"\n multiple\n @change=\"onFilesSelected\"\n />\n </div>\n\n <div class=\"max-w-[50em] flex items-stretch justify-start\">\n <FilePreview\n v-for=\"file in uploadedFiles\"\n :key=\"'file-upload-' + file.id\"\n class=\"w-32 m-2 cursor-pointer bg-gray-200\"\n :class=\"{'border border-dashed border-blue-600': !uploadedFiles.length}\"\n :image=\"file\"\n :related-files=\"uploadedFiles\"\n downloadable\n :removable=\"!readonly && !disable\"\n @remove=\"onRemove(file)\"\n />\n <FilePreview\n v-if=\"!disable && !readonly\"\n class=\"w-32 m-2 cursor-pointer border border-dashed border-blue-600\"\n disabled\n @click=\"$refs.file.click()\"\n />\n <div\n v-if=\"readonly && uploadedFiles.length === 0\"\n class=\"p-1\"\n >\n --\n </div>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { onMounted } from 'vue';\nimport { useMultiFileUpload } from '../../../../helpers';\nimport { FilePreview } from '../../../Utility';\nimport FieldLabel from './FieldLabel';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: [Object, String],\n default: null\n },\n field: {\n type: Object,\n required: true\n },\n showName: Boolean,\n disable: Boolean,\n readonly: Boolean\n});\n\nconst { onComplete, onDrop, onFilesSelected, uploadedFiles, onClear, onRemove } = useMultiFileUpload();\nonMounted(() => {\n if (props.modelValue) {\n uploadedFiles.value = props.modelValue;\n }\n});\nonComplete(() => emit('update:model-value', uploadedFiles.value));\n</script>\n","<template>\n <div>\n <QSelect\n ref=\"selectField\"\n v-bind=\"$props\"\n :model-value=\"selectedValue\"\n outlined\n hide-dropdown-icon\n dense\n emit-value\n :use-input=\"filterable\"\n :hide-selected=\"filterable && isShowing && !$props.multiple\"\n :input-debounce=\"100\"\n :options=\"filteredOptions\"\n option-label=\"label\"\n option-value=\"value\"\n placeholder=\"\"\n :input-class=\"{'is-hidden': !isShowing, [inputClass]: true}\"\n class=\"max-w-full\"\n @filter=\"onFilter\"\n @clear=\"onClear\"\n @popup-show=\"onShow\"\n @popup-hide=\"onHide\"\n @update:model-value=\"onUpdate\"\n >\n <template #append>\n <DropDownIcon\n class=\"w-4 transition\"\n :class=\"isShowing ? 'rotate-180' : ''\"\n />\n </template>\n <template #selected>\n <div\n v-if=\"$props.multiple\"\n class=\"flex gap-y-1 overflow-hidden\"\n :class=\"{'flex-nowrap gap-y-0': chipLimit === 1, [selectionClass]: true}\"\n >\n <template v-if=\"chipOptions.length > 0\">\n <QChip\n v-for=\"chipOption in chipOptions\"\n :key=\"'selected-' + chipOption.label\"\n class=\"!mr-1\"\n >{{ chipOption.label }}\n </QChip>\n <QChip\n v-if=\"selectedOptions.length > chipOptions.length\"\n class=\"!mr-1\"\n >\n +{{ selectedOptions.length - chipOptions.length }}\n </QChip>\n </template>\n <template v-else>\n {{ placeholder }}\n </template>\n </div>\n <div\n v-else\n :class=\"selectionClass\"\n >{{ selectedLabel }}\n </div>\n </template>\n </QSelect>\n </div>\n</template>\n<script setup>\nimport { ChevronDownIcon as DropDownIcon } from '@heroicons/vue/outline';\nimport { QSelect } from 'quasar';\nimport { computed, isRef, nextTick, ref } from 'vue';\n\nconst emit = defineEmits(['update:model-value', 'search', 'update']);\nconst props = defineProps({\n ...QSelect.props,\n modelValue: {\n type: [Array, String, Number, Object],\n default: undefined\n },\n placeholder: {\n type: String,\n default: ''\n },\n selectionLabel: {\n type: String,\n default: null\n },\n chipLimit: {\n type: Number,\n default: 3\n },\n inputClass: {\n type: String,\n default: ''\n },\n selectionClass: {\n type: String,\n default: ''\n },\n options: {\n type: Array,\n default: () => []\n },\n filterable: Boolean,\n filterFn: {\n type: Function,\n default: null\n }\n});\n\nconst selectField = ref(null);\n\n// The filter applied to the dropdown list of options\nconst filter = ref(null);\n// Is showing the dropdown list\nconst isShowing = ref(false);\n\n/**\n * The options formatted so each has a label, value and selectionLabel\n * @type {ComputedRef<{selectionLabel: string, label: string, value: string|*}[]>}\n */\nconst computedOptions = computed(() => {\n let options = props.options;\n if (props.placeholder && !props.multiple && !props.filterable) {\n options = [{ label: props.placeholder, value: null }, ...props.options];\n }\n options = options.map((o) => {\n let opt = isRef(o) ? o.value : o;\n return {\n label: resolveLabel(opt),\n value: resolveValue(opt),\n selectionLabel: resolveSelectionLabel(opt)\n };\n });\n return options;\n});\n\nconst filteredOptions = computed(() => {\n if (filter.value && !props.filterFn) {\n return computedOptions.value.filter(o => o.label.toLocaleLowerCase().indexOf(filter.value.toLowerCase()) > -1);\n } else {\n return computedOptions.value;\n }\n});\n\n/**\n * The value selected. Basically a wrapper to better handle null values (see onUpdate function for more details)\n * @type {ComputedRef<unknown>}\n */\nconst selectedValue = computed(() => {\n if (props.multiple) {\n const arrVal = Array.isArray(props.modelValue) ? props.modelValue : [];\n return arrVal.map((v) => {\n return v === null ? '__null__' : v;\n }) || [];\n } else {\n return props.modelValue === null ? '__null__' : props.modelValue;\n }\n});\n\n/**\n * The selected options. The list of options from the computedOptions list that are selected as defined by the modelValue\n * @type {ComputedRef<*>}\n */\nconst selectedOptions = computed(() => {\n let values = selectedValue.value;\n if (!props.multiple) {\n values = (values || values === 0) ? [values] : [];\n }\n return computedOptions.value.filter((o) => {\n return values.includes(o.value) || values.map(v => typeof v === 'object' && v.id).includes(o.value?.id);\n });\n});\n\n/**\n * The label to display in the input field of the dropdown for a selected state, non-selected state or an active filtering state.\n * NOTE: Only applies to single select (not multiselect)\n * @type {ComputedRef<unknown>}\n */\nconst selectedLabel = computed(() => {\n if (props.filterable && isShowing.value) return '';\n\n if (!selectedOptions.value || selectedOptions.value.length === 0) {\n return props.placeholder || '(Select Option)';\n }\n return selectedOptions.value[0].selectionLabel;\n});\n\n/**\n * The options to display as chips (limited by chipLimit prop)\n * @type {ComputedRef<*>}\n */\nconst chipOptions = computed(() => {\n return selectedOptions.value.slice(0, props.chipLimit);\n});\n\n/**\n * Resolve the label of the option. This will display as the text in the dropdown list\n * @param option\n * @returns {*|string}\n */\nfunction resolveLabel(option) {\n if (typeof option === 'string') {\n return option;\n }\n if (typeof props.optionLabel === 'string') {\n return option[props.optionLabel];\n }\n if (typeof props.optionLabel === 'function') {\n return props.optionLabel(option);\n }\n return option?.label;\n}\n\n/**\n * Resolve the label to display in the input field of the dropdown when an option is selected\n * NOTE: Does not apply to multiselect, single select only\n * @param option\n * @returns {*|{default: null, type: String | StringConstructor}|string}\n */\nfunction resolveSelectionLabel(option) {\n if (typeof option === 'string') {\n return option;\n }\n if (typeof props.selectionLabel === 'string') {\n return option[props.selectionLabel];\n }\n if (typeof props.selectionLabel === 'function') {\n return props.selectionLabel(option);\n }\n return option?.selectionLabel || option?.label;\n}\n\n/**\n * Resolve the value of the option using either defaults or the provided optionValue prop\n * @param option\n * @returns {string|*|string}\n */\nfunction resolveValue(option) {\n if (typeof option === 'string') {\n return option;\n }\n let value = option.value;\n if (typeof props.optionValue === 'string') {\n value = option[props.optionValue];\n } else if (typeof props.optionValue === 'function') {\n value = props.optionValue(option);\n }\n // Note the __null__ special case here. See the onUpdate function for more details\n return value === null ? '__null__' : value;\n}\n\n/**\n * Handle the update event from the QSelect\n * NOTE: casts all null values as a special __null__ string as the null character is handled the same as undefined by QSelect.\n * SelectField differentiates between these 2 to provide a null value selected state vs undefined is no value selected.\n * @param value\n */\nfunction onUpdate(value) {\n if (Array.isArray(value)) {\n value = value.map((v) => v === '__null__' ? null : v);\n }\n\n value = value === '__null__' ? null : value;\n\n emit('update', value);\n emit('update:model-value', value);\n}\n\n/** XXX: This tells us when we should apply the filter. QSelect likes to trigger a new filter everytime you open the dropdown\n * But most of the time when you open the dropdown it is already filtered and annoying to try and clear the previous filter\n **/\nconst shouldFilter = ref(false);\n\n/**\n * Filter the options list. Do this asynchronously for the update so that the QSelect can update its internal state first, then update SelectField\n * @param val\n * @param update\n */\nasync function onFilter(val, update) {\n if (!props.filterFn) {\n filter.value = val;\n await nextTick(update);\n } else {\n update();\n if (shouldFilter.value === false) return;\n if (val !== null && val !== filter.value) {\n filter.value = val;\n if (props.filterFn) {\n await props.filterFn(val);\n }\n }\n }\n}\n\n/**\n * Clear the selected value using undefined. SelectField differentiates between null and undefined.\n * See the onUpdate function for more details\n */\nfunction onClear() {\n emit('update:model-value', undefined);\n emit('update', undefined);\n}\n\n/**\n * Handle behavior when showing the dropdown\n */\nfunction onShow() {\n isShowing.value = true;\n\n // XXX: See description on shouldFilter declaration. Only allow filtering after dropdown is ALREADY opened\n shouldFilter.value = false;\n nextTick(() => {\n shouldFilter.value = true;\n selectField.value.focus();\n });\n}\n\n/**\n * Handle behavior when hiding the dropdown\n */\nfunction onHide() {\n isShowing.value = false;\n shouldFilter.value = false;\n}\n</script>\n","<template>\n <div>\n <SelectField\n v-model=\"selectedFieldName\"\n :label=\"undefined\"\n :options=\"field.options\"\n class=\"mb-2\"\n @update:model-value=\"onChange\"\n />\n <TextField\n v-model=\"textInput\"\n :field=\"field\"\n :no-label=\"!field.label\"\n label-class=\"text-xs font-bold text-gray-dark\"\n parent-class=\"tight-label\"\n input-class=\"!py-0\"\n dense\n type=\"textarea\"\n :debounce=\"500\"\n @update:model-value=\"onChange\"\n />\n </div>\n</template>\n\n<script setup>\nimport { computed, ref, watch } from 'vue';\nimport SelectField from './SelectField';\nimport TextField from './TextField';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: [String, Number, Object],\n default: ''\n },\n field: {\n type: Object,\n default: null\n }\n});\n\nconst selectedFieldName = ref(props.field.defaultOption);\nconst searchList = computed(() => props.modelValue && props.modelValue[selectedFieldName.value]);\nconst textInput = ref(formatModelValue());\nfunction onChange() {\n textInput.value = textInput.value?.replace(/\\n/g, ',').replace(/,{2,}/g, ',') || '';\n emit('update:model-value', textInput.value ? { [selectedFieldName.value]: textInput.value.split(',') } : undefined);\n}\n\nfunction formatModelValue() {\n return Array.isArray(searchList.value) ? searchList.value?.join(',') : '';\n}\n\nwatch(() => props.modelValue, () => {\n textInput.value = formatModelValue();\n});\n</script>\n","<template>\n <LabeledInput\n type=\"password\"\n v-bind=\"props\"\n :rules=\"rules\"\n @update:model-value=\"$emit('update:model-value', $event)\"\n />\n</template>\n\n<script setup>\nimport LabeledInput from './LabeledInput';\n\ndefineEmits(['update:model-value']);\nconst props = defineProps({\n name: {\n type: String,\n default: 'password'\n },\n label: {\n type: String,\n default: 'Password'\n },\n placeholder: {\n type: String,\n default: 'Enter Password'\n },\n modelValue: {\n type: [String, Number],\n required: true\n },\n error: {\n type: String,\n default: null\n },\n disabled: Boolean\n});\n\nconst rules = [(val) => val.length >= 8 || 'Please use at least 8 characters'];\n</script>\n","<template>\n <div>\n <div\n v-if=\"label\"\n class=\"font-bold text-xs mb-2\"\n >\n {{ label }}\n </div>\n <div class=\"flex items-center flex-nowrap cursor-pointer\">\n <component\n :is=\"previewIcon\"\n class=\"w-5 text-blue-600\"\n />\n <div class=\"text-sm ml-3 hover:text-blue-600 whitespace-nowrap\">\n <template v-if=\"range\">\n {{ formatNum(range.from || 0) }} - {{ formatNum(range.to) }}\n </template>\n <template v-else>\n No Limit\n </template>\n </div>\n </div>\n <QPopupProxy>\n <NumberField\n v-model=\"range.from\"\n :field=\"minField\"\n @update:model-value=\"onSave\"\n />\n <NumberField\n v-model=\"range.to\"\n class=\"mt-2\"\n :field=\"maxField\"\n @update:model-value=\"onSave\"\n />\n </QPopupProxy>\n </div>\n</template>\n\n<script setup>\nimport { CurrencyDollarIcon as CurrencyIcon, HashtagIcon as NumberIcon } from '@heroicons/vue/outline';\nimport { useDebounceFn } from '@vueuse/core';\nimport { computed, ref, watch } from 'vue';\nimport { fCurrency, fNumber, fPercent } from '../../../../helpers';\nimport { PercentIcon } from '../../../../svg';\nimport NumberField from './NumberField';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: Object,\n default: null\n },\n label: {\n type: String,\n default: null\n },\n icon: {\n type: Object,\n default: null\n },\n currency: Boolean,\n percent: Boolean,\n debounce: {\n type: Number,\n default: 0\n }\n});\n\nconst symbol = computed(() => {\n if (props.currency) {\n return '$';\n } else if (props.percent) {\n return '%';\n } else {\n return '';\n }\n});\nconst minField = computed(() => {\n return {\n id: 'min-field',\n name: 'from',\n label: 'Min' + symbol.value,\n placeholder: '0'\n };\n});\n\nconst maxField = computed(() => {\n return {\n id: 'max-field',\n name: 'to',\n label: 'Max' + symbol.value,\n placeholder: 'No Limit'\n };\n});\n\nconst previewIcon = computed(() => props.icon || (props.currency ? CurrencyIcon : (props.percent ? PercentIcon : NumberIcon)));\n\nconst range = ref({});\nwatch(() => props.modelValue, setRange);\nfunction setRange(val) {\n const multiplier = props.percent ? 100 : 1;\n range.value = {\n from: (val?.from ? val.from * multiplier : undefined),\n to: (val?.to ? val.to * multiplier : undefined)\n };\n}\nsetRange(props.modelValue || { from: undefined, to: undefined });\n\n/**\n * Convert the number into a nicely formatted string\n * @param num\n * @returns {string}\n */\nfunction formatNum(num) {\n if (num === undefined) return 'No Limit';\n if (props.currency) {\n return fCurrency(num);\n }\n if (props.percent) {\n return fPercent(num, { multiplier: 1, maximumFractionDigits: 2 });\n }\n return fNumber(num);\n}\n\n/**\n * Update the modelValue only after the debounce timeout\n * Empty values are converted to undefined so they will not be filtered on\n * @type {(function(): void)|*}\n */\nconst onSave = useDebounceFn(() => {\n if (range.value && (range.value.from || range.value.to)) {\n const multiplier = props.percent ? .01 : 1;\n let newVal = {\n from: (range.value.from ? range.value.from * multiplier : undefined),\n to: (range.value.to ? range.value.to * multiplier : undefined)\n };\n emit('update:model-value', newVal);\n }\n}, props.debounce);\n</script>\n","<template>\n <div>\n <ContentDrawer\n v-model:show=\"showDrawer\"\n content-class=\"\"\n position=\"bottom\"\n :title=\"'Filter ' + label\"\n >\n <div\n v-for=\"option in formattedOptions\"\n :key=\"'select-drawer-' + option.value\"\n :data-dusk=\"'drawer-opt-' + option.value\"\n class=\"cursor-pointer hover:bg-gray-light px-8 py-3 flex items-center border-b border-gray-light\"\n @click=\"toggleSelect(option)\"\n >\n <QCheckbox\n :model-value=\"isSelected(option)\"\n class=\"mr-2\"\n />\n <slot\n name=\"option\"\n :opt=\"option\"\n >{{ option.label }}\n </slot>\n </div>\n </ContentDrawer>\n\n <QChip\n ref=\"select\"\n outline\n clickable\n size=\"16px\"\n @click=\"showDrawer = true\"\n >\n <slot name=\"selected\">\n <slot name=\"label\">{{ label }}: </slot>\n <template v-if=\"modelValue && modelValue.length > 0\">\n <slot name=\"selection\">\n <template v-if=\"multiple\">\n {{ getOptionLabel(modelValue[0]) }}\n <template\n v-if=\"modelValue.length > 1\"\n >+ {{ modelValue.length - 1 }}\n </template\n >\n </template>\n <template v-else>\n {{ getOptionLabel(modelValue) }}\n </template>\n </slot>\n </template>\n <template v-else>\n <slot name=\"placeholder\">{{ placeholder }}</slot>\n </template>\n </slot>\n </QChip>\n </div>\n</template>\n\n<script setup>\nimport { computed, ref } from 'vue';\nimport { ContentDrawer } from '../../../Utility';\n\nconst emit = defineEmits(['update:modelValue']);\nconst props = defineProps({\n modelValue: {\n type: [Object, String, Array, null],\n required: true\n },\n options: {\n type: Array,\n default: () => []\n },\n multiple: Boolean,\n label: {\n type: String,\n default: 'Select'\n },\n placeholder: {\n type: String,\n default: 'All'\n }\n});\n\nconst showDrawer = ref(false);\nconst formattedOptions = computed(() =>\n props.options.map((opt) =>\n typeof opt === 'string'\n ? {\n label: opt,\n value: opt\n }\n : opt\n )\n);\n\nfunction getOptionValue(option) {\n return option.value === undefined ? option : option.value;\n}\n\nfunction getOptionLabel(value) {\n return formattedOptions.value.find((opt) => opt.value === value).label;\n}\n\nfunction isSelected(option) {\n const optionValue = getOptionValue(option);\n\n if (props.multiple) {\n return props.modelValue.includes(optionValue);\n } else {\n return props.modelValue === optionValue;\n }\n}\n\nfunction toggleSelect(option) {\n let optionValue = getOptionValue(option);\n\n let selection = optionValue;\n\n if (props.multiple) {\n selection = [...props.modelValue];\n if (isSelected(optionValue)) {\n selection = selection.filter((opt) => opt !== optionValue);\n } else {\n selection.push(optionValue);\n }\n } else {\n // Allow deselection on single select\n if (selection === props.modelValue) {\n selection = null;\n }\n }\n\n emit('update:modelValue', selection);\n}\n</script>\n","<template>\n <div>\n <template v-if=\"!loading && !options.length\">\n <div class=\"text-gray-silver\">No options available</div>\n </template>\n <SelectField\n v-model=\"selectedOption\"\n :options=\"options\"\n :label=\"label\"\n :placeholder=\"placeholder\"\n :option-value=\"opt => opt\"\n :loading=\"loading\"\n @update:model-value=\"onSelectOption\"\n />\n <div v-if=\"selectedOption\">\n <QCheckbox\n v-for=\"child in selectedOption.children\"\n :key=\"child.id\"\n :model-value=\"selectedChildren.includes(child.id)\"\n :field=\"child\"\n class=\"mt-3\"\n @update:model-value=\"onSelectChild(child)\"\n >\n <div>{{ child.label }}</div>\n <div class=\"text-xs text-gray-silver\">{{ child.name }}</div>\n </QCheckbox>\n </div>\n </div>\n</template>\n<script setup>\nimport { ref, watch } from 'vue';\nimport { remove } from '../../../../helpers';\nimport SelectField from './SelectField';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: Array,\n default: () => ([])\n },\n label: {\n type: String,\n default: 'Selection'\n },\n placeholder: {\n type: String,\n default: 'Select an option'\n },\n options: {\n type: Array,\n default: () => []\n },\n loading: Boolean\n});\n\nfunction resolveSelectedOption() {\n if (props.modelValue?.length > 0) {\n return props.options.find((option) => option.children.find(child => props.modelValue.includes(child.id)));\n }\n\n return null;\n}\nconst selectedOption = ref(resolveSelectedOption());\nconst selectedChildren = ref(props.modelValue || []);\nfunction onSelectChild(child) {\n if (selectedChildren.value.includes(child.id)) {\n selectedChildren.value = remove(selectedChildren.value, child.id);\n } else {\n selectedChildren.value.push(child.id);\n }\n emit('update:model-value', selectedChildren.value.length > 0 ? selectedChildren.value : undefined);\n}\nfunction onSelectOption() {\n selectedChildren.value = [];\n emit('update:model-value', undefined);\n}\nwatch(() => props.modelValue, (value) => {\n selectedOption.value = resolveSelectedOption();\n selectedChildren.value = value || [];\n});\n</script>\n","<template>\n <div\n class=\"max-w-full relative overflow-auto\"\n :class=\"{'p-4 border rounded border-gray-medium text-center': !readonly}\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n >\n <FieldLabel\n :field=\"field\"\n :show-name=\"showName\"\n class=\"text-sm font-semibold\"\n />\n <div\n v-if=\"!disable && !readonly\"\n class=\"text-sm mt-2\"\n >\n <a\n class=\"text-blue-600\"\n @click=\"$refs.file.click()\"\n >Upload</a>\n <a\n v-if=\"uploadedFile\"\n class=\"ml-3 text-red-dark\"\n @click=\"onClear\"\n >Clear</a>\n <input\n ref=\"file\"\n class=\"hidden\"\n type=\"file\"\n @change=\"onFileSelected\"\n />\n </div>\n\n <FilePreview\n v-if=\"!readonly || uploadedFile\"\n class=\"w-32 cursor-pointer mt-2\"\n :class=\"{'border border-dashed border-blue-600': !uploadedFile, 'mx-auto': !readonly}\"\n :image=\"uploadedFile\"\n downloadable\n @click=\"!disable && $refs.file.click()\"\n />\n <div\n v-else-if=\"readonly\"\n class=\"py-1\"\n >--\n </div>\n </div>\n</template>\n\n<script setup>\nimport { onMounted } from 'vue';\nimport { useSingleFileUpload } from '../../../../helpers';\nimport { FilePreview } from '../../../Utility';\nimport FieldLabel from './FieldLabel';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: [Object, String],\n default: null\n },\n field: {\n type: Object,\n required: true\n },\n showName: Boolean,\n disable: Boolean,\n readonly: Boolean\n});\nconst { onComplete, onDrop, onFileSelected, uploadedFile, onClear } = useSingleFileUpload();\nonComplete(() => emit('update:model-value', uploadedFile.value));\n\nonMounted(() => {\n if (props.modelValue) {\n uploadedFile.value = props.modelValue;\n }\n});\n</script>\n","/**\n * Copyright (c) 2018-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nimport { watch } from 'vue';\nvar validEvents = [\n 'onActivate',\n 'onAddUndo',\n 'onBeforeAddUndo',\n 'onBeforeExecCommand',\n 'onBeforeGetContent',\n 'onBeforeRenderUI',\n 'onBeforeSetContent',\n 'onBeforePaste',\n 'onBlur',\n 'onChange',\n 'onClearUndos',\n 'onClick',\n 'onContextMenu',\n 'onCopy',\n 'onCut',\n 'onDblclick',\n 'onDeactivate',\n 'onDirty',\n 'onDrag',\n 'onDragDrop',\n 'onDragEnd',\n 'onDragGesture',\n 'onDragOver',\n 'onDrop',\n 'onExecCommand',\n 'onFocus',\n 'onFocusIn',\n 'onFocusOut',\n 'onGetContent',\n 'onHide',\n 'onInit',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onLoadContent',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onNodeChange',\n 'onObjectResizeStart',\n 'onObjectResized',\n 'onObjectSelected',\n 'onPaste',\n 'onPostProcess',\n 'onPostRender',\n 'onPreProcess',\n 'onProgressState',\n 'onRedo',\n 'onRemove',\n 'onReset',\n 'onSaveContent',\n 'onSelectionChange',\n 'onSetAttrib',\n 'onSetContent',\n 'onShow',\n 'onSubmit',\n 'onUndo',\n 'onVisualAid'\n];\nvar isValidKey = function (key) {\n return validEvents.map(function (event) { return event.toLowerCase(); }).indexOf(key.toLowerCase()) !== -1;\n};\nvar bindHandlers = function (initEvent, listeners, editor) {\n Object.keys(listeners)\n .filter(isValidKey)\n .forEach(function (key) {\n var handler = listeners[key];\n if (typeof handler === 'function') {\n if (key === 'onInit') {\n handler(initEvent, editor);\n }\n else {\n editor.on(key.substring(2), function (e) { return handler(e, editor); });\n }\n }\n });\n};\nvar bindModelHandlers = function (props, ctx, editor, modelValue) {\n var modelEvents = props.modelEvents ? props.modelEvents : null;\n var normalizedEvents = Array.isArray(modelEvents) ? modelEvents.join(' ') : modelEvents;\n watch(modelValue, function (val, prevVal) {\n if (editor && typeof val === 'string' && val !== prevVal && val !== editor.getContent({ format: props.outputFormat })) {\n editor.setContent(val);\n }\n });\n editor.on(normalizedEvents ? normalizedEvents : 'change input undo redo', function () {\n ctx.emit('update:modelValue', editor.getContent({ format: props.outputFormat }));\n });\n};\nvar initEditor = function (initEvent, props, ctx, editor, modelValue, content) {\n editor.setContent(content());\n if (ctx.attrs['onUpdate:modelValue']) {\n bindModelHandlers(props, ctx, editor, modelValue);\n }\n bindHandlers(initEvent, ctx.attrs, editor);\n};\nvar unique = 0;\nvar uuid = function (prefix) {\n var time = Date.now();\n var random = Math.floor(Math.random() * 1000000000);\n unique++;\n return prefix + '_' + random + unique + String(time);\n};\nvar isTextarea = function (element) {\n return element !== null && element.tagName.toLowerCase() === 'textarea';\n};\nvar normalizePluginArray = function (plugins) {\n if (typeof plugins === 'undefined' || plugins === '') {\n return [];\n }\n return Array.isArray(plugins) ? plugins : plugins.split(' ');\n};\nvar mergePlugins = function (initPlugins, inputPlugins) {\n return normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));\n};\nvar isNullOrUndefined = function (value) {\n return value === null || value === undefined;\n};\nexport { bindHandlers, bindModelHandlers, initEditor, isValidKey, uuid, isTextarea, mergePlugins, isNullOrUndefined };\n","/**\n * Copyright (c) 2018-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nimport { uuid } from './Utils';\nvar createState = function () { return ({\n listeners: [],\n scriptId: uuid('tiny-script'),\n scriptLoaded: false\n}); };\nvar CreateScriptLoader = function () {\n var state = createState();\n var injectScriptTag = function (scriptId, doc, url, callback) {\n var scriptTag = doc.createElement('script');\n scriptTag.referrerPolicy = 'origin';\n scriptTag.type = 'application/javascript';\n scriptTag.id = scriptId;\n scriptTag.src = url;\n var handler = function () {\n scriptTag.removeEventListener('load', handler);\n callback();\n };\n scriptTag.addEventListener('load', handler);\n if (doc.head) {\n doc.head.appendChild(scriptTag);\n }\n };\n var load = function (doc, url, callback) {\n if (state.scriptLoaded) {\n callback();\n }\n else {\n state.listeners.push(callback);\n if (!doc.getElementById(state.scriptId)) {\n injectScriptTag(state.scriptId, doc, url, function () {\n state.listeners.forEach(function (fn) { return fn(); });\n state.scriptLoaded = true;\n });\n }\n }\n };\n // Only to be used by tests.\n var reinitialize = function () {\n state = createState();\n };\n return {\n load: load,\n reinitialize: reinitialize\n };\n};\nvar ScriptLoader = CreateScriptLoader();\nexport { ScriptLoader };\n","/**\n * Copyright (c) 2018-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nvar getGlobal = function () { return (typeof window !== 'undefined' ? window : global); };\nvar getTinymce = function () {\n var global = getGlobal();\n return global && global.tinymce ? global.tinymce : null;\n};\nexport { getTinymce };\n","export var editorProps = {\n apiKey: String,\n cloudChannel: String,\n id: String,\n init: Object,\n initialValue: String,\n inline: Boolean,\n modelEvents: [String, Array],\n plugins: [String, Array],\n tagName: String,\n toolbar: [String, Array],\n modelValue: String,\n disabled: Boolean,\n tinymceScriptSrc: String,\n outputFormat: {\n type: String,\n validator: function (prop) { return prop === 'html' || prop === 'text'; }\n },\n};\n","/**\n * Copyright (c) 2018-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { ScriptLoader } from '../ScriptLoader';\nimport { getTinymce } from '../TinyMCE';\nimport { isTextarea, mergePlugins, uuid, isNullOrUndefined, initEditor } from '../Utils';\nimport { editorProps } from './EditorPropTypes';\nimport { h, defineComponent, onMounted, ref, toRefs, nextTick, watch, onBeforeUnmount, onActivated, onDeactivated } from 'vue';\nvar renderInline = function (ce, id, elementRef, tagName) {\n return ce(tagName ? tagName : 'div', {\n id: id,\n ref: elementRef\n });\n};\nvar renderIframe = function (ce, id, elementRef) {\n return ce('textarea', {\n id: id,\n visibility: 'hidden',\n ref: elementRef\n });\n};\nvar defaultInitValues = { selector: undefined, target: undefined };\nexport var Editor = defineComponent({\n props: editorProps,\n setup: function (props, ctx) {\n var conf = props.init ? __assign(__assign({}, props.init), defaultInitValues) : __assign({}, defaultInitValues);\n var _a = toRefs(props), disabled = _a.disabled, modelValue = _a.modelValue, tagName = _a.tagName;\n var element = ref(null);\n var vueEditor = null;\n var elementId = props.id || uuid('tiny-vue');\n var inlineEditor = (props.init && props.init.inline) || props.inline;\n var modelBind = !!ctx.attrs['onUpdate:modelValue'];\n var mounting = true;\n var initialValue = props.initialValue ? props.initialValue : '';\n var cache = '';\n var getContent = function (isMounting) { return modelBind ?\n function () { return ((modelValue === null || modelValue === void 0 ? void 0 : modelValue.value) ? modelValue.value : ''); } :\n function () { return isMounting ? initialValue : cache; }; };\n var initWrapper = function () {\n var content = getContent(mounting);\n var finalInit = __assign(__assign({}, conf), { readonly: props.disabled, target: element.value, plugins: mergePlugins(conf.plugins, props.plugins), toolbar: props.toolbar || (conf.toolbar), inline: inlineEditor, setup: function (editor) {\n vueEditor = editor;\n editor.on('init', function (e) { return initEditor(e, props, ctx, editor, modelValue, content); });\n if (typeof conf.setup === 'function') {\n conf.setup(editor);\n }\n } });\n if (isTextarea(element.value)) {\n element.value.style.visibility = '';\n }\n getTinymce().init(finalInit);\n mounting = false;\n };\n watch(disabled, function (disable) {\n var _a;\n if (vueEditor !== null) {\n if (typeof ((_a = vueEditor.mode) === null || _a === void 0 ? void 0 : _a.set) === 'function') {\n vueEditor.mode.set(disable ? 'readonly' : 'design');\n }\n else {\n vueEditor.setMode(disable ? 'readonly' : 'design');\n }\n }\n });\n watch(tagName, function (_) {\n var _a;\n if (!modelBind) {\n cache = vueEditor.getContent();\n }\n (_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);\n nextTick(function () { return initWrapper(); });\n });\n onMounted(function () {\n if (getTinymce() !== null) {\n initWrapper();\n }\n else if (element.value && element.value.ownerDocument) {\n var channel = props.cloudChannel ? props.cloudChannel : '6';\n var apiKey = props.apiKey ? props.apiKey : 'no-api-key';\n var scriptSrc = isNullOrUndefined(props.tinymceScriptSrc) ?\n \"https://cdn.tiny.cloud/1/\".concat(apiKey, \"/tinymce/\").concat(channel, \"/tinymce.min.js\") :\n props.tinymceScriptSrc;\n ScriptLoader.load(element.value.ownerDocument, scriptSrc, initWrapper);\n }\n });\n onBeforeUnmount(function () {\n if (getTinymce() !== null) {\n getTinymce().remove(vueEditor);\n }\n });\n if (!inlineEditor) {\n onActivated(function () {\n if (!mounting) {\n initWrapper();\n }\n });\n onDeactivated(function () {\n var _a;\n if (!modelBind) {\n cache = vueEditor.getContent();\n }\n (_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);\n });\n }\n var rerender = function (init) {\n var _a;\n cache = vueEditor.getContent();\n (_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);\n conf = __assign(__assign(__assign({}, conf), init), defaultInitValues);\n nextTick(function () { return initWrapper(); });\n };\n ctx.expose({\n rerender: rerender,\n getEditor: function () { return vueEditor; }\n });\n return function () { return inlineEditor ?\n renderInline(h, elementId, element, props.tagName) :\n renderIframe(h, elementId, element); };\n }\n});\n","export const apiKey = \"YOUR_API_KEY\";\n","<template>\n <div>\n <template v-if=\"field.type === 'multi-select'\">\n <SelectField\n v-if=\"field.options?.length > 0 || loading\"\n :model-value=\"modelValue\"\n :options=\"field.options\"\n multiple\n :loading=\"loading\"\n :chip-limit=\"1\"\n filterable\n :placeholder=\"field.placeholder\"\n :label=\"field.label\"\n @update:model-value=\"onUpdate\"\n />\n <div\n v-else\n class=\"mt-2\"\n >\n <div class=\"text-xs font-bold\">{{ field.label }}</div>\n <div class=\"text-sm ml-3 py-2\">No Available Options</div>\n </div>\n </template>\n\n <SelectField\n v-else-if=\"field.type === 'single-select'\"\n :model-value=\"modelValue\"\n :options=\"field.options\"\n :placeholder=\"field.placeholder\"\n :loading=\"loading\"\n :label=\"field.label\"\n @update:model-value=\"onUpdate\"\n />\n <DateField\n v-else-if=\"field.type === 'date'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n class=\"mt-2\"\n @update:model-value=\"onUpdate\"\n />\n <DateRangeField\n v-else-if=\"field.type === 'date-range'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n :inline=\"field.inline\"\n with-time\n class=\"mt-2 reactive\"\n @update:model-value=\"onUpdate\"\n />\n <NumberRangeField\n v-else-if=\"field.type === 'number-range'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n class=\"mt-2\"\n :debounce=\"1000\"\n @update:model-value=\"onUpdate\"\n />\n <NumberRangeField\n v-else-if=\"field.type === 'currency-range'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n class=\"mt-2\"\n :debounce=\"1000\"\n currency\n @update:model-value=\"onUpdate\"\n />\n <NumberRangeField\n v-else-if=\"field.type === 'percent-range'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n class=\"mt-2\"\n :debounce=\"1000\"\n percent\n @update:model-value=\"onUpdate\"\n />\n <BooleanField\n v-else-if=\"field.type === 'boolean'\"\n :field=\"field\"\n :model-value=\"modelValue\"\n class=\"mt-2\"\n label-class=\"text-xs font-bold\"\n @update:model-value=\"onUpdate\"\n />\n <MultiKeywordField\n v-else-if=\"field.type === 'multi-keywords'\"\n :model-value=\"modelValue\"\n :field=\"field\"\n @update:model-value=\"onUpdate\"\n />\n <SelectWithChildrenField\n v-else-if=\"field.type === 'select-with-children'\"\n :model-value=\"modelValue\"\n :options=\"field.options\"\n :loading=\"loading\"\n :label=\"field.label\"\n :placeholder=\"field.placeholder\"\n @update:model-value=\"onUpdate\"\n />\n <template v-else>\n Field "{{ field.name }}": Unknown filter type {{ field.type }}\n </template>\n </div>\n</template>\n<script setup>\nimport {\n BooleanField,\n DateField,\n DateRangeField,\n MultiKeywordField,\n NumberRangeField,\n SelectField,\n SelectWithChildrenField\n} from '../Form/Fields';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n field: {\n type: Object,\n required: true\n },\n modelValue: {\n type: [String, Array, Number, Object, Boolean],\n default: undefined\n },\n loading: Boolean\n});\n\nfunction onUpdate(val) {\n let newVal = val || undefined;\n\n switch (props.field.type) {\n case 'multi-select':\n newVal = val.length > 0 ? val : undefined;\n break;\n case 'single-select':\n case 'boolean':\n newVal = val === null ? undefined : val;\n break;\n }\n\n emit('update:model-value', newVal);\n}\n</script>\n","<template>\n <QList>\n <div class=\"px-4 py-2 max-w-full\">\n <template\n v-for=\"(group, index) in filterFields\"\n :key=\"'group-' + group.name\"\n >\n <template v-if=\"group.flat\">\n <FilterableField\n v-for=\"field in group.fields\"\n :key=\"'field-' + field.name\"\n :model-value=\"field.calcValue ? field.calcValue(filter) : filter[field.name]\"\n :field=\"field\"\n :loading=\"loading\"\n class=\"mb-4\"\n @update:model-value=\"updateFilter(field, $event)\"\n />\n </template>\n\n <FilterFieldItem\n v-else\n :name=\"group.name\"\n :count=\"activeCountByGroup[group.name]\"\n >\n <FilterableField\n v-for=\"field in group.fields\"\n :key=\"'field-' + field.name\"\n :model-value=\"field.calcValue ? field.calcValue(filter) : filter[field.name]\"\n :field=\"field\"\n :loading=\"loading\"\n class=\"mb-4\"\n @update:model-value=\"updateFilter(field, $event)\"\n />\n </FilterFieldItem>\n\n <QSeparator\n v-if=\"index < (filterFields.length - 1)\"\n class=\"my-2\"\n />\n </template>\n </div>\n </QList>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport FilterableField from './FilterableField';\nimport FilterFieldItem from './FilterFieldItem';\n\nconst emit = defineEmits(['update:filter']);\nconst props = defineProps({\n filterFields: {\n type: Array,\n required: true\n },\n filter: {\n type: Object,\n required: true\n },\n loading: Boolean\n});\n\nconst activeCountByGroup = computed(() => {\n const activeCountByGroup = {};\n for (const group of props.filterFields) {\n activeCountByGroup[group.name] = group.fields.filter(field => props.filter[field.name] !== undefined).length;\n }\n return activeCountByGroup;\n});\nfunction updateFilter(field, value) {\n let fieldFilter = { [field.name]: value };\n if (field.filterBy) {\n fieldFilter = field.filterBy(value);\n }\n emit('update:filter', { ...props.filter, ...fieldFilter });\n}\n</script>\n","<template>\n <div class=\"flex items-center transition-all\" :class=\"{'w-72': showFilters, 'w-[6.5rem]': !showFilters}\">\n <div class=\"flex-grow\">\n <QBtn\n class=\"btn-blue-highlight\"\n :class=\"{'highlighted': showFilters}\"\n @click=\"$emit('update:show-filters', !showFilters)\"\n >\n <FilterIcon class=\"w-5 mr-2\" />\n <QBadge\n :label=\"'' + activeCount\"\n rounded\n :color=\"activeCount > 0 ? 'blue-600' : 'gray-base'\"\n />\n </QBtn>\n </div>\n <a\n v-if=\"activeCount > 0\"\n class=\"text-blue-600 hover:text-blue-plus-1 text-sm ml-4\"\n @click=\"$emit('update:filter', {})\"\n >Clear All</a>\n </div>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport { FilterIcon } from '../../../svg';\n\ndefineEmits(['update:show-filters', 'update:filter']);\nconst props = defineProps({\n filter: {\n type: Object,\n required: true\n },\n showFilters: Boolean\n});\n\nconst activeCount = computed(() => Object.keys(props.filter).filter(key => props.filter[key] !== undefined).length);\n</script>\n","<template>\n <div class=\"rendered-form\">\n <div\n v-for=\"(field, index) in mappedFields\"\n :key=\"field.id\"\n :class=\"{ 'mt-4': index > 0 }\"\n >\n <Component\n :is=\"field.component\"\n v-model=\"fieldValues[field.name]\"\n :field=\"field\"\n :label=\"field.label || undefined\"\n :no-label=\"noLabel\"\n :show-name=\"showName\"\n :disable=\"disable\"\n :readonly=\"readonly\"\n @update:model-value=\"onInput(field.name, $event)\"\n />\n </div>\n </div>\n</template>\n<script setup>\nimport { reactive } from 'vue';\nimport {\n BooleanField,\n DateField,\n DateRangeField,\n IntegerField,\n MultiFileField,\n NumberField,\n SingleFileField,\n TextField,\n WysiwygField\n} from './Fields';\n\nconst emit = defineEmits(['update:values']);\nconst props = defineProps({\n values: {\n type: Object,\n default: null\n },\n fields: {\n type: Array,\n required: true\n },\n noLabel: Boolean,\n showName: Boolean,\n disable: Boolean,\n readonly: Boolean\n});\n\nconst FORM_FIELD_MAP = {\n BOOLEAN: BooleanField,\n DATE: DateField,\n DATE_RANGE: DateRangeField,\n INTEGER: IntegerField,\n NUMBER: NumberField,\n TEXT: TextField,\n SINGLE_FILE: SingleFileField,\n MULTI_FILE: MultiFileField,\n WYSIWYG: WysiwygField\n};\n\nconst mappedFields = props.fields.map((field) => ({\n placeholder: `Enter ${field.label}`,\n ...field,\n component: FORM_FIELD_MAP[field.type],\n default: field.type === 'BOOLEAN' ? false : ''\n}));\n\nconst fieldValues = reactive(props.values || {});\n\nfunction onInput(key, value) {\n emit('update:values', { ...fieldValues, [key]: value });\n}\n</script>\n","<template>\n <div class=\"flex flex-grow flex-col flex-nowrap overflow-hidden h-full bg-white\">\n <slot name=\"top\" />\n <slot name=\"toolbar\" />\n <div class=\"flex flex-nowrap flex-grow overflow-hidden w-full\">\n <slot name=\"filters\" />\n <slot />\n </div>\n </div>\n</template>\n","import { onMounted } from \"vue\";\nimport { getUrlParam } from \"../../helpers\";\n\nexport function registerStickyScrolling(tableRef) {\n onMounted(() => {\n const scrollEl = tableRef.value.$el.getElementsByClassName(\"q-table__middle\")[0];\n scrollEl.addEventListener(\"scroll\", onScroll);\n\n function onScroll({ target }) {\n // Add / remove scroll y class based on whether we're scrolling vertically\n if (target.scrollTop > 0) {\n scrollEl.classList.add(\"is-scrolling-y\");\n } else {\n scrollEl.classList.remove(\"is-scrolling-y\");\n }\n\n // Add / remove scroll x class based on whether we're scrolling horizontally\n if (target.scrollLeft > 0) {\n scrollEl.classList.add(\"is-scrolling-x\");\n } else {\n scrollEl.classList.remove(\"is-scrolling-x\");\n }\n }\n });\n}\n\nexport function mapSortBy(pagination, columns) {\n if (!pagination.sortBy) return null;\n\n const column = columns.find(c => c.name === pagination.sortBy);\n if (!column) return null;\n \n return [\n {\n column: column.sortBy || column.name,\n expression: column.sortByExpression || undefined,\n order: pagination.descending ? \"desc\" : \"asc\"\n }\n ];\n}\n\n/**\n * Returns the filter from the URL if it is set\n * @param url\n * @param allowedKeys\n */\nexport function getFilterFromUrl(url: string, allowedKeys = null) {\n const filter = {};\n const urlFilter = getUrlParam(\"filter\", url);\n if (urlFilter) {\n const fields = JSON.parse(urlFilter);\n Object.keys(fields).forEach((key) => {\n if (!allowedKeys || allowedKeys.includes(key)) {\n filter[key] = fields[key];\n }\n });\n }\n return filter;\n}\n","import { computed, ref, watch } from \"vue\";\nimport { getItem, setItem, waitForRef } from \"../../helpers\";\nimport { getFilterFromUrl } from \"./listHelpers\";\n\ninterface ListActionsOptions {\n listRoute: Function;\n summaryRoute?: Function;\n filterFieldOptionsRoute?: Function;\n moreRoute?: Function;\n itemDetailsRoute?: Function;\n urlPattern?: RegExp;\n filterDefaults?: Record<string, any>;\n refreshFilters?: boolean;\n}\n\nexport function useListControls(name: string, {\n listRoute,\n summaryRoute = null,\n filterFieldOptionsRoute = null,\n moreRoute = null,\n itemDetailsRoute = null,\n refreshFilters = false,\n urlPattern = null,\n filterDefaults = {}\n}: ListActionsOptions) {\n let isInitialized = false;\n const PAGE_SETTINGS_KEY = `${name}-pagination-settings`;\n const pagedItems = ref(null);\n const filter = ref({});\n const globalFilter = ref({});\n const showFilters = ref(getItem(`${name}-show-filters`, true));\n const selectedRows = ref([]);\n const isLoadingList = ref(false);\n const isLoadingSummary = ref(false);\n const summary = ref(null);\n\n const filterActiveCount = computed(() => Object.keys(filter.value).filter(key => filter.value[key] !== undefined).length);\n\n const PAGING_DEFAULT = {\n __sort: null,\n sortBy: null,\n descending: false,\n page: 1,\n rowsNumber: 0,\n rowsPerPage: 50\n };\n const quasarPagination = ref(PAGING_DEFAULT);\n\n const pager = computed(() => ({\n perPage: quasarPagination.value.rowsPerPage,\n page: quasarPagination.value.page,\n filter: { ...filter.value, ...globalFilter.value },\n sort: quasarPagination.value.__sort || undefined\n }));\n\n // When any part of the filter changes, get the new list of creatives\n watch(pager, () => {\n saveSettings();\n loadList();\n });\n watch(filter, () => {\n saveSettings();\n loadSummary();\n });\n watch(selectedRows, loadSummary);\n\n if (refreshFilters) {\n watch(filter, loadFilterFieldOptions);\n }\n\n async function loadList() {\n if (!isInitialized) return;\n isLoadingList.value = true;\n setPagedItems(await listRoute(pager.value));\n isLoadingList.value = false;\n }\n\n async function loadSummary() {\n if (!summaryRoute || !isInitialized) return;\n\n isLoadingSummary.value = true;\n const summaryFilter = { id: null, ...filter.value, ...globalFilter.value };\n if (selectedRows.value.length) {\n summaryFilter.id = selectedRows.value.map((row) => row.id);\n }\n summary.value = await summaryRoute(summaryFilter);\n isLoadingSummary.value = false;\n }\n\n // Filter fields are the field values available for the currently applied filter on Creative Groups\n // (ie: all states available under the current filter)\n const filterFieldOptions = ref({});\n const isLoadingFilters = ref(false);\n\n watch(() => showFilters.value, (show) => {\n setItem(`${name}-show-filters`, show);\n });\n\n async function loadFilterFieldOptions() {\n if (!filterFieldOptionsRoute || !isInitialized) return;\n isLoadingFilters.value = true;\n filterFieldOptions.value = await filterFieldOptionsRoute(filter.value);\n isLoadingFilters.value = false;\n }\n\n /**\n * Watches for a filter URL parameter and applies the filter if it is set.\n */\n function applyFilterFromUrl(url, filterFields = null) {\n if (url.match(urlPattern)) {\n // A flat list of valid filterable field names\n const validFilterKeys = filterFields?.value?.map(group => group.fields.map(field => field.name)).flat();\n\n const urlFilter = getFilterFromUrl(url, validFilterKeys);\n\n if (Object.keys(urlFilter).length > 0) {\n filter.value = urlFilter;\n\n // Override whatever is in local storage with this new filter\n updateSettings(\"filter\", filter.value);\n }\n }\n }\n\n // Set the reactive pager to map from the Laravel pagination to Quasar pagination\n // and automatically update the list of ads\n function setPagedItems(items) {\n if (Array.isArray(items)) {\n pagedItems.value = { data: items, meta: { total: items.length } };\n } else {\n pagedItems.value = items;\n if (items?.meta && items.meta.total !== quasarPagination.value.rowsNumber) {\n quasarPagination.value.rowsNumber = items.meta.total;\n }\n }\n }\n\n /**\n * Resets the filter and pagination settings to their defaults.\n */\n function resetPaging() {\n quasarPagination.value = PAGING_DEFAULT;\n }\n\n /**\n * Updates a row in the paged items list with the new item data. Uses the item's id to find the row.\n *\n * @param updatedItem\n */\n function setItemInPagedList(updatedItem) {\n const data = pagedItems.value?.data?.map(item => (item.id === updatedItem.id && (item.updated_at === null || item.updated_at <= updatedItem.updated_at)) ? updatedItem : item);\n pagedItems.value = { ...pagedItems.value, data };\n\n // Update the active item as well if it is set\n if (activeItem.value?.id === updatedItem.id) {\n activeItem.value = { ...activeItem.value, ...updatedItem };\n }\n }\n\n /**\n * Loads more items into the list.\n * @param index\n * @param perPage\n */\n async function loadMore(index, perPage = undefined) {\n const newItems = await moreRoute({\n page: index + 1,\n perPage,\n filter: { ...filter.value, ...globalFilter.value }\n });\n\n if (newItems && newItems.length > 0) {\n pagedItems.value.data = [...pagedItems.value.data, ...newItems];\n return true;\n }\n\n return false;\n }\n\n /**\n * Refreshes the list, summary, and filter field options.\n * @returns {Promise<Awaited<void>[]>}\n */\n async function refreshAll() {\n return Promise.all([loadList(), loadSummary(), loadFilterFieldOptions(), getActiveItemDetails()]);\n }\n\n /**\n * Updates the settings in local storage\n * @param key\n * @param value\n */\n function updateSettings(key, value) {\n const settings = getItem(PAGE_SETTINGS_KEY) || {};\n settings[key] = value;\n setItem(PAGE_SETTINGS_KEY, settings);\n }\n\n /**\n * Loads the filter and pagination settings from local storage.\n */\n function loadSettings() {\n // Only load settings when the class is fully initialized\n if (!isInitialized) return;\n\n const settings = getItem(PAGE_SETTINGS_KEY);\n\n // Load the filter settings from local storage\n if (settings) {\n filter.value = { ...settings.filter, ...filter.value };\n quasarPagination.value = settings.quasarPagination;\n } else {\n // If no local storage settings, apply the default filters\n filter.value = { ...filterDefaults, ...filter.value };\n }\n\n setTimeout(() => {\n if (!isLoadingList.value) {\n loadList();\n }\n\n if (!isLoadingSummary.value) {\n loadSummary();\n }\n\n if (!isLoadingFilters.value) {\n loadFilterFieldOptions();\n }\n }, 1);\n }\n\n /**\n * Saves the current filter and pagination settings to local storage.\n */\n async function saveSettings() {\n const settings = {\n filter: filter.value,\n quasarPagination: { ...quasarPagination.value, page: 1 }\n };\n // save in local storage\n setItem(PAGE_SETTINGS_KEY, settings);\n }\n\n // The active ad for viewing / editing\n const activeItem = ref(null);\n // Controls the active panel (ie: tab) if rendering a panels drawer or similar\n const activePanel = ref(null);\n\n /**\n * Gets the additional details for the currently active item.\n * (ie: data that is not normally loaded in the list because it is not needed for the list view)\n * @returns {Promise<void>}\n */\n async function getActiveItemDetails() {\n if (!activeItem.value || !itemDetailsRoute) return;\n\n const result = await itemDetailsRoute(activeItem.value);\n\n // Only set the ad details if we are the response for the currently loaded item\n // NOTE: race conditions might allow the finished loading item to be different to the currently\n // requested item\n if (result?.id === activeItem.value?.id) {\n activeItem.value = result;\n }\n }\n\n // Whenever the active item changes, fill the additional item details\n // (ie: tasks, verifications, creatives, etc.)\n if (itemDetailsRoute) {\n watch(() => activeItem.value, async (newItem, oldItem) => {\n if (newItem && oldItem?.id !== newItem.id) {\n await getActiveItemDetails();\n }\n });\n }\n\n /**\n * Opens the item's form with the given item and tab\n *\n * @param item\n * @param panel\n */\n function activatePanel(item, panel) {\n activeItem.value = item;\n activePanel.value = panel;\n }\n\n /**\n * Gets the next item in the list at the given offset (ie: 1 or -1) from the current position in the list of the\n * selected item. If the next item is on a previous or next page, it will load the page first then select the item\n * @param offset\n * @returns {Promise<void>}\n */\n async function getNextItem(offset) {\n const index = pagedItems.value?.data.findIndex(i => i.id === activeItem.value.id);\n if (index === undefined) return;\n let nextIndex = index + offset;\n\n // Load the previous page if the offset is before index 0\n if (nextIndex < 0) {\n if (quasarPagination.value.page > 1) {\n quasarPagination.value = { ...quasarPagination.value, page: quasarPagination.value.page - 1 };\n await waitForRef(isLoadingList, false);\n nextIndex = pagedItems.value.data.length - 1;\n } else {\n // There are no more previous pages\n return;\n }\n }\n\n // Load the next page if the offset is past the last index\n if (nextIndex >= pagedItems.value.data.length) {\n if (quasarPagination.value.page < pagedItems.value.meta.last_page) {\n quasarPagination.value = { ...quasarPagination.value, page: quasarPagination.value.page + 1 };\n await waitForRef(isLoadingList, false);\n nextIndex = 0;\n } else {\n // There are no more next pages\n return;\n }\n }\n\n activeItem.value = pagedItems.value.data[nextIndex];\n }\n\n // Initialize the list actions and load settings, lists, summaries, filter fields, etc.\n function initialize() {\n isInitialized = true;\n loadSettings();\n }\n\n return {\n // State\n pagedItems,\n filter,\n globalFilter,\n filterActiveCount,\n showFilters,\n summary,\n filterFieldOptions,\n selectedRows,\n isLoadingList,\n isLoadingFilters,\n isLoadingSummary,\n pager,\n quasarPagination,\n activeItem,\n activePanel,\n\n // Actions\n initialize,\n loadSummary,\n resetPaging,\n loadList,\n loadMore,\n refreshAll,\n getNextItem,\n activatePanel,\n applyFilterFromUrl,\n setItemInPagedList\n };\n}\n","import { computed, ref, watch } from \"vue\";\nimport { getItem, setItem } from \"../../helpers\";\n\nexport function useTableColumns(name, columns) {\n const COLUMN_ORDER_KEY = `${name}-column-order`;\n const VISIBLE_COLUMNS_KEY = `${name}-visible-columns`;\n const TITLE_COLUMNS_KEY = `${name}-title-columns`;\n\n // The list that defines the order the columns should appear in\n const columnOrder = ref(getItem(COLUMN_ORDER_KEY) || []);\n\n // Manages visible columns on the table\n const hiddenColumnNames = ref(getItem(VISIBLE_COLUMNS_KEY, []));\n\n // Title columns will have their name appear on the first column of the table as part of the records' title\n const titleColumnNames = ref(getItem(TITLE_COLUMNS_KEY, []));\n\n // Columns that should be locked to the left side of the table\n const lockedColumns = computed(() => orderedColumns.value.slice(0, 1));\n\n // The resolved list of columns in the order they should appear in\n const orderedColumns = computed(() => [...columns].sort((a, b) => {\n const aIndex = columnOrder.value.indexOf(a.name);\n const bIndex = columnOrder.value.indexOf(b.name);\n return aIndex === -1 ? 1 : bIndex === -1 ? -1 : aIndex - bIndex;\n }));\n\n // The ordered list of columns. The ordering of this list is editable and will be stored in localStorage\n const sortableColumns = computed({\n get() {\n return orderedColumns.value.slice(1);\n },\n set(newColumns) {\n columnOrder.value = [...lockedColumns.value.map(c => c.name), ...newColumns.map(c => c.name)];\n setItem(COLUMN_ORDER_KEY, columnOrder.value);\n }\n });\n\n // The list of columns that are visible. To edit the visible columns, edit the hiddenColumnNames list\n const visibleColumns = computed(() => orderedColumns.value.filter(c => !hiddenColumnNames.value.includes(c.name)));\n\n // The list of columns that should be included in the title of a row\n const orderedTitleColumns = computed(() => orderedColumns.value.filter(c => titleColumnNames.value.includes(c.name)));\n\n // Save changes to the list of hidden columns in localStorage\n watch(() => hiddenColumnNames.value, () => setItem(VISIBLE_COLUMNS_KEY, hiddenColumnNames.value));\n watch(() => titleColumnNames.value, () => setItem(TITLE_COLUMNS_KEY, titleColumnNames.value));\n\n return {\n sortableColumns,\n lockedColumns,\n visibleColumns,\n hiddenColumnNames,\n titleColumnNames,\n orderedTitleColumns\n };\n}\n","<template>\n <PopoverMenu\n class=\"px-2 flex action-button\"\n :items=\"activeActions\"\n :disabled=\"!hasTarget\"\n :tooltip=\"!hasTarget ? tooltip : null\"\n :loading=\"isSaving || loading\"\n :loading-component=\"loadingComponent\"\n @action-item=\"onAction\"\n />\n</template>\n<script setup>\nimport { computed, ref } from 'vue';\nimport { PopoverMenu } from '../Utility';\n\nconst props = defineProps({\n actions: {\n type: Array,\n required: true\n },\n target: {\n type: [Array, Object],\n default: () => []\n },\n tooltip: {\n type: String,\n default: 'First select records to perform a batch action'\n },\n loading: Boolean,\n loadingComponent: {\n type: [Function, Object],\n default: undefined\n }\n});\n\nconst hasTarget = computed(() => Array.isArray(props.target) ? props.target.length > 0 : !!props.target);\n\nconst activeActions = computed(() => props.actions.filter(action => {\n if (Array.isArray(props.target)) {\n return action.batchEnabled ? action.batchEnabled(props.target) : true;\n }\n\n return action.enabled ? action.enabled(props.target) : true;\n}));\n\nconst isSaving = ref(false);\nasync function onAction(action) {\n if (!action.trigger) {\n throw new Error('Action must have a trigger function! Make sure you are using useActions() or implement your own trigger function.');\n }\n isSaving.value = true;\n await action.trigger(props.target);\n isSaving.value = false;\n}\n</script>\n","<template>\n <QTd :key=\"rowProps.key\" :props=\"rowProps\" :style=\"columnStyle\">\n <div :style=\"columnStyle\">\n <div\n class=\"flex items-center flex-nowrap\"\n :class=\"columnClass\"\n >\n <div class=\"flex-grow\">\n <a\n v-if=\"column.onClick\"\n @click=\"column.onClick(row)\"\n >\n <RenderVnode v-if=\"column.vnode\" :vnode=\"column.vnode(row)\" />\n <slot v-else>{{ value }}</slot>\n </a>\n <div v-else>\n <RenderVnode v-if=\"column.vnode\" :vnode=\"column.vnode(row)\" />\n <slot v-else>{{ value }}</slot>\n </div>\n <TitleColumnFormat v-if=\"column.titleColumns\" :row=\"row\" :columns=\"column.titleColumns()\" />\n </div>\n <div v-if=\"column.actionMenu\" class=\"flex flex-shrink-0 pl-2\">\n <ActionMenu\n :actions=\"column.actionMenu\"\n :target=\"row\"\n :loading=\"isSaving\"\n />\n </div>\n </div>\n </div>\n </QTd>\n</template>\n<script setup>\nimport { QTd } from 'quasar';\nimport { computed } from 'vue';\nimport { RenderVnode } from '../Utility';\nimport ActionMenu from './ActionMenu';\nimport { TitleColumnFormat } from './Columns';\n\nconst props = defineProps({\n rowProps: {\n type: Object,\n required: true\n },\n settings: {\n type: Object,\n default: null\n }\n});\n\nconst row = computed(() => props.rowProps.row);\nconst column = computed(() => props.rowProps.col);\nconst value = computed(() => props.rowProps.value);\nconst isSaving = computed(() => column.value.isSaving && column.value.isSaving(row.value));\n\nconst columnStyle = computed(() => {\n const width = props.settings?.width || column.value.width;\n return width ? { width: `${width}px` } : null;\n});\n\nconst columnClass = computed(() => ({\n 'is-saving': isSaving.value,\n 'justify-end': column.value.align === 'right',\n 'justify-center': column.value.align === 'center',\n 'justify-start': column.value.align === 'left'\n}));\n</script>\n","<template>\n <QTr\n class=\"sticky-column-1 transition-all sticky-row\"\n :class=\"{'!bg-neutral-plus-7': !selectedCount, '!bg-blue-600 text-white selected': selectedCount, 'opacity-50': loading}\"\n >\n <QTd\n :colspan=\"stickyColspan\"\n class=\"font-bold transition-all\"\n :class=\"{'!bg-neutral-plus-7 !pl-5': !selectedCount, '!bg-blue-600 text-white !pl-4': selectedCount}\"\n >\n <div class=\"flex flex-nowrap items-center\">\n <div\n v-if=\"selectedCount\"\n class=\"flex items-center\"\n >\n <ClearIcon\n class=\"w-6 mr-3\"\n @click=\"$emit('clear')\"\n />\n {{ fNumber(selectedCount) }} {{ selectedLabel }}\n </div>\n <div v-else-if=\"itemCount\">\n {{ fNumber(itemCount) }} {{ label }}\n </div>\n <QSpinner\n v-if=\"loading\"\n class=\"ml-3\"\n size=\"18\"\n />\n </div>\n </QTd>\n <QTd\n v-for=\"column in summaryColumns\"\n :key=\"column.name\"\n :align=\"column.align || 'left'\"\n >\n <template v-if=\"summary\">\n {{ formatValue(column) }}\n </template>\n </QTd>\n </QTr>\n</template>\n<script setup>\nimport { XCircleIcon as ClearIcon } from '@heroicons/vue/solid';\nimport { QSpinner, QTd, QTr } from 'quasar';\nimport { computed } from 'vue';\nimport { fNumber } from '../../helpers';\n\ndefineEmits(['clear']);\nconst props = defineProps({\n loading: Boolean,\n label: {\n type: String,\n default: 'Rows'\n },\n selectedLabel: {\n type: String,\n default: 'Selected'\n },\n selectedCount: {\n type: Number,\n default: 0\n },\n itemCount: {\n type: Number,\n default: 0\n },\n summary: {\n type: Object,\n default: null\n },\n columns: {\n type: Array,\n required: true\n },\n stickyColspan: {\n type: Number,\n default: 2\n }\n});\n\nconst summaryColumns = computed(() => {\n // The sticky columns are where we display the selection count and should not be included in the summary columns\n return props.columns.slice(props.stickyColspan - 1);\n});\n\nfunction formatValue(column) {\n const value = props.summary[column.name];\n if (value === undefined) return '';\n\n if (column.format) {\n return column.format(value);\n }\n return value;\n}\n</script>\n","<template>\n <div class=\"overflow-hidden w-full\">\n <ActionVnode />\n <QTable\n ref=\"actionTable\"\n :selected=\"selectedRows\"\n :pagination=\"quasarPagination\"\n :columns=\"columns\"\n :loading=\"isLoadingList\"\n :rows=\"pagedItems?.data || []\"\n binary-state-sort\n selection=\"multiple\"\n :rows-per-page-options=\"rowsPerPageOptions\"\n class=\"sticky-column sticky-header w-full h-full !border-0\"\n color=\"blue-600\"\n @update:selected=\"$emit('update:selected-rows', $event)\"\n @update:pagination=\"() => {}\"\n @request=\"$emit('update:quasar-pagination', {...$event.pagination, __sort: mapSortBy($event.pagination, columns)})\"\n >\n <template #no-data>\n <slot name=\"empty\">\n <EmptyTableState :text=\"`There are no ${label.toLowerCase()} matching the applied filter`\" />\n </slot>\n </template>\n <template #top-row>\n <TableSummaryRow\n :label=\"label\"\n :item-count=\"summary?.count || 0\"\n :selected-count=\"selectedRows.length\"\n :loading=\"isLoadingSummary\"\n :summary=\"summary\"\n :columns=\"columns\"\n @clear=\"$emit('update:selected-rows', [])\"\n />\n </template>\n <template #header-cell=\"rowProps\">\n <QTh\n :key=\"rowProps.key\"\n :props=\"rowProps\"\n :data-drop-zone=\"`resize-column-` + rowProps.col.name\"\n >\n {{ rowProps.col.label }}\n <HandleDraggable\n v-if=\"rowProps.col.resizeable\"\n :drop-zone=\"`resize-column-` + rowProps.col.name\"\n class=\"resize-handle\"\n @resize=\"onResizeColumn(rowProps.col, $event)\"\n >\n <RowResizeIcon class=\"w-4 text-neutral-base\" />\n </HandleDraggable>\n </QTh>\n </template>\n <template #body-cell=\"rowProps\">\n <ActionTableColumn\n :key=\"rowProps.key\"\n :row-props=\"rowProps\"\n :settings=\"columnSettings[rowProps.col.name]\"\n >\n <slot :column-name=\"rowProps.col.name\" :row=\"rowProps.row\" :value=\"rowProps.value\" />\n </ActionTableColumn>\n </template>\n </QTable>\n </div>\n</template>\n\n<script setup>\nimport { QTable, QTh } from 'quasar';\nimport { ref } from 'vue';\nimport { getItem, setItem } from '../../helpers';\nimport { DragHandleIcon as RowResizeIcon } from '../../svg';\nimport { HandleDraggable } from '../DragAndDrop';\nimport { ActionVnode } from '../Utility';\nimport ActionTableColumn from './ActionTableColumn.vue';\nimport EmptyTableState from './EmptyTableState.vue';\nimport { mapSortBy, registerStickyScrolling } from './listHelpers';\nimport TableSummaryRow from './TableSummaryRow.vue';\n\ndefineEmits(['update:quasar-pagination', 'update:selected-rows']);\nconst props = defineProps({\n name: {\n type: String,\n required: true\n },\n label: {\n type: String,\n required: true\n },\n selectedRows: {\n type: Array,\n required: true\n },\n quasarPagination: {\n type: Object,\n required: true\n },\n isLoadingList: Boolean,\n pagedItems: {\n type: Object,\n default: null\n },\n isLoadingSummary: Boolean,\n summary: {\n type: Object,\n default: null\n },\n columns: {\n type: Array,\n required: true\n },\n rowsPerPageOptions: {\n type: Array,\n default: () => [10, 25, 50, 100]\n }\n});\nconst actionTable = ref(null);\nregisterStickyScrolling(actionTable);\n\nconst COLUMN_SETTINGS_KEY = `column-settings-${props.name}`;\nconst columnSettings = ref(getItem(COLUMN_SETTINGS_KEY) || {});\nfunction onResizeColumn(column, val) {\n columnSettings.value = {\n ...columnSettings.value,\n [column.name]: {\n width: Math.max(Math.min(val.distance + val.startDropZoneSize, column.maxWidth || 500), column.minWidth || 80)\n }\n };\n setItem(COLUMN_SETTINGS_KEY, columnSettings.value);\n}\n</script>\n\n<style lang=\"scss\" scoped>\n[data-drop-zone] {\n .resize-handle {\n position: absolute;\n top: 0;\n right: -.45em;\n width: .9em;\n opacity: 0;\n transition: all .3s;\n }\n\n &:hover {\n .resize-handle {\n opacity: 1;\n }\n }\n}\n</style>\n","<template>\n <div class=\"flex space-x-2\">\n <template v-if=\"type === 'SINGLE_FILE'\">\n <FilePreview\n :image=\"value\"\n class=\"w-24\"\n />\n </template>\n <template v-else-if=\"type === 'MULTI_FILE'\">\n <FilePreview\n v-for=\"file in value\"\n :key=\"'file-' + file.id\"\n :image=\"file\"\n class=\"w-24 mb-2\"\n />\n </template>\n <template v-else-if=\"type === 'WYSIWYG'\">\n <div v-html=\"value\" />\n </template>\n <template v-else>\n {{ format(value) }}\n </template>\n </div>\n</template>\n<script setup>\nimport { fCurrency, fDate, fLocalizedDateTime, fNumber } from '../../helpers';\nimport { FilePreview } from '../Utility';\n\nconst props = defineProps({\n type: {\n type: String,\n required: true\n },\n value: {\n type: [Number, String, Array, Object, Boolean],\n default: null\n }\n});\n\nfunction format(value) {\n if (value === null || value === '' || value === undefined) {\n return '';\n }\n\n switch (props.type) {\n case 'NUMBER':\n return fNumber(value);\n case 'CURRENCY':\n return fCurrency(value);\n case 'DATE':\n return fDate(value);\n case 'DATETIME':\n return fLocalizedDateTime(value);\n case 'BOOLEAN':\n return value ? 'Yes' : 'No';\n }\n\n return value;\n}\n</script>\n","<template>\n <div class=\"text-gray-shadow flex items-stretch flex-nowrap p-4\">\n <div class=\"flex-grow text-sm w-3/5 overflow-auto\">\n <h5>{{ change.label }} ({{ change.name }})</h5>\n <div class=\"flex flex-nowrap items-center mt-4\">\n <div class=\"bg-red-light line-through p-2\">\n <AuditHistoryItemValue\n :type=\"change.type\"\n :value=\"change.oldValue\"\n />\n </div>\n <div class=\"bg-green-plus-4 ml-2.5 p-2\">\n <AuditHistoryItemValue\n :type=\"change.type\"\n :value=\"change.newValue\"\n />\n </div>\n </div>\n </div>\n <div class=\"ml-4 text-sm w-2/5\">\n <template v-if=\"item.user\">\n <div>{{ item.user.name }}</div>\n <div>{{ item.user.email }}</div>\n </template>\n <div>{{ item.account }}</div>\n <div>\n <a v-if=\"item.audit_request_id\" :href=\"novaUrl\" target=\"_blank\">{{ fLocalizedDateTime(item.timestamp) }}</a>\n <template v-else>{{ fLocalizedDateTime(item.timestamp) }}</template>\n </div>\n </div>\n </div>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport { fLocalizedDateTime } from '../../helpers';\nimport AuditHistoryItemValue from './AuditHistoryItemValue';\n\nconst props = defineProps({\n item: {\n type: Object,\n required: true\n },\n change: {\n type: Object,\n required: true\n },\n novaUrl: {\n type: String,\n default: '/nova'\n }\n});\n\nconst novaUrl = computed(() => props.novaUrl + `/resources/audit-requests/${props.item.audit_request_id}`);\n</script>\n","<template>\n <ContentDrawer\n position=\"right\"\n :show=\"true\"\n overlay\n content-class=\"h-full\"\n title=\"\"\n @update:show=\"$emit('close')\"\n >\n <div class=\"flex flex-col flex-nowrap h-full\">\n <div class=\"flex items-center px-6 py-4 border-b\">\n <div class=\"flex-grow\">\n <slot name=\"header\" />\n </div>\n\n <div>\n <QBtn @click=\"$emit('close')\">\n <CloseIcon class=\"w-4\" />\n </QBtn>\n </div>\n </div>\n <div class=\"flex-grow overflow-hidden h-full\">\n <div class=\"flex items-stretch flex-nowrap h-full\">\n <div class=\"border-r w-[13.5em] overflow-y-auto\">\n <PanelsDrawerTabs\n v-model=\"activePanel\"\n :panels=\"panels\"\n @update:model-value=\"$emit('update:model-value', $event)\"\n />\n </div>\n <PanelsDrawerPanels :panels=\"panels\" :active-panel=\"activePanel\" :class=\"panelsClass\" />\n <div v-if=\"$slots['right-sidebar']\" class=\"border-l overflow-y-auto\">\n <slot name=\"right-sidebar\" />\n </div>\n </div>\n </div>\n </div>\n </ContentDrawer>\n</template>\n<script setup>\nimport { ref, watch } from 'vue';\nimport { XIcon as CloseIcon } from '../../svg';\nimport { ContentDrawer } from '../Utility';\nimport PanelsDrawerPanels from './PanelsDrawerPanels';\nimport PanelsDrawerTabs from './PanelsDrawerTabs';\n\ndefineEmits(['update:model-value', 'close']);\nconst props = defineProps({\n modelValue: {\n type: String,\n default: null\n },\n panelsClass: {\n type: [Object, String],\n default: 'w-[35.5rem]'\n },\n panels: {\n type: Array,\n required: true\n }\n});\n\nconst activePanel = ref(props.modelValue);\nwatch(() => props.modelValue, (value) => activePanel.value = value);\n</script>\n","export * from './config';\nexport * from './helpers';\nexport * from './components';\nexport * from './svg';\n\nimport packageJson from '../package.json';\n\nconst { version } = packageJson;\n\nfunction install(app) {\n console.log(`Installing Danx UI ${version}... Nothing to do really.`);\n}\n\nexport {\n version,\n install\n};\n"],"names":["danxOptions","configure","options","replace","array","item","newItem","index","newArray","remove","uniqueBy","cb","a","self","b","tryOnScopeDispose","fn","getCurrentScope","onScopeDispose","toValue","r","unref","isClient","noop","createFilterWrapper","filter","wrapper","args","resolve","reject","debounceFilter","ms","timer","maxTimer","lastRejector","_clearTimeout","timer2","invoke","duration","maxDuration","useDebounceFn","defaultNavigator","useMounted","isMounted","ref","instance","getCurrentInstance","onMounted","useSupported","callback","computed","useGeolocation","enableHighAccuracy","maximumAge","timeout","navigator","immediate","isSupported","locatedAt","error","shallowRef","coords","updatePosition","position","watcher","resume","err","pause","sleep","delay","waitForRef","value","watch","newValue","minmax","min","max","metersToMiles","meters","milesToMeters","miles","parseCoords","location","latLong","lat","lng","isLoaded","hasAlreadyWaited","geolocationError","hasLocation","geolocation","useCompatibility","requestLocation","isLocationSupported","isCompatible","maxWait","waitTime","LuxonError","InvalidDateTimeError","reason","InvalidIntervalError","InvalidDurationError","ConflictingSpecificationError","InvalidUnitError","unit","InvalidArgumentError","ZoneIsAbstractError","n","s","l","DATE_SHORT","DATE_MED","DATE_MED_WITH_WEEKDAY","DATE_FULL","DATE_HUGE","TIME_SIMPLE","TIME_WITH_SECONDS","TIME_WITH_SHORT_OFFSET","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","ts","opts","format","otherZone","singleton","SystemZone","locale","parseZoneInfo","formatOffset","dtfCache","makeDTF","zone","typeToPos","hackyOffset","dtf","date","formatted","parsed","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","filled","type","pos","isUndefined","ianaZoneCache","IANAZone","name","year","month","day","adOrBc","hour","minute","second","asUTC","objToLocalTS","asTS","over","intlLFCache","getCachedLF","locString","key","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","intlRelCache","getCachedRTF","base","cacheKeyOpts","sysLocaleCache","systemLocale","weekInfoCache","getCachedWeekInfo","data","parseLocaleString","localeStr","xIndex","uIndex","selectedStr","smaller","numberingSystem","calendar","intlConfigString","outputCalendar","mapMonths","f","i","dt","DateTime","mapWeekdays","listStuff","loc","length","englishFn","intlFn","mode","supportsFastNumbers","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","intlOpts","fixed","roundTo","padStart","PolyDateFormatter","z","gmtOffset","offsetZ","parts","part","offsetName","PolyRelFormatter","isEnglish","hasRelative","count","English.formatRelativeTime","fallbackWeekSettings","Locale","weekSettings","defaultToEN","specifiedLocale","Settings","localeR","numberingSystemR","outputCalendarR","weekSettingsR","validateWeekSettings","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","isActuallyEn","hasNoWeirdness","alts","English.months","formatStr","English.weekdays","English.meridiems","English.eras","field","df","results","matching","m","hasLocaleWeekInfo","other","FixedOffsetZone","offset","signedOffset","InvalidZone","zoneName","normalizeZone","input","defaultZone","isString","lowered","isNumber","now","defaultLocale","defaultNumberingSystem","defaultOutputCalendar","twoDigitCutoffYear","throwOnInvalid","defaultWeekSettings","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","js","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekday","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","usesLocalWeekValues","obj","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","millisecond","validHour","validMinute","validSecond","validMillisecond","o","isDate","maybeArray","thing","bestBy","arr","by","compare","best","next","pair","pick","keys","k","hasOwnProperty","prop","settings","v","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseMillis","fraction","number","digits","towardZero","factor","modMonth","modYear","firstWeekOffset","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","timeZone","modified","offHourStr","offMinuteStr","offHour","offMin","offMinSigned","asNumber","numericValue","normalizeObject","normalizer","normalized","u","hours","minutes","sign","monthsLong","monthsShort","monthsNarrow","months","weekdaysLong","weekdaysShort","weekdaysNarrow","weekdays","meridiems","erasLong","erasShort","erasNarrow","eras","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","numeric","narrow","units","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","token","macroTokenToFormatOpts","Formats.DATE_SHORT","Formats.DATE_MED","Formats.DATE_FULL","Formats.DATE_HUGE","Formats.TIME_SIMPLE","Formats.TIME_WITH_SECONDS","Formats.TIME_WITH_SHORT_OFFSET","Formats.TIME_WITH_LONG_OFFSET","Formats.TIME_24_SIMPLE","Formats.TIME_24_WITH_SECONDS","Formats.TIME_24_WITH_SHORT_OFFSET","Formats.TIME_24_WITH_LONG_OFFSET","Formats.DATETIME_SHORT","Formats.DATETIME_MED","Formats.DATETIME_FULL","Formats.DATETIME_HUGE","Formats.DATETIME_SHORT_WITH_SECONDS","Formats.DATETIME_MED_WITH_SECONDS","Formats.DATETIME_FULL_WITH_SECONDS","Formats.DATETIME_HUGE_WITH_SECONDS","Formatter","fmt","current","currentFull","bracketed","c","formatOpts","interval","p","knownEnglish","useDateTimeFormatter","extract","meridiem","English.meridiemForDateTime","standalone","English.monthForDateTime","English.weekdayForDateTime","maybeMacro","era","English.eraForDateTime","dur","tokenToField","lildur","mapped","tokens","realTokens","found","literal","val","collapsed","ianaRegex","combineRegexes","regexes","full","combineExtractors","extractors","mergedVals","mergedZone","cursor","ex","parse","patterns","regex","extractor","simpleParse","match","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","extractISOTime","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","num","force","obsOffsets","fromStrings","weekdayStr","result","English.monthsShort","English.weekdaysLong","English.weekdaysShort","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","clone","clear","conf","Duration","durationToMillis","matrix","vals","sum","normalizeValues","previous","previousVal","conv","rollUp","removeZeroes","newVals","config","accurate","durationLike","text","invalid","fmtOpts","millis","values","mixed","conversionAccuracy","built","accumulated","lastUnit","own","ak","negated","eq","v1","v2","validateStartEnd","start","end","Interval","builtStart","friendlyDateTime","builtEnd","validateError","e","startIsValid","endIsValid","dateTime","dateTimes","sorted","added","idx","numberOfParts","intervals","final","sofar","currentCount","ends","flattened","dateFormat","separator","mapFn","Info","proto","locObj","dayDiff","earlier","later","utcDayStart","highOrderDiffs","differs","days","lowestOrder","highWater","differ","diff","remainingMillis","lowerOrderUnits","numberingSystems","numberingSystemsUTF16","hanidecChars","parseDigits","str","code","digitRegex","append","MISSING_FTP","intUnit","post","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","partTypeStyleToTokenVal","tokenForPart","resolvedOpts","isSpace","style","actualType","buildRegex","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","explainFromTokens","disqualifyingUnit","regexString","rawMatches","parseFromTokens","invalidReason","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","inst","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","objToTS","adjustTime","oPre","millisToAdd","parseDataToDateTime","parsedZone","setZone","interpretationZone","toTechFormat","allowZ","toISODate","extended","longFormat","toISOTime","suppressSeconds","suppressMilliseconds","includeOffset","extendedZone","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","normalizeUnit","normalizeUnitWithLocalWeeks","quickDT","tsNow","offsetProvis","diffRelative","round","lastOpts","argList","ot","zoneToUse","milliseconds","seconds","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","higherOrderInvalid","gregorian","tsFinal","offsetFinal","localeToUse","localeOpts","tokenList","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","keepLocalTime","keepCalendarTime","newTS","offsetGuess","asObj","settingWeekStuff","useLocaleWeeks","normalizedUnit","q","ext","includePrefix","includeZone","includeOffsetSpace","otherDateTime","durOpts","otherIsLater","diffed","inputMs","adjustedToZone","padding","Formats.DATE_MED_WITH_WEEKDAY","Formats.DATETIME_MED_WITH_WEEKDAY","dateTimeish","SERVER_TZ","localizedDateTime","dateTimeString","remoteDateTime","parseDateTime","parseQDate","parseQDateTime","fQDate","fDate","fLocalizedDateTime","fDateTime","empty","dbDateTime","fSecondsToTime","time","fCurrency","amount","fNumber","centerTruncate","maxLength","frontCharCount","backCharCount","fPercent","fPhone","phone","shift","diffInDays","date1","date2","download","strFileName","strMimeType","defaultMime","mimeType","payload","url","anchor","toString","myBlob","fileName","blob","reader","ajax","dataUrlToBlob","saver","strUrl","decoder","binData","mx","uiArr","winMode","downloadFile","filename","postParams","fetchOptions","response","errorMessage","jsonResponse","downloadFileResponse","contentDisposition","getResponseHeader","contentType","header","defaultValue","DataView$1","buffer","bufferTypeIsUnsupported","littleEndian","getDataView","byteOffset","byteLength","DataViewWrapper","getStringFromDataView","dataView","chars","getStringValueFromArray","getNullTerminatedStringFromDataView","char","getUnicodeStringFromDataView","getPascalStringFromDataView","size","charArray","charCode","objectAssign","property","deferInit","object","initializer","initialized","getBase64Image","image","byte","dataUriToBuffer","dataUri","decodedData","character","strRepeat","parseFloatRadix","radix","COMPRESSION_METHOD_NONE","COMPRESSION_METHOD_DEFLATE","decompress","compressionMethod","returnType","decompressionStream","decompressedStream","arrayBuffer","Constants","getStringValue","getEncodedString","encoding","getCalculatedGpsValue","LITTLE_ENDIAN","BIG_ENDIAN","ByteOrder","getByteOrder","tiffHeaderOffset","Tiff","isTiffFile","findTiffOffsets","hasTiffMarker","Jpeg","isJpegFile","findJpegOffsets","MIN_JPEG_DATA_BUFFER_LENGTH","JPEG_ID","JPEG_ID_SIZE","APP_ID_OFFSET","APP_MARKER_SIZE","JFIF_DATA_OFFSET","TIFF_HEADER_OFFSET","IPTC_DATA_OFFSET","XMP_DATA_OFFSET","XMP_EXTENDED_DATA_OFFSET","APP2_ICC_DATA_OFFSET","MPF_DATA_OFFSET","APP2_ICC_IDENTIFIER","ICC_CHUNK_NUMBER_OFFSET","ICC_TOTAL_CHUNKS_OFFSET","APP2_MPF_IDENTIFIER","SOF0_MARKER","SOF2_MARKER","DHT_MARKER","DQT_MARKER","DRI_MARKER","SOS_MARKER","APP0_MARKER","APP1_MARKER","APP2_MARKER","APP13_MARKER","APP15_MARKER","COMMENT_MARKER","FILL_BYTE","APP0_JFIF_IDENTIFIER","APP1_EXIF_IDENTIFIER","APP1_XMP_IDENTIFIER","APP1_XMP_EXTENDED_IDENTIFIER","APP13_IPTC_IDENTIFIER","appMarkerPosition","fieldLength","sof0DataOffset","sof2DataOffset","jfifDataOffset","iptcDataOffset","xmpChunks","iccChunks","mpfDataOffset","isSOF0Marker","isSOF2Marker","isApp0JfifMarker","isApp1ExifMarker","isApp1XmpMarker","getXmpChunkDetails","isApp1ExtendedXmpMarker","getExtendedXmpChunkDetails","isApp13PhotoshopMarker","isApp2ICCMarker","iccDataOffset","iccDataLength","iccChunkNumber","iccChunksTotal","isApp2MPFMarker","isAppMarker","isFillByte","markerIdLength","isXmpIdentifier","isExtendedXmpIdentifier","appMarker","Png","isPngFile","findPngOffsets","PNG_ID","PNG_CHUNK_LENGTH_SIZE","PNG_CHUNK_TYPE_SIZE","PNG_CHUNK_LENGTH_OFFSET","PNG_CHUNK_TYPE_OFFSET","PNG_CHUNK_DATA_OFFSET","PNG_XMP_PREFIX","TYPE_TEXT","TYPE_ITXT","TYPE_ZTXT","TYPE_PHYS","TYPE_TIME","TYPE_EXIF","TYPE_ICCP","async","offsets","isPngImageHeaderChunk","isPngXmpChunk","dataOffset","getPngXmpDataOffset","isPngTextChunk","chunkType","isPngExifChunk","isPngIccpChunk","chunkDataLength","iccHeaderOffset","profileName","compressedProfileOffset","parseIccHeader","isPngChunk","SUPPORTED_PNG_CHUNK_TYPES","numberOfNullSeparators","get64BitValue","parseItemLocationBox","version","contentOffset","boxLength","sizes","getItemLocationBoxOffsetsAndSizes","offsetSize","lengthSize","baseOffsetSize","indexSize","getIndexSize","itemCount","getItemCount","getItems","items","getItemId","getVariableSizedValue","j","extent","getExtentIndex","TYPE_FTYP","TYPE_IPRP","TYPE_META","TYPE_ILOC","TYPE_IINF","TYPE_INFE","TYPE_IPCO","TYPE_COLR","ITEM_INFO_TYPE_EXIF","ITEM_INFO_TYPE_MIME","ITEM_INFO_TYPE_URI","parseBox","getBoxLength","parseFileTypeBox","parseItemPropertiesBox","parseItemPropertyContainerBox","parseColorInformationBox","parseMetadataBox","parseItemInformationBox","parseItemInformationEntryBox","extendsToEndOfFile","hasExtendedSize","hasEmptyHighBits","findOffsets","metaBox","findMetaBox","findExifOffset","findXmpChunks","findIccChunks","box","exifItemId","findIinfExifItemId","ilocItem","findIlocItem","exifOffset","getTiffHeaderOffset","itemInfo","itemId","xmpItemId","findIinfXmpItemId","ilocItemExtent","icc","startOffset","parseSubBoxes","parseIcc","colorType","ACCEPTED_ITEM_INFO_TYPES","subBoxes","currentOffset","getItemInformationBoxOffsetsAndSizes","entry","Heic","isHeicFile","findHeicOffsets","HEIC_MAJOR_BRANDS","headerBox","Avif","isAvifFile","findAvifOffsets","Webp","isWebpFile","RIFF_ID","WEBP_MARKER","EXIF_IDENTIFIER","hasAppMarkers","vp8xChunkOffset","chunkId","chunkSize","Gif","isGifFile","GIF_SIGNATURE_SIZE","GIF_SIGNATURES","ImageHeader","parseAppMarkers","addFileType","fileType","fileTypeDescription","TagNamesCommon","decimal","denominator","TagNames0thIfd","formats","sample","TagNamesExifIfd","y","focalLengths","TagNamesGpsIfd","numerator","status","TagNamesInteroperabilityIfd","TagNamesMpfIfd","tagNames0thExifIfds","IFD_TYPE_0TH","IFD_TYPE_1ST","IFD_TYPE_EXIF","IFD_TYPE_GPS","IFD_TYPE_INTEROPERABILITY","IFD_TYPE_MPF","TagNames$1","typeSizes","tagTypes","Types","getAsciiValue","getByteAt","getAsciiAt","getShortAt","getLongAt","getRationalAt","getUndefinedAt","getSlongAt","getSrationalAt","getIfdPointerAt","getTypeSize","byteOrder","typeName","getTagValueAt","get0thIfdOffset","readIfd","ifdType","includeUnknown","FIELD_COUNT_SIZE","FIELD_SIZE","tags","numberOfFields","getNumberOfFields","fieldIndex","tag","readTag","nextIfdOffset","TAG_TYPE_OFFSET","TAG_COUNT_OFFSET","TAG_VALUE_OFFSET","tagCode","tagType","tagCount","tagValue","TagNames","tagValueFitsInOffsetSlot","getTagValue","tagValueOffset","tagValueFitsInDataView","forceByteType","splitNullSeparatedAsciiString","decodeAsciiValue","tagName","tagDescription","getDescriptionFromTagValue","valueIndex","asciiValue","EXIF_IFD_POINTER_KEY","GPS_INFO_IFD_POINTER_KEY","INTEROPERABILITY_IFD_POINTER_KEY","Tags","read","read0thIfd","readExifIfd","readGpsIfd","readInteroperabilityIfd","MpfTags","ENTRY_SIZE","addMpfImages","images","attributes","getImageNumberValue","getImageFlags","getImageFormat","getImageType","imageSize","imageOffset","getImageOffset","dependentImage1EntryNumber","dependentImage2EntryNumber","entries","flags","flagsDescription","imageFormat","imageIndex","mpEntry","isFirstIndividualImage","FileTags","fileDataOffset","getLength","numberOfColorComponents","getNumberOfColorComponents","getDataPrecision","getImageHeight","getImageWidth","getSubsampling","components","componentOffset","getComponentIds","getSamplingType","ids","compontent","types","JfifTags","thumbnailWidth","getThumbnailWidth","thumbnailHeight","getThumbnailHeight","getVersion","getResolutionUnit","getXResolution","getYResolution","thumbnail","getThumbnail","majorVersion","minorVersion","getResolutionUnitDescription","thumbnailLength","IptcTagNames","getCreationDate","getCreationTime","getEncodingName","stringValue","character0","character1","description","bits","intValue","formatVersions","objectDataPreviewFileFormat","parsedTime","TextDecoder$1","get","TagDecoder","decode","Decoder","TextDecoder","BYTES_8BIM","BYTES_8BIM_SIZE","RESOURCE_BLOCK_HEADER_SIZE","NAA_RESOURCE_BLOCK_TYPE","TAG_HEADER_SIZE","IptcTags","parseTags","naaBlock","newDataOffset","getNaaResourceBlock","resourceBlock","getResourceBlock","isNaaResourceBlock","getBlockPadding","endOfBlockOffset","tagSize","leadByteIsMissing","getTagName","getTagDescription","tagIsRepeatable","tagContainsEncoding","tagIsName","hasDynamicName","hasDescriptionProperty","tagValueIsText","XmpTagNames","calculateGPSValue","parseNumber","numbers","isFraction","func","degreesString","minutesString","degrees","DOMParser$1","XmpTags","chunks","readTags","standardXmp","extendedXmp","extractCompleteChunks","hasStandardTags","hasExtendedTags","combineChunks","completeChunks","totalLength","chunk","combinedChunks","slice","chunkDataView","doc","raw","getDocument","rdf","getRDF","parseXMPObject","convertToObject","domParser","DOMParser","xmlString","trimXmlSource","xmlSource","node","isTopNode","childNodes","getChildNodes","hasTextOnlyContent","getTextValue","getElementsFromNodes","elements","nodes","isElement","nodeElement","getElementFromNode","getAttributes","element","xmpObject","nodeName","parseNodeAttributesAsTags","parseNodeChildrenAsTags","isTagAttribute","getLocalName","getDescription","isNamespaceDefinition","arrayDescription","getDescriptionOfArray","getDescriptionOfObject","descriptions","getClearTextKey","children","parseNodeAsTag","isDuplicateTag","parseNodeAsDuplicateTag","isEmptyResourceTag","hasNestedSimpleRdfDescription","parseNodeAsSimpleRdfDescription","hasNestedStructureRdfDescription","parseNodeAsStructureRdfDescription","isCompactStructure","parseNodeAsCompactStructure","isArray","parseNodeAsArray","parseNodeAsSimpleValue","parseNodeAttributes","parseNodeChildrenAsAttributes","parseRdfValue","getURIValue","getArrayChild","parseArrayValue","PathRecordTypes","PATH_RECORD_SIZE","pathResource","paths","PATH_RECORD_TYPES","parseBezierKnot","parseClipboard","path","parsePathPoint","vertical","getFixedPointNumber","binaryPoint","integer","PhotoshopTags","SIGNATURE","TAG_ID_SIZE","RESOURCE_LENGTH_SIZE","SIGNATURE_SIZE","bytes","signature","tagId","tagNameSize","resourceSize","valueDataView","stringSize","iccTags","iccProfile","toCompany","parseDate","sliceToString","IccTags","PROFILE_HEADER_LENGTH","ICC_TAG_COUNT_OFFSET","ICC_SIGNATURE","TAG_TYPE_DESC","TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE","TAG_TYPE_TEXT","TAG_TYPE_SIGNATURE","TAG_TABLE_SINGLE_TAG_DATA","iccData","readCompressedIcc","readIcc","compressionMethodIsSupported","compressedDataView","totalIccProfileLength","iccBinaryData","getBuffer","chunkNumber","iccDataChunk","chunkData","iccDoesNotHaveTagCount","hasTagsData","tagHeaderOffset","iccProfileKeys","profileEntry","tagSignature","tagOffset","tagValueSize","addTag","numRecords","recordSize","recordNum","languageCode","countryCode","textLength","textOffset","valObj","valIndex","PngFileTags","getBitDepth","getColorType","getCompression","getFilter","getInterlace","COLOR_TYPES","INTERLACE_TYPES","PngTextTags","STATE_KEYWORD","STATE_COMPRESSION","STATE_LANG","STATE_TRANSLATED_KEYWORD","STATE_TEXT","COMPRESSION_SECTION_ITXT_EXTRA_BYTE","COMPRESSION_FLAG_COMPRESSED","EXIF_OFFSET","pngTextChunks","tagsPromises","nameAndValue","getNameAndValue","isExifGroupTag","decodeRawData","isIptcGroupTag","keywordChars","langChars","valueChars","parsingState","getCompressionMethod","moveToNextState","decompressedValueChars","_decompressedValueChars","constructTag","getValue","getName","lang","hexToDataView","hex","PngTags","chunkOffsets","chunkLength","getPixelsPerUnitX","getPixelsPerUnitY","getPixelUnits","getModifyDate","chunkOffset","tagFitsInBuffer","pad","Vp8xTags","IMAGE_WIDTH_OFFSET","IMAGE_HEIGHT_OFFSET","getAlpha","getAnimation","getThreeByteValue","GifFileTags","getGifVersion","getGlobalColorMap","getColorResolution","COMPRESSION_JPEG","Thumbnail","thumbnailTags","hasJpegThumbnail","MetadataMissingError","message","exifErrors","ExifReader","load","loadView","isFilePathOrURL","loadFile","fileContents","loadFromData","isBrowserFileObject","loadFileObject","fetchRemoteFile","nodeGetRemoteFile","isDataUri","loadLocalFile","requireNodeGet","fs","requireNodeFs","fd","stat","file","readerEvent","isNodeBuffer","expanded","foundMetaData","pngHeaderOffset","pngChunkOffsets","gifHeaderOffset","hasFileData","hasJfifData","hasExifData","addGpsGroup","hasIptcData","readIptcTags","hasXmpData","readXmpTags","readPhotoshopTags","hasIccData","readIccTags","addIccTags","hasMpfData","readMpfTags","hasPngFileData","hasPngTextData","readTagsPromise","addPngTextTags","tagList","hasPngData","hasVp8xData","hasGifFileData","group","groupKey","iccDataOffsets","pngFileDataOffset","_FlashMessages","msgProps","messages","__publicField","FlashMessages","notify","resolveFileLocation","waitMessage","waitForLocation","FileUpload","files","uid","formData","fileUpload","progress","uploadedFile","presignedUrl","fileResource","isS3Upload","xhr","request","fetchResourceListWithSelected","fetchFn","list","id","selectedResource","getUrlParam","useMultiFileUpload","uploadedFiles","onCompleteCb","onFilesChangeCb","onFilesSelected","updateFileInList","activeActionVnode","useActions","actions","globalOptions","mappedActions","action","mappedAction","target","performAction","isSavingTarget","activeTargets","activeTarget","vnode","confirmInput","onConfirmAction","filterActions","filters","filteredActions","filterValue","errors","useSingleFileUpload","onFileChangeCb","onFileSelected","completedFile","onDrop","setItem","getItem","render","_ctx","_cache","_openBlock","_createBlock","_createVNode","DragAndDrop","dropZone","_a","_b","emit","__emit","props","__props","dragAndDrop","_hoisted_1","_hoisted_3","_createElementVNode","_createElementBlock","CaretDownIcon","DragHandleIcon","RowResizeIcon","FilterIcon","_hoisted_5","ImageIcon","_hoisted_4","PdfIcon","PercentIcon","SkipNextIcon","SkipPreviousIcon","RemoveIcon","WarningIcon","CloseIcon","isExporting","onExport","onConfirm","onClose","carousel","currentSlide","isVideo","getThumbUrl","computedClass","newInput","showPreview","computedImage","isImage","isPdf","previewUrl","thumbUrl","isPreviewable","isConfirmingRemove","onRemove","resolvedSvg","isCollapsed","stored","toggleCollapse","setCollapse","state","isShowing","RenderVnode","isSaving","content","resolvedComponent","_c","onAction","show","tooltipBox","isHovering","isHoveringParent","onEnterParent","onLeaveParent","delayClose","onEnterTooltip","onLeaveTooltip","_assertThisInitialized","_inheritsLoose","subClass","superClass","_config","_defaults","_suppressOverwrites","_reverting","_context","_bigNum","_tinyNum","_2PI","_HALF_PI","_gsID","_sqrt","_cos","_sin","_isString","_isFunction","_isNumber","_isUndefined","_isObject","_isNotFalse","_windowExists","_isFuncOrString","_isTypedArray","_isArray","_strictNumExp","_numExp","_numWithUnitExp","_complexStringNumExp","_relExp","_delimitedValueExp","_unitExp","_globalTimeline","_win","_coreInitted","_doc","_globals","_installScope","_coreReady","_install","scope","_merge","gsap","_missingPlugin","_warn","suppress","_addGlobal","_emptyFunc","_startAtRevertConfig","_revertConfigNoKill","_revertConfig","_reservedProps","_lazyTweens","_lazyLookup","_lastRenderedFrame","_plugins","_effects","_nextGCFrame","_harnessPlugins","_callbackNames","_harness","targets","harnessPlugin","GSCache","_getCache","toArray","_getProperty","_forEachName","names","_round","_roundPrecise","_parseRelative","operator","_arrayContainsAny","toSearch","toFind","_lazyRender","tween","_lazySafeRender","animation","suppressEvents","_numericIfPossible","_passThrough","_setDefaults","defaults","_setKeyframeDefaults","excludeDuration","toMerge","_mergeDeep","_copyExcluding","excluding","copy","_inheritDefaults","vars","parent","_arraysMatch","a1","a2","_addLinkedListItem","child","firstProp","lastProp","sortBy","prev","_removeLinkedListItem","_removeFromParent","onlyIfParentHasAutoRemove","_uncache","_recacheAncestors","_rewindStartAt","totalTime","_hasNoPausedAncestors","_elapsedCycleDuration","_animationCycle","tTime","cycleDuration","whole","_parentToChildTotalTime","parentTime","_setEnd","_alignPlayhead","_postAddChecks","timeline","_clamp","_addToTimeline","skipChecks","_parsePosition","_isFromOrFromStart","_scrollTrigger","trigger","_attemptInitTween","_initTween","_ticker","_parentPlayheadIsBeforeStart","_ref","_ref2","_renderZeroDurationTween","prevRatio","ratio","repeatDelay","pt","iteration","prevIteration","_callback","_findNextPauseTween","prevTime","_setDuration","skipUncache","leavePlayhead","repeat","totalProgress","_onUpdateTotalDuration","Timeline","_zeroPosition","percentAnimation","labels","recent","clippedDuration","isPercent","_createTweenType","params","isLegacy","varsIndex","irVars","Tween","_conditionalReturn","getUnit","clamp","_slice","_isArrayLike","nonEmpty","_flatten","ar","leaveStrings","accumulator","_accumulator","_wake","selector","el","shuffle","distribute","ease","_parseEase","from","cache","isDecimal","ratios","axis","ratioX","ratioY","distances","originX","originY","wrapAt","_invertEase","_roundModifier","snap","snapTo","radius","is2D","closest","dx","dy","random","roundingIncrement","returnFunction","pipe","_len","functions","_key","unitize","normalize","mapRange","_wrapArray","wrap","range","wrapYoyo","total","_replaceRandom","nums","inMin","inMax","outMin","outMax","inRange","outRange","interpolate","mutate","master","interpolators","il","_addPropTween","_renderPropTweens","_getLabelInDirection","fromTime","backward","distance","label","executeLazyFirst","prevContext","context","_interrupt","_quickTween","_registerPluginQueue","_createPlugin","isFunc","Plugin","instanceDefaults","_killPropTweensOf","_addPluginModifier","statics","_getSetter","PropTween","_255","_colorLookup","_hue","m1","m2","splitColor","toHSL","forceAlpha","g","wasHSL","_colorOrderData","_colorExp","_formatColors","orderMatchData","colors","shell","color","_hslExp","_colorStringFilter","combined","_tickerActive","_getTime","_lagThreshold","_adjustedLag","_startTime","_lastUpdate","_gap","_nextTime","_listeners","_id","_req","_raf","_self","_delta","_i","_tick","elapsed","manual","overlap","dispatch","frame","fps","threshold","adjustedLag","_fps","once","prioritize","_easeMap","_customEaseExp","_quotesExp","_parseObjectInString","split","parsedVal","_valueInParentheses","open","close","nested","_configEaseFromString","_propagateYoyoEase","isYoyo","defaultEase","_insertEase","easeIn","easeOut","easeInOut","lowercaseName","_easeInOutFromOut","_configElastic","amplitude","period","p1","p2","p3","_configBack","overshoot","power","n1","n2","n3","steps","immediateStart","harness","Animation","_proto","_totalTime","includeRepeats","wrapRepeats","prevIsReverting","rawTime","includeDelay","atTime","onFulfilled","_resolve","_then","_Animation","_this","_proto2","fromVars","toVars","stagger","onCompleteAll","onCompleteAllParams","tDur","crossingStart","prevPaused","pauseTween","timeScale","prevStart","yoyo","rewinding","doesWrap","adjustedTime","_this2","tweens","timelines","ignoreBeforeTime","animations","_totalTime2","onlyActive","_overwritingTween","parsedTargets","isGlobalTime","tl","endTime","_vars","startAt","_onStart","onStartParams","immediateRender","initted","fromPosition","toPosition","afterTime","beforeTime","adjustLabels","soft","includeLabels","_addComplexStringPropTween","setter","stringFilter","funcParam","_renderComplexString","startNums","endNum","startNum","hasRandom","modifier","optional","currentValue","parsedStart","_setterFuncWithParam","_setterFunc","_setterPlain","_forceAllPropTweens","_renderBoolean","_renderPlain","_processVars","_parseFuncOrString","_checkPlugin","plugin","ptLookup","lazy","onUpdate","runBackwards","yoyoEase","keyframes","autoRevert","prevStartAt","fullTargets","autoOverwrite","cleanVars","hasPriority","gsData","harnessVars","overwritten","_sortPropTweensByPriority","_updatePropTweens","startIsRelative","skipRecursion","ptCache","rootPT","lookup","_addAliasesToVars","propertyAliases","aliases","_parseKeyframe","allProps","easeEach","_staggerTweenProps","_staggerPropsToSkip","_Animation2","skipInherit","_this3","_this3$vars","overwrite","scrollTrigger","curTarget","staggerFunc","staggerVarsToMerge","kf","_proto3","isNegative","killingTargets","propTweenLookup","firstPT","overwrittenProps","curLookup","curOverwriteProps","_setterAttribute","hasNonDependentRemaining","_setterWithModifier","pt2","first","last","change","renderer","priority","_proto4","_media","_emptyArray","_lastMediaTime","_contextID","_dispatch","_onMediaChange","queries","conditions","anyMatch","toggled","Context","_proto5","prevSelector","revert","matchMedia","_this4","MatchMedia","_proto6","cond","mq","active","_gsap","_len2","_key2","uncache","getter","setters","_merge2","_ref3","effect","plugins","extendTimeline","pluginName","includeDelayedCalls","toAdd","_getPluginPropTween","_addModifiers","modifiers","_buildModifierPlugin","temp","_docElement","_pluginInitted","_tempDiv","_recentSetterPlugin","_transformProps","_RAD2DEG","_DEG2RAD","_atan2","_capsExp","_horizontalExp","_complexExp","_propertyAliases","_renderCSSProp","_renderPropWithEnd","_renderCSSPropWithBeginning","_renderRoundedCSSProp","_renderNonTweeningValue","_renderNonTweeningValueOnlyAtEnd","_setterCSSStyle","_setterCSSProp","_setterTransform","_setterScale","_setterScaleWithRender","_setterTransformWithRender","_transformProp","_transformOriginProp","_saveStyle","isNotCSS","_get","_removeIndependentTransforms","_revertStyle","_getStyleSaver","properties","_supports3D","_createElement","ns","_getComputedProperty","skipPrefixFallback","cs","_checkPropPrefix","_prefixes","preferPrefix","_initCore","_getBBoxHack","swapIfPossible","svg","oldParent","oldSibling","oldCSS","bbox","_getAttributeFallbacks","attributesArray","_getBBox","bounds","_isSVG","_removeProperty","first2Chars","_addNonTweeningPT","beginning","onlySetAtEnd","_nonConvertibleUnits","_nonStandardLayouts","_convertToUnit","curValue","curUnit","horizontal","isRootSVG","measureProperty","toPixels","toPercent","px","isSVG","_parseTransform","_firstTwoOnly","_specialProps","_tweenComplexCSSString","startValues","startValue","endValue","endUnit","startUnit","endValues","_keywordToPercent","_convertKeywordsToPercentages","_renderClearProps","clearTransforms","_identity2DMatrix","_rotationalProperties","_isNullTransform","_getComputedTransformMatrixAsArray","matrixString","_getMatrix","force2D","nextSibling","addedToDOM","_applySVGOrigin","origin","originIsAbsolute","smooth","matrixArray","pluginToAddPropTweensTo","xOriginOld","yOriginOld","xOffsetOld","yOffsetOld","tx","ty","originSplit","xOrigin","yOrigin","determinant","invertedScaleX","deg","scaleX","scaleY","rotation","rotationX","rotationY","skewX","skewY","perspective","angle","cos","sin","a12","a22","t1","t2","t3","a13","a23","a33","a42","a43","a32","_renderSVGTransforms","_renderCSSTransforms","_renderNon3DTransforms","_addPxTranslate","_zeroDeg","_zeroPx","_endParenthesis","xPercent","yPercent","transformPerspective","force3D","zOrigin","transforms","use3D","xOffset","yOffset","forceCSS","a11","a21","_addRotationalPropTween","cap","finalValue","direction","_assign","source","_addRawTransformPTs","startCache","exclude","endCache","side","CSSPlugin","specialProp","relative","isTransformRelated","transformPropTween","inlineProps","positionAndScale","others","gsapWithCSS","indexDelay","onBeforeEnter","onEnter","onComplete","onLeave","ListDragAndDrop","draggableData","prevPosition","newPosition","point","rect","velocity","velocityFn","cursorPos","rectStart","rectEnd","beforeDiff","afterDiff","oldPosition","allowMoreTitleColumns","isVisible","column","onVisibilityChange","visible","hiddenColumnNames","isTitleColumn","onTitleColumnChange","isTitle","titleColumnNames","isShowingColumnToggle","categories","columnsInCategory","category","categoryHasVisibleColumns","getCategoryCheckboxState","categoryColumns","visibleColumns","toggleColumns","columns","showColumns","toggleColumn","columnName","showColumn","labelText","requiredLabel","rules","formattedDate","onSave","formattedDates","dateRangeValue","dateRange","toQDateValue","debouncedChange","onInput","__expose","upload","onAttachFiles","numberVal","fieldOptions","minimumFractionDigits","onUpdateDebounced","oldVal","nextTick","onClear","selectField","computedOptions","opt","isRef","resolveLabel","resolveValue","resolveSelectionLabel","filteredOptions","selectedValue","selectedOptions","selectedLabel","chipOptions","option","shouldFilter","onFilter","update","onShow","onHide","selectedFieldName","searchList","textInput","formatModelValue","onChange","symbol","minField","maxField","previewIcon","CurrencyIcon","NumberIcon","vue","setRange","multiplier","formatNum","newVal","showDrawer","formattedOptions","getOptionValue","getOptionLabel","isSelected","optionValue","toggleSelect","selection","resolveSelectedOption","selectedOption","selectedChildren","onSelectChild","onSelectOption","validEvents","isValidKey","event","bindHandlers","initEvent","listeners","editor","handler","bindModelHandlers","ctx","modelValue","modelEvents","normalizedEvents","prevVal","initEditor","unique","uuid","prefix","isTextarea","normalizePluginArray","mergePlugins","initPlugins","inputPlugins","isNullOrUndefined","createState","CreateScriptLoader","injectScriptTag","scriptId","scriptTag","reinitialize","ScriptLoader","getGlobal","getTinymce","global","editorProps","__assign","renderInline","ce","elementRef","renderIframe","defaultInitValues","Editor","defineComponent","toRefs","disabled","vueEditor","elementId","inlineEditor","modelBind","mounting","initialValue","getContent","isMounting","initWrapper","finalInit","disable","_","channel","apiKey","scriptSrc","onBeforeUnmount","onActivated","onDeactivated","rerender","init","activeCountByGroup","updateFilter","fieldFilter","activeCount","FORM_FIELD_MAP","BooleanField","DateField","DateRangeField","IntegerField","NumberField","TextField","SingleFileField","MultiFileField","WysiwygField","mappedFields","fieldValues","reactive","_sfc_render","_renderSlot","_hoisted_2","registerStickyScrolling","tableRef","scrollEl","onScroll","mapSortBy","pagination","getFilterFromUrl","allowedKeys","urlFilter","fields","useListControls","listRoute","summaryRoute","filterFieldOptionsRoute","moreRoute","itemDetailsRoute","refreshFilters","urlPattern","filterDefaults","isInitialized","PAGE_SETTINGS_KEY","pagedItems","globalFilter","showFilters","selectedRows","isLoadingList","isLoadingSummary","summary","filterActiveCount","PAGING_DEFAULT","quasarPagination","pager","saveSettings","loadList","loadSummary","loadFilterFieldOptions","setPagedItems","summaryFilter","row","filterFieldOptions","isLoadingFilters","applyFilterFromUrl","filterFields","validFilterKeys","updateSettings","resetPaging","setItemInPagedList","updatedItem","activeItem","loadMore","perPage","newItems","refreshAll","getActiveItemDetails","loadSettings","activePanel","oldItem","activatePanel","panel","getNextItem","nextIndex","initialize","useTableColumns","COLUMN_ORDER_KEY","VISIBLE_COLUMNS_KEY","TITLE_COLUMNS_KEY","columnOrder","lockedColumns","orderedColumns","aIndex","bIndex","sortableColumns","newColumns","orderedTitleColumns","hasTarget","activeActions","columnStyle","width","columnClass","summaryColumns","formatValue","actionTable","COLUMN_SETTINGS_KEY","columnSettings","onResizeColumn","novaUrl","packageJson","install","app"],"mappings":"2cAAWA,EAAAA,YAAc,CACrB,WAAY,CACR,UAAW,cACX,mBAAoB,KACpB,mBAAoB,IACxB,CACJ,EAEO,SAASC,GAAUC,EAAS,CACjBF,cAAA,CACV,GAAGA,EAAA,YACH,GAAGE,CAAA,CAEX,CCNO,SAASC,GAAQC,EAAOC,EAAMC,EAAU,OAAW,CAClD,MAAAC,EACJ,OAAOF,GAAS,WAAaD,EAAM,UAAUC,CAAI,EAAID,EAAM,QAAQC,CAAI,EACzE,GAAIE,IAAU,GACJ,cAAA,MAAM,0BAA2BF,EAAMD,CAAK,EAC9C,IAAI,MAAM,yBAAyB,EAErC,MAAAI,EAAW,CAAC,GAAGJ,CAAK,EACd,OAAAE,IAAA,OACRE,EAAS,OAAOD,EAAO,EAAGD,CAAO,EACjCE,EAAS,OAAOD,EAAO,CAAC,EACrBC,CACT,CAEgB,SAAAC,GAAOL,EAAOC,EAAM,CAC3B,OAAAF,GAAQC,EAAOC,CAAI,CAC5B,CAQgB,SAAAK,GAASN,EAAOO,EAAI,CAClC,OAAOP,E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AAE,QAAAq8B,EAAS,EAAG6mD,GAEpB,SAASC,GAAQC,EAAK,CAClB,QAAQ,IAAI,sBAAsB/mD,EAAO,2BAA2B,CACxE","x_google_ignoreList":[2,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,139,140,141,166,167,168,169,170]}
|