{ "version": 3, "sources": ["angular:script/global:scripts.js"], "sourcesContent": ["\nclass CustomInput extends HTMLInputElement {\n static observedAttributes = ['autocomplete', 'type', 'name', 'pattern', 'customValidity',];\n /**\n * @type {Object.<(string,RegExp)>}\n */\n static PatternMap = {\n phoneNumber: /(\\+(9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1))*\\s*[\\d\\s]*/,\n mobilePhoneNumber: /(\\+(9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1))*\\s*[\\d\\s]*/,\n };\n /**\n * @typedef {('button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week')} InputType\n * @typedef {(Object.<(string,InputType)>)} InputTypeMap\n * @type {InputTypeMap}\n */\n static TypeMap = {\n firstName: 'text',\n lastName: 'text',\n reference: 'text',\n email: 'email',\n organizationName: 'text',\n line1: 'text',\n line2: 'text',\n city: 'text',\n postalCode: 'text',\n regionCode: 'text',\n country: 'text',\n phoneNumber: 'tel',\n mobilePhoneNumber: 'tel',\n note: 'text',\n gln: 'text',\n cvr: 'text',\n username: 'text',\n password: 'password',\n\n };\n /**\n * @typedef {('on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'email' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'impp' | 'url' | 'webauthn')} InputAutoCompleteOption\n * @typedef {(Object.<(string,InputAutoCompleteOption)>)} InputAutoCompleteOptionMap\n * @type {InputAutoCompleteOptionMap}\n * */\n static AutocompleteMap = {\n firstName: 'given-name',\n reference: 'off',\n lastName: 'family-name',\n email: 'email',\n organizationName: 'organization',\n line1: 'address-line1',\n line2: 'address-line2',\n city: 'address-level2',\n postalCode: 'postal-code',\n regionCode: 'off',\n country: 'country',\n phoneNumber: 'tel',\n mobilePhoneNumber: 'tel',\n note: 'off',\n gln: 'on',\n cvr: 'on',\n username: 'username',\n password: 'current-password'\n };\n /**\n * @type {Array.<(string)>}\n */\n static ErrorTypes = [\n 'badInput',\n 'customError',\n 'patternMismatch',\n 'rangeOverflow',\n 'rangeUnderflow',\n 'stepMismatch',\n 'tooLong',\n 'tooShort',\n 'typeMismatch',\n 'valid',\n 'valueMissing',\n ]\n\n connectedCallback() {\n this.addEventListener('input', this.checkValidity());\n }\n disconnectedCallback() {\n this.removeEventListener('input', this.checkValidity());\n }\n\n /**\n *\n * @param {string} name\n * @param {string} oldValue\n * @param {string} newValue\n */\n attributeChangedCallback(name, oldValue, newValue) {\n this.#setName(this.name);\n }\n /**\n *\n * @returns {string}\n */\n #formName() {\n let fieldWithForm = this.closest('fieldset[form]');\n let formElm = fieldWithForm != null ? window[fieldWithForm.getAttribute('form')] : this.closest('form');\n return formElm.name;\n }\n /**\n *\n * @returns {string}\n */\n #fieldsetName() {\n return this.closest('fieldset')?.name ?? '';\n }\n\n #setLabel() {\n this.#translate([this.#formName(), this.#fieldsetName(), this.name, 'label']).then(text => {\n if (!(text?.length > 0))\n return;\n let oldLabelElm = this.closest('label').querySelector('.label');\n if (oldLabelElm != null)\n oldLabelElm.remove();\n let labelElm = document.createElement('span');\n labelElm.className = 'label';\n labelElm.innerHTML = text;\n this.parentElement.prepend(labelElm);\n })\n }\n /**\n *\n */\n #setPlaceholder() {\n if (this.placeholder?.length > 0)\n this.placeholder = this.placeholder;\n else\n this.#translate([this.#formName(), this.#fieldsetName(), this.name, 'placeholder']).then(text => this.placeholder = text);\n }\n /**\n *\n */\n #setAutocomplete() {\n let fieldsetName = this.#fieldsetName();\n this.autocomplete = this.autocomplete?.length > 0 ? this.autocomplete : [['shipping', 'billing'].includes(fieldsetName) ? fieldsetName : '', CustomInput.AutocompleteMap[this.name] ?? 'off'].join(' ');\n }\n /**\n *\n * @param {string} name\n */\n #setName(name) {\n this.name = name;\n this.#setAutocomplete();\n this.type = this.type?.length > 0 ? this.type : CustomInput.TypeMap[name];\n this.pattern = this.pattern?.length > 0 ? this.pattern : CustomInput.PatternMap[name] ?? null;\n this.#setPlaceholder();\n this.#setLabel();\n }\n /**\n *\n * @param {Array.<(string)>} keys\n * @returns {string}\n */\n #translate(keys) {\n let translationMap = JSON.parse(sessionStorage.getItem('translationMap'));\n // console.log(translationMap)\n return keys.reduce((acc, key) => acc[key], translationMap);\n }\n /**\n *\n * @returns {void}\n */\n checkValidity() {\n // Custom\n if (this.customValidity != null)\n this.setCustomValidity(this.customValidity(this));\n\n // Validity\n let validity = this.validity;\n if (this.parentElement.querySelector('.errors') != null)\n this.parentElement.querySelector('.errors').remove();\n if (validity.valid)\n return;\n // Errors\n let errorElm = document.createElement('span');\n errorElm.className = 'errors';\n let formName = this.#formName();\n let fieldsetName = this.#fieldsetName();\n [\n 'badInput',\n 'customError',\n 'patternMismatch',\n 'rangeOverflow',\n 'rangeUnderflow',\n 'stepMismatch',\n 'tooLong',\n 'tooShort',\n 'typeMismatch',\n 'valid',\n 'valueMissing',\n ].forEach(_validityType => {\n if (validity[_validityType]) {\n let _errorElm = document.createElement('span');\n _errorElm.className = _validityType;\n this.#translate([formName, fieldsetName, this.name, _validityType]).then(_ => _errorElm.innerHTML = _);\n errorElm.append(_errorElm);\n }\n })\n\n this.parentElement.append(errorElm);\n // this.reportValidity();\n }\n}\ncustomElements.define('custom-input', CustomInput, { extends: \"input\" })\n\n// @w11k/ngx-componentdestroyed\n// @ngx-translate\n\nclass CustomLink extends HTMLAnchorElement {\n click(event) {\n event.preventDefault();\n const _url = new URL(this.href, window.origin);\n this.dispatchEvent(new CustomEvent('navigate', {\n bubbles: true,\n detail: _url.href.replace(_url.origin,''),\n }))\n }\n connectedCallback() {\n this.addEventListener('click', this.click);\n }\n disconnectedCallback() {\n this.removeEventListener('click', this.click);\n }\n\n}\ncustomElements.define('navigate-link', CustomLink, { extends: \"a\" })\n\nvar paints = [\n // 'dist/browser/assets/blob.js',\n]\nif (window.CSS['paintWorklet']) {\n paints.forEach(paint => window.CSS['paintWorklet'].addModule(paint));\n}\n\n"], "mappings": "AACA,MAAM,oBAAoB,gBAAiB,CACvC,OAAO,mBAAqB,CAAC,eAAgB,OAAQ,OAAQ,UAAW,gBAAiB,EAIzF,OAAO,WAAa,CAChB,YAAa,iKACb,kBAAmB,gKACvB,EAMA,OAAO,QAAU,CACb,UAAW,OACX,SAAU,OACV,UAAW,OACX,MAAO,QACP,iBAAkB,OAClB,MAAO,OACP,MAAO,OACP,KAAM,OACN,WAAY,OACZ,WAAY,OACZ,QAAS,OACT,YAAa,MACb,kBAAmB,MACnB,KAAM,OACN,IAAK,OACL,IAAK,OACL,SAAU,OACV,SAAU,UAEd,EAMA,OAAO,gBAAkB,CACrB,UAAW,aACX,UAAW,MACX,SAAU,cACV,MAAO,QACP,iBAAkB,eAClB,MAAO,gBACP,MAAO,gBACP,KAAM,iBACN,WAAY,cACZ,WAAY,MACZ,QAAS,UACT,YAAa,MACb,kBAAmB,MACnB,KAAM,MACN,IAAK,KACL,IAAK,KACL,SAAU,WACV,SAAU,kBACd,EAIA,OAAO,WAAa,CAChB,WACA,cACA,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CACvC,MAAMK,EAAO,CACTA,EAAM,eAAe,EACrB,MAAMC,EAAO,IAAI,IAAI,KAAK,KAAM,OAAO,MAAM,EAC7C,KAAK,cAAc,IAAI,YAAY,WAAY,CAC3C,QAAS,GACT,OAAQA,EAAK,KAAK,QAAQA,EAAK,OAAO,EAAE,CAC5C,CAAC,CAAC,CACN,CACA,mBAAoB,CAChB,KAAK,iBAAiB,QAAS,KAAK,KAAK,CAC7C,CACA,sBAAuB,CACnB,KAAK,oBAAoB,QAAS,KAAK,KAAK,CAChD,CAEJ,CACA,eAAe,OAAO,gBAAiB,WAAY,CAAE,QAAS,GAAI,CAAC,EAEnE,IAAI,OAAS,CAEb,EACI,OAAO,IAAI,cACX,OAAO,QAAQC,GAAS,OAAO,IAAI,aAAgB,UAAUA,CAAK,CAAC", "names": ["name", "oldValue", "newValue", "#setName", "#formName", "fieldWithForm", "#fieldsetName", "#setLabel", "#translate", "text", "oldLabelElm", "labelElm", "#setPlaceholder", "#setAutocomplete", "fieldsetName", "keys", "translationMap", "acc", "key", "validity", "errorElm", "formName", "_validityType", "_errorElm", "_", "event", "_url", "paint"] }