{"version":3,"file":"stytchResetPassword.mjs","sources":["../../../src/b2c/stytchResetPassword.ts"],"sourcesContent":["import type { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { ResetPasswordContainer, ResetPasswordSDKConfig } from '@stytch/web';\n\nimport { createMountFn, createWebComponent } from '../bindings/WebComponents';\n\nconst defaultSdkProps = ['client', 'config', 'presentation', 'callbacks', 'strings'] as const;\n\n/**\n * Renders a reset password screen.\n *\n * @attr {boolean} [shadow] - use shadow DOM to contain styles\n * @attr {string} passwordResetToken - The password reset token from the magic link\n *\n * @prop {StytchClient} client - used to make API calls.\n * @prop {StytchLoginConfig} config - object containing the products that should be registered\n * @prop {PresentationConfig} [presentation] - for customizing the UI styling and presentation\n * @prop {Messages} [strings] - custom strings to be used, to customize text or for localization\n * @prop {string} passwordResetToken - The password reset token from the magic link.\n *\n * @event StytchEvent - see {@link import('./idpWebComponent').StytchEvent}\n * @event StytchError - see {@link import('./idpWebComponent').StytchError}\n *\n */\nexport const StytchResetPassword = createWebComponent<ResetPasswordSDKConfig<StytchProjectConfigurationInput>>(\n  ResetPasswordContainer,\n  {\n    propNames: [...defaultSdkProps, 'passwordResetToken'],\n    attributeNames: ['passwordResetToken'],\n  },\n);\n\n/**\n * Mounts a reset password screen inside the element provided.\n * If a reset password screen has already been rendered inside the element,\n * it will be updated to use the new config, style, and callback options passed in.\n *\n * @deprecated Prefer using the StytchResetPassword web component instead\n *\n * @example\n * mountResetPassword({\n *   client: stytchClient,\n *   elementId: '#login-container',\n *   config: {...},\n *   passwordResetToken: 'token-here'\n * });\n *\n * @param client - A {@link StytchClient} instance used for making API calls.\n * @param elementId - A string containing the id of the element that should contain the login screen.\n * @param config - A {@link StytchLoginConfig} object containing the products that should be registered\n * @param presentation - Optional {@link PresentationConfig} object for customizing the UI presentation\n * @param callbacks - Optional {@link Callbacks} triggered by various events in the Stytch SDK.\n * @param strings - Optional custom strings to be used in the prebuilt UI.\n * @param passwordResetToken - The password reset token from the magic link.\n * @throws An error when the element specified by elementId cannot be found.\n */\nexport const mountResetPassword = createMountFn('stytch-reset-password', StytchResetPassword);\n"],"names":["defaultSdkProps","StytchResetPassword","createWebComponent","ResetPasswordContainer","propNames","attributeNames","mountResetPassword","createMountFn"],"mappings":";;;AAKA,MAAMA,iBAAAA,GAAkB;AAAC,IAAA,QAAA;AAAU,IAAA,QAAA;AAAU,IAAA,cAAA;AAAgB,IAAA,WAAA;AAAa,IAAA;AAAU,CAAA;AAEpF;;;;;;;;;;;;;;;AAeC,IACM,MAAMC,mBAAAA,GAAsBC,kBAAAA,CACjCC,sBAAAA,EACA;IACEC,SAAAA,EAAW;AAAIJ,QAAAA,GAAAA,iBAAAA;AAAiB,QAAA;AAAqB,KAAA;IACrDK,cAAAA,EAAgB;AAAC,QAAA;AAAqB;AACxC,CAAA;AAGF;;;;;;;;;;;;;;;;;;;;;;;AAuBC,IACM,MAAMC,kBAAAA,GAAqBC,aAAAA,CAAc,yBAAyBN,mBAAAA;;;;"}