{"version":3,"file":"index.js","sources":["../../../../src/packages/core/localization/localize.element.ts","../../../../src/packages/core/localization/localize-date.element.ts","../../../../src/packages/core/localization/localize-number.element.ts","../../../../src/packages/core/localization/localize-relative-time.element.ts","../../../../src/packages/core/localization/registry/localization.registry.ts","../../../../src/packages/core/localization/components/ui-culture-input/ui-culture-input.element.ts"],"sourcesContent":["import { css, customElement, html, property, state, unsafeHTML } from '@umbraco-cms/backoffice/external/lit';\r\nimport { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';\r\n\r\n/**\r\n * This element allows you to localize a string with optional interpolation values.\r\n * @element umb-localize\r\n * @slot - The fallback value if the key is not found.\r\n */\r\n@customElement('umb-localize')\r\nexport class UmbLocalizeElement extends UmbLitElement {\r\n\t/**\r\n\t * The key to localize. The key is case sensitive.\r\n\t * @attr\r\n\t * @example key=\"general_ok\"\r\n\t */\r\n\t@property()\r\n\tkey!: string;\r\n\r\n\t/**\r\n\t * The values to forward to the localization function (must be JSON compatible).\r\n\t * @attr\r\n\t * @example args=\"[1,2,3]\"\r\n\t * @type {any[] | undefined}\r\n\t */\r\n\t@property({ type: Array })\r\n\targs?: unknown[];\r\n\r\n\t/**\r\n\t * If true, the key will be rendered instead of the localized value if the key is not found.\r\n\t * @attr\r\n\t */\r\n\t@property({ type: Boolean })\r\n\tdebug = false;\r\n\r\n\t@state()\r\n\tprotected get text(): string {\r\n\t\tconst localizedValue = this.localize.term(this.key, ...(this.args ?? []));\r\n\r\n\t\t// If the value is the same as the key, it means the key was not found.\r\n\t\tif (localizedValue === this.key) {\r\n\t\t\t(this.getHostElement() as HTMLElement).setAttribute('data-localize-missing', this.key);\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\t(this.getHostElement() as HTMLElement).removeAttribute('data-localize-missing');\r\n\r\n\t\treturn localizedValue;\r\n\t}\r\n\r\n\toverride render() {\r\n\t\treturn this.text.trim()\r\n\t\t\t? html`${unsafeHTML(this.text)}`\r\n\t\t\t: this.debug\r\n\t\t\t\t? html`${this.key}`\r\n\t\t\t\t: html``;\r\n\t}\r\n\r\n\tstatic override styles = [\r\n\t\tcss`\r\n\t\t\t:host {\r\n\t\t\t\tdisplay: contents;\r\n\t\t\t}\r\n\t\t`,\r\n\t];\r\n}\r\n\r\ndeclare global {\r\n\tinterface HTMLElementTagNameMap {\r\n\t\t'umb-localize': UmbLocalizeElement;\r\n\t}\r\n}\r\n","import { css, customElement, nothing, property } from '@umbraco-cms/backoffice/external/lit';\r\nimport { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';\r\n\r\n/**\r\n * This element allows you to localize a date\r\n * @element umb-localize-date\r\n * @slot - The fallback value if the key is not found.\r\n */\r\n@customElement('umb-localize-date')\r\nexport class UmbLocalizeDateElement extends UmbLitElement {\r\n\t/**\r\n\t * The date to localize.\r\n\t * @attr\r\n\t * @example date=\"Sep 22 2023\"\r\n\t */\r\n\t@property({ type: String })\r\n\tdate?: string | Date;\r\n\r\n\t/**\r\n\t * Formatting options\r\n\t * @attr\r\n\t * @example options={ dateStyle: 'full', timeStyle: 'long', timeZone: 'Australia/Sydney' }\r\n\t */\r\n\t@property({ type: Object })\r\n\toptions?: Intl.DateTimeFormatOptions;\r\n\r\n\t/**\r\n\t * Do not show the duration in the title.\r\n\t */\r\n\t@property({ type: Boolean })\r\n\tskipDuration = false;\r\n\r\n\toverride updated() {\r\n\t\tthis.#setTitle();\r\n\t}\r\n\r\n\toverride render() {\r\n\t\treturn this.date ? this.localize.date(this.date, this.options) : nothing;\r\n\t}\r\n\r\n\t#setTitle() {\r\n\t\tif (this.skipDuration) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet title = '';\r\n\r\n\t\tif (this.date) {\r\n\t\t\tconst now = new Date();\r\n\t\t\tconst d = new Date(this.date);\r\n\t\t\tconst duration = this.localize.duration(d, now);\r\n\t\t\ttitle = this.localize.term('general_duration', duration, d, now);\r\n\t\t}\r\n\r\n\t\tthis.title = title;\r\n\t}\r\n\r\n\tstatic override styles = [\r\n\t\tcss`\r\n\t\t\t:host {\r\n\t\t\t\tdisplay: contents;\r\n\t\t\t}\r\n\t\t`,\r\n\t];\r\n}\r\n\r\ndeclare global {\r\n\tinterface HTMLElementTagNameMap {\r\n\t\t'umb-localize-date': UmbLocalizeDateElement;\r\n\t}\r\n}\r\n","import { css, customElement, html, property, state, unsafeHTML } from '@umbraco-cms/backoffice/external/lit';\r\nimport { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';\r\n\r\n/**\r\n * This element allows you to localize a number\r\n * @element umb-localize-number\r\n * @slot - The fallback value if the key is not found.\r\n */\r\n@customElement('umb-localize-number')\r\nexport class UmbLocalizeNumberElement extends UmbLitElement {\r\n\t/**\r\n\t * The number to localize.\r\n\t * @attr\r\n\t * @example number=1_000_000\r\n\t */\r\n\t@property()\r\n\tnumber!: number | string;\r\n\r\n\t/**\r\n\t * Formatting options\r\n\t * @attr\r\n\t * @example options={ style: 'currency', currency: 'EUR' }\r\n\t */\r\n\t@property()\r\n\toptions?: Intl.NumberFormatOptions;\r\n\r\n\t@state()\r\n\tprotected get text(): string {\r\n\t\treturn this.localize.number(this.number, this.options);\r\n\t}\r\n\r\n\toverride render() {\r\n\t\treturn this.number ? html`${unsafeHTML(this.text)}` : html``;\r\n\t}\r\n\r\n\tstatic override styles = [\r\n\t\tcss`\r\n\t\t\t:host {\r\n\t\t\t\tdisplay: contents;\r\n\t\t\t}\r\n\t\t`,\r\n\t];\r\n}\r\n\r\ndeclare global {\r\n\tinterface HTMLElementTagNameMap {\r\n\t\t'umb-localize-number': UmbLocalizeNumberElement;\r\n\t}\r\n}\r\n","import { css, customElement, html, property, state, unsafeHTML } from '@umbraco-cms/backoffice/external/lit';\r\nimport { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';\r\n\r\n/**\r\n * This element allows you to localize a relative time\r\n * @element umb-localize-relative-time\r\n * @slot - The fallback value if the key is not found.\r\n */\r\n@customElement('umb-localize-relative-time')\r\nexport class UmbLocalizeRelativeTimeElement extends UmbLitElement {\r\n\t/**\r\n\t * The date to localize.\r\n\t * @attr\r\n\t * @example time=10\r\n\t */\r\n\t@property({ type: Number })\r\n\ttime!: number;\r\n\r\n\t/**\r\n\t * Formatting options\r\n\t * @attr\r\n\t * @example options={ dateStyle: 'full', timeStyle: 'long', timeZone: 'Australia/Sydney' }\r\n\t */\r\n\t@property({ type: Object })\r\n\toptions?: Intl.RelativeTimeFormatOptions;\r\n\r\n\t/**\r\n\t * Unit\r\n\t * @attr\r\n\t * @example unit='seconds'\r\n\t */\r\n\t@property()\r\n\tunit: Intl.RelativeTimeFormatUnit = 'seconds';\r\n\r\n\t@state()\r\n\tprotected get text(): string {\r\n\t\treturn this.localize.relativeTime(this.time, this.unit, this.options);\r\n\t}\r\n\r\n\toverride render() {\r\n\t\treturn this.time ? html`${unsafeHTML(this.text)}` : html``;\r\n\t}\r\n\r\n\tstatic override styles = [\r\n\t\tcss`\r\n\t\t\t:host {\r\n\t\t\t\tdisplay: contents;\r\n\t\t\t}\r\n\t\t`,\r\n\t];\r\n}\r\n\r\ndeclare global {\r\n\tinterface HTMLElementTagNameMap {\r\n\t\t'umb-localize-relative-time': UmbLocalizeRelativeTimeElement;\r\n\t}\r\n}\r\n","import type { ManifestLocalization } from '../extensions/localization.extension.js';\r\nimport {\r\n\ttype UmbLocalizationSetBase,\r\n\ttype UmbLocalizationDictionary,\r\n\ttype UmbLocalizationFlatDictionary,\r\n\tUMB_DEFAULT_LOCALIZATION_CULTURE,\r\n} from '@umbraco-cms/backoffice/localization-api';\r\nimport { umbLocalizationManager } from '@umbraco-cms/backoffice/localization-api';\r\nimport type { UmbBackofficeExtensionRegistry } from '@umbraco-cms/backoffice/extension-registry';\r\nimport { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';\r\nimport { UmbStringState } from '@umbraco-cms/backoffice/observable-api';\r\nimport { combineLatest } from '@umbraco-cms/backoffice/external/rxjs';\r\nimport { hasDefaultExport, loadManifestPlainJs } from '@umbraco-cms/backoffice/extension-api';\r\n\r\n/**\r\n *\r\n * @param innerDictionary\r\n * @param dictionaryName\r\n * @param dictionary\r\n */\r\nfunction addOrUpdateDictionary(\r\n\tinnerDictionary: UmbLocalizationFlatDictionary,\r\n\tdictionaryName: string,\r\n\tdictionary: UmbLocalizationDictionary['value'],\r\n) {\r\n\tfor (const [key, value] of Object.entries(dictionary)) {\r\n\t\tinnerDictionary[`${dictionaryName}_${key}`] = value;\r\n\t}\r\n}\r\n\r\nexport class UmbLocalizationRegistry {\r\n\t#currentLanguage = new UmbStringState(\r\n\t\tdocument.documentElement.lang !== '' ? document.documentElement.lang : UMB_DEFAULT_LOCALIZATION_CULTURE,\r\n\t);\r\n\treadonly currentLanguage = this.#currentLanguage.asObservable();\r\n\r\n\t#loadedExtAliases: Array = [];\r\n\r\n\t/**\r\n\t * Get the current registered translations.\r\n\t * @returns {Map} Returns the registered translations\r\n\t */\r\n\tget localizations() {\r\n\t\treturn umbLocalizationManager.localizations;\r\n\t}\r\n\r\n\tconstructor(extensionRegistry: UmbBackofficeExtensionRegistry) {\r\n\t\tcombineLatest([this.currentLanguage, extensionRegistry.byType('localization')]).subscribe(\r\n\t\t\tasync ([currentLanguage, extensions]) => {\r\n\t\t\t\tconst locale = new Intl.Locale(currentLanguage);\r\n\t\t\t\tconst currentLanguageExtensions = extensions.filter(\r\n\t\t\t\t\t(ext) =>\r\n\t\t\t\t\t\text.meta.culture.toLowerCase() === locale.baseName.toLowerCase() ||\r\n\t\t\t\t\t\text.meta.culture.toLowerCase() === locale.language.toLowerCase(),\r\n\t\t\t\t);\r\n\r\n\t\t\t\t// If there are no extensions for the current language, return early\r\n\t\t\t\tif (!currentLanguageExtensions.length) return;\r\n\r\n\t\t\t\t// Register the new translations only if they have not been registered before\r\n\t\t\t\tconst diff = currentLanguageExtensions.filter((ext) => !this.#loadedExtAliases.includes(ext.alias));\r\n\r\n\t\t\t\t// Load all localizations\r\n\t\t\t\tconst translations = await Promise.all(currentLanguageExtensions.map(this.#loadExtension));\r\n\r\n\t\t\t\t// If there are no translations, return early\r\n\t\t\t\tif (!translations.length) return;\r\n\r\n\t\t\t\tif (diff.length) {\r\n\t\t\t\t\tconst filteredTranslations = translations.filter((t) => diff.some((ext) => ext.meta.culture === t.$code));\r\n\t\t\t\t\tumbLocalizationManager.registerManyLocalizations(filteredTranslations);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Set the document language\r\n\t\t\t\tconst newLang = locale.baseName.toLowerCase();\r\n\t\t\t\tif (document.documentElement.lang.toLowerCase() !== newLang) {\r\n\t\t\t\t\tdocument.documentElement.lang = newLang;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Set the document direction to the direction of the primary language\r\n\t\t\t\tconst newDir = translations[0].$dir ?? 'ltr';\r\n\t\t\t\tif (document.documentElement.dir !== newDir) {\r\n\t\t\t\t\tdocument.documentElement.dir = newDir;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t);\r\n\t}\r\n\r\n\t#loadExtension = async (extension: ManifestLocalization) => {\r\n\t\tthis.#loadedExtAliases.push(extension.alias);\r\n\r\n\t\tconst innerDictionary: UmbLocalizationFlatDictionary = {};\r\n\r\n\t\t// If extension contains a dictionary, add it to the inner dictionary.\r\n\t\tif (extension.meta.localizations) {\r\n\t\t\tfor (const [dictionaryName, dictionary] of Object.entries(extension.meta.localizations)) {\r\n\t\t\t\taddOrUpdateDictionary(innerDictionary, dictionaryName, dictionary);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If extension contains a js file, load it and add the default dictionary to the inner dictionary.\r\n\t\tif (extension.js) {\r\n\t\t\tconst loadedExtension = await loadManifestPlainJs(extension.js);\r\n\r\n\t\t\tif (loadedExtension && hasDefaultExport(loadedExtension)) {\r\n\t\t\t\tfor (const [dictionaryName, dictionary] of Object.entries(loadedExtension.default)) {\r\n\t\t\t\t\taddOrUpdateDictionary(innerDictionary, dictionaryName, dictionary);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Notify subscribers that the inner dictionary has changed.\r\n\t\treturn {\r\n\t\t\t$code: extension.meta.culture.toLowerCase(),\r\n\t\t\t$dir: extension.meta.direction ?? 'ltr',\r\n\t\t\t...innerDictionary,\r\n\t\t} satisfies UmbLocalizationSetBase;\r\n\t};\r\n\r\n\t/**\r\n\t * Load a language from the extension registry.\r\n\t * @param {string} locale The locale to load.\r\n\t */\r\n\tloadLanguage(locale: string) {\r\n\t\tthis.#currentLanguage.setValue(locale.toLowerCase());\r\n\t}\r\n}\r\n\r\nexport const umbLocalizationRegistry = new UmbLocalizationRegistry(umbExtensionsRegistry);\r\n","import type { ManifestLocalization } from '../../extensions/localization.extension.js';\r\nimport { UmbChangeEvent } from '@umbraco-cms/backoffice/event';\r\nimport { css, html, customElement, query, state, property } from '@umbraco-cms/backoffice/external/lit';\r\nimport type { UUISelectEvent } from '@umbraco-cms/backoffice/external/uui';\r\nimport { UUIFormControlMixin } from '@umbraco-cms/backoffice/external/uui';\r\nimport { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';\r\nimport { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';\r\n\r\ninterface UmbCultureInputOption {\r\n\tname: string;\r\n\tvalue: string;\r\n}\r\n\r\n@customElement('umb-ui-culture-input')\r\nexport class UmbUiCultureInputElement extends UUIFormControlMixin(UmbLitElement, '') {\r\n\t@state()\r\n\tprivate _options: Array = [];\r\n\r\n\t@query('uui-combobox')\r\n\tprivate _selectElement!: HTMLInputElement;\r\n\r\n\t@property({ type: String })\r\n\toverride get value() {\r\n\t\treturn super.value;\r\n\t}\r\n\toverride set value(value: FormDataEntryValue | FormData) {\r\n\t\tif (typeof value === 'string') {\r\n\t\t\tconst oldValue = super.value;\r\n\t\t\tsuper.value = value.toLowerCase();\r\n\t\t\tthis.requestUpdate('value', oldValue);\r\n\t\t}\r\n\t}\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.#observeTranslations();\r\n\t}\r\n\r\n\t#observeTranslations() {\r\n\t\tthis.observe(\r\n\t\t\tumbExtensionsRegistry.byType('localization'),\r\n\t\t\t(localizationManifests) => {\r\n\t\t\t\tthis.#mapToOptions(localizationManifests);\r\n\t\t\t},\r\n\t\t\t'umbObserveLocalizationManifests',\r\n\t\t);\r\n\t}\r\n\r\n\t#mapToOptions(manifests: Array) {\r\n\t\tthis._options = manifests\r\n\t\t\t.filter((isoCode) => isoCode !== undefined)\r\n\t\t\t.map((manifest) => ({\r\n\t\t\t\tname: manifest.name,\r\n\t\t\t\tvalue: manifest.meta.culture.toLowerCase(),\r\n\t\t\t}));\r\n\t}\r\n\r\n\tprotected override getFormElement() {\r\n\t\treturn this._selectElement;\r\n\t}\r\n\r\n\t#onCustomValidationChange(event: UUISelectEvent) {\r\n\t\tthis.value = event.target.value.toString();\r\n\t\tthis.dispatchEvent(new UmbChangeEvent());\r\n\t}\r\n\r\n\toverride render() {\r\n\t\treturn html`\r\n\t\t\t ({\r\n\t\t\t\t\tname: e.name,\r\n\t\t\t\t\tvalue: e.value,\r\n\t\t\t\t\tselected: e.value == this.value,\r\n\t\t\t\t}))}>\r\n\t\t`;\r\n\t}\r\n\r\n\tstatic override styles = [\r\n\t\tcss`\r\n\t\t\t:host {\r\n\t\t\t\tdisplay: block;\r\n\t\t\t}\r\n\t\t`,\r\n\t];\r\n}\r\n\r\nexport default UmbUiCultureInputElement;\r\n\r\ndeclare global {\r\n\tinterface HTMLElementTagNameMap {\r\n\t\t'umb-ui-culture-input': UmbUiCultureInputElement;\r\n\t}\r\n}\r\n"],"names":["UmbLocalizeElement","UmbLitElement","localizedValue","html","unsafeHTML","css","__decorateClass","property","state","customElement","_UmbLocalizeDateElement_instances","setTitle_fn","UmbLocalizeDateElement","__privateAdd","__privateMethod","nothing","title","now","d","duration","UmbLocalizeNumberElement","UmbLocalizeRelativeTimeElement","addOrUpdateDictionary","innerDictionary","dictionaryName","dictionary","key","value","UmbLocalizationRegistry","extensionRegistry","#currentLanguage","UmbStringState","UMB_DEFAULT_LOCALIZATION_CULTURE","#loadedExtAliases","#loadExtension","extension","loadedExtension","loadManifestPlainJs","hasDefaultExport","combineLatest","currentLanguage","extensions","locale","currentLanguageExtensions","ext","diff","translations","filteredTranslations","t","umbLocalizationManager","newLang","newDir","umbLocalizationRegistry","umbExtensionsRegistry","_UmbUiCultureInputElement_instances","observeTranslations_fn","mapToOptions_fn","onCustomValidationChange_fn","UmbUiCultureInputElement","UUIFormControlMixin","oldValue","localizationManifests","manifests","isoCode","manifest","event","UmbChangeEvent","query"],"mappings":";;;;;;;;;;;;;;AASa,IAAAA,IAAN,cAAiCC,EAAc;AAAA,EAA/C,cAAA;AAAA,UAAA,GAAA,SAAA,GAuBE,KAAA,QAAA;AAAA,EAAA;AAAA,EAGR,IAAc,OAAe;AACtB,UAAAC,IAAiB,KAAK,SAAS,KAAK,KAAK,KAAK,GAAI,KAAK,QAAQ,EAAG;AAGpE,WAAAA,MAAmB,KAAK,OAC1B,KAAK,eAAe,EAAkB,aAAa,yBAAyB,KAAK,GAAG,GAC9E,OAGP,KAAK,eAAA,EAAiC,gBAAgB,uBAAuB,GAEvEA;AAAA,EAAA;AAAA,EAGC,SAAS;AACjB,WAAO,KAAK,KAAK,KAAK,IACnBC,IAAOC,EAAW,KAAK,IAAI,CAAC,KAC5B,KAAK,QACJD,4BAA+B,KAAK,GAAG,YACvCA;AAAA,EAAA;AAUN;AAvDaH,EAgDI,SAAS;AAAA,EACxBK;AAAA;AAAA;AAAA;AAAA;AAKD;AA/CAC,EAAA;AAAA,EADCC,EAAS;AAAA,GANEP,EAOZ,WAAA,OAAA,CAAA;AASAM,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,MAAO,CAAA;AAAA,GAfbP,EAgBZ,WAAA,QAAA,CAAA;AAOAM,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GAtBfP,EAuBZ,WAAA,SAAA,CAAA;AAGcM,EAAA;AAAA,EADbE,EAAM;AAAA,GAzBKR,E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