@descope/web-components-ui 3.24.0 → 3.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +2134 -1370
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3057 -2083
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/8961.js +1 -1
- package/dist/umd/8961.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-email-field.js +55 -0
- package/dist/umd/descope-email-field.js.map +1 -0
- package/dist/umd/descope-hybrid-field-index-js.js +3 -3
- package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
- package/dist/umd/descope-new-email.js +55 -0
- package/dist/umd/descope-new-email.js.LICENSE.txt +11 -0
- package/dist/umd/descope-new-email.js.map +1 -0
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js.map +1 -1
- package/dist/umd/descope-policy-validation-index-js.js +1 -1
- package/dist/umd/descope-policy-validation-index-js.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +45 -43
- package/src/components/descope-hybrid-field/index.js +1 -1
- package/src/components/descope-new-password/NewPasswordClass.js +1 -0
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +1 -0
- package/src/components/descope-policy-validation/PolicyValidationClass.js +21 -6
- package/src/index.cjs.js +0 -1
- package/src/index.js +0 -1
- package/src/theme/components/index.js +3 -1
- package/stories/descope-email-field.stories.js +1 -1
- package/stories/descope-policy-validation.stories.js +21 -1
- package/dist/umd/descope-email-field-index-js.js +0 -55
- package/dist/umd/descope-email-field-index-js.js.map +0 -1
- package/src/components/descope-email-field/EmailFieldClass.js +0 -138
- package/src/components/descope-email-field/emailPattern.js +0 -7
- package/src/components/descope-email-field/index.js +0 -6
- package/src/theme/components/emailField.js +0 -55
- /package/dist/umd/{descope-email-field-index-js.js.LICENSE.txt → descope-email-field.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descope-new-password-index-js.js","mappings":"yOAoBO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,cAE7CC,EAAA,0CAmFOC,GAAuB,EAAAC,EAAAC,KAC5B,EAAAC,EAAAC,IAAgB,CAClBC,SAAcC,EAAAC,IAEZJ,EAAAK,IACA,EAAAL,EAAAM,IAAe,CACjBC,WAAA,0CACAC,iBAAA,IAEER,EAAAS,GA1FFC,GACA,cAAAA,EACA,6BAAAC,GACA,OAAAf,EAAAgB,OAAAF,EAAAC,oBAAA,GACA,CAEAE,KAEA,IAAAC,GACAC,MAAAD,UAIM,EAAApB,EAAAsB,IAAYC,KAAAA,KAAAC,YAAA,CAA2BC,aAAA,iBAC7C,CAEA,qBAAAC,CAAAC,GACA,IAAAA,EAEA,YADAJ,KAAAJ,MAAAS,SAIA,MAAAC,EAAA,CACAV,KAAA,gBACAW,MAAA,OACAC,MAAA,mBAGAC,EAAA,CACAb,KAAA,wBACAW,MAAA,SACAC,MAAA,mBAGAR,KAAAJ,KAAAc,OAAAC,OAAAC,SAAAC,cAAA,gBACAC,KAAA,YACAR,IAGAN,KAAAC,YAAAc,YAAAf,KAAAJ,MACAI,KAAAJ,KAAAoB,iBAAA,aACAC,UAAAC,UAAAC,UAAAnB,KAAAoB,OACAV,OAAAC,OAAAX,KAAAJ,KAAAa,GAGAY,WAAA,KACAX,OAAAC,OAAAX,KAAAJ,KAAAU,IACS,MAET,CAEA,YAAAgB,GACAtB,KAAAuB,OACA,CAEA,wBAAAC,CAAAC,EAAAC,EAAAC,GACA7B,MAAA8B,0BAAAH,EAAAC,EAAAC,GAOA,SAAAF,GACAzB,KAAAC,YAAA4B,SAAAF,GAGAD,IAAAC,I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zS,SAAA,wCACnB0S,cAAA,CAAmB1S,SAAA,wCACnB2S,YAAA,CAAiB3S,SAAA,0CAGV4S,GAA8B,EAAAC,EAAA/X,KACnC,EAAA0I,EAAAxI,IAAgB,CAAG8X,uBAAuB,EAAA7E,EAAAvT,IAAgB,oBAC1D,EAAA8I,EAAAxI,IAAgB,CAClBC,SAAA,CACA6F,cAAA,CAAuBd,SAAA,YAAAK,SAAA,aACvBH,SAAA,GACAC,WAAA,GACA4E,QAAA,GACAgO,YAAA,IAAqB/T,EAAAqB,SAAA,gBACrB2S,YAAA,IAAqBhU,EAAAqB,SAAA,gBACrB4S,YAAA,IAAqBjU,EAAAqB,SAAA,gBACrB6S,aAAA,IAAsBlU,EAAAqB,SAAA,iBACtBwE,gBAAA,IAAyB7F,EAAAqB,SAAA,oBACzB8S,UAAA,CAAmB9S,SAAA,SACnB+S,YAAA,IAAqBpU,EAAAqB,SAAA,OACrBgT,aAAA,IAAsBb,EAAAnS,SAAA,eACtBiT,uBAAA,IAAgCZ,EAAArS,SAAA,SAChCkT,qBAAA,IAA8BZ,EAAAtS,SAAA,SAC9BmT,kBAAA,IAA2Bf,EAAApS,SAAA,WAC3BoT,kBAAA,IAA2Bf,EAAArS,SAAA,WAC3BqT,gBAAA,IAAyBf,EAAAtS,SAAA,cAGvBmD,EAAApI,GACAoI,EAAAhI,GAxBmC,CAyBrC4S,kCC7VO,MAAAuF,EAAA,CAAA3O,EAAA4O,IACP5O,EAAAwB,QAAA,cAA8B,CAAAqN,EAAAtH,IAAAqH,IAAArH,IAAAsH,oGCC9BlV,eAAAC,OAAsBkV,EAAAhV,EAAegV,EAAA/U","sources":["webpack://@descope/web-components-ui/../components/descope-text-field/src/component/TextFieldClass.js","webpack://@descope/web-components-ui/../components/descope-text-field/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text-field/src/component/textFieldMappings.js","webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/NewPasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/descope-new-password-internal/componentName.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/descope-new-password-internal/index.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-password/PasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-password/passwordDraggableMixin.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/PolicyValidationClass.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/index.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n} from '@descope-ui/common/components-helpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '@descope-ui/common/theme-helpers';\nimport textFieldMappings from './textFieldMappings';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n\n // Excluded from syncAttrs (bidirectional would let vaadin revert host\n // values). Push host → vaadin one-way so authored placeholder applies.\n forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({\n proxyProps: ['value', 'selectionStart', 'selectionEnd'],\n useProxyTargets: true,\n }),\n componentNameValidationMixin,\n customMixin,\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style', 'placeholder'],\n componentName,\n }),\n);\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, componentName };\n","const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: {\n selector: '[required]::part(required-indicator)::after',\n },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: {\n selector: () => '::slotted(input:disabled::placeholder)',\n },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n inputValueFontWeight: [\n { ...input, property: 'font-weight' },\n { ...externalInput, property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n {\n selector: () => ':host input:placeholder-shown',\n property: 'font-weight',\n },\n { ...externalPlaceholder, property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: {\n ...errorMessage,\n property: 'padding-inline-start',\n },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: {\n ...errorMessage,\n property: 'background-position',\n },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n inputTextSecurity: [\n { ...input, property: '-webkit-text-security' },\n { ...input, property: 'text-security' },\n { ...externalInput, property: '-webkit-text-security' },\n { ...externalInput, property: 'text-security' },\n ],\n};\n","import { compose } from '../helpers';\nimport {\n changeMixin,\n inputEventsDispatchingMixin,\n inputValidationMixin,\n normalizeBooleanAttributesMixin,\n} from '../mixins';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { compose } from '../../helpers';\nimport { createStyleMixin, proxyInputMixin, draggableMixin, createProxy } from '../../mixins';\nimport { componentName as descopeInternalComponentName } from './descope-new-password-internal/componentName';\nimport { PasswordClass } from '../descope-password/PasswordClass';\nimport { useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';\nimport { PolicyValidationClass } from '../descope-policy-validation/PolicyValidationClass';\n\nexport const componentName = getComponentName('new-password');\n\nconst policyPreviewVars = PolicyValidationClass.cssVarList;\n\nconst customMixin = (superclass) =>\n class NewPasswordMixinClass extends superclass {\n init() {\n super.init?.();\n\n const template = document.createElement('template');\n\n const externalInputAttr = this.getAttribute('external-input');\n\n template.innerHTML = `\n\t\t\t<${descopeInternalComponentName}\n\t\t\t\tname=\"new-password\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\tslot=\"input\"\n external-input=\"${externalInputAttr}\"\n\t\t\t>\n </${descopeInternalComponentName}>\n\t\t\t`;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n\n if (this.getAttribute('external-input') === 'true') {\n this.initExternalInput();\n }\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'password-label',\n 'password-placeholder',\n 'confirm-label',\n 'confirm-placeholder',\n 'full-width',\n 'size',\n 'bordered',\n 'label',\n 'has-confirm',\n 'invalid',\n 'readonly',\n 'disabled',\n 'draggable',\n 'has-validation',\n 'policy-label',\n 'active-policies',\n 'available-policies',\n 'data-password-policy-value-minlength',\n 'data-password-policy-value-passwordstrength',\n 'data-password-policy-value-disallowedchars',\n 'data-password-policy-value-email',\n 'label-type',\n 'manual-visibility-toggle',\n ],\n });\n }\n\n createSlottedExternalInput(node, slotName) {\n const externalInput = node.querySelector('input');\n const slotEle = document.createElement('slot');\n\n const targetSlot = externalInput.getAttribute('slot');\n\n slotEle.setAttribute('name', slotName);\n slotEle.setAttribute('slot', targetSlot);\n\n node.appendChild(slotEle);\n\n // move external input\n externalInput.setAttribute('slot', slotName);\n externalInput.setAttribute('name', this.getAttribute('name'));\n externalInput.setAttribute('data-hidden-input', 'true');\n\n this.appendChild(externalInput);\n }\n\n initExternalInput() {\n // get descope input components\n this.passwordInput = this.inputElement.querySelector('[data-id=\"password\"]');\n this.confirmInput = this.inputElement.querySelector('[data-id=\"confirm\"]');\n\n // create slots for external password input\n this.createSlottedExternalInput(this.passwordInput, 'external-password-input');\n this.createSlottedExternalInput(this.confirmInput, 'external-confirm-input');\n }\n };\n\nconst {\n host,\n label,\n internalInputsWrapper,\n errorMessage,\n helperText,\n passwordInput,\n policyPreview,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n internalInputsWrapper: { selector: 'descope-new-password-internal .wrapper' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n passwordInput: { selector: 'descope-password' },\n policyPreview: { selector: 'descope-policy-validation' },\n};\n\nexport const NewPasswordClass = compose(\n createStyleMixin({\n mappings: {\n fontSize: [\n host,\n {},\n {\n selector: PasswordClass.componentName,\n property: PasswordClass.cssVarList.fontSize,\n },\n ],\n fontFamily: [label, errorMessage, helperText],\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: {\n ...passwordInput,\n property: PasswordClass.cssVarList.inputValueFontWeight,\n },\n inputPlaceholderFontWeight: {\n ...passwordInput,\n property: PasswordClass.cssVarList.inputPlaceholderFontWeight,\n },\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: { ...label, property: 'color' },\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: [\n { ...host, property: 'direction' },\n { ...passwordInput, property: PasswordClass.cssVarList.hostDirection },\n ],\n inputsRequiredIndicator: { ...host, property: 'content' },\n spaceBetweenInputs: { ...internalInputsWrapper, property: 'gap' },\n policyPreviewBackgroundColor: {\n ...policyPreview,\n property: policyPreviewVars.backgroundColor,\n },\n policyPreviewPadding: { ...policyPreview, property: policyPreviewVars.padding },\n\n valueInputHeight: { ...passwordInput, property: PasswordClass.cssVarList.valueInputHeight },\n valueInputMarginBottom: {\n ...passwordInput,\n property: PasswordClass.cssVarList.valueInputMarginBottom,\n },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n customMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t:host {\n\t\t\tdisplay: inline-block;\n\t\t\tmax-width: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n :host ::part(error-message) {\n direction: ltr;\n }\n\t\t${useHostExternalPadding(PasswordClass.cssVarList)}\n\t\tvaadin-text-field {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\tvaadin-text-field::part(input-field) {\n\t\t\tmin-height: 0;\n\t\t\tbackground: transparent;\n\t\t\tbox-shadow: none;\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-text-field::part(input-field)::after {\n\t\t\tbackground: transparent;\n\t\t\topacity: 0;\n\t\t}\n\t\tdescope-new-password-internal {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\twidth: 100%;\n\t\t\tpadding: 0;\n\t\t}\n\t\tdescope-new-password-internal > .wrapper {\n -webkit-mask-image: none;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t}\n\t\tdescope-password {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t}\n\t\tdescope-new-password-internal vaadin-password-field::before {\n\t\t\theight: initial;\n\t\t}\n descope-policy-validation {\n margin-top: 8px;\n display: flex;\n }\n .hidden {\n display: none;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import { getComponentName } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('new-password-internal');\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, observeAttributes } from '../../../helpers/componentHelpers';\nimport { NewPasswordClass } from '../NewPasswordClass';\nimport { componentName } from './componentName';\n\nconst passwordAttrPrefixRegex = /^password-/;\nconst confirmAttrPrefixRegex = /^confirm-/;\n\nconst removeAttrPrefix = (attr, prefix) => attr.replace(prefix, '');\n\nconst passwordInputAttrs = ['password-label', 'password-placeholder'];\nconst confirmInputAttrs = ['confirm-label', 'confirm-placeholder'];\nconst policyPanelAttrs = [\n 'has-validation',\n 'policy-label',\n 'available-policies',\n 'active-policies',\n 'data-password-policy-value-minlength',\n 'data-password-policy-value-passwordstrength',\n 'data-password-policy-value-disallowedchars',\n 'data-password-policy-value-email',\n 'manual-visibility-toggle',\n];\nconst commonAttrs = [\n 'has-confirm',\n 'disabled',\n 'bordered',\n 'size',\n 'full-width',\n 'maxlength',\n 'invalid',\n 'readonly',\n 'draggable',\n 'autocomplete',\n 'label-type',\n 'manual-visibility-toggle',\n];\n\nconst inputRelatedAttrs = [].concat(\n commonAttrs,\n passwordInputAttrs,\n confirmInputAttrs,\n policyPanelAttrs\n);\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass NewPasswordInternal extends BaseInputClass {\n static get observedAttributes() {\n return [].concat(BaseInputClass.observedAttributes || [], inputRelatedAttrs);\n }\n\n constructor() {\n super();\n\n this.innerHTML = `\n\t\t\t<div class=\"wrapper\"></div>\n\t\t`;\n\n this.wrapperEle = this.querySelector('.wrapper');\n }\n\n get value() {\n return this.passwordInput?.value || '';\n }\n\n set value(val) {\n if (val === this.value) return;\n this.passwordInput.value = val;\n }\n\n get hasConfirm() {\n return this.getAttribute('has-confirm') === 'true';\n }\n\n onHasConfirmChange(hasConfirm) {\n this.confirmInput.classList.toggle('hidden', !hasConfirm);\n }\n\n onHasValidationChange(hasValidation) {\n this.policyPanel.classList.toggle('hidden', !hasValidation);\n }\n\n get hasValidation() {\n return this.getAttribute('has-validation') === 'true';\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n\n if (this.value && !this.policyPanel.isValid) {\n return { typeMismatch: true };\n }\n\n if (this.hasConfirm && this.confirmInput && this.value !== this.confirmInput.value) {\n return { patternMismatch: true };\n }\n\n const min = this.getAttribute('minlength');\n const minVal = parseInt(min, 10) || 0;\n const minValid = this.value.length >= minVal;\n if (!minValid) {\n return { tooShort: true };\n }\n\n return {};\n }\n\n init() {\n this.addEventListener('focus', (e) => {\n // we want to ignore focus events we are dispatching\n if (e.isTrusted) {\n this.passwordInput.focus();\n }\n });\n super.init?.();\n this.renderInputs(this.hasConfirm, this.hasValidation);\n }\n\n renderInputs() {\n const hasExternalInput = this.getAttribute('external-input') === 'true';\n const template = `\n <div class=\"password-input-container\">\n <descope-password\n autocomplete=\"new-password\"\n manual-visibility-toggle=\"true\"\n data-id=\"password\"\n external-input=\"${hasExternalInput}\"\n ></descope-password>\n <descope-policy-validation></descope-policy-validation>\n </div>\n <descope-password\n autocomplete=\"new-password\"\n manual-visibility-toggle=\"true\"\n external-input=\"${hasExternalInput}\"\n data-id=\"confirm\"\n ></descope-password>\n `;\n\n this.wrapperEle.innerHTML = template;\n\n this.passwordInput = this.querySelector('[data-id=\"password\"]');\n this.confirmInput = this.querySelector('[data-id=\"confirm\"]');\n this.policyPanel = this.querySelector('descope-policy-validation');\n this.passwordStrength = this.querySelector('descope-password-strength');\n\n this.inputs = [this.passwordInput, this.confirmInput];\n\n this.initInputs();\n\n // sync input value to policy validation panel\n this.passwordInput.addEventListener('input', (e) => {\n this.passwordStrength?.addEventListener(\n 'score-changed',\n ({ detail }) => {\n this.policyPanel.setAttribute('data-password-policy-actual-passwordstrength', detail);\n },\n { once: true }\n );\n this.passwordStrength?.setAttribute('value', e.target.value);\n this.policyPanel.setAttribute('value', e.target.value);\n });\n\n forwardAttrs(this, this.policyPanel, {\n includeAttrs: policyPanelAttrs,\n mapAttrs: {\n 'policy-label': 'label',\n 'available-policies': 'data',\n },\n });\n }\n\n // the inputs are not required but we still want it to have a required\n // indicator in case the root component is required\n handleIndicatorStyle() {\n this.inputs.forEach((input) => {\n injectStyle(\n `\n\t\t\t\t:host ::part(required-indicator)::after {\n\t\t\t\t\tcontent: var(${NewPasswordClass.cssVarList.inputsRequiredIndicator});\n width: 1em;\n text-align: center;\n\t\t\t\t}\n :host ::part(required-indicator) {\n display: inline-flex;\n }\n\t\t\t\t`,\n input\n );\n });\n }\n\n get isInvalid() {\n return this.hasAttribute('invalid') && this.getAttribute('invalid') !== 'false';\n }\n\n // for some reason, Vaadin is removing the invalid attribute on several events,\n // e.g. focus, input, etc..., so we need to make sure the inputs will stay invalid\n // if the root component is invalid\n handleInputsInvalidAttribute() {\n this.inputs.forEach((input) => {\n input &&\n observeAttributes(\n input,\n (changedAttributes) => {\n if (changedAttributes.includes('invalid')) {\n const inputInvalidValue = input.getAttribute('invalid');\n const rootInvalidValue = this.getAttribute('invalid');\n\n if (this.isInvalid && rootInvalidValue !== inputInvalidValue) {\n input.setAttribute('invalid', 'true');\n }\n }\n },\n {}\n );\n });\n }\n\n initInputs() {\n this.handleIndicatorStyle();\n this.handleInputsInvalidAttribute();\n this.handleFocusEventsDispatching(this.inputs);\n }\n\n async togglePasswordStrength() {\n if (this.activePolicies.includes('passwordstrength')) {\n if (!this.passwordStrength) {\n await import('@descope-ui/descope-password-strength');\n this.passwordStrength = document.createElement('descope-password-strength');\n this.passwordStrength.setAttribute('options', 'Very weak,Weak,Average,Strong,Very strong');\n this.passwordStrength.setAttribute('value', this.passwordInput.value || '');\n this.passwordStrength.setAttribute(\n 'st-host-direction',\n this.getAttribute('st-host-direction')\n );\n this.passwordStrength.setAttribute('full-width', 'true');\n this.querySelector('.password-input-container').insertBefore(\n this.passwordStrength,\n this.policyPanel\n );\n }\n } else if (this.passwordStrength) {\n this.passwordStrength.remove();\n this.passwordStrength = null;\n }\n }\n\n get activePolicies() {\n return (this.getAttribute('active-policies') || '').split(',');\n }\n\n toggleBooleanAttribute(ele, name, value) {\n value === null ? ele?.removeAttribute(name) : ele?.setAttribute(name, value);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'has-validation') {\n this.onHasValidationChange(newValue === 'true');\n } else if (attrName === 'has-confirm') {\n this.onHasConfirmChange(newValue === 'true');\n } else if (commonAttrs.includes(attrName)) {\n this.inputs.forEach((input) => this.toggleBooleanAttribute(input, attrName, newValue));\n } else if (passwordInputAttrs.includes(attrName)) {\n this.toggleBooleanAttribute(\n this.passwordInput,\n removeAttrPrefix(attrName, passwordAttrPrefixRegex),\n newValue\n );\n } else if (confirmInputAttrs.includes(attrName)) {\n this.toggleBooleanAttribute(\n this.confirmInput,\n removeAttrPrefix(attrName, confirmAttrPrefixRegex),\n newValue\n );\n }\n if (attrName === 'active-policies') {\n this.togglePasswordStrength();\n }\n }\n }\n}\n\nexport default NewPasswordInternal;\n","import NewPasswordInternal from './NewPasswordInternal';\nimport { componentName } from './componentName';\n\ncustomElements.define(componentName, NewPasswordInternal);\n","import { componentName, NewPasswordClass } from './NewPasswordClass';\nimport '@descope-ui/descope-text-field';\nimport '../descope-password';\nimport '../descope-policy-validation';\nimport './descope-new-password-internal';\n\ncustomElements.define(componentName, NewPasswordClass);\n\nexport { NewPasswordClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n externalInputMixin,\n} from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport passwordDraggableMixin from './passwordDraggableMixin';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('password');\n\nconst customMixin = (superclass) =>\n class PasswordFieldMixinClass extends superclass {\n static get observedAttributes() {\n return ['manual-visibility-toggle'];\n }\n\n get manualToggleVisibility() {\n return this.getAttribute('manual-visibility-toggle') === 'true';\n }\n\n init() {\n super.init?.();\n this.handleCaretOnVisibilityChange();\n this.origSetPasswordVisible = this.baseElement._setPasswordVisible;\n this.origSetFocused = this.baseElement._setFocused;\n this.baseElement._setFocused = this.setFocus.bind(this);\n\n this.initExternalInput();\n this.stopRevealButtonEnterPropagation();\n }\n\n // Vaadin toggles visibility on Enter keydown but lets the event bubble,\n // and the SDK submits the form on any Enter that reaches the flow root.\n stopRevealButtonEnterPropagation() {\n this.revealButton?.addEventListener('keydown', (e) => {\n if (e.key === 'Enter') e.stopPropagation();\n });\n }\n\n get revealButton() {\n return this.baseElement.querySelector('vaadin-password-field-button');\n }\n\n initExternalInput() {\n const externalInput = this.createExternalInput();\n if (externalInput) {\n this.handlePasswordVisibility(externalInput);\n }\n }\n\n get caretPosition() {\n return this.value?.length || 0;\n }\n\n handleCaretOnVisibilityChange() {\n const origTogglePasswordVisibility = this.baseElement._togglePasswordVisibility.bind(\n this.baseElement\n );\n this.baseElement._togglePasswordVisibility = () => {\n setTimeout(() => {\n origTogglePasswordVisibility();\n this.inputElement.setSelectionRange(this.caretPosition, this.caretPosition);\n return false;\n });\n };\n }\n\n // We use `manual-visibility-toggle` to to toggle the password's visibility\n // even if the input field is focused-out. However, on focusout - Vaadin resets\n // password visibility. Since we don't want to override Vaadin's native setFocus\n // function (which is part of their FocusMixin).\n // So, here we override the part of logic that runs within Vaadin's setFocus that reports\n // the password visibility state. This logic is part of our `manual-visibility-toggle` only.\n setFocus(focused) {\n if (this.manualToggleVisibility) {\n this.baseElement._setPasswordVisible = () => {};\n }\n this.origSetFocused.call(this.baseElement, focused);\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible.bind(this.baseElement);\n }\n\n resetPasswordVisibilityToggle() {\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible;\n this.baseElement._setFocused = this.origSetFocus;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n }\n\n // override vaadin's password visibility toggle.\n // we need this override in order to to resolve the external input `focus` race condition,\n // which is caused due to the focus sync between the two inputs.\n handlePasswordVisibility(externalInput) {\n // disable vaadin's `__boundRevealButtonMouseDown` mouse-down event lisetener\n const origBoundRevealButtonMouseDown = this.baseElement.__boundRevealButtonMouseDown;\n this.revealButton?.removeEventListener('mousedown', origBoundRevealButtonMouseDown);\n\n // disable vaadin's `_passwordVisibleChanged` observer\n this.baseElement._passwordVisibleChanged = () => {};\n\n // override vaadin's `_togglePasswordVisibility`\n this.baseElement._togglePasswordVisibility = () => {\n const currVisibility = externalInput.getAttribute('type');\n if (currVisibility === 'password') {\n this.showPasswordVisibility(externalInput);\n } else {\n this.hidePasswordVisibility(externalInput);\n }\n };\n }\n\n showPasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'text');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'true');\n }\n\n hidePasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'password');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'false');\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n inputElementPlaceholder,\n revealButtonContainer,\n revealButtonIcon,\n label,\n requiredIndicator,\n errorMessage,\n helperText,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: '> input' },\n inputElementPlaceholder: { selector: () => ':host input:placeholder-shown' },\n revealButtonContainer: { selector: '::part(reveal-button)' },\n revealButtonIcon: { selector: '::part(reveal-button)::before' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const PasswordClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: [{}, host],\n fontFamily: [label, inputField, errorMessage, helperText],\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n ],\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: [\n { ...inputElement, property: 'font-weight' },\n { selector: () => ':host ::slotted(input)', property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n { ...inputElementPlaceholder, property: 'font-weight' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: 'color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n inputPlaceholderTextColor: [\n { ...inputElementPlaceholder, property: 'color' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'color' },\n ],\n inputValueTextColor: [\n { ...inputElement, property: 'color' },\n { selector: () => ':host ::slotted(input)', property: 'color' },\n ],\n\n revealButtonOffset: [\n { ...revealButtonContainer, property: 'margin-right' },\n { ...revealButtonContainer, property: 'margin-left' },\n ],\n revealButtonSize: { ...revealButtonContainer, property: 'font-size' },\n revealButtonColor: { ...revealButtonIcon, property: 'color' },\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...inputElement, property: 'opacity' },\n ],\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n },\n }),\n draggableMixin,\n externalInputMixin({\n inputType: 'password',\n inputName: 'password',\n includeAttrs: ['disabled', 'readonly', 'pattern', 'type', 'autocomplete'],\n noBlurDispatch: true,\n }),\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n passwordDraggableMixin,\n customMixin\n)(\n createProxy({\n slots: ['', 'suffix'],\n wrappedEleName: 'vaadin-password-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n position: relative;\n\t\t\t}\n\t\t\t${useHostExternalPadding(PasswordClass.cssVarList)}\n\t\t\t${resetInputCursor('vaadin-password-field')}\n ${resetInputLabelPosition('vaadin-password-field')}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n -webkit-mask-image: none;\n\t\t\t\tbox-sizing: border-box;\n opacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n :host ::slotted(input) {\n\t\t\t\tmin-height: 0;\n }\n :host([readonly]) ::slotted(input:placeholder-shown) {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t:host([readonly]) vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${PasswordClass.cssVarList.inputOutlineColor});\n\t\t\t}\n\n ${inputFloatingLabelStyle()}\n\n ::part(reveal-button) {\n align-self: center;\n }\n\n vaadin-password-field[external-input=\"true\"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/password-field';\nimport { componentName, PasswordClass } from './PasswordClass';\n\ncustomElements.define(componentName, PasswordClass);\n\nexport { PasswordClass, componentName };\n","const passwordDraggableMixin = (superclass) =>\n class PasswordDraggableMixinClass extends superclass {\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n init() {\n // there is an issue in Chrome that input field with type password cannot be D&D\n // so in case the input is draggable & readonly, we are changing the input type to \"text\" before dragging\n // and return the original type when done\n super.init?.();\n\n const ele = this.querySelector('input');\n\n ele?.addEventListener('mousedown', (e) => {\n if (this.isDraggable && this.isReadOnly) {\n ele.setAttribute('inert', 'true');\n\n const inputEle = e.target;\n const prevType = inputEle.getAttribute('type');\n inputEle.setAttribute('type', 'text');\n setTimeout(() => {\n inputEle.focus();\n });\n\n const onComplete = (_) => {\n inputEle.setAttribute('type', prevType);\n ele.removeAttribute('inert');\n this.removeEventListener('mouseup', onComplete);\n this.removeEventListener('dragend', onComplete);\n };\n\n this.addEventListener('dragend', onComplete, { once: true });\n this.addEventListener('mouseup', onComplete, { once: true });\n }\n });\n }\n };\n\nexport default passwordDraggableMixin;\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { interpolateString } from './helpers';\n\nexport const componentName = getComponentName('policy-validation');\n\nconst overrideAttrs = [\n 'data-password-policy-value-minlength',\n 'data-password-policy-value-passwordstrength',\n 'data-password-policy-actual-passwordstrength',\n 'data-password-policy-value-disallowedchars',\n 'data-password-policy-value-email',\n];\nconst dataAttrs = ['data', 'active-policies', 'overrides', ...overrideAttrs];\nconst policyAttrs = ['label', 'value', ...dataAttrs];\n\nclass RawPolicyValidation extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #availablePolicies;\n\n #activePolicies = [];\n\n #overrides;\n\n static get observedAttributes() {\n return policyAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <div class=\"label\"></div>\n <ul></ul>\n </div>\n\t\t`;\n\n injectStyle(\n `\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n `,\n this\n );\n\n this.panel = this.shadowRoot.querySelector(':host > div');\n this.label = this.shadowRoot.querySelector('.label');\n this.list = this.shadowRoot.querySelector('ul');\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n if (oldValue !== newValue) {\n if (attrName === 'label') {\n this.updateLabel(newValue);\n }\n\n // we're don't know the order in which the attributes are forwarded, so we're trying to render every time\n // once `data` and `active-policies` are populated, the render will be executed.\n // once the `overrides` object is updated, we want to re-render the panel.\n if (dataAttrs.includes(attrName)) {\n if (attrName === 'data') {\n try {\n this.availablePolicies = JSON.parse(newValue);\n } catch {\n // eslint-disable-next-line no-console\n console.error('Failed to set available policies');\n }\n }\n if (attrName === 'active-policies') {\n this.#activePolicies = (newValue || '').split(',');\n }\n\n if (attrName === 'data-password-policy-value-minlength') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln > 0) {\n this.#overrides = { ...this.#overrides, minlength: { value: `${ln}` } };\n }\n }\n\n if (attrName === 'data-password-policy-value-passwordstrength') {\n const passwordStrength = parseInt(newValue);\n if (!Number.isNaN(passwordStrength) && passwordStrength >= 0) {\n this.#overrides = {\n ...this.#overrides,\n passwordstrength: {\n ...this.#overrides?.passwordstrength,\n expected: passwordStrength,\n },\n };\n }\n }\n\n if (attrName === 'data-password-policy-actual-passwordstrength') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln >= 0) {\n this.#overrides = {\n ...this.#overrides,\n passwordstrength: { ...this.#overrides?.passwordstrength, actual: ln },\n };\n }\n }\n\n // disallowedchars: this stores the configured char list in\n // overrides.disallowedchars.value so the message can interpolate\n // `{{value}}`. The regex pattern itself is built upstream (orchestrator\n // or caller) and shipped on the policy entry — it is not derived from\n // this override. When the attribute is cleared, drop the override so\n // the panel doesn't keep stale data.\n if (attrName === 'data-password-policy-value-disallowedchars') {\n if (newValue) {\n this.#overrides = {\n ...this.#overrides,\n disallowedchars: {\n ...this.#overrides?.disallowedchars,\n value: newValue,\n },\n };\n } else if (this.#overrides?.disallowedchars) {\n const { disallowedchars: _drop, ...rest } = this.#overrides;\n this.#overrides = rest;\n }\n }\n\n // disallowemail: stash the user's email so the STR_NEQ_CI comparator\n // has an `expected` to compare against the live password value. Clear\n // the override when the attribute is removed/empty so we don't keep\n // blocking against a previous user's email.\n if (attrName === 'data-password-policy-value-email') {\n if (newValue) {\n this.#overrides = {\n ...this.#overrides,\n disallowemail: {\n ...this.#overrides?.disallowemail,\n expected: newValue,\n },\n };\n } else if (this.#overrides?.disallowemail) {\n const { disallowemail: _drop, ...rest } = this.#overrides;\n this.#overrides = rest;\n }\n }\n }\n\n this.renderItems(this.#availablePolicies, this.#activePolicies, this.#overrides);\n }\n }\n\n get availablePolicies() {\n return this.#availablePolicies || [];\n }\n\n set availablePolicies(val) {\n this.#availablePolicies = val;\n }\n\n get value() {\n return this.getAttribute('value') || '';\n }\n\n getStrengthScore() {\n return this.value.length;\n }\n\n compareValues(comparison, expected, actual) {\n switch (comparison.toUpperCase()) {\n case 'GTE': // Greater than or equal to\n return actual >= expected;\n case 'GT': // Greater than\n return actual > expected;\n case 'LTE': // Less than or equal to\n return actual <= expected;\n case 'LT': // Less than\n return actual < expected;\n case 'EQ': // Equal to\n return actual === expected;\n case 'NEQ': // Not equal to\n return actual !== expected;\n default:\n throw new Error(`Invalid comparison type: ${comparison}`);\n }\n }\n\n validate() {\n let policies = this.#availablePolicies;\n\n if (this.#overrides) {\n policies = this.#availablePolicies.map((policy) => {\n const data = this.#overrides[policy.id];\n\n if (!data) return policy;\n\n const res = { ...policy, data };\n\n return res;\n });\n }\n\n return this.#activePolicies.reduce((results, id) => {\n const policy = policies.find((p) => p.id === id);\n\n if (!policy) {\n return results;\n }\n\n const { pattern, message, data, compare } = policy;\n const normalizedCompare = typeof compare === 'string' ? compare.toUpperCase() : compare;\n\n if ((!pattern && !compare) || !message) {\n return results;\n }\n\n const validationResult = {\n message: interpolateString(message, data),\n id,\n };\n\n if (pattern) {\n const exp = new RegExp(interpolateString(pattern, data));\n validationResult.valid = exp.test(this.value);\n } else if (normalizedCompare === 'STR_NEQ_CI') {\n // Compare the live password against the configured string AND its\n // local-part (before '@'), case-insensitively. Used by the\n // disallowemail policy.\n const expected = (data?.expected ?? '').toLowerCase();\n const actual = (this.value ?? '').toLowerCase();\n if (!expected || !actual) {\n // nothing to compare → mark valid so we don't block the flow\n validationResult.valid = true;\n } else {\n const at = expected.indexOf('@');\n const localPart = at > 0 ? expected.slice(0, at) : expected;\n validationResult.valid = actual !== expected && actual !== localPart;\n }\n } else if (compare) {\n validationResult.valid = this.compareValues(\n normalizedCompare,\n data?.expected ?? -1,\n data?.actual ?? -1\n );\n }\n\n results.push(validationResult);\n\n return results;\n }, []);\n }\n\n get isValid() {\n return !this.validate().some(({ valid }) => valid === false);\n }\n\n buildValidationItem({ valid, message }) {\n const status = !this.value ? 'none' : valid;\n const li = document.createElement('li');\n li.className = 'item';\n li.dataset.valid = status;\n const span = document.createElement('span');\n span.className = 'message';\n // `textContent` handles any tenant-configured string in `message` safely\n // (e.g. the disallowedchars list) without needing to escape HTML.\n span.textContent = message ?? '';\n li.appendChild(span);\n return li;\n }\n\n renderItems(availablePolicies, activePolicies) {\n if (!availablePolicies || !activePolicies.length) {\n return;\n }\n\n this.list.replaceChildren(...this.validate().map(this.buildValidationItem.bind(this)));\n }\n\n updateLabel(val) {\n if (!val) {\n this.classList.add('hide-label');\n this.label.textContent = '';\n } else {\n this.label.textContent = val;\n this.classList.remove('hide-label');\n }\n }\n}\n\nconst { host, item, symbolDefault, symbolSuccess, symbolError } = {\n host: { selector: () => ':host > div' },\n item: { selector: () => '.item' },\n symbolDefault: { selector: () => '.item[data-valid=\"none\"]::before' },\n symbolSuccess: { selector: () => '.item[data-valid=\"true\"]::before' },\n symbolError: { selector: () => '.item[data-valid=\"false\"]::before' },\n};\n\nexport const PolicyValidationClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n padding: {},\n borderWidth: { ...host, property: 'border-width' },\n borderStyle: { ...host, property: 'border-style' },\n borderColor: { ...host, property: 'border-color' },\n borderRadius: { ...host, property: 'border-radius' },\n backgroundColor: { ...host, property: 'background-color' },\n textColor: { property: 'color' },\n labelMargin: { ...host, property: 'gap' },\n itemsSpacing: { ...item, property: 'line-height' },\n itemSymbolSuccessColor: { ...symbolSuccess, property: 'color' },\n itemSymbolErrorColor: { ...symbolError, property: 'color' },\n itemSymbolDefault: { ...symbolDefault, property: 'content' },\n itemSymbolSuccess: { ...symbolSuccess, property: 'content' },\n itemSymbolError: { ...symbolError, property: 'content' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawPolicyValidation);\n","export const interpolateString = (template, values) =>\n template.replace(/{{(\\w+)+}}/g, (match, key) => values?.[key] || match);\n","import { componentName, PolicyValidationClass } from './PolicyValidationClass';\n\ncustomElements.define(componentName, PolicyValidationClass);\n\nexport { PolicyValidationClass, componentName };\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","xE","observedAttrs","TextFieldClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","RF","mappings","_textFieldMappings__WEBPACK_IMPORTED_MODULE_4__","A","VO","OZ","proxyProps","useProxyTargets","tQ","superclass","observedAttributes","concat","icon","init","super","EA","this","baseElement","includeAttrs","renderCopyToClipboard","shouldRender","remove","iconInitConfig","title","style","iconCopiedConfig","Object","assign","document","createElement","slot","appendChild","addEventListener","navigator","clipboard","writeText","value","setTimeout","onLabelClick","focus","attributeChangedCallback","attrName","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","tz","slots","wrappedEleName","cssVarList","inputOutlineWidth","inputOutlineOffset","_descope_ui_common_theme_helpers__WEBPACK_IMPORTED_MODULE_3__","$J","cy","LJ","Kl","excludeAttrsSync","customElements","define","_TextFieldClass__WEBPACK_IMPORTED_MODULE_3__","T","w","host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","__WEBPACK_DEFAULT_EXPORT__","fontSize","fontFamily","labelFontSize","property","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity","createBaseInputClass","args","_helpers__WEBPACK_IMPORTED_MODULE_0__","_mixins__WEBPACK_IMPORTED_MODULE_1__","XX","_$","yF","jd","_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_0__","policyPreviewVars","_descope_policy_validation_PolicyValidationClass__WEBPACK_IMPORTED_MODULE_6__","internalInputsWrapper","passwordInput","policyPreview","NewPasswordClass","_helpers__WEBPACK_IMPORTED_MODULE_1__","_mixins__WEBPACK_IMPORTED_MODULE_2__","_descope_password_PasswordClass__WEBPACK_IMPORTED_MODULE_4__","M","inputsRequiredIndicator","spaceBetweenInputs","policyPreviewBackgroundColor","backgroundColor","policyPreviewPadding","padding","template","externalInputAttr","getAttribute","innerHTML","_descope_new_password_internal_componentName__WEBPACK_IMPORTED_MODULE_3__","content","cloneNode","inputElement","shadowRoot","querySelector","initExternalInput","createSlottedExternalInput","node","slotName","slotEle","targetSlot","setAttribute","confirmInput","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_5__","passwordAttrPrefixRegex","confirmAttrPrefixRegex","removeAttrPrefix","attr","prefix","replace","passwordInputAttrs","confirmInputAttrs","policyPanelAttrs","commonAttrs","inputRelatedAttrs","BaseInputClass","y","baseSelector","constructor","wrapperEle","val","hasConfirm","onHasConfirmChange","classList","toggle","onHasValidationChange","hasValidation","policyPanel","getValidity","isRequired","valueMissing","isValid","typeMismatch","patternMismatch","min","minVal","parseInt","length","tooShort","e","isTrusted","renderInputs","hasExternalInput","passwordStrength","inputs","initInputs","detail","once","target","componentHelpers","mapAttrs","handleIndicatorStyle","forEach","componentsHelpers","fz","isInvalid","hasAttribute","handleInputsInvalidAttribute","mx","changedAttributes","includes","inputInvalidValue","rootInvalidValue","handleFocusEventsDispatching","togglePasswordStrength","activePolicies","Promise","all","__webpack_require__","then","bind","insertBefore","split","toggleBooleanAttribute","ele","name","removeAttribute","oldValue","newValue","_NewPasswordClass__WEBPACK_IMPORTED_MODULE_0__","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_2__","inputElementPlaceholder","revealButtonContainer","revealButtonIcon","PasswordClass","_mixins__WEBPACK_IMPORTED_MODULE_0__","inputPlaceholderTextColor","revealButtonOffset","revealButtonSize","revealButtonColor","RV","inputType","inputName","noBlurDispatch","_passwordDraggableMixin__WEBPACK_IMPORTED_MODULE_3__","manualToggleVisibility","handleCaretOnVisibilityChange","origSetPasswordVisible","_setPasswordVisible","origSetFocused","_setFocused","setFocus","stopRevealButtonEnterPropagation","revealButton","key","stopPropagation","createExternalInput","handlePasswordVisibility","caretPosition","origTogglePasswordVisibility","_togglePasswordVisibility","setSelectionRange","focused","call","resetPasswordVisibilityToggle","origSetFocus","origBoundRevealButtonMouseDown","__boundRevealButtonMouseDown","_passwordVisibleChanged","showPasswordVisibility","hidePasswordVisibility","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_4__","I4","_PasswordClass__WEBPACK_IMPORTED_MODULE_1__","isReadOnly","isDraggable","inputEle","prevType","onComplete","_","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_4__","dataAttrs","policyAttrs","RawPolicyValidation","_baseClasses_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","availablePolicies","overrides","attachShadow","mode","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_0__","panel","list","updateLabel","JSON","parse","console","error","ln","Number","isNaN","minlength","passwordstrength","expected","actual","disallowedchars","_drop","rest","disallowemail","renderItems","getStrengthScore","compareValues","comparison","toUpperCase","Error","validate","policies","map","policy","data","id","reduce","results","find","p","pattern","message","compare","normalizedCompare","validationResult","_helpers__WEBPACK_IMPORTED_MODULE_5__","z","exp","RegExp","valid","test","toLowerCase","at","indexOf","localPart","slice","push","some","buildValidationItem","status","li","className","dataset","span","textContent","replaceChildren","add","item","symbolDefault","symbolSuccess","symbolError","PolicyValidationClass","_helpers__WEBPACK_IMPORTED_MODULE_3__","componentNameOverride","borderWidth","borderStyle","borderColor","borderRadius","textColor","labelMargin","itemsSpacing","itemSymbolSuccessColor","itemSymbolErrorColor","itemSymbolDefault","itemSymbolSuccess","itemSymbolError","interpolateString","values","match","_PolicyValidationClass__WEBPACK_IMPORTED_MODULE_0__"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-new-password-index-js.js","mappings":"yOAoBO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,cAE7CC,EAAA,0CAmFOC,GAAuB,EAAAC,EAAAC,KAC5B,EAAAC,EAAAC,IAAgB,CAClBC,SAAcC,EAAAC,IAEZJ,EAAAK,IACA,EAAAL,EAAAM,IAAe,CACjBC,WAAA,0CACAC,iBAAA,IAEER,EAAAS,GA1FFC,GACA,cAAAA,EACA,6BAAAC,GACA,OAAAf,EAAAgB,OAAAF,EAAAC,oBAAA,GACA,CAEAE,KAEA,IAAAC,GACAC,MAAAD,UAIM,EAAApB,EAAAsB,IAAYC,KAAAA,KAAAC,YAAA,CAA2BC,aAAA,iBAC7C,CAEA,qBAAAC,CAAAC,GACA,IAAAA,EAEA,YADAJ,KAAAJ,MAAAS,SAIA,MAAAC,EAAA,CACAV,KAAA,gBACAW,MAAA,OACAC,MAAA,mBAGAC,EAAA,CACAb,KAAA,wBACAW,MAAA,SACAC,MAAA,mBAGAR,KAAAJ,KAAAc,OAAAC,OAAAC,SAAAC,cAAA,gBACAC,KAAA,YACAR,IAGAN,KAAAC,YAAAc,YAAAf,KAAAJ,MACAI,KAAAJ,KAAAoB,iBAAA,aACAC,UAAAC,UAAAC,UAAAnB,KAAAoB,OACAV,OAAAC,OAAAX,KAAAJ,KAAAa,GAGAY,WAAA,KACAX,OAAAC,OAAAX,KAAAJ,KAAAU,IACS,MAET,CAEA,YAAAgB,GACAtB,KAAAuB,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3ByT,kBAAA,IAA2Bf,EAAA1S,SAAA,WAC3B0T,gBAAA,IAAyBf,EAAA3S,SAAA,cAGvBmD,EAAApI,GACAoI,EAAAhI,GAxBmC,CAyBrC4S,kCC5WO,MAAA4F,EAAA,CAAAhP,EAAAiP,IACPjP,EAAAwB,QAAA,cAA8B,CAAA0N,EAAA3H,IAAA0H,IAAA1H,IAAA2H,oGCC9BvV,eAAAC,OAAsBuV,EAAArV,EAAeqV,EAAApV","sources":["webpack://@descope/web-components-ui/../components/descope-text-field/src/component/TextFieldClass.js","webpack://@descope/web-components-ui/../components/descope-text-field/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text-field/src/component/textFieldMappings.js","webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/NewPasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/descope-new-password-internal/componentName.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/descope-new-password-internal/index.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-password/PasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-password/passwordDraggableMixin.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/PolicyValidationClass.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/index.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n} from '@descope-ui/common/components-helpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '@descope-ui/common/theme-helpers';\nimport textFieldMappings from './textFieldMappings';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n\n // Excluded from syncAttrs (bidirectional would let vaadin revert host\n // values). Push host → vaadin one-way so authored placeholder applies.\n forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({\n proxyProps: ['value', 'selectionStart', 'selectionEnd'],\n useProxyTargets: true,\n }),\n componentNameValidationMixin,\n customMixin,\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style', 'placeholder'],\n componentName,\n }),\n);\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, componentName };\n","const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: {\n selector: '[required]::part(required-indicator)::after',\n },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: {\n selector: () => '::slotted(input:disabled::placeholder)',\n },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n inputValueFontWeight: [\n { ...input, property: 'font-weight' },\n { ...externalInput, property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n {\n selector: () => ':host input:placeholder-shown',\n property: 'font-weight',\n },\n { ...externalPlaceholder, property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: {\n ...errorMessage,\n property: 'padding-inline-start',\n },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: {\n ...errorMessage,\n property: 'background-position',\n },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n inputTextSecurity: [\n { ...input, property: '-webkit-text-security' },\n { ...input, property: 'text-security' },\n { ...externalInput, property: '-webkit-text-security' },\n { ...externalInput, property: 'text-security' },\n ],\n};\n","import { compose } from '../helpers';\nimport {\n changeMixin,\n inputEventsDispatchingMixin,\n inputValidationMixin,\n normalizeBooleanAttributesMixin,\n} from '../mixins';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { compose } from '../../helpers';\nimport { createStyleMixin, proxyInputMixin, draggableMixin, createProxy } from '../../mixins';\nimport { componentName as descopeInternalComponentName } from './descope-new-password-internal/componentName';\nimport { PasswordClass } from '../descope-password/PasswordClass';\nimport { useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';\nimport { PolicyValidationClass } from '../descope-policy-validation/PolicyValidationClass';\n\nexport const componentName = getComponentName('new-password');\n\nconst policyPreviewVars = PolicyValidationClass.cssVarList;\n\nconst customMixin = (superclass) =>\n class NewPasswordMixinClass extends superclass {\n init() {\n super.init?.();\n\n const template = document.createElement('template');\n\n const externalInputAttr = this.getAttribute('external-input');\n\n template.innerHTML = `\n\t\t\t<${descopeInternalComponentName}\n\t\t\t\tname=\"new-password\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\tslot=\"input\"\n external-input=\"${externalInputAttr}\"\n\t\t\t>\n </${descopeInternalComponentName}>\n\t\t\t`;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n\n if (this.getAttribute('external-input') === 'true') {\n this.initExternalInput();\n }\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'password-label',\n 'password-placeholder',\n 'confirm-label',\n 'confirm-placeholder',\n 'full-width',\n 'size',\n 'bordered',\n 'label',\n 'has-confirm',\n 'invalid',\n 'readonly',\n 'disabled',\n 'draggable',\n 'has-validation',\n 'policy-label',\n 'active-policies',\n 'available-policies',\n 'data-password-policy-value-minlength',\n 'data-password-policy-value-passwordstrength',\n 'data-password-policy-value-disallowedchars',\n 'data-password-policy-value-email',\n 'data-password-policy-value-reuse',\n 'label-type',\n 'manual-visibility-toggle',\n ],\n });\n }\n\n createSlottedExternalInput(node, slotName) {\n const externalInput = node.querySelector('input');\n const slotEle = document.createElement('slot');\n\n const targetSlot = externalInput.getAttribute('slot');\n\n slotEle.setAttribute('name', slotName);\n slotEle.setAttribute('slot', targetSlot);\n\n node.appendChild(slotEle);\n\n // move external input\n externalInput.setAttribute('slot', slotName);\n externalInput.setAttribute('name', this.getAttribute('name'));\n externalInput.setAttribute('data-hidden-input', 'true');\n\n this.appendChild(externalInput);\n }\n\n initExternalInput() {\n // get descope input components\n this.passwordInput = this.inputElement.querySelector('[data-id=\"password\"]');\n this.confirmInput = this.inputElement.querySelector('[data-id=\"confirm\"]');\n\n // create slots for external password input\n this.createSlottedExternalInput(this.passwordInput, 'external-password-input');\n this.createSlottedExternalInput(this.confirmInput, 'external-confirm-input');\n }\n };\n\nconst {\n host,\n label,\n internalInputsWrapper,\n errorMessage,\n helperText,\n passwordInput,\n policyPreview,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n internalInputsWrapper: { selector: 'descope-new-password-internal .wrapper' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n passwordInput: { selector: 'descope-password' },\n policyPreview: { selector: 'descope-policy-validation' },\n};\n\nexport const NewPasswordClass = compose(\n createStyleMixin({\n mappings: {\n fontSize: [\n host,\n {},\n {\n selector: PasswordClass.componentName,\n property: PasswordClass.cssVarList.fontSize,\n },\n ],\n fontFamily: [label, errorMessage, helperText],\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: {\n ...passwordInput,\n property: PasswordClass.cssVarList.inputValueFontWeight,\n },\n inputPlaceholderFontWeight: {\n ...passwordInput,\n property: PasswordClass.cssVarList.inputPlaceholderFontWeight,\n },\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: { ...label, property: 'color' },\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: [\n { ...host, property: 'direction' },\n { ...passwordInput, property: PasswordClass.cssVarList.hostDirection },\n ],\n inputsRequiredIndicator: { ...host, property: 'content' },\n spaceBetweenInputs: { ...internalInputsWrapper, property: 'gap' },\n policyPreviewBackgroundColor: {\n ...policyPreview,\n property: policyPreviewVars.backgroundColor,\n },\n policyPreviewPadding: { ...policyPreview, property: policyPreviewVars.padding },\n\n valueInputHeight: { ...passwordInput, property: PasswordClass.cssVarList.valueInputHeight },\n valueInputMarginBottom: {\n ...passwordInput,\n property: PasswordClass.cssVarList.valueInputMarginBottom,\n },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n customMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t:host {\n\t\t\tdisplay: inline-block;\n\t\t\tmax-width: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n :host ::part(error-message) {\n direction: ltr;\n }\n\t\t${useHostExternalPadding(PasswordClass.cssVarList)}\n\t\tvaadin-text-field {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\tvaadin-text-field::part(input-field) {\n\t\t\tmin-height: 0;\n\t\t\tbackground: transparent;\n\t\t\tbox-shadow: none;\n\t\t\tpadding: 0;\n\t\t}\n\t\tvaadin-text-field::part(input-field)::after {\n\t\t\tbackground: transparent;\n\t\t\topacity: 0;\n\t\t}\n\t\tdescope-new-password-internal {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\twidth: 100%;\n\t\t\tpadding: 0;\n\t\t}\n\t\tdescope-new-password-internal > .wrapper {\n -webkit-mask-image: none;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t}\n\t\tdescope-password {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t}\n\t\tdescope-new-password-internal vaadin-password-field::before {\n\t\t\theight: initial;\n\t\t}\n descope-policy-validation {\n margin-top: 8px;\n display: flex;\n }\n .hidden {\n display: none;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import { getComponentName } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('new-password-internal');\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, observeAttributes } from '../../../helpers/componentHelpers';\nimport { NewPasswordClass } from '../NewPasswordClass';\nimport { componentName } from './componentName';\n\nconst passwordAttrPrefixRegex = /^password-/;\nconst confirmAttrPrefixRegex = /^confirm-/;\n\nconst removeAttrPrefix = (attr, prefix) => attr.replace(prefix, '');\n\nconst passwordInputAttrs = ['password-label', 'password-placeholder'];\nconst confirmInputAttrs = ['confirm-label', 'confirm-placeholder'];\nconst policyPanelAttrs = [\n 'has-validation',\n 'policy-label',\n 'available-policies',\n 'active-policies',\n 'data-password-policy-value-minlength',\n 'data-password-policy-value-passwordstrength',\n 'data-password-policy-value-disallowedchars',\n 'data-password-policy-value-email',\n 'data-password-policy-value-reuse',\n 'manual-visibility-toggle',\n];\nconst commonAttrs = [\n 'has-confirm',\n 'disabled',\n 'bordered',\n 'size',\n 'full-width',\n 'maxlength',\n 'invalid',\n 'readonly',\n 'draggable',\n 'autocomplete',\n 'label-type',\n 'manual-visibility-toggle',\n];\n\nconst inputRelatedAttrs = [].concat(\n commonAttrs,\n passwordInputAttrs,\n confirmInputAttrs,\n policyPanelAttrs\n);\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass NewPasswordInternal extends BaseInputClass {\n static get observedAttributes() {\n return [].concat(BaseInputClass.observedAttributes || [], inputRelatedAttrs);\n }\n\n constructor() {\n super();\n\n this.innerHTML = `\n\t\t\t<div class=\"wrapper\"></div>\n\t\t`;\n\n this.wrapperEle = this.querySelector('.wrapper');\n }\n\n get value() {\n return this.passwordInput?.value || '';\n }\n\n set value(val) {\n if (val === this.value) return;\n this.passwordInput.value = val;\n }\n\n get hasConfirm() {\n return this.getAttribute('has-confirm') === 'true';\n }\n\n onHasConfirmChange(hasConfirm) {\n this.confirmInput.classList.toggle('hidden', !hasConfirm);\n }\n\n onHasValidationChange(hasValidation) {\n this.policyPanel.classList.toggle('hidden', !hasValidation);\n }\n\n get hasValidation() {\n return this.getAttribute('has-validation') === 'true';\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n\n if (this.value && !this.policyPanel.isValid) {\n return { typeMismatch: true };\n }\n\n if (this.hasConfirm && this.confirmInput && this.value !== this.confirmInput.value) {\n return { patternMismatch: true };\n }\n\n const min = this.getAttribute('minlength');\n const minVal = parseInt(min, 10) || 0;\n const minValid = this.value.length >= minVal;\n if (!minValid) {\n return { tooShort: true };\n }\n\n return {};\n }\n\n init() {\n this.addEventListener('focus', (e) => {\n // we want to ignore focus events we are dispatching\n if (e.isTrusted) {\n this.passwordInput.focus();\n }\n });\n super.init?.();\n this.renderInputs(this.hasConfirm, this.hasValidation);\n }\n\n renderInputs() {\n const hasExternalInput = this.getAttribute('external-input') === 'true';\n const template = `\n <div class=\"password-input-container\">\n <descope-password\n autocomplete=\"new-password\"\n manual-visibility-toggle=\"true\"\n data-id=\"password\"\n external-input=\"${hasExternalInput}\"\n ></descope-password>\n <descope-policy-validation></descope-policy-validation>\n </div>\n <descope-password\n autocomplete=\"new-password\"\n manual-visibility-toggle=\"true\"\n external-input=\"${hasExternalInput}\"\n data-id=\"confirm\"\n ></descope-password>\n `;\n\n this.wrapperEle.innerHTML = template;\n\n this.passwordInput = this.querySelector('[data-id=\"password\"]');\n this.confirmInput = this.querySelector('[data-id=\"confirm\"]');\n this.policyPanel = this.querySelector('descope-policy-validation');\n this.passwordStrength = this.querySelector('descope-password-strength');\n\n this.inputs = [this.passwordInput, this.confirmInput];\n\n this.initInputs();\n\n // sync input value to policy validation panel\n this.passwordInput.addEventListener('input', (e) => {\n this.passwordStrength?.addEventListener(\n 'score-changed',\n ({ detail }) => {\n this.policyPanel.setAttribute('data-password-policy-actual-passwordstrength', detail);\n },\n { once: true }\n );\n this.passwordStrength?.setAttribute('value', e.target.value);\n this.policyPanel.setAttribute('value', e.target.value);\n });\n\n forwardAttrs(this, this.policyPanel, {\n includeAttrs: policyPanelAttrs,\n mapAttrs: {\n 'policy-label': 'label',\n 'available-policies': 'data',\n },\n });\n }\n\n // the inputs are not required but we still want it to have a required\n // indicator in case the root component is required\n handleIndicatorStyle() {\n this.inputs.forEach((input) => {\n injectStyle(\n `\n\t\t\t\t:host ::part(required-indicator)::after {\n\t\t\t\t\tcontent: var(${NewPasswordClass.cssVarList.inputsRequiredIndicator});\n width: 1em;\n text-align: center;\n\t\t\t\t}\n :host ::part(required-indicator) {\n display: inline-flex;\n }\n\t\t\t\t`,\n input\n );\n });\n }\n\n get isInvalid() {\n return this.hasAttribute('invalid') && this.getAttribute('invalid') !== 'false';\n }\n\n // for some reason, Vaadin is removing the invalid attribute on several events,\n // e.g. focus, input, etc..., so we need to make sure the inputs will stay invalid\n // if the root component is invalid\n handleInputsInvalidAttribute() {\n this.inputs.forEach((input) => {\n input &&\n observeAttributes(\n input,\n (changedAttributes) => {\n if (changedAttributes.includes('invalid')) {\n const inputInvalidValue = input.getAttribute('invalid');\n const rootInvalidValue = this.getAttribute('invalid');\n\n if (this.isInvalid && rootInvalidValue !== inputInvalidValue) {\n input.setAttribute('invalid', 'true');\n }\n }\n },\n {}\n );\n });\n }\n\n initInputs() {\n this.handleIndicatorStyle();\n this.handleInputsInvalidAttribute();\n this.handleFocusEventsDispatching(this.inputs);\n }\n\n async togglePasswordStrength() {\n if (this.activePolicies.includes('passwordstrength')) {\n if (!this.passwordStrength) {\n await import('@descope-ui/descope-password-strength');\n this.passwordStrength = document.createElement('descope-password-strength');\n this.passwordStrength.setAttribute('options', 'Very weak,Weak,Average,Strong,Very strong');\n this.passwordStrength.setAttribute('value', this.passwordInput.value || '');\n this.passwordStrength.setAttribute(\n 'st-host-direction',\n this.getAttribute('st-host-direction')\n );\n this.passwordStrength.setAttribute('full-width', 'true');\n this.querySelector('.password-input-container').insertBefore(\n this.passwordStrength,\n this.policyPanel\n );\n }\n } else if (this.passwordStrength) {\n this.passwordStrength.remove();\n this.passwordStrength = null;\n }\n }\n\n get activePolicies() {\n return (this.getAttribute('active-policies') || '').split(',');\n }\n\n toggleBooleanAttribute(ele, name, value) {\n value === null ? ele?.removeAttribute(name) : ele?.setAttribute(name, value);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'has-validation') {\n this.onHasValidationChange(newValue === 'true');\n } else if (attrName === 'has-confirm') {\n this.onHasConfirmChange(newValue === 'true');\n } else if (commonAttrs.includes(attrName)) {\n this.inputs.forEach((input) => this.toggleBooleanAttribute(input, attrName, newValue));\n } else if (passwordInputAttrs.includes(attrName)) {\n this.toggleBooleanAttribute(\n this.passwordInput,\n removeAttrPrefix(attrName, passwordAttrPrefixRegex),\n newValue\n );\n } else if (confirmInputAttrs.includes(attrName)) {\n this.toggleBooleanAttribute(\n this.confirmInput,\n removeAttrPrefix(attrName, confirmAttrPrefixRegex),\n newValue\n );\n }\n if (attrName === 'active-policies') {\n this.togglePasswordStrength();\n }\n }\n }\n}\n\nexport default NewPasswordInternal;\n","import NewPasswordInternal from './NewPasswordInternal';\nimport { componentName } from './componentName';\n\ncustomElements.define(componentName, NewPasswordInternal);\n","import { componentName, NewPasswordClass } from './NewPasswordClass';\nimport '@descope-ui/descope-text-field';\nimport '../descope-password';\nimport '../descope-policy-validation';\nimport './descope-new-password-internal';\n\ncustomElements.define(componentName, NewPasswordClass);\n\nexport { NewPasswordClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n externalInputMixin,\n} from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport passwordDraggableMixin from './passwordDraggableMixin';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('password');\n\nconst customMixin = (superclass) =>\n class PasswordFieldMixinClass extends superclass {\n static get observedAttributes() {\n return ['manual-visibility-toggle'];\n }\n\n get manualToggleVisibility() {\n return this.getAttribute('manual-visibility-toggle') === 'true';\n }\n\n init() {\n super.init?.();\n this.handleCaretOnVisibilityChange();\n this.origSetPasswordVisible = this.baseElement._setPasswordVisible;\n this.origSetFocused = this.baseElement._setFocused;\n this.baseElement._setFocused = this.setFocus.bind(this);\n\n this.initExternalInput();\n this.stopRevealButtonEnterPropagation();\n }\n\n // Vaadin toggles visibility on Enter keydown but lets the event bubble,\n // and the SDK submits the form on any Enter that reaches the flow root.\n stopRevealButtonEnterPropagation() {\n this.revealButton?.addEventListener('keydown', (e) => {\n if (e.key === 'Enter') e.stopPropagation();\n });\n }\n\n get revealButton() {\n return this.baseElement.querySelector('vaadin-password-field-button');\n }\n\n initExternalInput() {\n const externalInput = this.createExternalInput();\n if (externalInput) {\n this.handlePasswordVisibility(externalInput);\n }\n }\n\n get caretPosition() {\n return this.value?.length || 0;\n }\n\n handleCaretOnVisibilityChange() {\n const origTogglePasswordVisibility = this.baseElement._togglePasswordVisibility.bind(\n this.baseElement\n );\n this.baseElement._togglePasswordVisibility = () => {\n setTimeout(() => {\n origTogglePasswordVisibility();\n this.inputElement.setSelectionRange(this.caretPosition, this.caretPosition);\n return false;\n });\n };\n }\n\n // We use `manual-visibility-toggle` to to toggle the password's visibility\n // even if the input field is focused-out. However, on focusout - Vaadin resets\n // password visibility. Since we don't want to override Vaadin's native setFocus\n // function (which is part of their FocusMixin).\n // So, here we override the part of logic that runs within Vaadin's setFocus that reports\n // the password visibility state. This logic is part of our `manual-visibility-toggle` only.\n setFocus(focused) {\n if (this.manualToggleVisibility) {\n this.baseElement._setPasswordVisible = () => {};\n }\n this.origSetFocused.call(this.baseElement, focused);\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible.bind(this.baseElement);\n }\n\n resetPasswordVisibilityToggle() {\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible;\n this.baseElement._setFocused = this.origSetFocus;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n }\n\n // override vaadin's password visibility toggle.\n // we need this override in order to to resolve the external input `focus` race condition,\n // which is caused due to the focus sync between the two inputs.\n handlePasswordVisibility(externalInput) {\n // disable vaadin's `__boundRevealButtonMouseDown` mouse-down event lisetener\n const origBoundRevealButtonMouseDown = this.baseElement.__boundRevealButtonMouseDown;\n this.revealButton?.removeEventListener('mousedown', origBoundRevealButtonMouseDown);\n\n // disable vaadin's `_passwordVisibleChanged` observer\n this.baseElement._passwordVisibleChanged = () => {};\n\n // override vaadin's `_togglePasswordVisibility`\n this.baseElement._togglePasswordVisibility = () => {\n const currVisibility = externalInput.getAttribute('type');\n if (currVisibility === 'password') {\n this.showPasswordVisibility(externalInput);\n } else {\n this.hidePasswordVisibility(externalInput);\n }\n };\n }\n\n showPasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'text');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'true');\n }\n\n hidePasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'password');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'false');\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n inputElementPlaceholder,\n revealButtonContainer,\n revealButtonIcon,\n label,\n requiredIndicator,\n errorMessage,\n helperText,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: '> input' },\n inputElementPlaceholder: { selector: () => ':host input:placeholder-shown' },\n revealButtonContainer: { selector: '::part(reveal-button)' },\n revealButtonIcon: { selector: '::part(reveal-button)::before' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const PasswordClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: [{}, host],\n fontFamily: [label, inputField, errorMessage, helperText],\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n ],\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: [\n { ...inputElement, property: 'font-weight' },\n { selector: () => ':host ::slotted(input)', property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n { ...inputElementPlaceholder, property: 'font-weight' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: 'color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n inputPlaceholderTextColor: [\n { ...inputElementPlaceholder, property: 'color' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'color' },\n ],\n inputValueTextColor: [\n { ...inputElement, property: 'color' },\n { selector: () => ':host ::slotted(input)', property: 'color' },\n ],\n\n revealButtonOffset: [\n { ...revealButtonContainer, property: 'margin-right' },\n { ...revealButtonContainer, property: 'margin-left' },\n ],\n revealButtonSize: { ...revealButtonContainer, property: 'font-size' },\n revealButtonColor: { ...revealButtonIcon, property: 'color' },\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...inputElement, property: 'opacity' },\n ],\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n },\n }),\n draggableMixin,\n externalInputMixin({\n inputType: 'password',\n inputName: 'password',\n includeAttrs: ['disabled', 'readonly', 'pattern', 'type', 'autocomplete'],\n noBlurDispatch: true,\n }),\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n passwordDraggableMixin,\n customMixin\n)(\n createProxy({\n slots: ['', 'suffix'],\n wrappedEleName: 'vaadin-password-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n position: relative;\n\t\t\t}\n\t\t\t${useHostExternalPadding(PasswordClass.cssVarList)}\n\t\t\t${resetInputCursor('vaadin-password-field')}\n ${resetInputLabelPosition('vaadin-password-field')}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n -webkit-mask-image: none;\n\t\t\t\tbox-sizing: border-box;\n opacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n :host ::slotted(input) {\n\t\t\t\tmin-height: 0;\n }\n :host([readonly]) ::slotted(input:placeholder-shown) {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t:host([readonly]) vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${PasswordClass.cssVarList.inputOutlineColor});\n\t\t\t}\n\n ${inputFloatingLabelStyle()}\n\n ::part(reveal-button) {\n align-self: center;\n }\n\n vaadin-password-field[external-input=\"true\"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/password-field';\nimport { componentName, PasswordClass } from './PasswordClass';\n\ncustomElements.define(componentName, PasswordClass);\n\nexport { PasswordClass, componentName };\n","const passwordDraggableMixin = (superclass) =>\n class PasswordDraggableMixinClass extends superclass {\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n init() {\n // there is an issue in Chrome that input field with type password cannot be D&D\n // so in case the input is draggable & readonly, we are changing the input type to \"text\" before dragging\n // and return the original type when done\n super.init?.();\n\n const ele = this.querySelector('input');\n\n ele?.addEventListener('mousedown', (e) => {\n if (this.isDraggable && this.isReadOnly) {\n ele.setAttribute('inert', 'true');\n\n const inputEle = e.target;\n const prevType = inputEle.getAttribute('type');\n inputEle.setAttribute('type', 'text');\n setTimeout(() => {\n inputEle.focus();\n });\n\n const onComplete = (_) => {\n inputEle.setAttribute('type', prevType);\n ele.removeAttribute('inert');\n this.removeEventListener('mouseup', onComplete);\n this.removeEventListener('dragend', onComplete);\n };\n\n this.addEventListener('dragend', onComplete, { once: true });\n this.addEventListener('mouseup', onComplete, { once: true });\n }\n });\n }\n };\n\nexport default passwordDraggableMixin;\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { interpolateString } from './helpers';\n\nexport const componentName = getComponentName('policy-validation');\n\nconst overrideAttrs = [\n 'data-password-policy-value-minlength',\n 'data-password-policy-value-passwordstrength',\n 'data-password-policy-actual-passwordstrength',\n 'data-password-policy-value-disallowedchars',\n 'data-password-policy-value-email',\n 'data-password-policy-value-reuse',\n];\nconst dataAttrs = ['data', 'active-policies', 'overrides', ...overrideAttrs];\nconst policyAttrs = ['label', 'value', ...dataAttrs];\n\nclass RawPolicyValidation extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #availablePolicies;\n\n #activePolicies = [];\n\n #overrides;\n\n static get observedAttributes() {\n return policyAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <div class=\"label\"></div>\n <ul></ul>\n </div>\n\t\t`;\n\n injectStyle(\n `\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n `,\n this\n );\n\n this.panel = this.shadowRoot.querySelector(':host > div');\n this.label = this.shadowRoot.querySelector('.label');\n this.list = this.shadowRoot.querySelector('ul');\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n if (oldValue !== newValue) {\n if (attrName === 'label') {\n this.updateLabel(newValue);\n }\n\n // we're don't know the order in which the attributes are forwarded, so we're trying to render every time\n // once `data` and `active-policies` are populated, the render will be executed.\n // once the `overrides` object is updated, we want to re-render the panel.\n if (dataAttrs.includes(attrName)) {\n if (attrName === 'data') {\n try {\n this.availablePolicies = JSON.parse(newValue);\n } catch {\n // eslint-disable-next-line no-console\n console.error('Failed to set available policies');\n }\n }\n if (attrName === 'active-policies') {\n this.#activePolicies = (newValue || '').split(',');\n }\n\n if (attrName === 'data-password-policy-value-minlength') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln > 0) {\n this.#overrides = { ...this.#overrides, minlength: { value: `${ln}` } };\n }\n }\n\n if (attrName === 'data-password-policy-value-reuse') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln > 0) {\n this.#overrides = { ...this.#overrides, reuse: { value: `${ln}` } };\n }\n }\n\n if (attrName === 'data-password-policy-value-passwordstrength') {\n const passwordStrength = parseInt(newValue);\n if (!Number.isNaN(passwordStrength) && passwordStrength >= 0) {\n this.#overrides = {\n ...this.#overrides,\n passwordstrength: {\n ...this.#overrides?.passwordstrength,\n expected: passwordStrength,\n },\n };\n }\n }\n\n if (attrName === 'data-password-policy-actual-passwordstrength') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln >= 0) {\n this.#overrides = {\n ...this.#overrides,\n passwordstrength: { ...this.#overrides?.passwordstrength, actual: ln },\n };\n }\n }\n\n // disallowedchars: this stores the configured char list in\n // overrides.disallowedchars.value so the message can interpolate\n // `{{value}}`. The regex pattern itself is built upstream (orchestrator\n // or caller) and shipped on the policy entry — it is not derived from\n // this override. When the attribute is cleared, drop the override so\n // the panel doesn't keep stale data.\n if (attrName === 'data-password-policy-value-disallowedchars') {\n if (newValue) {\n this.#overrides = {\n ...this.#overrides,\n disallowedchars: {\n ...this.#overrides?.disallowedchars,\n value: newValue,\n },\n };\n } else if (this.#overrides?.disallowedchars) {\n const { disallowedchars: _drop, ...rest } = this.#overrides;\n this.#overrides = rest;\n }\n }\n\n // disallowemail: stash the user's email so the STR_NEQ_CI comparator\n // has an `expected` to compare against the live password value. Clear\n // the override when the attribute is removed/empty so we don't keep\n // blocking against a previous user's email.\n if (attrName === 'data-password-policy-value-email') {\n if (newValue) {\n this.#overrides = {\n ...this.#overrides,\n disallowemail: {\n ...this.#overrides?.disallowemail,\n expected: newValue,\n },\n };\n } else if (this.#overrides?.disallowemail) {\n const { disallowemail: _drop, ...rest } = this.#overrides;\n this.#overrides = rest;\n }\n }\n }\n\n this.renderItems(this.#availablePolicies, this.#activePolicies, this.#overrides);\n }\n }\n\n get availablePolicies() {\n return this.#availablePolicies || [];\n }\n\n set availablePolicies(val) {\n this.#availablePolicies = val;\n }\n\n get value() {\n return this.getAttribute('value') || '';\n }\n\n getStrengthScore() {\n return this.value.length;\n }\n\n compareValues(comparison, expected, actual) {\n switch (comparison.toUpperCase()) {\n case 'GTE': // Greater than or equal to\n return actual >= expected;\n case 'GT': // Greater than\n return actual > expected;\n case 'LTE': // Less than or equal to\n return actual <= expected;\n case 'LT': // Less than\n return actual < expected;\n case 'EQ': // Equal to\n return actual === expected;\n case 'NEQ': // Not equal to\n return actual !== expected;\n default:\n throw new Error(`Invalid comparison type: ${comparison}`);\n }\n }\n\n validate() {\n let policies = this.#availablePolicies;\n\n if (this.#overrides) {\n policies = this.#availablePolicies.map((policy) => {\n const data = this.#overrides[policy.id];\n\n if (!data) return policy;\n\n const res = { ...policy, data };\n\n return res;\n });\n }\n\n const items = this.#activePolicies.reduce((results, id) => {\n const policy = policies.find((p) => p.id === id);\n\n if (!policy) {\n return results;\n }\n\n const { pattern, message, data, compare, info } = policy;\n const normalizedCompare = typeof compare === 'string' ? compare.toUpperCase() : compare;\n\n if ((!pattern && !compare && !info) || !message) {\n return results;\n }\n\n const validationResult = {\n message: interpolateString(message, data),\n id,\n };\n\n if (info) {\n // informational rule the client can't check (e.g. password reuse):\n // `valid` stays undefined, so it renders neutral and never blocks `isValid`\n validationResult.info = true;\n } else if (pattern) {\n const exp = new RegExp(interpolateString(pattern, data));\n validationResult.valid = exp.test(this.value);\n } else if (normalizedCompare === 'STR_NEQ_CI') {\n // Compare the live password against the configured string AND its\n // local-part (before '@'), case-insensitively. Used by the\n // disallowemail policy.\n const expected = (data?.expected ?? '').toLowerCase();\n const actual = (this.value ?? '').toLowerCase();\n if (!expected || !actual) {\n // nothing to compare → mark valid so we don't block the flow\n validationResult.valid = true;\n } else {\n const at = expected.indexOf('@');\n const localPart = at > 0 ? expected.slice(0, at) : expected;\n validationResult.valid = actual !== expected && actual !== localPart;\n }\n } else if (compare) {\n validationResult.valid = this.compareValues(\n normalizedCompare,\n data?.expected ?? -1,\n data?.actual ?? -1\n );\n }\n\n results.push(validationResult);\n\n return results;\n }, []);\n\n // informational rules always render last\n return items.sort((a, b) => Number(!!a.info) - Number(!!b.info));\n }\n\n get isValid() {\n return !this.validate().some(({ valid }) => valid === false);\n }\n\n buildValidationItem({ valid, message, info }) {\n const status = !this.value || info ? 'none' : valid;\n const li = document.createElement('li');\n li.className = 'item';\n li.dataset.valid = status;\n const span = document.createElement('span');\n span.className = 'message';\n // `textContent` handles any tenant-configured string in `message` safely\n // (e.g. the disallowedchars list) without needing to escape HTML.\n span.textContent = message ?? '';\n li.appendChild(span);\n return li;\n }\n\n renderItems(availablePolicies, activePolicies) {\n if (!availablePolicies || !activePolicies.length) {\n return;\n }\n\n this.list.replaceChildren(...this.validate().map(this.buildValidationItem.bind(this)));\n }\n\n updateLabel(val) {\n if (!val) {\n this.classList.add('hide-label');\n this.label.textContent = '';\n } else {\n this.label.textContent = val;\n this.classList.remove('hide-label');\n }\n }\n}\n\nconst { host, item, symbolDefault, symbolSuccess, symbolError } = {\n host: { selector: () => ':host > div' },\n item: { selector: () => '.item' },\n symbolDefault: { selector: () => '.item[data-valid=\"none\"]::before' },\n symbolSuccess: { selector: () => '.item[data-valid=\"true\"]::before' },\n symbolError: { selector: () => '.item[data-valid=\"false\"]::before' },\n};\n\nexport const PolicyValidationClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n padding: {},\n borderWidth: { ...host, property: 'border-width' },\n borderStyle: { ...host, property: 'border-style' },\n borderColor: { ...host, property: 'border-color' },\n borderRadius: { ...host, property: 'border-radius' },\n backgroundColor: { ...host, property: 'background-color' },\n textColor: { property: 'color' },\n labelMargin: { ...host, property: 'gap' },\n itemsSpacing: { ...item, property: 'line-height' },\n itemSymbolSuccessColor: { ...symbolSuccess, property: 'color' },\n itemSymbolErrorColor: { ...symbolError, property: 'color' },\n itemSymbolDefault: { ...symbolDefault, property: 'content' },\n itemSymbolSuccess: { ...symbolSuccess, property: 'content' },\n itemSymbolError: { ...symbolError, property: 'content' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawPolicyValidation);\n","export const interpolateString = (template, values) =>\n template.replace(/{{(\\w+)+}}/g, (match, key) => values?.[key] || match);\n","import { componentName, PolicyValidationClass } from './PolicyValidationClass';\n\ncustomElements.define(componentName, PolicyValidationClass);\n\nexport { PolicyValidationClass, componentName };\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","xE","observedAttrs","TextFieldClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","RF","mappings","_textFieldMappings__WEBPACK_IMPORTED_MODULE_4__","A","VO","OZ","proxyProps","useProxyTargets","tQ","superclass","observedAttributes","concat","icon","init","super","EA","this","baseElement","includeAttrs","renderCopyToClipboard","shouldRender","remove","iconInitConfig","title","style","iconCopiedConfig","Object","assign","document","createElement","slot","appendChild","addEventListener","navigator","clipboard","writeText","value","setTimeout","onLabelClick","focus","attributeChangedCallback","attrName","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","tz","slots","wrappedEleName","cssVarList","inputOutlineWidth","inputOutlineOffset","_descope_ui_common_theme_helpers__WEBPACK_IMPORTED_MODULE_3__","$J","cy","LJ","Kl","excludeAttrsSync","customElements","define","_TextFieldClass__WEBPACK_IMPORTED_MODULE_3__","T","w","host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","__WEBPACK_DEFAULT_EXPORT__","fontSize","fontFamily","labelFontSize","property","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity","createBaseInputClass","args","_helpers__WEBPACK_IMPORTED_MODULE_0__","_mixins__WEBPACK_IMPORTED_MODULE_1__","XX","_$","yF","jd","_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_0__","policyPreviewVars","_descope_policy_validation_PolicyValidationClass__WEBPACK_IMPORTED_MODULE_6__","internalInputsWrapper","passwordInput","policyPreview","NewPasswordClass","_helpers__WEBPACK_IMPORTED_MODULE_1__","_mixins__WEBPACK_IMPORTED_MODULE_2__","_descope_password_PasswordClass__WEBPACK_IMPORTED_MODULE_4__","M","inputsRequiredIndicator","spaceBetweenInputs","policyPreviewBackgroundColor","backgroundColor","policyPreviewPadding","padding","template","externalInputAttr","getAttribute","innerHTML","_descope_new_password_internal_componentName__WEBPACK_IMPORTED_MODULE_3__","content","cloneNode","inputElement","shadowRoot","querySelector","initExternalInput","createSlottedExternalInput","node","slotName","slotEle","targetSlot","setAttribute","confirmInput","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_5__","passwordAttrPrefixRegex","confirmAttrPrefixRegex","removeAttrPrefix","attr","prefix","replace","passwordInputAttrs","confirmInputAttrs","policyPanelAttrs","commonAttrs","inputRelatedAttrs","BaseInputClass","y","baseSelector","constructor","wrapperEle","val","hasConfirm","onHasConfirmChange","classList","toggle","onHasValidationChange","hasValidation","policyPanel","getValidity","isRequired","valueMissing","isValid","typeMismatch","patternMismatch","min","minVal","parseInt","length","tooShort","e","isTrusted","renderInputs","hasExternalInput","passwordStrength","inputs","initInputs","detail","once","target","componentHelpers","mapAttrs","handleIndicatorStyle","forEach","componentsHelpers","fz","isInvalid","hasAttribute","handleInputsInvalidAttribute","mx","changedAttributes","includes","inputInvalidValue","rootInvalidValue","handleFocusEventsDispatching","togglePasswordStrength","activePolicies","Promise","all","__webpack_require__","then","bind","insertBefore","split","toggleBooleanAttribute","ele","name","removeAttribute","oldValue","newValue","_NewPasswordClass__WEBPACK_IMPORTED_MODULE_0__","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_2__","inputElementPlaceholder","revealButtonContainer","revealButtonIcon","PasswordClass","_mixins__WEBPACK_IMPORTED_MODULE_0__","inputPlaceholderTextColor","revealButtonOffset","revealButtonSize","revealButtonColor","RV","inputType","inputName","noBlurDispatch","_passwordDraggableMixin__WEBPACK_IMPORTED_MODULE_3__","manualToggleVisibility","handleCaretOnVisibilityChange","origSetPasswordVisible","_setPasswordVisible","origSetFocused","_setFocused","setFocus","stopRevealButtonEnterPropagation","revealButton","key","stopPropagation","createExternalInput","handlePasswordVisibility","caretPosition","origTogglePasswordVisibility","_togglePasswordVisibility","setSelectionRange","focused","call","resetPasswordVisibilityToggle","origSetFocus","origBoundRevealButtonMouseDown","__boundRevealButtonMouseDown","_passwordVisibleChanged","showPasswordVisibility","hidePasswordVisibility","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_4__","I4","_PasswordClass__WEBPACK_IMPORTED_MODULE_1__","isReadOnly","isDraggable","inputEle","prevType","onComplete","_","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_4__","dataAttrs","policyAttrs","RawPolicyValidation","_baseClasses_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","availablePolicies","overrides","attachShadow","mode","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_0__","panel","list","updateLabel","JSON","parse","console","error","ln","Number","isNaN","minlength","reuse","passwordstrength","expected","actual","disallowedchars","_drop","rest","disallowemail","renderItems","getStrengthScore","compareValues","comparison","toUpperCase","Error","validate","policies","map","policy","data","id","reduce","results","find","p","pattern","message","compare","info","normalizedCompare","validationResult","_helpers__WEBPACK_IMPORTED_MODULE_5__","z","exp","RegExp","valid","test","toLowerCase","at","indexOf","localPart","slice","push","sort","a","b","some","buildValidationItem","status","li","className","dataset","span","textContent","replaceChildren","add","item","symbolDefault","symbolSuccess","symbolError","PolicyValidationClass","_helpers__WEBPACK_IMPORTED_MODULE_3__","componentNameOverride","borderWidth","borderStyle","borderColor","borderRadius","textColor","labelMargin","itemsSpacing","itemSymbolSuccessColor","itemSymbolErrorColor","itemSymbolDefault","itemSymbolSuccess","itemSymbolError","interpolateString","values","match","_PolicyValidationClass__WEBPACK_IMPORTED_MODULE_0__"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2996],{10777(e,t,s){s.d(t,{T:()=>n,w:()=>y});var i=s(25964),a=s(79365),r=s(81365),o=s(9696),l=s(97810),d=s(88191);const n=(0,l.xE)("policy-validation"),c=["data","active-policies","overrides","data-password-policy-value-minlength","data-password-policy-value-passwordstrength","data-password-policy-actual-passwordstrength","data-password-policy-value-disallowedchars","data-password-policy-value-email"],p=["label","value",...c];class h extends((0,r.q)({componentName:n,baseSelector:":host > div"})){#e;#t=[];#s;static get observedAttributes(){return p}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <div class="label"></div>\n <ul></ul>\n </div>\n\t\t',(0,i.fz)("\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n ",this),this.panel=this.shadowRoot.querySelector(":host > div"),this.label=this.shadowRoot.querySelector(".label"),this.list=this.shadowRoot.querySelector("ul")}attributeChangedCallback(e,t,s){if(super.attributeChangedCallback?.(e,t,s),t!==s){if("label"===e&&this.updateLabel(s),c.includes(e)){if("data"===e)try{this.availablePolicies=JSON.parse(s)}catch{console.error("Failed to set available policies")}if("active-policies"===e&&(this.#t=(s||"").split(",")),"data-password-policy-value-minlength"===e){const e=Number(s);!Number.isNaN(e)&&e>0&&(this.#s={...this.#s,minlength:{value:`${e}`}})}if("data-password-policy-value-passwordstrength"===e){const e=parseInt(s);!Number.isNaN(e)&&e>=0&&(this.#s={...this.#s,passwordstrength:{...this.#s?.passwordstrength,expected:e}})}if("data-password-policy-actual-passwordstrength"===e){const e=Number(s);!Number.isNaN(e)&&e>=0&&(this.#s={...this.#s,passwordstrength:{...this.#s?.passwordstrength,actual:e}})}if("data-password-policy-value-disallowedchars"===e)if(s)this.#s={...this.#s,disallowedchars:{...this.#s?.disallowedchars,value:s}};else if(this.#s?.disallowedchars){const{disallowedchars:e,...t}=this.#s;this.#s=t}if("data-password-policy-value-email"===e)if(s)this.#s={...this.#s,disallowemail:{...this.#s?.disallowemail,expected:s}};else if(this.#s?.disallowemail){const{disallowemail:e,...t}=this.#s;this.#s=t}}this.renderItems(this.#e,this.#t,this.#s)}}get availablePolicies(){return this.#e||[]}set availablePolicies(e){this.#e=e}get value(){return this.getAttribute("value")||""}getStrengthScore(){return this.value.length}compareValues(e,t,s){switch(e.toUpperCase()){case"GTE":return s>=t;case"GT":return s>t;case"LTE":return s<=t;case"LT":return s<t;case"EQ":return s===t;case"NEQ":return s!==t;default:throw new Error(`Invalid comparison type: ${e}`)}}validate(){let e=this.#e;return this.#s&&(e=this.#e.map(e=>{const t=this.#s[e.id];return t?{...e,data:t}:e})),this.#t.reduce((t,s)=>{const i=e.find(e=>e.id===s);if(!i)return t;const{pattern:a,message:r,data:o,compare:l}=i,
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2996],{10777(e,t,s){s.d(t,{T:()=>n,w:()=>y});var i=s(25964),a=s(79365),r=s(81365),o=s(9696),l=s(97810),d=s(88191);const n=(0,l.xE)("policy-validation"),c=["data","active-policies","overrides","data-password-policy-value-minlength","data-password-policy-value-passwordstrength","data-password-policy-actual-passwordstrength","data-password-policy-value-disallowedchars","data-password-policy-value-email","data-password-policy-value-reuse"],p=["label","value",...c];class h extends((0,r.q)({componentName:n,baseSelector:":host > div"})){#e;#t=[];#s;static get observedAttributes(){return p}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <div class="label"></div>\n <ul></ul>\n </div>\n\t\t',(0,i.fz)("\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n ",this),this.panel=this.shadowRoot.querySelector(":host > div"),this.label=this.shadowRoot.querySelector(".label"),this.list=this.shadowRoot.querySelector("ul")}attributeChangedCallback(e,t,s){if(super.attributeChangedCallback?.(e,t,s),t!==s){if("label"===e&&this.updateLabel(s),c.includes(e)){if("data"===e)try{this.availablePolicies=JSON.parse(s)}catch{console.error("Failed to set available policies")}if("active-policies"===e&&(this.#t=(s||"").split(",")),"data-password-policy-value-minlength"===e){const e=Number(s);!Number.isNaN(e)&&e>0&&(this.#s={...this.#s,minlength:{value:`${e}`}})}if("data-password-policy-value-reuse"===e){const e=Number(s);!Number.isNaN(e)&&e>0&&(this.#s={...this.#s,reuse:{value:`${e}`}})}if("data-password-policy-value-passwordstrength"===e){const e=parseInt(s);!Number.isNaN(e)&&e>=0&&(this.#s={...this.#s,passwordstrength:{...this.#s?.passwordstrength,expected:e}})}if("data-password-policy-actual-passwordstrength"===e){const e=Number(s);!Number.isNaN(e)&&e>=0&&(this.#s={...this.#s,passwordstrength:{...this.#s?.passwordstrength,actual:e}})}if("data-password-policy-value-disallowedchars"===e)if(s)this.#s={...this.#s,disallowedchars:{...this.#s?.disallowedchars,value:s}};else if(this.#s?.disallowedchars){const{disallowedchars:e,...t}=this.#s;this.#s=t}if("data-password-policy-value-email"===e)if(s)this.#s={...this.#s,disallowemail:{...this.#s?.disallowemail,expected:s}};else if(this.#s?.disallowemail){const{disallowemail:e,...t}=this.#s;this.#s=t}}this.renderItems(this.#e,this.#t,this.#s)}}get availablePolicies(){return this.#e||[]}set availablePolicies(e){this.#e=e}get value(){return this.getAttribute("value")||""}getStrengthScore(){return this.value.length}compareValues(e,t,s){switch(e.toUpperCase()){case"GTE":return s>=t;case"GT":return s>t;case"LTE":return s<=t;case"LT":return s<t;case"EQ":return s===t;case"NEQ":return s!==t;default:throw new Error(`Invalid comparison type: ${e}`)}}validate(){let e=this.#e;return this.#s&&(e=this.#e.map(e=>{const t=this.#s[e.id];return t?{...e,data:t}:e})),this.#t.reduce((t,s)=>{const i=e.find(e=>e.id===s);if(!i)return t;const{pattern:a,message:r,data:o,compare:l,info:n}=i,c="string"==typeof l?l.toUpperCase():l;if(!a&&!l&&!n||!r)return t;const p={message:(0,d.z)(r,o),id:s};if(n)p.info=!0;else if(a){const e=new RegExp((0,d.z)(a,o));p.valid=e.test(this.value)}else if("STR_NEQ_CI"===c){const e=(o?.expected??"").toLowerCase(),t=(this.value??"").toLowerCase();if(e&&t){const s=e.indexOf("@"),i=s>0?e.slice(0,s):e;p.valid=t!==e&&t!==i}else p.valid=!0}else l&&(p.valid=this.compareValues(c,o?.expected??-1,o?.actual??-1));return t.push(p),t},[]).sort((e,t)=>Number(!!e.info)-Number(!!t.info))}get isValid(){return!this.validate().some(({valid:e})=>!1===e)}buildValidationItem({valid:e,message:t,info:s}){const i=!this.value||s?"none":e,a=document.createElement("li");a.className="item",a.dataset.valid=i;const r=document.createElement("span");return r.className="message",r.textContent=t??"",a.appendChild(r),a}renderItems(e,t){e&&t.length&&this.list.replaceChildren(...this.validate().map(this.buildValidationItem.bind(this)))}updateLabel(e){e?(this.label.textContent=e,this.classList.remove("hide-label")):(this.classList.add("hide-label"),this.label.textContent="")}}const{host:u,item:v,symbolDefault:m,symbolSuccess:b,symbolError:w}={host:{selector:()=>":host > div"},item:{selector:()=>".item"},symbolDefault:{selector:()=>'.item[data-valid="none"]::before'},symbolSuccess:{selector:()=>'.item[data-valid="true"]::before'},symbolError:{selector:()=>'.item[data-valid="false"]::before'}},y=(0,o.Zz)((0,a.RF)({componentNameOverride:(0,l.xE)("input-wrapper")}),(0,a.RF)({mappings:{hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},padding:{},borderWidth:{...u,property:"border-width"},borderStyle:{...u,property:"border-style"},borderColor:{...u,property:"border-color"},borderRadius:{...u,property:"border-radius"},backgroundColor:{...u,property:"background-color"},textColor:{property:"color"},labelMargin:{...u,property:"gap"},itemsSpacing:{...v,property:"line-height"},itemSymbolSuccessColor:{...b,property:"color"},itemSymbolErrorColor:{...w,property:"color"},itemSymbolDefault:{...m,property:"content"},itemSymbolSuccess:{...b,property:"content"},itemSymbolError:{...w,property:"content"}}}),a.VO,a.tQ)(h)},88191(e,t,s){s.d(t,{z:()=>i});const i=(e,t)=>e.replace(/{{(\w+)+}}/g,(e,s)=>t?.[s]||e)},26782(e,t,s){s.r(t),s.d(t,{PolicyValidationClass:()=>i.w,componentName:()=>i.T});var i=s(10777);customElements.define(i.T,i.w)}}]);
|
|
2
2
|
//# sourceMappingURL=descope-policy-validation-index-js.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descope-policy-validation-index-js.js","mappings":"oOAOO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,qBAS7CC,EAAA,sCANA,uCACA,8CACA,+CACA,6CACA,oCAGAC,EAAA,oBAAAD,GAEA,MAAAE,WAAkC,EAAAC,EAAAC,GAAe,CAAGP,gBAAAQ,aAAA,iBACpDC,GAEAC,GAAA,GAEAC,GAEA,6BAAAC,GACA,OAAAR,CACA,CAEA,WAAAS,GACAC,QAEAC,KAAAC,aAAA,CAAwBC,KAAA,SAAcC,UAAA,mFAOlC,EAAAC,EAAAC,IACJ,4oBAgCAL,MAGAA,KAAAM,MAAAN,KAAAO,WAAAC,cAAA,eACAR,KAAAS,MAAAT,KAAAO,WAAAC,cAAA,UACAR,KAAAU,KAAAV,KAAAO,WAAAC,cAAA,KACA,CAEA,wBAAAG,CAAAC,EAAAC,EAAAC,GAEA,GADAf,MAAAY,2BAAAC,EAAAC,EAAAC,GACAD,IAAAC,EAAA,CAQA,GAPA,UAAAF,GACAZ,KAAAe,YAAAD,GAMA1B,EAAA4B,SAAAJ,GAAA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,EAAAlH,EAAAC,IAAgB,oBAC1D,EAAA+G,EAAAC,IAAgB,CAClBE,SAAA,CACAC,cAAA,CAAuBR,SAAA,YAAAS,SAAA,aACvBC,SAAA,GACAC,WAAA,GACAC,QAAA,GACAC,YAAA,IAAqBlB,EAAAc,SAAA,gBACrBK,YAAA,IAAqBnB,EAAAc,SAAA,gBACrBM,YAAA,IAAqBpB,EAAAc,SAAA,gBACrBO,aAAA,IAAsBrB,EAAAc,SAAA,iBACtBQ,gBAAA,IAAyBtB,EAAAc,SAAA,oBACzBS,UAAA,CAAmBT,SAAA,SACnBU,YAAA,IAAqBxB,EAAAc,SAAA,OACrBW,aAAA,IAAsBxB,EAAAa,SAAA,eACtBY,uBAAA,IAAgCvB,EAAAW,SAAA,SAChCa,qBAAA,IAA8BvB,EAAAU,SAAA,SAC9Bc,kBAAA,IAA2B1B,EAAAY,SAAA,WAC3Be,kBAAA,IAA2B1B,EAAAW,SAAA,WAC3BgB,gBAAA,IAAyB1B,EAAAU,SAAA,cAGvBL,EAAAsB,GACAtB,EAAAuB,GAxBmC,CAyBrCnI,kCC7VO,MAAAoI,EAAA,CAAAC,EAAAC,IACPD,EAAAE,QAAA,cAA8B,CAAAC,EAAAC,IAAAH,IAAAG,IAAAD,oGCC9BE,eAAAC,OAAsBC,EAAAC,EAAeD,EAAAE","sources":["webpack://@descope/web-components-ui/./src/components/descope-policy-validation/PolicyValidationClass.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/index.js"],"sourcesContent":["import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { interpolateString } from './helpers';\n\nexport const componentName = getComponentName('policy-validation');\n\nconst overrideAttrs = [\n 'data-password-policy-value-minlength',\n 'data-password-policy-value-passwordstrength',\n 'data-password-policy-actual-passwordstrength',\n 'data-password-policy-value-disallowedchars',\n 'data-password-policy-value-email',\n];\nconst dataAttrs = ['data', 'active-policies', 'overrides', ...overrideAttrs];\nconst policyAttrs = ['label', 'value', ...dataAttrs];\n\nclass RawPolicyValidation extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #availablePolicies;\n\n #activePolicies = [];\n\n #overrides;\n\n static get observedAttributes() {\n return policyAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <div class=\"label\"></div>\n <ul></ul>\n </div>\n\t\t`;\n\n injectStyle(\n `\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n `,\n this\n );\n\n this.panel = this.shadowRoot.querySelector(':host > div');\n this.label = this.shadowRoot.querySelector('.label');\n this.list = this.shadowRoot.querySelector('ul');\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n if (oldValue !== newValue) {\n if (attrName === 'label') {\n this.updateLabel(newValue);\n }\n\n // we're don't know the order in which the attributes are forwarded, so we're trying to render every time\n // once `data` and `active-policies` are populated, the render will be executed.\n // once the `overrides` object is updated, we want to re-render the panel.\n if (dataAttrs.includes(attrName)) {\n if (attrName === 'data') {\n try {\n this.availablePolicies = JSON.parse(newValue);\n } catch {\n // eslint-disable-next-line no-console\n console.error('Failed to set available policies');\n }\n }\n if (attrName === 'active-policies') {\n this.#activePolicies = (newValue || '').split(',');\n }\n\n if (attrName === 'data-password-policy-value-minlength') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln > 0) {\n this.#overrides = { ...this.#overrides, minlength: { value: `${ln}` } };\n }\n }\n\n if (attrName === 'data-password-policy-value-passwordstrength') {\n const passwordStrength = parseInt(newValue);\n if (!Number.isNaN(passwordStrength) && passwordStrength >= 0) {\n this.#overrides = {\n ...this.#overrides,\n passwordstrength: {\n ...this.#overrides?.passwordstrength,\n expected: passwordStrength,\n },\n };\n }\n }\n\n if (attrName === 'data-password-policy-actual-passwordstrength') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln >= 0) {\n this.#overrides = {\n ...this.#overrides,\n passwordstrength: { ...this.#overrides?.passwordstrength, actual: ln },\n };\n }\n }\n\n // disallowedchars: this stores the configured char list in\n // overrides.disallowedchars.value so the message can interpolate\n // `{{value}}`. The regex pattern itself is built upstream (orchestrator\n // or caller) and shipped on the policy entry — it is not derived from\n // this override. When the attribute is cleared, drop the override so\n // the panel doesn't keep stale data.\n if (attrName === 'data-password-policy-value-disallowedchars') {\n if (newValue) {\n this.#overrides = {\n ...this.#overrides,\n disallowedchars: {\n ...this.#overrides?.disallowedchars,\n value: newValue,\n },\n };\n } else if (this.#overrides?.disallowedchars) {\n const { disallowedchars: _drop, ...rest } = this.#overrides;\n this.#overrides = rest;\n }\n }\n\n // disallowemail: stash the user's email so the STR_NEQ_CI comparator\n // has an `expected` to compare against the live password value. Clear\n // the override when the attribute is removed/empty so we don't keep\n // blocking against a previous user's email.\n if (attrName === 'data-password-policy-value-email') {\n if (newValue) {\n this.#overrides = {\n ...this.#overrides,\n disallowemail: {\n ...this.#overrides?.disallowemail,\n expected: newValue,\n },\n };\n } else if (this.#overrides?.disallowemail) {\n const { disallowemail: _drop, ...rest } = this.#overrides;\n this.#overrides = rest;\n }\n }\n }\n\n this.renderItems(this.#availablePolicies, this.#activePolicies, this.#overrides);\n }\n }\n\n get availablePolicies() {\n return this.#availablePolicies || [];\n }\n\n set availablePolicies(val) {\n this.#availablePolicies = val;\n }\n\n get value() {\n return this.getAttribute('value') || '';\n }\n\n getStrengthScore() {\n return this.value.length;\n }\n\n compareValues(comparison, expected, actual) {\n switch (comparison.toUpperCase()) {\n case 'GTE': // Greater than or equal to\n return actual >= expected;\n case 'GT': // Greater than\n return actual > expected;\n case 'LTE': // Less than or equal to\n return actual <= expected;\n case 'LT': // Less than\n return actual < expected;\n case 'EQ': // Equal to\n return actual === expected;\n case 'NEQ': // Not equal to\n return actual !== expected;\n default:\n throw new Error(`Invalid comparison type: ${comparison}`);\n }\n }\n\n validate() {\n let policies = this.#availablePolicies;\n\n if (this.#overrides) {\n policies = this.#availablePolicies.map((policy) => {\n const data = this.#overrides[policy.id];\n\n if (!data) return policy;\n\n const res = { ...policy, data };\n\n return res;\n });\n }\n\n return this.#activePolicies.reduce((results, id) => {\n const policy = policies.find((p) => p.id === id);\n\n if (!policy) {\n return results;\n }\n\n const { pattern, message, data, compare } = policy;\n const normalizedCompare = typeof compare === 'string' ? compare.toUpperCase() : compare;\n\n if ((!pattern && !compare) || !message) {\n return results;\n }\n\n const validationResult = {\n message: interpolateString(message, data),\n id,\n };\n\n if (pattern) {\n const exp = new RegExp(interpolateString(pattern, data));\n validationResult.valid = exp.test(this.value);\n } else if (normalizedCompare === 'STR_NEQ_CI') {\n // Compare the live password against the configured string AND its\n // local-part (before '@'), case-insensitively. Used by the\n // disallowemail policy.\n const expected = (data?.expected ?? '').toLowerCase();\n const actual = (this.value ?? '').toLowerCase();\n if (!expected || !actual) {\n // nothing to compare → mark valid so we don't block the flow\n validationResult.valid = true;\n } else {\n const at = expected.indexOf('@');\n const localPart = at > 0 ? expected.slice(0, at) : expected;\n validationResult.valid = actual !== expected && actual !== localPart;\n }\n } else if (compare) {\n validationResult.valid = this.compareValues(\n normalizedCompare,\n data?.expected ?? -1,\n data?.actual ?? -1\n );\n }\n\n results.push(validationResult);\n\n return results;\n }, []);\n }\n\n get isValid() {\n return !this.validate().some(({ valid }) => valid === false);\n }\n\n buildValidationItem({ valid, message }) {\n const status = !this.value ? 'none' : valid;\n const li = document.createElement('li');\n li.className = 'item';\n li.dataset.valid = status;\n const span = document.createElement('span');\n span.className = 'message';\n // `textContent` handles any tenant-configured string in `message` safely\n // (e.g. the disallowedchars list) without needing to escape HTML.\n span.textContent = message ?? '';\n li.appendChild(span);\n return li;\n }\n\n renderItems(availablePolicies, activePolicies) {\n if (!availablePolicies || !activePolicies.length) {\n return;\n }\n\n this.list.replaceChildren(...this.validate().map(this.buildValidationItem.bind(this)));\n }\n\n updateLabel(val) {\n if (!val) {\n this.classList.add('hide-label');\n this.label.textContent = '';\n } else {\n this.label.textContent = val;\n this.classList.remove('hide-label');\n }\n }\n}\n\nconst { host, item, symbolDefault, symbolSuccess, symbolError } = {\n host: { selector: () => ':host > div' },\n item: { selector: () => '.item' },\n symbolDefault: { selector: () => '.item[data-valid=\"none\"]::before' },\n symbolSuccess: { selector: () => '.item[data-valid=\"true\"]::before' },\n symbolError: { selector: () => '.item[data-valid=\"false\"]::before' },\n};\n\nexport const PolicyValidationClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n padding: {},\n borderWidth: { ...host, property: 'border-width' },\n borderStyle: { ...host, property: 'border-style' },\n borderColor: { ...host, property: 'border-color' },\n borderRadius: { ...host, property: 'border-radius' },\n backgroundColor: { ...host, property: 'background-color' },\n textColor: { property: 'color' },\n labelMargin: { ...host, property: 'gap' },\n itemsSpacing: { ...item, property: 'line-height' },\n itemSymbolSuccessColor: { ...symbolSuccess, property: 'color' },\n itemSymbolErrorColor: { ...symbolError, property: 'color' },\n itemSymbolDefault: { ...symbolDefault, property: 'content' },\n itemSymbolSuccess: { ...symbolSuccess, property: 'content' },\n itemSymbolError: { ...symbolError, property: 'content' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawPolicyValidation);\n","export const interpolateString = (template, values) =>\n template.replace(/{{(\\w+)+}}/g, (match, key) => values?.[key] || match);\n","import { componentName, PolicyValidationClass } from './PolicyValidationClass';\n\ncustomElements.define(componentName, PolicyValidationClass);\n\nexport { PolicyValidationClass, componentName };\n"],"names":["componentName","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_4__","xE","dataAttrs","policyAttrs","RawPolicyValidation","_baseClasses_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","baseSelector","availablePolicies","activePolicies","overrides","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_0__","fz","panel","shadowRoot","querySelector","label","list","attributeChangedCallback","attrName","oldValue","newValue","updateLabel","includes","JSON","parse","console","error","split","ln","Number","isNaN","minlength","value","passwordStrength","parseInt","passwordstrength","expected","actual","disallowedchars","_drop","rest","disallowemail","renderItems","val","getAttribute","getStrengthScore","length","compareValues","comparison","toUpperCase","Error","validate","policies","map","policy","data","id","reduce","results","find","p","pattern","message","compare","normalizedCompare","validationResult","_helpers__WEBPACK_IMPORTED_MODULE_5__","z","exp","RegExp","valid","test","toLowerCase","at","indexOf","localPart","slice","push","isValid","some","buildValidationItem","status","li","document","createElement","className","dataset","span","textContent","appendChild","replaceChildren","bind","classList","remove","add","host","item","symbolDefault","symbolSuccess","symbolError","selector","PolicyValidationClass","_helpers__WEBPACK_IMPORTED_MODULE_3__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_1__","RF","componentNameOverride","mappings","hostDirection","property","fontSize","fontFamily","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textColor","labelMargin","itemsSpacing","itemSymbolSuccessColor","itemSymbolErrorColor","itemSymbolDefault","itemSymbolSuccess","itemSymbolError","VO","tQ","interpolateString","template","values","replace","match","key","customElements","define","_PolicyValidationClass__WEBPACK_IMPORTED_MODULE_0__","T","w"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-policy-validation-index-js.js","mappings":"oOAOO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,qBAU7CC,EAAA,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AAA,IAAyBtB,EAAAc,SAAA,oBACzBS,UAAA,CAAmBT,SAAA,SACnBU,YAAA,IAAqBxB,EAAAc,SAAA,OACrBW,aAAA,IAAsBxB,EAAAa,SAAA,eACtBY,uBAAA,IAAgCvB,EAAAW,SAAA,SAChCa,qBAAA,IAA8BvB,EAAAU,SAAA,SAC9Bc,kBAAA,IAA2B1B,EAAAY,SAAA,WAC3Be,kBAAA,IAA2B1B,EAAAW,SAAA,WAC3BgB,gBAAA,IAAyB1B,EAAAU,SAAA,cAGvBL,EAAAsB,GACAtB,EAAAuB,GAxBmC,CAyBrCxI,kCC5WO,MAAAyI,EAAA,CAAAC,EAAAC,IACPD,EAAAE,QAAA,cAA8B,CAAAC,EAAAC,IAAAH,IAAAG,IAAAD,oGCC9BE,eAAAC,OAAsBC,EAAAC,EAAeD,EAAAE","sources":["webpack://@descope/web-components-ui/./src/components/descope-policy-validation/PolicyValidationClass.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/index.js"],"sourcesContent":["import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { interpolateString } from './helpers';\n\nexport const componentName = getComponentName('policy-validation');\n\nconst overrideAttrs = [\n 'data-password-policy-value-minlength',\n 'data-password-policy-value-passwordstrength',\n 'data-password-policy-actual-passwordstrength',\n 'data-password-policy-value-disallowedchars',\n 'data-password-policy-value-email',\n 'data-password-policy-value-reuse',\n];\nconst dataAttrs = ['data', 'active-policies', 'overrides', ...overrideAttrs];\nconst policyAttrs = ['label', 'value', ...dataAttrs];\n\nclass RawPolicyValidation extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #availablePolicies;\n\n #activePolicies = [];\n\n #overrides;\n\n static get observedAttributes() {\n return policyAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <div class=\"label\"></div>\n <ul></ul>\n </div>\n\t\t`;\n\n injectStyle(\n `\n :host > div {\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n .label {\n max-width: 100%;\n text-wrap: wrap;\n overflow-wrap: break-word;\n }\n .hide-label .label {\n display: none;\n }\n ul {\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n }\n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li::before {\n display: inline-block;\n width: 1em;\n text-align: center;\n }\n `,\n this\n );\n\n this.panel = this.shadowRoot.querySelector(':host > div');\n this.label = this.shadowRoot.querySelector('.label');\n this.list = this.shadowRoot.querySelector('ul');\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n if (oldValue !== newValue) {\n if (attrName === 'label') {\n this.updateLabel(newValue);\n }\n\n // we're don't know the order in which the attributes are forwarded, so we're trying to render every time\n // once `data` and `active-policies` are populated, the render will be executed.\n // once the `overrides` object is updated, we want to re-render the panel.\n if (dataAttrs.includes(attrName)) {\n if (attrName === 'data') {\n try {\n this.availablePolicies = JSON.parse(newValue);\n } catch {\n // eslint-disable-next-line no-console\n console.error('Failed to set available policies');\n }\n }\n if (attrName === 'active-policies') {\n this.#activePolicies = (newValue || '').split(',');\n }\n\n if (attrName === 'data-password-policy-value-minlength') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln > 0) {\n this.#overrides = { ...this.#overrides, minlength: { value: `${ln}` } };\n }\n }\n\n if (attrName === 'data-password-policy-value-reuse') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln > 0) {\n this.#overrides = { ...this.#overrides, reuse: { value: `${ln}` } };\n }\n }\n\n if (attrName === 'data-password-policy-value-passwordstrength') {\n const passwordStrength = parseInt(newValue);\n if (!Number.isNaN(passwordStrength) && passwordStrength >= 0) {\n this.#overrides = {\n ...this.#overrides,\n passwordstrength: {\n ...this.#overrides?.passwordstrength,\n expected: passwordStrength,\n },\n };\n }\n }\n\n if (attrName === 'data-password-policy-actual-passwordstrength') {\n const ln = Number(newValue);\n if (!Number.isNaN(ln) && ln >= 0) {\n this.#overrides = {\n ...this.#overrides,\n passwordstrength: { ...this.#overrides?.passwordstrength, actual: ln },\n };\n }\n }\n\n // disallowedchars: this stores the configured char list in\n // overrides.disallowedchars.value so the message can interpolate\n // `{{value}}`. The regex pattern itself is built upstream (orchestrator\n // or caller) and shipped on the policy entry — it is not derived from\n // this override. When the attribute is cleared, drop the override so\n // the panel doesn't keep stale data.\n if (attrName === 'data-password-policy-value-disallowedchars') {\n if (newValue) {\n this.#overrides = {\n ...this.#overrides,\n disallowedchars: {\n ...this.#overrides?.disallowedchars,\n value: newValue,\n },\n };\n } else if (this.#overrides?.disallowedchars) {\n const { disallowedchars: _drop, ...rest } = this.#overrides;\n this.#overrides = rest;\n }\n }\n\n // disallowemail: stash the user's email so the STR_NEQ_CI comparator\n // has an `expected` to compare against the live password value. Clear\n // the override when the attribute is removed/empty so we don't keep\n // blocking against a previous user's email.\n if (attrName === 'data-password-policy-value-email') {\n if (newValue) {\n this.#overrides = {\n ...this.#overrides,\n disallowemail: {\n ...this.#overrides?.disallowemail,\n expected: newValue,\n },\n };\n } else if (this.#overrides?.disallowemail) {\n const { disallowemail: _drop, ...rest } = this.#overrides;\n this.#overrides = rest;\n }\n }\n }\n\n this.renderItems(this.#availablePolicies, this.#activePolicies, this.#overrides);\n }\n }\n\n get availablePolicies() {\n return this.#availablePolicies || [];\n }\n\n set availablePolicies(val) {\n this.#availablePolicies = val;\n }\n\n get value() {\n return this.getAttribute('value') || '';\n }\n\n getStrengthScore() {\n return this.value.length;\n }\n\n compareValues(comparison, expected, actual) {\n switch (comparison.toUpperCase()) {\n case 'GTE': // Greater than or equal to\n return actual >= expected;\n case 'GT': // Greater than\n return actual > expected;\n case 'LTE': // Less than or equal to\n return actual <= expected;\n case 'LT': // Less than\n return actual < expected;\n case 'EQ': // Equal to\n return actual === expected;\n case 'NEQ': // Not equal to\n return actual !== expected;\n default:\n throw new Error(`Invalid comparison type: ${comparison}`);\n }\n }\n\n validate() {\n let policies = this.#availablePolicies;\n\n if (this.#overrides) {\n policies = this.#availablePolicies.map((policy) => {\n const data = this.#overrides[policy.id];\n\n if (!data) return policy;\n\n const res = { ...policy, data };\n\n return res;\n });\n }\n\n const items = this.#activePolicies.reduce((results, id) => {\n const policy = policies.find((p) => p.id === id);\n\n if (!policy) {\n return results;\n }\n\n const { pattern, message, data, compare, info } = policy;\n const normalizedCompare = typeof compare === 'string' ? compare.toUpperCase() : compare;\n\n if ((!pattern && !compare && !info) || !message) {\n return results;\n }\n\n const validationResult = {\n message: interpolateString(message, data),\n id,\n };\n\n if (info) {\n // informational rule the client can't check (e.g. password reuse):\n // `valid` stays undefined, so it renders neutral and never blocks `isValid`\n validationResult.info = true;\n } else if (pattern) {\n const exp = new RegExp(interpolateString(pattern, data));\n validationResult.valid = exp.test(this.value);\n } else if (normalizedCompare === 'STR_NEQ_CI') {\n // Compare the live password against the configured string AND its\n // local-part (before '@'), case-insensitively. Used by the\n // disallowemail policy.\n const expected = (data?.expected ?? '').toLowerCase();\n const actual = (this.value ?? '').toLowerCase();\n if (!expected || !actual) {\n // nothing to compare → mark valid so we don't block the flow\n validationResult.valid = true;\n } else {\n const at = expected.indexOf('@');\n const localPart = at > 0 ? expected.slice(0, at) : expected;\n validationResult.valid = actual !== expected && actual !== localPart;\n }\n } else if (compare) {\n validationResult.valid = this.compareValues(\n normalizedCompare,\n data?.expected ?? -1,\n data?.actual ?? -1\n );\n }\n\n results.push(validationResult);\n\n return results;\n }, []);\n\n // informational rules always render last\n return items.sort((a, b) => Number(!!a.info) - Number(!!b.info));\n }\n\n get isValid() {\n return !this.validate().some(({ valid }) => valid === false);\n }\n\n buildValidationItem({ valid, message, info }) {\n const status = !this.value || info ? 'none' : valid;\n const li = document.createElement('li');\n li.className = 'item';\n li.dataset.valid = status;\n const span = document.createElement('span');\n span.className = 'message';\n // `textContent` handles any tenant-configured string in `message` safely\n // (e.g. the disallowedchars list) without needing to escape HTML.\n span.textContent = message ?? '';\n li.appendChild(span);\n return li;\n }\n\n renderItems(availablePolicies, activePolicies) {\n if (!availablePolicies || !activePolicies.length) {\n return;\n }\n\n this.list.replaceChildren(...this.validate().map(this.buildValidationItem.bind(this)));\n }\n\n updateLabel(val) {\n if (!val) {\n this.classList.add('hide-label');\n this.label.textContent = '';\n } else {\n this.label.textContent = val;\n this.classList.remove('hide-label');\n }\n }\n}\n\nconst { host, item, symbolDefault, symbolSuccess, symbolError } = {\n host: { selector: () => ':host > div' },\n item: { selector: () => '.item' },\n symbolDefault: { selector: () => '.item[data-valid=\"none\"]::before' },\n symbolSuccess: { selector: () => '.item[data-valid=\"true\"]::before' },\n symbolError: { selector: () => '.item[data-valid=\"false\"]::before' },\n};\n\nexport const PolicyValidationClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n padding: {},\n borderWidth: { ...host, property: 'border-width' },\n borderStyle: { ...host, property: 'border-style' },\n borderColor: { ...host, property: 'border-color' },\n borderRadius: { ...host, property: 'border-radius' },\n backgroundColor: { ...host, property: 'background-color' },\n textColor: { property: 'color' },\n labelMargin: { ...host, property: 'gap' },\n itemsSpacing: { ...item, property: 'line-height' },\n itemSymbolSuccessColor: { ...symbolSuccess, property: 'color' },\n itemSymbolErrorColor: { ...symbolError, property: 'color' },\n itemSymbolDefault: { ...symbolDefault, property: 'content' },\n itemSymbolSuccess: { ...symbolSuccess, property: 'content' },\n itemSymbolError: { ...symbolError, property: 'content' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawPolicyValidation);\n","export const interpolateString = (template, values) =>\n template.replace(/{{(\\w+)+}}/g, (match, key) => values?.[key] || match);\n","import { componentName, PolicyValidationClass } from './PolicyValidationClass';\n\ncustomElements.define(componentName, PolicyValidationClass);\n\nexport { PolicyValidationClass, componentName };\n"],"names":["componentName","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_4__","xE","dataAttrs","policyAttrs","RawPolicyValidation","_baseClasses_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","baseSelector","availablePolicies","activePolicies","overrides","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_0__","fz","panel","shadowRoot","querySelector","label","list","attributeChangedCallback","attrName","oldValue","newValue","updateLabel","includes","JSON","parse","console","error","split","ln","Number","isNaN","minlength","value","reuse","passwordStrength","parseInt","passwordstrength","expected","actual","disallowedchars","_drop","rest","disallowemail","renderItems","val","getAttribute","getStrengthScore","length","compareValues","comparison","toUpperCase","Error","validate","policies","map","policy","data","id","reduce","results","find","p","pattern","message","compare","info","normalizedCompare","validationResult","_helpers__WEBPACK_IMPORTED_MODULE_5__","z","exp","RegExp","valid","test","toLowerCase","at","indexOf","localPart","slice","push","sort","a","b","isValid","some","buildValidationItem","status","li","document","createElement","className","dataset","span","textContent","appendChild","replaceChildren","bind","classList","remove","add","host","item","symbolDefault","symbolSuccess","symbolError","selector","PolicyValidationClass","_helpers__WEBPACK_IMPORTED_MODULE_3__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_1__","RF","componentNameOverride","mappings","hostDirection","property","fontSize","fontFamily","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textColor","labelMargin","itemsSpacing","itemSymbolSuccessColor","itemSymbolErrorColor","itemSymbolDefault","itemSymbolSuccess","itemSymbolError","VO","tQ","interpolateString","template","values","replace","match","key","customElements","define","_PolicyValidationClass__WEBPACK_IMPORTED_MODULE_0__","T","w"],"sourceRoot":""}
|