{"version":3,"file":"index.js","sources":["../../../../src/packages/core/utils/debounce/debounce.function.ts","../../../../src/packages/core/utils/direction/index.ts","../../../../src/packages/core/utils/download/blob-download.function.ts","../../../../src/packages/core/utils/get-guid-from-udi.function.ts","../../../../src/packages/core/utils/get-processed-image-url.function.ts","../../../../src/packages/core/utils/math/math.ts","../../../../src/packages/core/utils/media/image-size.function.ts","../../../../src/packages/core/utils/object/deep-merge.function.ts","../../../../src/packages/core/utils/pagination-manager/pagination.manager.ts","../../../../src/packages/core/utils/path/ensure-local-path.function.ts","../../../../src/packages/core/utils/path/ensure-path-ends-with-slash.function.ts","../../../../src/packages/core/utils/path/has-own-opener.function.ts","../../../../src/packages/core/utils/path/path-decode.function.ts","../../../../src/packages/core/utils/path/path-encode.function.ts","../../../../src/packages/core/utils/string/from-camel-case/from-camel-case.function.ts","../../../../src/packages/core/utils/string/to-camel-case/to-camel-case.function.ts","../../../../src/packages/core/utils/string/generate-umbraco-alias/generate-umbraco-alias.function.ts","../../../../src/packages/core/utils/string/increment-string/increment-string.function.ts","../../../../src/packages/core/utils/string/split-string-to-array/split-string-to-array.function.ts","../../../../src/packages/core/utils/string/string-or-string-array-contains/string-or-string-array-contains.function.ts","../../../../src/packages/core/utils/path/path-folder-name.function.ts","../../../../src/packages/core/utils/path/remove-initial-slash-from-path.function.ts","../../../../src/packages/core/utils/path/remove-last-slash-from-path.function.ts","../../../../src/packages/core/utils/path/stored-path.function.ts","../../../../src/packages/core/utils/path/transform-server-path-to-client-path.function.ts","../../../../src/packages/core/utils/path/umbraco-path.function.ts","../../../../src/packages/core/utils/sanitize/escape-html.function.ts","../../../../src/packages/core/utils/sanitize/sanitize-html.function.ts","../../../../src/packages/core/utils/selection-manager/selection.manager.ts","../../../../src/packages/core/utils/state-manager/state.manager.ts","../../../../src/packages/core/utils/state-manager/read-only-state.manager.ts","../../../../src/packages/core/utils/state-manager/read-only-variant-state.manager.ts","../../../../src/packages/core/utils/deprecation/deprecation.ts"],"sourcesContent":["// TODO: add types\r\nexport const debounce = (fn: any, ms = 0) => {\r\n\tlet timeoutId: ReturnType;\r\n\r\n\treturn function (this: any, ...args: any[]) {\r\n\t\tclearTimeout(timeoutId);\r\n\t\ttimeoutId = setTimeout(() => fn.apply(this, args), ms);\r\n\t};\r\n};\r\n","export type UmbDirectionType = 'Ascending' | 'Descending';\r\n\r\nexport const UmbDirection = Object.freeze({\r\n\tASCENDING: 'Ascending',\r\n\tDESCENDING: 'Descending',\r\n});\r\n","/**\r\n * Triggers a client-side download of a file, using a `Blob` object.\r\n * To do this, a temporary anchor element is created, appended to the document body,\r\n * immediate triggered to download, then removed from the document body.\r\n * @param {any} data - The data to be downloaded.\r\n * @param {string} filename - The name of the file to be downloaded.\r\n * @param {string} mimeType - The MIME type of the file to be downloaded.\r\n * @returns {void}\r\n * @example\r\n * blobDownload(data, 'package.xml', 'text/xml');\r\n */\r\nexport const blobDownload = (data: any, filename: string, mimeType: string) => {\r\n\tconst blob = new Blob([data], { type: mimeType });\r\n\tconst url = window.URL.createObjectURL(blob);\r\n\tconst a = document.createElement('a');\r\n\ta.href = url;\r\n\ta.download = filename;\r\n\ta.style.display = 'none';\r\n\tdocument.body.appendChild(a);\r\n\ta.dispatchEvent(new MouseEvent('click'));\r\n\ta.remove();\r\n\twindow.URL.revokeObjectURL(url);\r\n};\r\n","/**\r\n * Get the guid from a UDI.\r\n * @example getGuidFromUdi('umb://document/4f058f8b1f7e4f3e8b4b6b4b4b6b4b6b') // '4f058f8b-1f7e-4f3e-8b4b-6b4b4b6b4b6b'\r\n * @param {string} udi The UDI to get the guid from.\r\n * @returns {string} The guid from the UDI.\r\n */\r\nexport function getGuidFromUdi(udi: string) {\r\n\tif (!udi.startsWith('umb://')) throw new Error('udi does not start with umb://');\r\n\r\n\tconst withoutScheme = udi.replace('umb://', '');\r\n\tconst withoutHost = withoutScheme.split('/')[1];\r\n\tif (withoutHost.length !== 32) throw new Error('udi is not 32 chars');\r\n\r\n\treturn `${withoutHost.substring(0, 8)}-${withoutHost.substring(8, 12)}-${withoutHost.substring(12, 16)}-${withoutHost.substring(16, 20)}-${withoutHost.substring(20)}`;\r\n}\r\n","import type { GetImagingResizeUrlsData } from '@umbraco-cms/backoffice/external/backend-api';\r\n\r\n/**\r\n * Returns the URL of the processed image.\r\n * @param {string} imagePath The path to the image.\r\n * @param {GetImagingResizeUrlsData} options The options for resizing the image.\r\n * @returns {Promise} The URL of the processed image.\r\n */\r\nexport async function getProcessedImageUrl(imagePath: string, options: GetImagingResizeUrlsData): Promise {\r\n\tif (!options) {\r\n\t\treturn imagePath;\r\n\t}\r\n\r\n\tconst searchParams = new URLSearchParams({\r\n\t\twidth: options.width?.toString() ?? '',\r\n\t\theight: options.height?.toString() ?? '',\r\n\t\tmode: options.mode ?? '',\r\n\t});\r\n\r\n\t// This should ideally use the ImagingService.getImagingResizeUrls method, but\r\n\t// that would require the GUID of the media item, which is not available here.\r\n\tconst url = `${imagePath}?${searchParams.toString()}`;\r\n\r\n\treturn url;\r\n}\r\n","import { clamp } from '@umbraco-cms/backoffice/external/uui';\r\nexport { clamp };\r\n\r\n/**\r\n * Performs linear interpolation (lerp) between two numbers based on a blending factor.\r\n * @param {number} start - The starting value.\r\n * @param {number} end - The ending value.\r\n * @param {number} alpha - The blending factor, clamped to the range [0, 1].\r\n * @returns {number} The result of linear interpolation between `start` and `end` using `alpha`.\r\n * @example\r\n * // Interpolate between two values.\r\n * const value1 = 10;\r\n * const value2 = 20;\r\n * const alpha = 0.5; // Blend halfway between value1 and value2.\r\n * const result = lerp(value1, value2, alpha);\r\n * // result is 15\r\n *\r\n * // Ensure alpha is clamped to the range [0, 1].\r\n * const value3 = 5;\r\n * const value4 = 15;\r\n * const invalidAlpha = 1.5; // This will be clamped to 1.\r\n * const result2 = lerp(value3, value4, invalidAlpha);\r\n * // result2 is 15, equivalent to lerp(value3, value4, 1)\r\n */\r\nexport function lerp(start: number, end: number, alpha: number): number {\r\n\t// Ensure that alpha is clamped between 0 and 1\r\n\talpha = clamp(alpha, 0, 1);\r\n\r\n\t// Perform linear interpolation\r\n\treturn start * (1 - alpha) + end * alpha;\r\n}\r\n\r\n/**\r\n * Calculates the inverse linear interpolation (inverse lerp) factor based on a value between two numbers.\r\n * The inverse lerp factor indicates where the given `value` falls between `start` and `end`.\r\n *\r\n * If `value` is equal to `start`, the function returns 0. If `value` is equal to `end`, the function returns 1.\r\n * @param {number} start - The starting value.\r\n * @param {number} end - The ending value.\r\n * @param {number} value - The value to calculate the inverse lerp factor for.\r\n * @returns {number} The inverse lerp factor, a value in the range [0, 1], indicating where `value` falls between `start` and `end`.\r\n * - If `start` and `end` are equal, the function returns 0.\r\n * - If `value` is less than `start`, the factor is less than 0, indicating it's before `start`.\r\n * - If `value` is greater than `end`, the factor is greater than 1, indicating it's after `end`.\r\n * - If `value` is between `start` and `end`, the factor is between 0 and 1, indicating where `value` is along that range.\r\n * @example\r\n * // Calculate the inverse lerp factor for a value between two points.\r\n * const startValue = 10;\r\n * const endValue = 20;\r\n * const targetValue = 15; // The value we want to find the factor for.\r\n * const result = inverseLerp(startValue, endValue, targetValue);\r\n * // result is 0.5, indicating that targetValue is halfway between startValue and endValue.\r\n *\r\n * // Handle the case where start and end are equal.\r\n * const equalStartAndEnd = 5;\r\n * const result2 = inverseLerp(equalStartAndEnd, equalStartAndEnd, equalStartAndEnd);\r\n * // result2 is 0, as start and end are equal.\r\n */\r\nexport function inverseLerp(start: number, end: number, value: number): number {\r\n\tif (start === end) {\r\n\t\treturn 0; // Avoid division by zero if start and end are equal\r\n\t}\r\n\r\n\treturn (value - start) / (end - start);\r\n}\r\n\r\n/**\r\n * Calculates the absolute difference between two numbers.\r\n * @param {number} a - The first number.\r\n * @param {number} b - The second number.\r\n * @returns {number} The absolute difference between `a` and `b`.\r\n * @example\r\n * // Calculate the distance between two points on a number line.\r\n * const point1 = 5;\r\n * const point2 = 8;\r\n * const result = distance(point1, point2);\r\n * // result is 3\r\n *\r\n * // Calculate the absolute difference between two values.\r\n * const value1 = -10;\r\n * const value2 = 20;\r\n * const result2 = distance(value1, value2);\r\n * // result2 is 30\r\n */\r\nexport function distance(a: number, b: number): number {\r\n\treturn Math.abs(a - b);\r\n}\r\n\r\n/**\r\n * Calculates the extrapolated final value based on an initial value and an increase factor.\r\n * @param {number} initialValue - The starting value.\r\n * @param {number} increaseFactor - The factor by which the value should increase\r\n * (must be in the range [0(inclusive), 1(exclusive)] where 0 means no increase and 1 means no limit).\r\n * @returns {number} The extrapolated final value.\r\n * Returns NaN if the increase factor is not within the valid range.\r\n * @example\r\n * // Valid input\r\n * const result = calculateExtrapolatedValue(100, 0.2);\r\n * // result is 125\r\n *\r\n * // Valid input\r\n * const result2 = calculateExtrapolatedValue(50, 0.5);\r\n * // result2 is 100\r\n *\r\n * // Invalid input (increaseFactor is out of range)\r\n * const result3 = calculateExtrapolatedValue(200, 1.2);\r\n * // result3 is NaN\r\n */\r\nexport function calculateExtrapolatedValue(initialValue: number, increaseFactor: number): number {\r\n\tif (increaseFactor < 0 || increaseFactor >= 1) {\r\n\t\t// Return a special value to indicate an invalid input.\r\n\t\treturn NaN;\r\n\t}\r\n\r\n\treturn initialValue / (1 - increaseFactor);\r\n}\r\n\r\n/**\r\n * Find the index for a target value on an array of individual values.\r\n * @param {number} target - The target value to interpolate to.\r\n * @param {Array} weights - An array of values to interpolate between.\r\n * @returns\r\n */\r\nexport function getInterpolatedIndexOfPositionInWeightMap(target: number, weights: Array): number {\r\n\tconst map = [0];\r\n\tweights.reduce((a, b, i) => {\r\n\t\treturn (map[i + 1] = a + b);\r\n\t}, 0);\r\n\tconst foundValue = map.reduce((a, b) => {\r\n\t\tconst aDiff = Math.abs(a - target);\r\n\t\tconst bDiff = Math.abs(b - target);\r\n\r\n\t\tif (aDiff === bDiff) {\r\n\t\t\treturn a < b ? a : b;\r\n\t\t} else {\r\n\t\t\treturn bDiff < aDiff ? b : a;\r\n\t\t}\r\n\t});\r\n\tconst foundIndex = map.indexOf(foundValue);\r\n\tconst targetDiff = target - foundValue;\r\n\tlet interpolatedIndex = foundIndex;\r\n\tif (targetDiff < 0 && foundIndex === 0) {\r\n\t\t// Don't adjust.\r\n\t} else if (targetDiff > 0 && foundIndex === map.length - 1) {\r\n\t\t// Don't adjust.\r\n\t} else {\r\n\t\tconst foundInterpolationWeight = weights[targetDiff >= 0 ? foundIndex : foundIndex - 1];\r\n\t\tinterpolatedIndex += foundInterpolationWeight === 0 ? interpolatedIndex : targetDiff / foundInterpolationWeight;\r\n\t}\r\n\treturn interpolatedIndex;\r\n}\r\n\r\n/**\r\n * Combine the values of an array up to a certain index.\r\n * @param {number} index - The index to accumulate to, everything after this index will not be accumulated.\r\n * @param {Array} weights - An array of values to accumulate.\r\n * @returns\r\n */\r\nexport function getAccumulatedValueOfIndex(index: number, weights: Array): number {\r\n\tconst len = Math.min(index, weights.length);\r\n\tlet i = 0,\r\n\t\tcalc = 0;\r\n\twhile (i < len) {\r\n\t\tcalc += weights[i++];\r\n\t}\r\n\treturn calc;\r\n}\r\n\r\n/**\r\n *\r\n * @param {number} x - The x coordinate.\r\n * @param {number} y - The y coordinate.\r\n * @param {DOMRect} rect - The rectangle to check.\r\n * @param {number} expand - The amount to expand or contract the rectangle.\r\n * @returns\r\n */\r\nexport function isWithinRect(x: number, y: number, rect: DOMRect, expand = 0) {\r\n\treturn x > rect.left - expand && x < rect.right + expand && y > rect.top - expand && y < rect.bottom + expand;\r\n}\r\n","/**\r\n * Get the dimensions of an image from a URL.\r\n * @param {string} url The URL of the image. It can be a local file (blob url) or a remote file.\r\n * @param {{maxWidth?: number}} opts Options for the image size.\r\n * @param {number} opts.maxWidth The maximum width of the image. If the image is wider than this, it will be scaled down to this width while keeping the aspect ratio.\r\n * @returns {Promise<{width: number, height: number, naturalWidth: number, naturalHeight: number}>} The width and height of the image as downloaded from the URL. The width and height can differ from the natural numbers if maxImageWidth is given.\r\n */\r\nexport function imageSize(\r\n\turl: string,\r\n\topts?: { maxWidth?: number },\r\n): Promise<{ width: number; height: number; naturalWidth: number; naturalHeight: number }> {\r\n\tconst img = new Image();\r\n\r\n\tconst promise = new Promise<{ width: number; height: number; naturalWidth: number; naturalHeight: number }>(\r\n\t\t(resolve, reject) => {\r\n\t\t\timg.onload = () => {\r\n\t\t\t\t// Natural size is the actual image size regardless of rendering.\r\n\t\t\t\t// The 'normal' `width`/`height` are for the **rendered** size.\r\n\t\t\t\tconst naturalWidth = img.naturalWidth;\r\n\t\t\t\tconst naturalHeight = img.naturalHeight;\r\n\t\t\t\tlet width = naturalWidth;\r\n\t\t\t\tlet height = naturalHeight;\r\n\r\n\t\t\t\tif (opts?.maxWidth && opts.maxWidth > 0 && width > opts?.maxWidth) {\r\n\t\t\t\t\tconst ratio = opts.maxWidth / naturalWidth;\r\n\t\t\t\t\twidth = opts.maxWidth;\r\n\t\t\t\t\theight = Math.round(naturalHeight * ratio);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Resolve promise with the width and height\r\n\t\t\t\tresolve({ width, height, naturalWidth, naturalHeight });\r\n\t\t\t};\r\n\r\n\t\t\t// Reject promise on error\r\n\t\t\timg.onerror = reject;\r\n\t\t},\r\n\t);\r\n\r\n\t// Setting the source makes it start downloading and eventually call `onload`\r\n\timg.src = url;\r\n\r\n\treturn promise;\r\n}\r\n","import type { UmbDeepPartialObject } from '../type/deep-partial-object.type.js';\r\n\r\n/**\r\n * Deep merge two objects.\r\n * @param target\r\n * @param ...sources\r\n * @param source\r\n * @param fallback\r\n */\r\nexport function umbDeepMerge<\r\n\tT extends { [key: string]: any },\r\n\tPartialType extends UmbDeepPartialObject = UmbDeepPartialObject,\r\n>(source: PartialType, fallback: T) {\r\n\tconst result = { ...fallback };\r\n\r\n\tfor (const key in source) {\r\n\t\tif (Object.prototype.hasOwnProperty.call(source, key) && source[key] !== undefined) {\r\n\t\t\tif (source[key]?.constructor === Object && fallback[key]?.constructor === Object) {\r\n\t\t\t\tresult[key] = umbDeepMerge(source[key] as any, fallback[key]);\r\n\t\t\t} else {\r\n\t\t\t\tresult[key] = source[key] as any;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n","import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';\r\nimport { UmbNumberState } from '@umbraco-cms/backoffice/observable-api';\r\n\r\nexport class UmbPaginationManager extends EventTarget {\r\n\t#defaultValues = {\r\n\t\ttotalItems: 0,\r\n\t\ttotalPages: 1,\r\n\t\tcurrentPage: 1,\r\n\t};\r\n\r\n\t#pageSize = new UmbNumberState(10);\r\n\tpublic readonly pageSize = this.#pageSize.asObservable();\r\n\r\n\t#totalItems = new UmbNumberState(this.#defaultValues.totalItems);\r\n\tpublic readonly totalItems = this.#totalItems.asObservable();\r\n\r\n\t#totalPages = new UmbNumberState(this.#defaultValues.totalPages);\r\n\tpublic readonly totalPages = this.#totalPages.asObservable();\r\n\r\n\t#currentPage = new UmbNumberState(this.#defaultValues.currentPage);\r\n\tpublic readonly currentPage = this.#currentPage.asObservable();\r\n\r\n\t#skip = new UmbNumberState(0);\r\n\tpublic readonly skip = this.#skip.asObservable();\r\n\r\n\t/**\r\n\t * Sets the number of items per page and recalculates the total number of pages\r\n\t * @param {number} pageSize\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\tpublic setPageSize(pageSize: number) {\r\n\t\tthis.#pageSize.setValue(pageSize);\r\n\t\tthis.#calculateTotalPages();\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the number of items per page\r\n\t * @returns {number}\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\tpublic getPageSize() {\r\n\t\treturn this.#pageSize.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the total number of items\r\n\t * @returns {number}\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\tpublic getTotalItems() {\r\n\t\treturn this.#totalItems.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the total number of items and recalculates the total number of pages\r\n\t * @param {number} totalItems\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\tpublic setTotalItems(totalItems: number) {\r\n\t\tthis.#totalItems.setValue(totalItems);\r\n\t\tthis.#calculateTotalPages();\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the total number of pages\r\n\t * @returns {number}\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\tpublic getTotalPages() {\r\n\t\treturn this.#totalPages.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the current page number\r\n\t * @returns {number}\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\tpublic getCurrentPageNumber() {\r\n\t\treturn this.#currentPage.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the current page number\r\n\t * @param {number} pageNumber\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\tpublic setCurrentPageNumber(pageNumber: number) {\r\n\t\tif (pageNumber < 1) {\r\n\t\t\tpageNumber = 1;\r\n\t\t}\r\n\r\n\t\tif (pageNumber > this.#totalPages.getValue()) {\r\n\t\t\tpageNumber = this.#totalPages.getValue();\r\n\t\t}\r\n\r\n\t\tthis.#currentPage.setValue(pageNumber);\r\n\t\tthis.#calculateSkip();\r\n\t\tthis.dispatchEvent(new UmbChangeEvent());\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the number of items to skip\r\n\t * @returns {number}\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\tpublic getSkip() {\r\n\t\treturn this.#skip.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Clears the pagination manager values and resets them to their default values\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\tpublic clear() {\r\n\t\tthis.#totalItems.setValue(this.#defaultValues.totalItems);\r\n\t\tthis.#totalPages.setValue(this.#defaultValues.totalPages);\r\n\t\tthis.#currentPage.setValue(this.#defaultValues.currentPage);\r\n\t\tthis.#skip.setValue(0);\r\n\t}\r\n\r\n\t/**\r\n\t * Calculates the total number of pages\r\n\t * @memberof UmbPaginationManager\r\n\t */\r\n\t#calculateTotalPages() {\r\n\t\tlet totalPages = Math.ceil(this.#totalItems.getValue() / this.#pageSize.getValue());\r\n\t\ttotalPages = totalPages === 0 ? 1 : totalPages;\r\n\t\tthis.#totalPages.setValue(totalPages);\r\n\r\n\t\t/* If we currently are on a page higher than the total pages. We need to reset the current page to the last page.\r\n This can happen if we have a filter that returns less items than the current page size. */\r\n\t\tif (this.getCurrentPageNumber() > totalPages) {\r\n\t\t\tthis.setCurrentPageNumber(totalPages);\r\n\t\t}\r\n\t}\r\n\r\n\t#calculateSkip() {\r\n\t\tconst skip = Math.max(0, (this.#currentPage.getValue() - 1) * this.#pageSize.getValue());\r\n\t\tthis.#skip.setValue(skip);\r\n\t}\r\n}\r\n","/**\r\n * Ensure that the path is a local path.\r\n * @param path\r\n * @param fallbackPath\r\n */\r\nexport function ensureLocalPath(path: URL | string, fallbackPath?: URL | string): URL {\r\n\tconst url = new URL(path, window.location.origin);\r\n\tif (url.origin === window.location.origin) {\r\n\t\treturn url;\r\n\t}\r\n\treturn fallbackPath ? new URL(fallbackPath) : new URL(window.location.origin);\r\n}\r\n","/**\r\n *\r\n * @param path\r\n */\r\nexport function ensurePathEndsWithSlash(path: string) {\r\n\treturn path.endsWith('/') ? path : path + '/';\r\n}\r\n","/**\r\n * Check if the current window has an opener window with the same origin and optional pathname.\r\n * This is useful for checking if the current window was opened by another window from within the same application.\r\n * @remark If the current window was opened by another window, the opener window is accessible via `window.opener`.\r\n * @remark There could still be an opener if the opener window is closed or navigated away or if the opener window is not from the same origin,\r\n * but this function will only return `true` if the opener window is accessible and has the same origin and optional pathname.\r\n * @param pathname Optional pathname to check if the opener window has the same pathname.\r\n * @param windowLike The window-like object to use for checking the opener. Default is `window`.\r\n * @returns `true` if the current window has an opener window with the same origin and optional pathname, otherwise `false`.\r\n */\r\nexport function hasOwnOpener(pathname?: string, windowLike: Window = globalThis.window): boolean {\r\n\ttry {\r\n\t\tconst opener = windowLike.opener;\r\n\t\tif (!opener) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst openerLocation = opener.location;\r\n\t\tconst currentLocation = windowLike.location;\r\n\r\n\t\tif (openerLocation.origin !== currentLocation.origin) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// If there is a pathname, check if the opener has the same pathname\r\n\t\tif (typeof pathname !== 'undefined' && !openerLocation.pathname.startsWith(pathname)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t} catch {\r\n\t\t// If there is a security error, it means that the opener is from a different origin, so we let it fall through\r\n\t\treturn false;\r\n\t}\r\n}\r\n","// Notice, no need to handle . or : specifically as decodeURIComponent does handle these. [NL]\r\nexport const decodeFilePath = (path: string) => decodeURIComponent(path);\r\n","export const encodeFilePath = (path: string) => encodeURIComponent(path).replaceAll('.', '%2E').replaceAll(':', '%3A');\r\n\r\nexport const aliasToPath = (path: string) => encodeFilePath(path);\r\n","/**\r\n * Converts a string from camelCase to human-readable labels.\r\n *\r\n * This function has been adapted from the following Stack Overflow answer:\r\n * https://stackoverflow.com/a/7225450/12787\r\n * Licensed under the permissions of the CC BY-SA 4.0 DEED.\r\n * https://creativecommons.org/licenses/by-sa/4.0/\r\n * Modifications are licensed under the MIT License.\r\n * Copyright © 2024 Umbraco HQ.\r\n * @param {string} str - The camelCased string to convert.\r\n * @returns {string} - The converted human-readable label.\r\n * @example\r\n * const label = fromCamelCase('workspaceActionMenuItem');\r\n * // label: 'Workspace Action Menu Item'\r\n */\r\nexport const fromCamelCase = (str: string) => {\r\n\tconst s = str.replace(/([A-Z])/g, ' $1');\r\n\treturn s.charAt(0).toUpperCase() + s.slice(1);\r\n};\r\n","export const toCamelCase = (str: string) => {\r\n\tconst s = str\r\n\t\t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)\r\n\t\t?.map((x: string) => x.slice(0, 1).toUpperCase() + x.slice(1).toLowerCase())\r\n\t\t.join('');\r\n\treturn (s && s.slice(0, 1).toLowerCase() + s.slice(1)) || '';\r\n};\r\n","import { toCamelCase } from '../to-camel-case/index.js';\r\n\r\n/**\r\n * @description Generate an alias from a string\r\n * @param {string} text The text to generate the alias from\r\n * @returns {string} The alias\r\n */\r\nexport function generateAlias(text: string): string {\r\n\treturn toCamelCase(text);\r\n}\r\n","/**\r\n * @description Increment string\r\n * @param {string} text The text to increment\r\n * @returns {string} The incremented string\r\n */\r\nexport function incrementString(text: string): string {\r\n\treturn text.replace(/(\\d*)$/, (_, t) => (+t + 1).toString().padStart(t.length, '0'));\r\n}\r\n","/**\r\n * Splits a string into an array using a specified delimiter,\r\n * trims whitespace from each element, and removes empty elements.\r\n * @param {string | undefined} string - The input string to be split and processed.\r\n * @param {string} [split] - The delimiter used for splitting the string (default is comma).\r\n * @returns {Array} An array of non-empty, trimmed strings.\r\n * @example\r\n * const result = splitStringToArray('one, two, three, ,five');\r\n * // result: ['one', 'two', 'three', 'five']\r\n * @example\r\n * const customDelimiterResult = splitStringToArray('apple | orange | banana', ' | ');\r\n * // customDelimiterResult: ['apple', 'orange', 'banana']\r\n */\r\nexport function splitStringToArray(string: string | undefined, split: string = ','): string[] {\r\n\tif (!string) return [];\r\n\treturn (\r\n\t\tstring\r\n\t\t\t.split(split)\r\n\t\t\t.map((s) => s.trim())\r\n\t\t\t.filter((s) => s.length > 0) ?? []\r\n\t);\r\n}\r\n","/**\r\n * @description Check if a string or array of strings contains a specific string\r\n * @param value The string or array of strings to search in\r\n * @param search The string to search for\r\n * @returns {boolean} Whether the string or array of strings contains the search string\r\n */\r\nexport function stringOrStringArrayContains(value: string | Array, search: string): boolean {\r\n\treturn Array.isArray(value) ? value.indexOf(search) !== -1 : value === search;\r\n}\r\n\r\n/**\r\n * Check if a string or array of strings intersects with another array of strings\r\n * @param value The string or array of strings to search in\r\n * @param search The array of strings to search for\r\n * @returns {boolean} Whether the string or array of strings intersects with the search array\r\n */\r\nexport function stringOrStringArrayIntersects(value: string | Array, search: Array): boolean {\r\n\tif (Array.isArray(value)) {\r\n\t\treturn value.some((v) => search.indexOf(v) !== -1);\r\n\t} else {\r\n\t\treturn search.indexOf(value) !== -1;\r\n\t}\r\n}\r\n","import { generateAlias } from '../string/index.js';\r\n\r\nexport const pathFolderName = generateAlias;\r\n","/**\r\n * Removes the initial slash from a path, if the first character is a slash.\r\n * @param path\r\n */\r\nexport function removeInitialSlashFromPath(path: string) {\r\n\treturn path.startsWith('/') ? path.slice(1) : path;\r\n}\r\n","/**\r\n * Remove the last slash from a path, if the last character is a slash.\r\n * @param path\r\n */\r\nexport function removeLastSlashFromPath(path: string) {\r\n\treturn path.endsWith('/') ? path.slice(undefined, -1) : path;\r\n}\r\n","import { ensureLocalPath } from './ensure-local-path.function.js';\r\n\r\nexport const UMB_STORAGE_REDIRECT_URL = 'umb:auth:redirect';\r\n\r\n/**\r\n * Retrieve the stored path from the session storage.\r\n * @remark This is used to redirect the user to the correct page after login.\r\n */\r\nexport function retrieveStoredPath(): URL | null {\r\n\tlet currentRoute = '';\r\n\tconst savedRoute = sessionStorage.getItem(UMB_STORAGE_REDIRECT_URL);\r\n\tif (savedRoute) {\r\n\t\tsessionStorage.removeItem(UMB_STORAGE_REDIRECT_URL);\r\n\t\tcurrentRoute = savedRoute.endsWith('logout') ? currentRoute : savedRoute;\r\n\t}\r\n\r\n\treturn currentRoute ? ensureLocalPath(currentRoute) : null;\r\n}\r\n\r\n/**\r\n * Store the path in the session storage.\r\n * @param path\r\n * @remark This is used to redirect the user to the correct page after login.\r\n * @remark The path must be a local path, otherwise it is not stored.\r\n */\r\nexport function setStoredPath(path: string): void {\r\n\tconst url = new URL(path, window.location.origin);\r\n\tif (url.origin !== window.location.origin) {\r\n\t\treturn;\r\n\t}\r\n\tsessionStorage.setItem(UMB_STORAGE_REDIRECT_URL, url.toString());\r\n}\r\n","type StringMaybeUndefined = string | undefined;\r\n\r\n/**\r\n *\r\n * @param path\r\n */\r\nexport function transformServerPathToClientPath(path: T): T {\r\n\tif (path?.indexOf('~/') === 0) {\r\n\t\tpath = path.slice(1) as T;\r\n\t}\r\n\tif (path?.indexOf('/wwwroot/') === 0) {\r\n\t\tpath = path.slice(8) as T;\r\n\t}\r\n\treturn path;\r\n}\r\n","// TODO: Rename to something more obvious, naming wise this can mean anything. I suggest: umbracoManagementApiPath()\r\n/**\r\n *\r\n * @param path\r\n */\r\nexport function umbracoPath(path: string) {\r\n\treturn `/umbraco/management/api/v1${path}`;\r\n}\r\n","const SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\r\n// Match everything outside of normal chars and \" (quote character)\r\nconst NON_ALPHANUMERIC_REGEXP = /([^#-~| |!])/g;\r\n\r\n/**\r\n * Escapes HTML entities in a string.\r\n * @example escapeHTML(''), // \"<script>alert("XSS")</script>\"\r\n * @param html The HTML string to escape.\r\n * @returns The sanitized HTML string.\r\n */\r\nexport function escapeHTML(html: unknown): string {\r\n\tif (typeof html !== 'string' && html instanceof String === false) {\r\n\t\treturn html as string;\r\n\t}\r\n\r\n\treturn html\r\n\t\t.toString()\r\n\t\t.replace(/&/g, '&')\r\n\t\t.replace(SURROGATE_PAIR_REGEXP, function (value) {\r\n\t\t\tconst hi = value.charCodeAt(0);\r\n\t\t\tconst low = value.charCodeAt(1);\r\n\t\t\treturn '&#' + ((hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000) + ';';\r\n\t\t})\r\n\t\t.replace(NON_ALPHANUMERIC_REGEXP, function (value) {\r\n\t\t\treturn '&#' + value.charCodeAt(0) + ';';\r\n\t\t})\r\n\t\t.replace(//g, '>');\r\n}\r\n","import { DOMPurify } from '@umbraco-cms/backoffice/external/dompurify';\r\n\r\n/**\r\n * Sanitize a HTML string by removing any potentially harmful content such as scripts.\r\n * @param {string} html The HTML string to sanitize.\r\n * @returns The sanitized HTML string.\r\n */\r\nexport function sanitizeHTML(html: string): string {\r\n\treturn DOMPurify.sanitize(html);\r\n}\r\n","import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';\r\nimport type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';\r\nimport { UmbDeselectedEvent, UmbSelectedEvent, UmbSelectionChangeEvent } from '@umbraco-cms/backoffice/event';\r\nimport { UmbArrayState, UmbBooleanState } from '@umbraco-cms/backoffice/observable-api';\r\n\r\n/**\r\n * Manages the selection of items.\r\n * @class UmbSelectionManager\r\n */\r\nexport class UmbSelectionManager extends UmbControllerBase {\r\n\t#selectable = new UmbBooleanState(true);\r\n\tpublic readonly selectable = this.#selectable.asObservable();\r\n\r\n\t#selection = new UmbArrayState(>[], (x) => x);\r\n\tpublic readonly selection = this.#selection.asObservable();\r\n\tpublic readonly hasSelection = this.#selection.asObservablePart((x) => x.length > 0);\r\n\r\n\t#multiple = new UmbBooleanState(false);\r\n\tpublic readonly multiple = this.#multiple.asObservable();\r\n\r\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n\t#allow = (unique: ValueType) => true;\r\n\r\n\tconstructor(host: UmbControllerHost) {\r\n\t\tsuper(host);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns whether items can be selected.\r\n\t * @returns {*}\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic getSelectable() {\r\n\t\treturn this.#selectable.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets whether items can be selected.\r\n\t * @param {boolean} value\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic setSelectable(value: boolean) {\r\n\t\tthis.#selectable.setValue(value);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the current selection.\r\n\t * @returns {*}\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic getSelection() {\r\n\t\treturn this.#selection.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the current selection.\r\n\t * @param {Array} value\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic setSelection(value: Array) {\r\n\t\tif (this.getSelectable() === false) return;\r\n\t\tif (value === undefined) throw new Error('Value cannot be undefined');\r\n\r\n\t\tvalue.forEach((unique) => {\r\n\t\t\tif (this.#allow(unique) === false) {\r\n\t\t\t\tthrow new Error(`${unique} is now allowed to be selected`);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst newSelection = this.getMultiple() ? value : value.slice(0, 1);\r\n\t\tthis.#selection.setValue(newSelection);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns whether multiple items can be selected.\r\n\t * @returns {*}\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic getMultiple() {\r\n\t\treturn this.#multiple.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Sets whether multiple items can be selected.\r\n\t * @param {boolean} value\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic setMultiple(value: boolean) {\r\n\t\tthis.#multiple.setValue(value);\r\n\r\n\t\t/* If multiple is set to false, and the current selection is more than one,\r\n\t\tthen we need to set the selection to the first item. */\r\n\t\tif (value === false && this.getSelection().length > 1) {\r\n\t\t\tconst first = this.getSelection()[0];\r\n\t\t\tthis.clearSelection();\r\n\t\t\tthis.select(first);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles the given unique id in the current selection.\r\n\t * @param {(ValueType)} unique\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic toggleSelect(unique: ValueType) {\r\n\t\tif (this.getSelectable() === false) return;\r\n\t\tif (this.isSelected(unique)) {\r\n\t\t\tthis.deselect(unique);\r\n\t\t} else {\r\n\t\t\tthis.select(unique);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Appends the given unique id to the current selection.\r\n\t * @param {(ValueType)} unique\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic select(unique: ValueType) {\r\n\t\tif (this.getSelectable() === false) return;\r\n\t\tif (this.isSelected(unique)) return;\r\n\t\tif (this.#allow(unique) === false) {\r\n\t\t\tthrow new Error('The item is now allowed to be selected');\r\n\t\t}\r\n\t\tconst newSelection = this.getMultiple() ? [...this.getSelection(), unique] : [unique];\r\n\t\tthis.#selection.setValue(newSelection);\r\n\t\tthis.getHostElement().dispatchEvent(new UmbSelectedEvent(unique));\r\n\t\tthis.getHostElement().dispatchEvent(new UmbSelectionChangeEvent());\r\n\t}\r\n\r\n\t/**\r\n\t * Removes the given unique id from the current selection.\r\n\t * @param {(ValueType)} unique\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic deselect(unique: ValueType) {\r\n\t\tif (this.getSelectable() === false) return;\r\n\t\tconst newSelection = this.getSelection().filter((x) => x !== unique);\r\n\t\tthis.#selection.setValue(newSelection);\r\n\t\tthis.getHostElement().dispatchEvent(new UmbDeselectedEvent(unique));\r\n\t\tthis.getHostElement().dispatchEvent(new UmbSelectionChangeEvent());\r\n\t}\r\n\r\n\t/**\r\n\t * Returns true if the given unique id is selected.\r\n\t * @param {(ValueType)} unique\r\n\t * @returns {*}\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic isSelected(unique: ValueType) {\r\n\t\treturn this.getSelection().includes(unique);\r\n\t}\r\n\r\n\t/**\r\n\t * Clears the current selection.\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic clearSelection() {\r\n\t\tif (this.getSelectable() === false) return;\r\n\t\tthis.#selection.setValue([]);\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a function that determines if an item is selectable or not.\r\n\t * @param compareFn A function that determines if an item is selectable or not.\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic setAllowLimitation(compareFn: (unique: ValueType) => boolean): void {\r\n\t\tthis.#allow = compareFn;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the function that determines if an item is selectable or not.\r\n\t * @returns {*}\r\n\t * @memberof UmbSelectionManager\r\n\t */\r\n\tpublic getAllowLimitation() {\r\n\t\treturn this.#allow;\r\n\t}\r\n}\r\n","import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';\r\nimport type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';\r\nimport { UmbArrayState } from '@umbraco-cms/backoffice/observable-api';\r\n\r\nexport interface UmbState {\r\n\tunique: string;\r\n\tmessage: string;\r\n}\r\n\r\nexport class UmbStateManager extends UmbControllerBase {\r\n\t/**\r\n\t * Observable that emits all states in the state manager\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\tprotected _states = new UmbArrayState([], (x) => x.unique);\r\n\tpublic states = this._states.asObservable();\r\n\r\n\t/**\r\n\t * Observable that emits true if there are any states in the state manager\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\tpublic isOn = this._states.asObservablePart((x) => x.length > 0);\r\n\r\n\t/**\r\n\t * Observable that emits true if there are no states in the state manager\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\tpublic isOff = this._states.asObservablePart((x) => x.length === 0);\r\n\r\n\t/**\r\n\t * Creates an instance of UmbStateManager.\r\n\t * @param {UmbControllerHost} host\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\tconstructor(host: UmbControllerHost) {\r\n\t\tsuper(host);\r\n\t}\r\n\r\n\t/**\r\n\t * Add a new state to the state manager\r\n\t * @param {StateType} state\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\taddState(state: StateType) {\r\n\t\tif (!state.unique) throw new Error('State must have a unique property');\r\n\t\tif (this._states.getValue().find((x) => x.unique === state.unique)) {\r\n\t\t\tthrow new Error('State with unique already exists');\r\n\t\t}\r\n\t\tthis._states.setValue([...this._states.getValue(), state]);\r\n\t}\r\n\r\n\t/**\r\n\t * Add multiple states to the state manager\r\n\t * @param {StateType[]} states\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\taddStates(states: StateType[]) {\r\n\t\tstates.forEach((state) => this.addState(state));\r\n\t}\r\n\r\n\t/**\r\n\t * Remove a state from the state manager\r\n\t * @param {StateType['unique']} unique\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\tremoveState(unique: StateType['unique']) {\r\n\t\tthis._states.setValue(this._states.getValue().filter((x) => x.unique !== unique));\r\n\t}\r\n\r\n\t/**\r\n\t * Remove multiple states from the state manager\r\n\t * @param {StateType['unique'][]} uniques\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\tremoveStates(uniques: StateType['unique'][]) {\r\n\t\tthis._states.setValue(this._states.getValue().filter((x) => !uniques.includes(x.unique)));\r\n\t}\r\n\r\n\t/**\r\n\t * Get all states from the state manager\r\n\t * @returns {StateType[]} {StateType[]} All states in the state manager\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\tgetStates() {\r\n\t\treturn this._states.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Clear all states from the state manager\r\n\t * @memberof UmbStateManager\r\n\t */\r\n\tclear() {\r\n\t\tthis._states.setValue([]);\r\n\t}\r\n}\r\n","import type { UmbState } from './state.manager.js';\r\nimport { UmbStateManager } from './state.manager.js';\r\n\r\nexport class UmbReadOnlyStateManager extends UmbStateManager {\r\n\treadonly isReadOnly = this.isOn;\r\n}\r\n","import type { UmbState } from './state.manager.js';\r\nimport { UmbReadOnlyStateManager } from './read-only-state.manager.js';\r\nimport type { UmbVariantId } from '@umbraco-cms/backoffice/variant';\r\n\r\nexport interface UmbVariantState extends UmbState {\r\n\tvariantId: UmbVariantId;\r\n}\r\n\r\nexport class UmbReadOnlyVariantStateManager extends UmbReadOnlyStateManager {}\r\n","import type { UmbDeprecationArgs } from './types.js';\r\n\r\n/**\r\n * Helper class for deprecation warnings.\r\n * @exports\r\n * @class UmbDeprecation\r\n */\r\nexport class UmbDeprecation {\r\n\t#messagePrefix: string = 'Umbraco Backoffice:';\r\n\t#deprecated: string;\r\n\t#removeInVersion: string;\r\n\t#solution: string;\r\n\r\n\tconstructor(args: UmbDeprecationArgs) {\r\n\t\tthis.#deprecated = args.deprecated;\r\n\t\tthis.#removeInVersion = args.removeInVersion;\r\n\t\tthis.#solution = args.solution;\r\n\t}\r\n\r\n\t/**\r\n\t * Logs a warning message to the console.\r\n\t * @memberof UmbDeprecation\r\n\t */\r\n\twarn() {\r\n\t\tconsole.warn(\r\n\t\t\t`${this.#messagePrefix} ${this.#deprecated} The feature will be removed in version ${this.#removeInVersion}. ${this.#solution}`,\r\n\t\t);\r\n\t}\r\n}\r\n"],"names":["debounce","fn","ms","timeoutId","args","UmbDirection","blobDownload","data","filename","mimeType","blob","url","a","getGuidFromUdi","udi","withoutHost","getProcessedImageUrl","imagePath","options","searchParams","lerp","start","end","alpha","clamp","inverseLerp","value","distance","b","calculateExtrapolatedValue","initialValue","increaseFactor","getInterpolatedIndexOfPositionInWeightMap","target","weights","map","i","foundValue","aDiff","bDiff","foundIndex","targetDiff","interpolatedIndex","foundInterpolationWeight","getAccumulatedValueOfIndex","index","len","calc","isWithinRect","x","y","rect","expand","imageSize","opts","img","promise","resolve","reject","naturalWidth","naturalHeight","width","height","ratio","umbDeepMerge","source","fallback","result","key","UmbPaginationManager","#defaultValues","#pageSize","UmbNumberState","#totalItems","#totalPages","#currentPage","#skip","pageSize","#calculateTotalPages","totalItems","pageNumber","#calculateSkip","UmbChangeEvent","totalPages","skip","ensureLocalPath","path","fallbackPath","ensurePathEndsWithSlash","hasOwnOpener","pathname","windowLike","opener","openerLocation","currentLocation","decodeFilePath","encodeFilePath","aliasToPath","fromCamelCase","str","s","toCamelCase","generateAlias","text","incrementString","_","t","splitStringToArray","string","split","stringOrStringArrayContains","search","stringOrStringArrayIntersects","v","pathFolderName","removeInitialSlashFromPath","removeLastSlashFromPath","UMB_STORAGE_REDIRECT_URL","retrieveStoredPath","currentRoute","savedRoute","setStoredPath","transformServerPathToClientPath","umbracoPath","SURROGATE_PAIR_REGEXP","NON_ALPHANUMERIC_REGEXP","escapeHTML","html","hi","low","sanitizeHTML","DOMPurify","UmbSelectionManager","UmbControllerBase","host","#selectable","UmbBooleanState","#selection","UmbArrayState","#multiple","#allow","unique","newSelection","first","UmbSelectedEvent","UmbSelectionChangeEvent","UmbDeselectedEvent","compareFn","UmbStateManager","state","states","uniques","UmbReadOnlyStateManager","UmbReadOnlyVariantStateManager","UmbDeprecation","#messagePrefix","#deprecated","#removeInVersion","#solution"],"mappings":";;;;;;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