@descope/web-components-ui 1.53.0 → 1.55.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.
@@ -1 +1 @@
1
- {"version":3,"file":"descope-new-password-index-js.js","mappings":"4MASO,MAAMA,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,oGCGhB,MAAMC,GAAgB,QAAiB,aA4GxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,wBACZC,EAAuB,sBACvBC,EAAqB,iBACrBC,EAAgB,MAChBC,EAAK,kBACLC,EAAiB,aACjBC,EAAY,WACZC,GACE,CACFT,KAAM,CAAEU,SAAU,IAAM,SACxBT,WAAY,CAAES,SAAU,uBACxBR,aAAc,CAAEQ,SAAU,WAC1BP,wBAAyB,CAAEO,SAAU,IAAM,iCAC3CN,sBAAuB,CAAEM,SAAU,yBACnCL,iBAAkB,CAAEK,SAAU,iCAC9BJ,MAAO,CAAEI,SAAU,iBACnBH,kBAAmB,CAAEG,SAAU,+CAC/BD,WAAY,CAAEC,SAAU,uBACxBF,aAAc,CAAEE,SAAU,0BAGfC,GAAgB,SAC3B,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKb,EAAMc,SAAU,SAChCC,aAAc,IAAKf,EAAMc,SAAU,aACnCE,cAAe,IAAKhB,EAAMc,SAAU,aACpCG,SAAU,CAAC,CAAC,EAAGjB,GACfkB,WAAY,CAACZ,EAAOL,EAAYO,EAAcC,GAC9CU,YAAa,IAAKlB,EAAYa,SAAU,UACxCM,uBAAwB,CACtB,IAAKlB,EAAcY,SAAU,gBAC7B,IAAKZ,EAAcY,SAAU,kBAE/BO,qBAAsB,IAAKpB,EAAYa,SAAU,oBAEjDQ,iBAAkB,IAAKrB,EAAYa,SAAU,gBAC7CS,iBAAkB,IAAKtB,EAAYa,SAAU,gBAC7CU,iBAAkB,IAAKvB,EAAYa,SAAU,gBAC7CW,kBAAmB,IAAKxB,EAAY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q,CAA2BC,EAAMC,GAC/B,MAAMzP,EAAgBwP,EAAKpO,cAAc,SACnCsO,EAAUpC,SAASC,cAAc,QAEjCoC,EAAa3P,EAAcZ,aAAa,QAE9CsQ,EAAQhO,aAAa,OAAQ+N,GAC7BC,EAAQhO,aAAa,OAAQiO,GAE7BH,EAAKnB,YAAYqB,GAGjB1P,EAAc0B,aAAa,OAAQ+N,GACnCzP,EAAc0B,aAAa,OAAQvC,KAAKC,aAAa,SACrDY,EAAc0B,aAAa,oBAAqB,QAEhDvC,KAAKkP,YAAYrO,EACnB,CAEA,iBAAAD,GAEEZ,KAAKgM,cAAgBhM,KAAK7D,aAAa8F,cAAc,wBACrDjC,KAAKmM,aAAenM,KAAK7D,aAAa8F,cAAc,uBAGpDjC,KAAKoQ,2BAA2BpQ,KAAKgM,cAAe,2BACpDhM,KAAKoQ,2BAA2BpQ,KAAKmM,aAAc,yBACrD,IAqB4B,EA8C9B,QAAY,CACV3J,MAAO,GACPC,eAAgB,oBAChBC,MAAO,IAAM,oLASb,QAAuB,IAAcC,g+BA4CrCC,iBAAkB,CAAC,YACnB5G,kB,mCCxNG,MAAMyU,EAAoB,CAACtD,EAAUuD,IAC1CvD,EAAS5B,QAAQ,eAAe,CAACoF,EAAOC,IAAQF,IAASE,IAAQD,G","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/PasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.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-policy-validation/PolicyValidationClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/passwordDraggableMixin.js","webpack://@descope/web-components-ui/./src/components/descope-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/index.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/index.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.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-text-field/TextFieldClass.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/NewPasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/helpers.js"],"sourcesContent":["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 {\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 }\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.baseElement\n .querySelector('vaadin-password-field-button')\n .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 labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: '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\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'],\n componentName,\n })\n);\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: { selector: '[required]::part(required-indicator)::after' },\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: { selector: () => '::slotted(input:disabled::placeholder)' },\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 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: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\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};\n","import { getComponentName } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('new-password-internal');\n","// eslint-disable-next-line max-classes-per-file\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { interpolateString } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-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];\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\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\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 (compare) {\n validationResult.valid = this.compareValues(compare, data.expected, data.actual);\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 getValidationItemTemplate({ valid, message }) {\n const status = !this.value ? 'none' : valid;\n return `\n <li class=\"item\" data-valid=\"${status}\">\n <span class=\"message\">${message}</span>\n </li>\n `;\n }\n\n renderItems(availablePolicies, activePolicies) {\n if (!availablePolicies || !activePolicies.length) {\n return;\n }\n\n this.list.innerHTML = this.validate().map(this.getValidationItemTemplate.bind(this)).join('');\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","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 '@vaadin/password-field';\nimport { componentName, PasswordClass } from './PasswordClass';\n\ncustomElements.define(componentName, PasswordClass);\n\nexport { PasswordClass, componentName };\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","import { componentName, PolicyValidationClass } from './PolicyValidationClass';\n\ncustomElements.define(componentName, PolicyValidationClass);\n\nexport { PolicyValidationClass, componentName };\n","import { componentName, NewPasswordClass } from './NewPasswordClass';\nimport '../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","export const useHostExternalPadding = (cssVarList) => `\n :host {\n padding: calc(var(${cssVarList.inputOutlineWidth}) + var(${cssVarList.inputOutlineOffset}))\n }\n`;\n\nexport const resetInputFieldUnderlayingBorder = (name) => `\n ${name}::part(input-field)::after {\n border: none;\n }\n`;\n\nexport const resetInitialHeight = (name) => `\n ${name}::before {\n\t\theight: unset;\n\t}\n`;\n\nexport const resetInputElement = (name) => `\n ${name} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputContainer = (name) => `\n ${name} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputField = (name) => `\n ${name}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`;\n\nexport const resetInputCursor = (name) => `\n ${name} > label,\n ${name}::part(label),\n ${name}::part(required-indicator) {\n cursor: pointer;\n }\n`;\n\nexport const resetInputPlaceholder = (name, ele = 'input') => `\n ${name}[disabled] > ${ele}:placeholder-shown,\n\t${name}[readonly] > ${ele}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`;\n\nexport const resetInputAutoFill = (name, cssVarList) => `\n ${name} input:-webkit-autofill,\n ${name} input:-webkit-autofill::first-line,\n ${name} input:-webkit-autofill:hover,\n ${name} input:-webkit-autofill:active,\n ${name} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${cssVarList.inputValueTextColor});\n box-shadow: 0 0 0 var(${cssVarList.inputHeight}) var(${cssVarList.inputBackgroundColor}) inset;\n }\n`;\n\nexport const resetInputFieldDefaultWidth = () => `\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputReadonlyStyle = (name) => `\n ${name}::part(input-field)::after {\n opacity: 0;\n }\n`;\n\nexport const resetInputFieldInvalidBackgroundColor = (name) => `\n ${name}::part(input-field)::after {\n background: none;\n }\n`;\n\nexport const resetInputOverrides = (name, cssVarList) => `\n ${resetInputContainer(name)}\n ${resetInputCursor(name)}\n ${resetInputPlaceholder(name)}\n ${resetInputField(name)}\n ${resetInputAutoFill(name, cssVarList)}\n ${resetInputFieldInvalidBackgroundColor(name)}\n ${resetInitialHeight(name)}\n ${resetInputElement(name)}\n ${resetInputFieldUnderlayingBorder(name)}\n`;\n\n// This function is used to support RTL correctly for input components.\n// It also fixes the error message to be displayed LTR since we currently\n// don't support RTL for error messages.\nexport const resetInputLabelPosition = (name) => `\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${name} [slot=\"label\"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`;\n\nexport const inputFloatingLabelStyle = () => {\n return `\n :host([label-type=\"floating\"]) {\n position: relative;\n }\n :host([label-type=\"floating\"][has-label]) [slot=\"label\"] {\n padding: 0;\n }\n :host([label-type=\"floating\"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n `;\n};\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 '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 {\n if (this.passwordStrength) {\n this.passwordStrength.remove();\n this.passwordStrength = null;\n }\n }\n }\n\n get activePolicies() {\n return (this.getAttribute('active-policies') || '').split(',');\n }\n\n // eslint-disable-next-line class-methods-use-this\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 {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\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\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({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\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'],\n componentName,\n })\n);\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 '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 '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 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 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'],\n componentName,\n })\n);\n","export const interpolateString = (template, values) =>\n template.replace(/{{(\\w+)+}}/g, (match, key) => values?.[key] || match);\n"],"names":["createBaseInputClass","args","componentName","host","inputField","inputElement","inputElementPlaceholder","revealButtonContainer","revealButtonIcon","label","requiredIndicator","errorMessage","helperText","selector","PasswordClass","mappings","hostWidth","property","hostMinWidth","hostDirection","fontSize","fontFamily","inputHeight","inputHorizontalPadding","inputBackgroundColor","inputBorderStyle","inputBorderWidth","inputBorderColor","inputBorderRadius","inputOutlineColor","inputOutlineStyle","inputOutlineOffset","inputOutlineWidth","labelFontSize","labelFontWeight","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","inputPlaceholderTextColor","inputValueTextColor","revealButtonOffset","revealButtonSize","revealButtonColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","inputType","inputName","includeAttrs","noBlurDispatch","proxyProps","useProxyTargets","superclass","observedAttributes","manualToggleVisibility","this","getAttribute","init","super","handleCaretOnVisibilityChange","origSetPasswordVisible","baseElement","_setPasswordVisible","origSetFocused","_setFocused","setFocus","bind","initExternalInput","externalInput","createExternalInput","handlePasswordVisibility","caretPosition","value","length","origTogglePasswordVisibility","_togglePasswordVisibility","setTimeout","setSelectionRange","focused","call","resetPasswordVisibilityToggle","origSetFocus","attributeChangedCallback","attrName","oldValue","newValue","origBoundRevealButtonMouseDown","__boundRevealButtonMouseDown","querySelector","removeEventListener","_passwordVisibleChanged","showPasswordVisibility","hidePasswordVisibility","input","setAttribute","slots","wrappedEleName","style","cssVarList","excludeAttrsSync","placeholder","inputMask","disabledPlaceholder","inputDisabled","inputIcon","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","inputDirection","helperTextColor","inputCaretTextColor","textAlign","inputTextAlign","inputPlaceholderColor","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","dataAttrs","policyAttrs","RawPolicyValidation","baseSelector","constructor","attachShadow","mode","innerHTML","panel","shadowRoot","list","updateLabel","includes","availablePolicies","JSON","parse","console","error","split","ln","Number","isNaN","minlength","passwordStrength","parseInt","passwordstrength","expected","actual","renderItems","val","getStrengthScore","compareValues","comparison","toUpperCase","Error","validate","policies","map","policy","data","id","reduce","results","find","p","pattern","message","compare","validationResult","exp","RegExp","valid","test","push","isValid","some","getValidationItemTemplate","activePolicies","join","textContent","classList","remove","add","item","symbolDefault","symbolSuccess","symbolError","PolicyValidationClass","componentNameOverride","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textColor","labelMargin","itemsSpacing","itemSymbolSuccessColor","itemSymbolErrorColor","itemSymbolDefault","itemSymbolSuccess","itemSymbolError","isReadOnly","hasAttribute","ele","addEventListener","e","isDraggable","inputEle","target","prevType","focus","onComplete","_","removeAttribute","once","customElements","define","useHostExternalPadding","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle","passwordAttrPrefixRegex","confirmAttrPrefixRegex","removeAttrPrefix","attr","prefix","replace","passwordInputAttrs","confirmInputAttrs","policyPanelAttrs","commonAttrs","inputRelatedAttrs","concat","BaseInputClass","wrapperEle","passwordInput","hasConfirm","onHasConfirmChange","confirmInput","toggle","onHasValidationChange","hasValidation","policyPanel","getValidity","isRequired","valueMissing","typeMismatch","patternMismatch","min","minVal","tooShort","isTrusted","renderInputs","hasExternalInput","template","inputs","initInputs","detail","mapAttrs","handleIndicatorStyle","forEach","NewPasswordClass","inputsRequiredIndicator","isInvalid","handleInputsInvalidAttribute","changedAttributes","inputInvalidValue","rootInvalidValue","handleFocusEventsDispatching","togglePasswordStrength","document","createElement","insertBefore","toggleBooleanAttribute","observedAttrs","TextFieldClass","icon","renderCopyToClipboard","shouldRender","iconInitConfig","title","iconCopiedConfig","Object","assign","slot","appendChild","navigator","clipboard","writeText","onLabelClick","oldVal","newVal","attributeChangeCallback","_setType","policyPreviewVars","internalInputsWrapper","policyPreview","spaceBetweenInputs","policyPreviewBackgroundColor","policyPreviewPadding","externalInputAttr","content","cloneNode","createSlottedExternalInput","node","slotName","slotEle","targetSlot","interpolateString","values","match","key"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-new-password-index-js.js","mappings":"4MASO,MAAMA,EAAuB,IAAIC,KACtC,QACE,KACA,KACA,KACA,KAJF,EAKE,UAAmBA,G,oGCGhB,MAAMC,GAAgB,QAAiB,aA4GxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,wBACZC,EAAuB,sBACvBC,EAAqB,iBACrBC,EAAgB,MAChBC,EAAK,kBACLC,EAAiB,aACjBC,EAAY,WACZC,GACE,CACFT,KAAM,CAAEU,SAAU,IAAM,SACxBT,WAAY,CAAES,SAAU,uBACxBR,aAAc,CAAEQ,SAAU,WAC1BP,wBAAyB,CAAEO,SAAU,IAAM,iCAC3CN,sBAAuB,CAAEM,SAAU,yBACnCL,iBAAkB,CAAEK,SAAU,iCAC9BJ,MAAO,CAAEI,SAAU,iBACnBH,kBAAmB,CAAEG,SAAU,+CAC/BD,WAAY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4CrCC,iBAAkB,CAAC,YACnB5G,kB,mCCxNG,MAAMyU,EAAoB,CAACtD,EAAUuD,IAC1CvD,EAAS5B,QAAQ,eAAe,CAACoF,EAAOC,IAAQF,IAASE,IAAQD,G","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/PasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.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-policy-validation/PolicyValidationClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/passwordDraggableMixin.js","webpack://@descope/web-components-ui/./src/components/descope-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/index.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/index.js","webpack://@descope/web-components-ui/./src/helpers/themeHelpers/resetHelpers.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-text-field/TextFieldClass.js","webpack://@descope/web-components-ui/./src/components/descope-new-password/NewPasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/helpers.js"],"sourcesContent":["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 {\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 }\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.baseElement\n .querySelector('vaadin-password-field-button')\n .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 labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: '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\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'],\n componentName,\n })\n);\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: { selector: '[required]::part(required-indicator)::after' },\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: { selector: () => '::slotted(input:disabled::placeholder)' },\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 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: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\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};\n","import { getComponentName } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('new-password-internal');\n","// eslint-disable-next-line max-classes-per-file\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { interpolateString } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-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];\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\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\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 (compare) {\n validationResult.valid = this.compareValues(\n compare,\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 getValidationItemTemplate({ valid, message }) {\n const status = !this.value ? 'none' : valid;\n return `\n <li class=\"item\" data-valid=\"${status}\">\n <span class=\"message\">${message}</span>\n </li>\n `;\n }\n\n renderItems(availablePolicies, activePolicies) {\n if (!availablePolicies || !activePolicies.length) {\n return;\n }\n\n this.list.innerHTML = this.validate().map(this.getValidationItemTemplate.bind(this)).join('');\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","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 '@vaadin/password-field';\nimport { componentName, PasswordClass } from './PasswordClass';\n\ncustomElements.define(componentName, PasswordClass);\n\nexport { PasswordClass, componentName };\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","import { componentName, PolicyValidationClass } from './PolicyValidationClass';\n\ncustomElements.define(componentName, PolicyValidationClass);\n\nexport { PolicyValidationClass, componentName };\n","import { componentName, NewPasswordClass } from './NewPasswordClass';\nimport '../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","export const useHostExternalPadding = (cssVarList) => `\n :host {\n padding: calc(var(${cssVarList.inputOutlineWidth}) + var(${cssVarList.inputOutlineOffset}))\n }\n`;\n\nexport const resetInputFieldUnderlayingBorder = (name) => `\n ${name}::part(input-field)::after {\n border: none;\n }\n`;\n\nexport const resetInitialHeight = (name) => `\n ${name}::before {\n\t\theight: unset;\n\t}\n`;\n\nexport const resetInputElement = (name) => `\n ${name} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputContainer = (name) => `\n ${name} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputField = (name) => `\n ${name}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`;\n\nexport const resetInputCursor = (name) => `\n ${name} > label,\n ${name}::part(label),\n ${name}::part(required-indicator) {\n cursor: pointer;\n }\n`;\n\nexport const resetInputPlaceholder = (name, ele = 'input') => `\n ${name}[disabled] > ${ele}:placeholder-shown,\n\t${name}[readonly] > ${ele}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`;\n\nexport const resetInputAutoFill = (name, cssVarList) => `\n ${name} input:-webkit-autofill,\n ${name} input:-webkit-autofill::first-line,\n ${name} input:-webkit-autofill:hover,\n ${name} input:-webkit-autofill:active,\n ${name} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${cssVarList.inputValueTextColor});\n box-shadow: 0 0 0 var(${cssVarList.inputHeight}) var(${cssVarList.inputBackgroundColor}) inset;\n }\n`;\n\nexport const resetInputFieldDefaultWidth = () => `\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n`;\n\nexport const resetInputReadonlyStyle = (name) => `\n ${name}::part(input-field)::after {\n opacity: 0;\n }\n`;\n\nexport const resetInputFieldInvalidBackgroundColor = (name) => `\n ${name}::part(input-field)::after {\n background: none;\n }\n`;\n\nexport const resetInputOverrides = (name, cssVarList) => `\n ${resetInputContainer(name)}\n ${resetInputCursor(name)}\n ${resetInputPlaceholder(name)}\n ${resetInputField(name)}\n ${resetInputAutoFill(name, cssVarList)}\n ${resetInputFieldInvalidBackgroundColor(name)}\n ${resetInitialHeight(name)}\n ${resetInputElement(name)}\n ${resetInputFieldUnderlayingBorder(name)}\n`;\n\n// This function is used to support RTL correctly for input components.\n// It also fixes the error message to be displayed LTR since we currently\n// don't support RTL for error messages.\nexport const resetInputLabelPosition = (name) => `\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${name} [slot=\"label\"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`;\n\nexport const inputFloatingLabelStyle = () => {\n return `\n :host([label-type=\"floating\"]) {\n position: relative;\n }\n :host([label-type=\"floating\"][has-label]) [slot=\"label\"] {\n padding: 0;\n }\n :host([label-type=\"floating\"][has-label]) > ::part(label) {\n z-index: 1;\n padding: 0;\n width: auto;\n }\n `;\n};\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 '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 {\n if (this.passwordStrength) {\n this.passwordStrength.remove();\n this.passwordStrength = null;\n }\n }\n }\n\n get activePolicies() {\n return (this.getAttribute('active-policies') || '').split(',');\n }\n\n // eslint-disable-next-line class-methods-use-this\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 {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\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\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({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\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'],\n componentName,\n })\n);\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 '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 '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 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 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'],\n componentName,\n })\n);\n","export const interpolateString = (template, values) =>\n template.replace(/{{(\\w+)+}}/g, (match, key) => values?.[key] || match);\n"],"names":["createBaseInputClass","args","componentName","host","inputField","inputElement","inputElementPlaceholder","revealButtonContainer","revealButtonIcon","label","requiredIndicator","errorMessage","helperText","selector","PasswordClass","mappings","hostWidth","property","hostMinWidth","hostDirection","fontSize","fontFamily","inputHeight","inputHorizontalPadding","inputBackgroundColor","inputBorderStyle","inputBorderWidth","inputBorderColor","inputBorderRadius","inputOutlineColor","inputOutlineStyle","inputOutlineOffset","inputOutlineWidth","labelFontSize","labelFontWeight","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","inputPlaceholderTextColor","inputValueTextColor","revealButtonOffset","revealButtonSize","revealButtonColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","inputType","inputName","includeAttrs","noBlurDispatch","proxyProps","useProxyTargets","superclass","observedAttributes","manualToggleVisibility","this","getAttribute","init","super","handleCaretOnVisibilityChange","origSetPasswordVisible","baseElement","_setPasswordVisible","origSetFocused","_setFocused","setFocus","bind","initExternalInput","externalInput","createExternalInput","handlePasswordVisibility","caretPosition","value","length","origTogglePasswordVisibility","_togglePasswordVisibility","setTimeout","setSelectionRange","focused","call","resetPasswordVisibilityToggle","origSetFocus","attributeChangedCallback","attrName","oldValue","newValue","origBoundRevealButtonMouseDown","__boundRevealButtonMouseDown","querySelector","removeEventListener","_passwordVisibleChanged","showPasswordVisibility","hidePasswordVisibility","input","setAttribute","slots","wrappedEleName","style","cssVarList","excludeAttrsSync","placeholder","inputMask","disabledPlaceholder","inputDisabled","inputIcon","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","inputDirection","helperTextColor","inputCaretTextColor","textAlign","inputTextAlign","inputPlaceholderColor","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","dataAttrs","policyAttrs","RawPolicyValidation","baseSelector","constructor","attachShadow","mode","innerHTML","panel","shadowRoot","list","updateLabel","includes","availablePolicies","JSON","parse","console","error","split","ln","Number","isNaN","minlength","passwordStrength","parseInt","passwordstrength","expected","actual","renderItems","val","getStrengthScore","compareValues","comparison","toUpperCase","Error","validate","policies","map","policy","data","id","reduce","results","find","p","pattern","message","compare","validationResult","exp","RegExp","valid","test","push","isValid","some","getValidationItemTemplate","activePolicies","join","textContent","classList","remove","add","item","symbolDefault","symbolSuccess","symbolError","PolicyValidationClass","componentNameOverride","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textColor","labelMargin","itemsSpacing","itemSymbolSuccessColor","itemSymbolErrorColor","itemSymbolDefault","itemSymbolSuccess","itemSymbolError","isReadOnly","hasAttribute","ele","addEventListener","e","isDraggable","inputEle","target","prevType","focus","onComplete","_","removeAttribute","once","customElements","define","useHostExternalPadding","resetInputContainer","name","resetInputField","resetInputCursor","resetInputPlaceholder","resetInputFieldDefaultWidth","resetInputReadonlyStyle","resetInputFieldInvalidBackgroundColor","resetInputOverrides","resetInputAutoFill","resetInitialHeight","resetInputElement","resetInputFieldUnderlayingBorder","resetInputLabelPosition","inputFloatingLabelStyle","passwordAttrPrefixRegex","confirmAttrPrefixRegex","removeAttrPrefix","attr","prefix","replace","passwordInputAttrs","confirmInputAttrs","policyPanelAttrs","commonAttrs","inputRelatedAttrs","concat","BaseInputClass","wrapperEle","passwordInput","hasConfirm","onHasConfirmChange","confirmInput","toggle","onHasValidationChange","hasValidation","policyPanel","getValidity","isRequired","valueMissing","typeMismatch","patternMismatch","min","minVal","tooShort","isTrusted","renderInputs","hasExternalInput","template","inputs","initInputs","detail","mapAttrs","handleIndicatorStyle","forEach","NewPasswordClass","inputsRequiredIndicator","isInvalid","handleInputsInvalidAttribute","changedAttributes","inputInvalidValue","rootInvalidValue","handleFocusEventsDispatching","togglePasswordStrength","document","createElement","insertBefore","toggleBooleanAttribute","observedAttrs","TextFieldClass","icon","renderCopyToClipboard","shouldRender","iconInitConfig","title","iconCopiedConfig","Object","assign","slot","appendChild","navigator","clipboard","writeText","onLabelClick","oldVal","newVal","attributeChangeCallback","_setType","policyPreviewVars","internalInputsWrapper","policyPreview","spaceBetweenInputs","policyPreviewBackgroundColor","policyPreviewPadding","externalInputAttr","content","cloneNode","createSlottedExternalInput","node","slotName","slotEle","targetSlot","interpolateString","values","match","key"],"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,i)=>{i.d(t,{T:()=>d,w:()=>g});var s=i(79365),r=i(81365),a=i(9696),o=i(97810),l=i(88191),n=i(25964);const d=(0,o.xE)("policy-validation"),c=["data","active-policies","overrides","data-password-policy-value-minlength","data-password-policy-value-passwordstrength","data-password-policy-actual-passwordstrength"],p=["label","value",...c];class h extends((0,r.q)({componentName:d,baseSelector:":host > div"})){#e;#t=[];#i;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,n.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,i){if(super.attributeChangedCallback?.(e,t,i),t!==i){if("label"===e&&this.updateLabel(i),c.includes(e)){if("data"===e)try{this.availablePolicies=JSON.parse(i)}catch{console.error("Failed to set available policies")}if("active-policies"===e&&(this.#t=(i||"").split(",")),"data-password-policy-value-minlength"===e){const e=Number(i);!Number.isNaN(e)&&e>0&&(this.#i={...this.#i,minlength:{value:`${e}`}})}if("data-password-policy-value-passwordstrength"===e){const e=parseInt(i);!Number.isNaN(e)&&e>0&&(this.#i={...this.#i,passwordstrength:{...this.#i?.passwordstrength,expected:e}})}if("data-password-policy-actual-passwordstrength"===e){const e=Number(i);!Number.isNaN(e)&&e>0&&(this.#i={...this.#i,passwordstrength:{...this.#i?.passwordstrength,actual:e}})}}this.renderItems(this.#e,this.#t,this.#i)}}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,i){switch(e.toUpperCase()){case"GTE":return i>=t;case"GT":return i>t;case"LTE":return i<=t;case"LT":return i<t;case"EQ":return i===t;case"NEQ":return i!==t;default:throw new Error(`Invalid comparison type: ${e}`)}}validate(){let e=this.#e;return this.#i&&(e=this.#e.map((e=>{const t=this.#i[e.id];return t?{...e,data:t}:e}))),this.#t.reduce(((t,i)=>{const s=e.find((e=>e.id===i));if(!s)return t;const{pattern:r,message:a,data:o,compare:n}=s;if(!r&&!n||!a)return t;const d={message:(0,l.z)(a,o),id:i};if(r){const e=new RegExp((0,l.z)(r,o));d.valid=e.test(this.value)}else n&&(d.valid=this.compareValues(n,o.expected,o.actual));return t.push(d),t}),[])}get isValid(){return!this.validate().some((({valid:e})=>!1===e))}getValidationItemTemplate({valid:e,message:t}){return`\n <li class="item" data-valid="${this.value?e:"none"}">\n <span class="message">${t}</span>\n </li>\n `}renderItems(e,t){e&&t.length&&(this.list.innerHTML=this.validate().map(this.getValidationItemTemplate.bind(this)).join(""))}updateLabel(e){e?(this.label.textContent=e,this.classList.remove("hide-label")):(this.classList.add("hide-label"),this.label.textContent="")}}const{host:u,item:b,symbolDefault:m,symbolSuccess:v,symbolError:y}={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'}},g=(0,a.Zz)((0,s.RF)({componentNameOverride:(0,o.xE)("input-wrapper")}),(0,s.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:{...b,property:"line-height"},itemSymbolSuccessColor:{...v,property:"color"},itemSymbolErrorColor:{...y,property:"color"},itemSymbolDefault:{...m,property:"content"},itemSymbolSuccess:{...v,property:"content"},itemSymbolError:{...y,property:"content"}}}),s.VO,s.tQ)(h)},26782:(e,t,i)=>{i.r(t),i.d(t,{PolicyValidationClass:()=>s.w,componentName:()=>s.T});var s=i(10777);customElements.define(s.T,s.w)},88191:(e,t,i)=>{i.d(t,{z:()=>s});const s=(e,t)=>e.replace(/{{(\w+)+}}/g,((e,i)=>t?.[i]||e))}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2996],{10777:(e,t,i)=>{i.d(t,{T:()=>d,w:()=>g});var s=i(79365),r=i(81365),a=i(9696),o=i(97810),l=i(88191),n=i(25964);const d=(0,o.xE)("policy-validation"),c=["data","active-policies","overrides","data-password-policy-value-minlength","data-password-policy-value-passwordstrength","data-password-policy-actual-passwordstrength"],p=["label","value",...c];class h extends((0,r.q)({componentName:d,baseSelector:":host > div"})){#e;#t=[];#i;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,n.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,i){if(super.attributeChangedCallback?.(e,t,i),t!==i){if("label"===e&&this.updateLabel(i),c.includes(e)){if("data"===e)try{this.availablePolicies=JSON.parse(i)}catch{console.error("Failed to set available policies")}if("active-policies"===e&&(this.#t=(i||"").split(",")),"data-password-policy-value-minlength"===e){const e=Number(i);!Number.isNaN(e)&&e>0&&(this.#i={...this.#i,minlength:{value:`${e}`}})}if("data-password-policy-value-passwordstrength"===e){const e=parseInt(i);!Number.isNaN(e)&&e>=0&&(this.#i={...this.#i,passwordstrength:{...this.#i?.passwordstrength,expected:e}})}if("data-password-policy-actual-passwordstrength"===e){const e=Number(i);!Number.isNaN(e)&&e>=0&&(this.#i={...this.#i,passwordstrength:{...this.#i?.passwordstrength,actual:e}})}}this.renderItems(this.#e,this.#t,this.#i)}}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,i){switch(e.toUpperCase()){case"GTE":return i>=t;case"GT":return i>t;case"LTE":return i<=t;case"LT":return i<t;case"EQ":return i===t;case"NEQ":return i!==t;default:throw new Error(`Invalid comparison type: ${e}`)}}validate(){let e=this.#e;return this.#i&&(e=this.#e.map((e=>{const t=this.#i[e.id];return t?{...e,data:t}:e}))),this.#t.reduce(((t,i)=>{const s=e.find((e=>e.id===i));if(!s)return t;const{pattern:r,message:a,data:o,compare:n}=s;if(!r&&!n||!a)return t;const d={message:(0,l.z)(a,o),id:i};if(r){const e=new RegExp((0,l.z)(r,o));d.valid=e.test(this.value)}else n&&(d.valid=this.compareValues(n,o?.expected??-1,o?.actual??-1));return t.push(d),t}),[])}get isValid(){return!this.validate().some((({valid:e})=>!1===e))}getValidationItemTemplate({valid:e,message:t}){return`\n <li class="item" data-valid="${this.value?e:"none"}">\n <span class="message">${t}</span>\n </li>\n `}renderItems(e,t){e&&t.length&&(this.list.innerHTML=this.validate().map(this.getValidationItemTemplate.bind(this)).join(""))}updateLabel(e){e?(this.label.textContent=e,this.classList.remove("hide-label")):(this.classList.add("hide-label"),this.label.textContent="")}}const{host:u,item:b,symbolDefault:m,symbolSuccess:v,symbolError:y}={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'}},g=(0,a.Zz)((0,s.RF)({componentNameOverride:(0,o.xE)("input-wrapper")}),(0,s.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:{...b,property:"line-height"},itemSymbolSuccessColor:{...v,property:"color"},itemSymbolErrorColor:{...y,property:"color"},itemSymbolDefault:{...m,property:"content"},itemSymbolSuccess:{...v,property:"content"},itemSymbolError:{...y,property:"content"}}}),s.VO,s.tQ)(h)},26782:(e,t,i)=>{i.r(t),i.d(t,{PolicyValidationClass:()=>s.w,componentName:()=>s.T});var s=i(10777);customElements.define(s.T,s.w)},88191:(e,t,i)=>{i.d(t,{z:()=>s});const s=(e,t)=>e.replace(/{{(\w+)+}}/g,((e,i)=>t?.[i]||e))}}]);
2
2
  //# sourceMappingURL=descope-policy-validation-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-policy-validation-index-js.js","mappings":"uOAQO,MAAMA,GAAgB,QAAiB,qBAOxCC,EAAY,CAAC,OAAQ,kBAAmB,YAJ5C,uCACA,8CACA,gDAGIC,EAAc,CAAC,QAAS,WAAYD,GAE1C,MAAME,WAA4B,OAAgB,CAAEH,gBAAeI,aAAc,iBAC/E,GAEA,GAAkB,GAElB,GAEA,6BAAWC,GACT,OAAOH,CACT,CAEA,W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AAKtB,EAAeQ,SAAU,WACjDe,kBAAmB,IAAKtB,EAAeO,SAAU,WACjDgB,gBAAiB,IAAKtB,EAAaM,SAAU,cAGjD,KACA,KAxBmC,CAyBnCpF,E,qGC1RFqG,eAAeC,OAAO,IAAe,I,mCCF9B,MAAMC,EAAoB,CAACC,EAAUC,IAC1CD,EAASE,QAAQ,eAAe,CAACC,EAAOC,IAAQH,IAASG,IAAQD,G","sources":["webpack://@descope/web-components-ui/./src/components/descope-policy-validation/PolicyValidationClass.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/index.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/helpers.js"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { interpolateString } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-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];\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\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\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 (compare) {\n validationResult.valid = this.compareValues(compare, data.expected, data.actual);\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 getValidationItemTemplate({ valid, message }) {\n const status = !this.value ? 'none' : valid;\n return `\n <li class=\"item\" data-valid=\"${status}\">\n <span class=\"message\">${message}</span>\n </li>\n `;\n }\n\n renderItems(availablePolicies, activePolicies) {\n if (!availablePolicies || !activePolicies.length) {\n return;\n }\n\n this.list.innerHTML = this.validate().map(this.getValidationItemTemplate.bind(this)).join('');\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","import { componentName, PolicyValidationClass } from './PolicyValidationClass';\n\ncustomElements.define(componentName, PolicyValidationClass);\n\nexport { PolicyValidationClass, componentName };\n","export const interpolateString = (template, values) =>\n template.replace(/{{(\\w+)+}}/g, (match, key) => values?.[key] || match);\n"],"names":["componentName","dataAttrs","policyAttrs","RawPolicyValidation","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","panel","shadowRoot","querySelector","label","list","attributeChangedCallback","attrName","oldValue","newValue","updateLabel","includes","availablePolicies","JSON","parse","console","error","split","ln","Number","isNaN","minlength","value","passwordStrength","parseInt","passwordstrength","expected","actual","renderItems","val","getAttribute","getStrengthScore","length","compareValues","comparison","toUpperCase","Error","validate","policies","map","policy","data","id","reduce","results","find","p","pattern","message","compare","validationResult","exp","RegExp","valid","test","push","isValid","some","getValidationItemTemplate","activePolicies","bind","join","textContent","classList","remove","add","host","item","symbolDefault","symbolSuccess","symbolError","selector","PolicyValidationClass","componentNameOverride","mappings","hostDirection","property","fontSize","fontFamily","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textColor","labelMargin","itemsSpacing","itemSymbolSuccessColor","itemSymbolErrorColor","itemSymbolDefault","itemSymbolSuccess","itemSymbolError","customElements","define","interpolateString","template","values","replace","match","key"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-policy-validation-index-js.js","mappings":"uOAQO,MAAMA,GAAgB,QAAiB,qBAOxCC,EAAY,CAAC,OAAQ,kBAAmB,YAJ5C,uCACA,8CACA,gDAGIC,EAAc,CAAC,QAAS,WAAYD,GAE1C,MAAME,WAA4B,OAAgB,CAAEH,gBAAeI,aAAc,iBAC/E,GAEA,GAAkB,GAElB,GAEA,6BAAWC,GACT,OAAOH,CACT,CAEA,WAAAI,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,mFAOhD,QACE,4oBAgCAH,MAGFA,KAAKI,MAAQJ,KAAKK,WAAWC,cAAc,eAC3CN,KAAKO,MAAQP,KAAKK,WAAWC,cAAc,UAC3CN,KAAKQ,KAAOR,KAAKK,WAAWC,cAAc,KAC5C,CAEA,wBAAAG,CAAyBC,EAAUC,EAAUC,GAE3C,GADAb,MAAMU,2BAA2BC,EAAUC,EAAUC,GACjDD,IAAaC,EAAU,CAQzB,GAPiB,UAAbF,GACFV,KAAKa,YAAYD,GAMfnB,EAAUqB,SAASJ,GAAW,CAChC,GAAiB,SAAbA,EACF,IACEV,KAAKe,kBAAoBC,KAAKC,MAAML,EACtC,CAAE,MAEAM,QAAQC,MAAM,mCAChB,CAMF,GAJiB,oBAAbT,IACFV,MAAK,GAAmBY,GAAY,IAAIQ,MAAM,MAG/B,yCAAbV,EAAqD,CACvD,MAAMW,EAAKC,OAAOV,IACbU,OAAOC,MAAMF,IAAOA,EAAK,IAC5BrB,MAAK,EAAa,IAAKA,MAAK,EAAYwB,UAAW,CAAEC,MAA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BC,GAAwB,SACnC,QAAiB,CAAEC,uBAAuB,QAAiB,oBAC3D,QAAiB,CACfC,SAAU,CACRC,cAAe,CAAEJ,SAAU,IAAM,QAASK,SAAU,aACpDC,SAAU,CAAC,EACXC,WAAY,CAAC,EACbC,QAAS,CAAC,EACVC,YAAa,IAAKd,EAAMU,SAAU,gBAClCK,YAAa,IAAKf,EAAMU,SAAU,gBAClCM,YAAa,IAAKhB,EAAMU,SAAU,gBAClCO,aAAc,IAAKjB,EAAMU,SAAU,iBACnCQ,gBAAiB,IAAKlB,EAAMU,SAAU,oBACtCS,UAAW,CAAET,SAAU,SACvBU,YAAa,IAAKpB,EAAMU,SAAU,OAClCW,aAAc,IAAKpB,EAAMS,SAAU,eACnCY,uBAAwB,IAAKnB,EAAeO,SAAU,SACtDa,qBAAsB,IAAKnB,EAAaM,SAAU,SAClDc,kBAAmB,IAAKtB,EAAeQ,SAAU,WACjDe,kBAAmB,IAAKtB,EAAeO,SAAU,WACjDgB,gBAAiB,IAAKtB,EAAaM,SAAU,cAGjD,KACA,KAxBmC,CAyBnCpF,E,qGC9RFqG,eAAeC,OAAO,IAAe,I,mCCF9B,MAAMC,EAAoB,CAACC,EAAUC,IAC1CD,EAASE,QAAQ,eAAe,CAACC,EAAOC,IAAQH,IAASG,IAAQD,G","sources":["webpack://@descope/web-components-ui/./src/components/descope-policy-validation/PolicyValidationClass.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/index.js","webpack://@descope/web-components-ui/./src/components/descope-policy-validation/helpers.js"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { interpolateString } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-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];\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\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\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 (compare) {\n validationResult.valid = this.compareValues(\n compare,\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 getValidationItemTemplate({ valid, message }) {\n const status = !this.value ? 'none' : valid;\n return `\n <li class=\"item\" data-valid=\"${status}\">\n <span class=\"message\">${message}</span>\n </li>\n `;\n }\n\n renderItems(availablePolicies, activePolicies) {\n if (!availablePolicies || !activePolicies.length) {\n return;\n }\n\n this.list.innerHTML = this.validate().map(this.getValidationItemTemplate.bind(this)).join('');\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","import { componentName, PolicyValidationClass } from './PolicyValidationClass';\n\ncustomElements.define(componentName, PolicyValidationClass);\n\nexport { PolicyValidationClass, componentName };\n","export const interpolateString = (template, values) =>\n template.replace(/{{(\\w+)+}}/g, (match, key) => values?.[key] || match);\n"],"names":["componentName","dataAttrs","policyAttrs","RawPolicyValidation","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","panel","shadowRoot","querySelector","label","list","attributeChangedCallback","attrName","oldValue","newValue","updateLabel","includes","availablePolicies","JSON","parse","console","error","split","ln","Number","isNaN","minlength","value","passwordStrength","parseInt","passwordstrength","expected","actual","renderItems","val","getAttribute","getStrengthScore","length","compareValues","comparison","toUpperCase","Error","validate","policies","map","policy","data","id","reduce","results","find","p","pattern","message","compare","validationResult","exp","RegExp","valid","test","push","isValid","some","getValidationItemTemplate","activePolicies","bind","join","textContent","classList","remove","add","host","item","symbolDefault","symbolSuccess","symbolError","selector","PolicyValidationClass","componentNameOverride","mappings","hostDirection","property","fontSize","fontFamily","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textColor","labelMargin","itemsSpacing","itemSymbolSuccessColor","itemSymbolErrorColor","itemSymbolDefault","itemSymbolSuccess","itemSymbolError","customElements","define","interpolateString","template","values","replace","match","key"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.53.0",
3
+ "version": "1.55.0",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -33,7 +33,12 @@ const multiSelectComboBoxMixin = (superclass) =>
33
33
 
34
34
  // eslint-disable-next-line class-methods-use-this
35
35
  #renderItem = ({ displayName, value, label }) => {
36
- return `<span data-name="${label}" data-id="${value}">${displayName || label}</span>`;
36
+ const ele = document.createElement('span');
37
+ ele.setAttribute('data-name', label);
38
+ ele.setAttribute('data-id', value);
39
+ ele.textContent = displayName || label;
40
+
41
+ return ele.outerHTML;
37
42
  };
38
43
 
39
44
  #data;
@@ -151,14 +151,14 @@ class NewPasswordInternal extends BaseInputClass {
151
151
 
152
152
  // sync input value to policy validation panel
153
153
  this.passwordInput.addEventListener('input', (e) => {
154
- this.passwordStrength.addEventListener(
154
+ this.passwordStrength?.addEventListener(
155
155
  'score-changed',
156
156
  ({ detail }) => {
157
157
  this.policyPanel.setAttribute('data-password-policy-actual-passwordstrength', detail);
158
158
  },
159
159
  { once: true }
160
160
  );
161
- this.passwordStrength.setAttribute('value', e.target.value);
161
+ this.passwordStrength?.setAttribute('value', e.target.value);
162
162
  this.policyPanel.setAttribute('value', e.target.value);
163
163
  });
164
164
 
@@ -110,7 +110,7 @@ class RawPolicyValidation extends createBaseClass({ componentName, baseSelector:
110
110
 
111
111
  if (attrName === 'data-password-policy-value-passwordstrength') {
112
112
  const passwordStrength = parseInt(newValue);
113
- if (!Number.isNaN(passwordStrength) && passwordStrength > 0) {
113
+ if (!Number.isNaN(passwordStrength) && passwordStrength >= 0) {
114
114
  this.#overrides = {
115
115
  ...this.#overrides,
116
116
  passwordstrength: {
@@ -123,7 +123,7 @@ class RawPolicyValidation extends createBaseClass({ componentName, baseSelector:
123
123
 
124
124
  if (attrName === 'data-password-policy-actual-passwordstrength') {
125
125
  const ln = Number(newValue);
126
- if (!Number.isNaN(ln) && ln > 0) {
126
+ if (!Number.isNaN(ln) && ln >= 0) {
127
127
  this.#overrides = {
128
128
  ...this.#overrides,
129
129
  passwordstrength: { ...this.#overrides?.passwordstrength, actual: ln },
@@ -208,7 +208,11 @@ class RawPolicyValidation extends createBaseClass({ componentName, baseSelector:
208
208
  const exp = new RegExp(interpolateString(pattern, data));
209
209
  validationResult.valid = exp.test(this.value);
210
210
  } else if (compare) {
211
- validationResult.valid = this.compareValues(compare, data.expected, data.actual);
211
+ validationResult.valid = this.compareValues(
212
+ compare,
213
+ data?.expected ?? -1,
214
+ data?.actual ?? -1
215
+ );
212
216
  }
213
217
 
214
218
  results.push(validationResult);