@globalpayments-private/gpds-pattern-web 0.0.0-stage → 0.1.0-pr.7.gdcb74cd

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.
Files changed (97) hide show
  1. package/README.md +567 -2
  2. package/dist/cjs/control-strategy-DhhYTbse.js +113 -0
  3. package/dist/cjs/gpds-pattern-web.cjs.js +24 -0
  4. package/dist/cjs/index-Dzm6P89U.js +1565 -0
  5. package/dist/cjs/index.cjs.js +180 -0
  6. package/dist/cjs/loader.cjs.js +12 -0
  7. package/dist/cjs/uds-pattern-login-card_2.cjs.entry.js +1662 -0
  8. package/dist/collection/collection-manifest.json +14 -0
  9. package/dist/collection/components/uds-pattern-login-card/slimmers/identity-memory.slimmer.js +63 -0
  10. package/dist/collection/components/uds-pattern-login-card/slimmers/login-workflow.slimmer.js +357 -0
  11. package/dist/collection/components/uds-pattern-login-card/slimmers/renderers/login-card-renderer.js +100 -0
  12. package/dist/collection/components/uds-pattern-login-card/slimmers/renderers/login-field-renderer.js +129 -0
  13. package/dist/collection/components/uds-pattern-login-card/slimmers/renderers/login-step-renderer.js +192 -0
  14. package/dist/collection/components/uds-pattern-login-card/slimmers/resend-throttle.slimmer.js +65 -0
  15. package/dist/collection/components/uds-pattern-login-card/uds-pattern-login-card.css +154 -0
  16. package/dist/collection/components/uds-pattern-login-card/uds-pattern-login-card.js +508 -0
  17. package/dist/collection/components/uds-pattern-login-card/validation/login-validation-rules.js +86 -0
  18. package/dist/collection/components/uds-pattern-login-card/view-model/login-card-handlers.js +1 -0
  19. package/dist/collection/components/uds-pattern-login-card/view-model/login-step.view-model.js +138 -0
  20. package/dist/collection/components/uds-pattern-login-page/uds-pattern-login-page.css +37 -0
  21. package/dist/collection/components/uds-pattern-login-page/uds-pattern-login-page.js +97 -0
  22. package/dist/collection/index.js +5 -0
  23. package/dist/collection/providers/auth-provider.js +28 -0
  24. package/dist/collection/providers/control-strategy.js +21 -0
  25. package/dist/collection/providers/login-config.js +4 -0
  26. package/dist/collection/providers/memory-auth-provider.js +133 -0
  27. package/dist/collection/providers/parse-auth-result.js +135 -0
  28. package/dist/collection/slimmer/common/log.js +14 -0
  29. package/dist/collection/slimmer/common/symbols.js +10 -0
  30. package/dist/collection/slimmer/common/types.js +2 -0
  31. package/dist/collection/slimmer/decorators/inject-slimmer.js +73 -0
  32. package/dist/collection/slimmer/decorators/map-to-component-field.js +41 -0
  33. package/dist/collection/slimmer/decorators/map-to-component-method.js +33 -0
  34. package/dist/collection/slimmer/decorators/slimmer.js +10 -0
  35. package/dist/collection/slimmer/index.js +5 -0
  36. package/dist/collection/utils/labels.js +81 -0
  37. package/dist/collection/utils/types.js +1 -0
  38. package/dist/components/index.d.ts +35 -0
  39. package/dist/components/index.js +1 -0
  40. package/dist/components/p-DOrg55po.js +1 -0
  41. package/dist/components/p-_G8A9gg0.js +1 -0
  42. package/dist/components/uds-pattern-login-card.d.ts +11 -0
  43. package/dist/components/uds-pattern-login-card.js +1 -0
  44. package/dist/components/uds-pattern-login-page.d.ts +11 -0
  45. package/dist/components/uds-pattern-login-page.js +1 -0
  46. package/dist/docs.d.ts +480 -0
  47. package/dist/docs.json +549 -0
  48. package/dist/esm/control-strategy-DOrg55po.js +105 -0
  49. package/dist/esm/gpds-pattern-web.js +20 -0
  50. package/dist/esm/index-DsXlLyGj.js +1537 -0
  51. package/dist/esm/index.js +170 -0
  52. package/dist/esm/loader.js +10 -0
  53. package/dist/esm/uds-pattern-login-card_2.entry.js +1659 -0
  54. package/dist/gpds-pattern-web/gpds-pattern-web.css +1 -0
  55. package/dist/gpds-pattern-web/gpds-pattern-web.esm.js +1 -0
  56. package/dist/gpds-pattern-web/index.esm.js +1 -0
  57. package/dist/gpds-pattern-web/p-2c97d2da.entry.js +1 -0
  58. package/dist/gpds-pattern-web/p-DOrg55po.js +1 -0
  59. package/dist/gpds-pattern-web/p-DsXlLyGj.js +3 -0
  60. package/dist/index.cjs.js +1 -0
  61. package/dist/index.js +1 -0
  62. package/dist/types/components/uds-pattern-login-card/slimmers/identity-memory.slimmer.d.ts +21 -0
  63. package/dist/types/components/uds-pattern-login-card/slimmers/login-workflow.slimmer.d.ts +100 -0
  64. package/dist/types/components/uds-pattern-login-card/slimmers/renderers/login-card-renderer.d.ts +44 -0
  65. package/dist/types/components/uds-pattern-login-card/slimmers/renderers/login-field-renderer.d.ts +91 -0
  66. package/dist/types/components/uds-pattern-login-card/slimmers/renderers/login-step-renderer.d.ts +40 -0
  67. package/dist/types/components/uds-pattern-login-card/slimmers/resend-throttle.slimmer.d.ts +21 -0
  68. package/dist/types/components/uds-pattern-login-card/uds-pattern-login-card.d.ts +134 -0
  69. package/dist/types/components/uds-pattern-login-card/validation/login-validation-rules.d.ts +72 -0
  70. package/dist/types/components/uds-pattern-login-card/view-model/login-card-handlers.d.ts +21 -0
  71. package/dist/types/components/uds-pattern-login-card/view-model/login-step.view-model.d.ts +96 -0
  72. package/dist/types/components/uds-pattern-login-page/uds-pattern-login-page.d.ts +21 -0
  73. package/dist/types/components.d.ts +327 -0
  74. package/dist/types/index.d.ts +10 -0
  75. package/dist/types/providers/auth-provider.d.ts +168 -0
  76. package/dist/types/providers/control-strategy.d.ts +144 -0
  77. package/dist/types/providers/login-config.d.ts +52 -0
  78. package/dist/types/providers/memory-auth-provider.d.ts +37 -0
  79. package/dist/types/providers/parse-auth-result.d.ts +8 -0
  80. package/dist/types/slimmer/common/log.d.ts +8 -0
  81. package/dist/types/slimmer/common/symbols.d.ts +10 -0
  82. package/dist/types/slimmer/common/types.d.ts +30 -0
  83. package/dist/types/slimmer/decorators/inject-slimmer.d.ts +24 -0
  84. package/dist/types/slimmer/decorators/map-to-component-field.d.ts +16 -0
  85. package/dist/types/slimmer/decorators/map-to-component-method.d.ts +11 -0
  86. package/dist/types/slimmer/decorators/slimmer.d.ts +10 -0
  87. package/dist/types/slimmer/index.d.ts +6 -0
  88. package/dist/types/stencil-public-runtime.d.ts +1879 -0
  89. package/dist/types/utils/labels.d.ts +13 -0
  90. package/dist/types/utils/types.d.ts +106 -0
  91. package/dist/types/vega.d.ts +11 -0
  92. package/loader/cdn.js +1 -0
  93. package/loader/index.cjs.js +1 -0
  94. package/loader/index.d.ts +24 -0
  95. package/loader/index.es2017.js +1 -0
  96. package/loader/index.js +2 -0
  97. package/package.json +82 -4
@@ -0,0 +1,73 @@
1
+ import { asBag } from "../common/types";
2
+ import { ConsumerSlimmers, SlimmerConsumedBy, SlimmerMappedMethod } from "../common/symbols";
3
+ /**
4
+ * Marks a component field as a slimmer injection point.
5
+ *
6
+ * ```ts
7
+ * class UdsPatternLoginCard {
8
+ * @InjectSlimmer() private workflow = new WorkflowSlimmer();
9
+ * }
10
+ * ```
11
+ *
12
+ * The decorator replaces the field with an accessor pair, so assigning the
13
+ * instance in the field initialiser is what performs the injection: the slimmer
14
+ * is handed a back-reference to the component and any `@MapToComponentMethod`
15
+ * hooks it declares are attached.
16
+ *
17
+ * Note this relies on field initialisers compiling to assignment rather than
18
+ * `Object.defineProperty` — i.e. `useDefineForClassFields` must be off, which is
19
+ * the default below an ES2022 target. With define semantics the initialiser
20
+ * would shadow this accessor on the instance and nothing would be wired up.
21
+ */
22
+ export function InjectSlimmer() {
23
+ return function (componentPrototype, propertyKey) {
24
+ Object.defineProperty(componentPrototype, propertyKey, {
25
+ set: createSlimmerFieldSetter(propertyKey),
26
+ get: createSlimmerFieldGetter(propertyKey),
27
+ configurable: true,
28
+ });
29
+ };
30
+ }
31
+ export function createSlimmerFieldSetter(fieldName) {
32
+ return function (slimmer) {
33
+ if (!this[ConsumerSlimmers]) {
34
+ this[ConsumerSlimmers] = new Map();
35
+ }
36
+ this[ConsumerSlimmers].set(fieldName, slimmer);
37
+ asBag(slimmer)[SlimmerConsumedBy] = this;
38
+ registerSlimmerMethods(slimmer, this);
39
+ };
40
+ }
41
+ export function createSlimmerFieldGetter(fieldName) {
42
+ return function () {
43
+ return this[ConsumerSlimmers]?.get(fieldName);
44
+ };
45
+ }
46
+ /** Attaches every `@MapToComponentMethod` hook the slimmer declares. */
47
+ function registerSlimmerMethods(slimmer, component) {
48
+ const slimmerPrototype = asBag(Object.getPrototypeOf(slimmer));
49
+ const entries = slimmerPrototype[SlimmerMappedMethod];
50
+ if (!entries) {
51
+ return;
52
+ }
53
+ for (const entry of entries) {
54
+ component[entry.componentMethodName] = chainSlimmerMethod(component, slimmer, component[entry.componentMethodName], entry);
55
+ }
56
+ }
57
+ /**
58
+ * Appends the slimmer method to the component method, preserving any hook that
59
+ * an earlier slimmer already attached so several slimmers can share a target.
60
+ *
61
+ * When the component method returns a promise the slimmer method is chained
62
+ * onto it, so an async `componentWillLoad` still completes in order.
63
+ */
64
+ function chainSlimmerMethod(component, slimmer, originalMethod, mapEntry) {
65
+ return function (...args) {
66
+ const result = originalMethod?.apply(component, args);
67
+ const slimmerMethod = asBag(slimmer)[mapEntry.slimmerMethodName];
68
+ if (result && typeof result.then === 'function') {
69
+ return result.then(() => slimmerMethod.apply(slimmer, args));
70
+ }
71
+ return slimmerMethod.apply(slimmer, args);
72
+ };
73
+ }
@@ -0,0 +1,41 @@
1
+ import { LogUtility } from "../common/log";
2
+ import { SlimmerConsumedBy } from "../common/symbols";
3
+ /**
4
+ * Binds a slimmer field to a field on the component that injected it:
5
+ *
6
+ * - reading the slimmer field returns the component's current value;
7
+ * - writing it updates the component (only when `writable` is set).
8
+ *
9
+ * The slimmer therefore holds no copy of the state. That matters inside a
10
+ * Stencil component, where the component's `@State()` fields are the values the
11
+ * renderer actually observes — a slimmer-local duplicate would drift and would
12
+ * not trigger re-renders.
13
+ *
14
+ * The slimmer field name is used as the component field name unless
15
+ * `componentFieldName` says otherwise.
16
+ */
17
+ export function MapToComponentField(options) {
18
+ return function (slimmerPrototype, propertyKey) {
19
+ Object.defineProperty(slimmerPrototype, propertyKey, {
20
+ get: createMappedFieldGetter(propertyKey, options),
21
+ set: createMappedFieldSetter(propertyKey, options),
22
+ configurable: true,
23
+ });
24
+ };
25
+ }
26
+ function createMappedFieldSetter(slimmerFieldName, options = {}) {
27
+ return function (value) {
28
+ if (!options.writable) {
29
+ LogUtility.error(`${String(slimmerFieldName)} is not writable`);
30
+ return;
31
+ }
32
+ const component = this[SlimmerConsumedBy];
33
+ component[options.componentFieldName ?? slimmerFieldName] = value;
34
+ };
35
+ }
36
+ function createMappedFieldGetter(slimmerFieldName, options = {}) {
37
+ return function () {
38
+ const component = this[SlimmerConsumedBy];
39
+ return component[options.componentFieldName ?? slimmerFieldName];
40
+ };
41
+ }
@@ -0,0 +1,33 @@
1
+ import { asBag } from "../common/types";
2
+ import { SlimmerMappedMethod } from "../common/symbols";
3
+ /**
4
+ * Hooks a slimmer method onto a component method of the given name.
5
+ *
6
+ * When the component method runs, the slimmer method runs after it and its
7
+ * return value becomes the result. The hook is one-way: calling the slimmer
8
+ * method directly does not invoke the component's.
9
+ *
10
+ * Typical targets are Stencil lifecycle methods (`componentWillLoad`,
11
+ * `disconnectedCallback`), `@Watch` handlers, and `@Method()` members.
12
+ */
13
+ export function MapToComponentMethod(componentMethodName) {
14
+ return function (slimmerPrototype, propertyKey) {
15
+ const bag = asBag(slimmerPrototype);
16
+ initMappedMethodList(bag);
17
+ bag[SlimmerMappedMethod].push({
18
+ componentMethodName,
19
+ slimmerMethodName: String(propertyKey),
20
+ });
21
+ };
22
+ }
23
+ /**
24
+ * Gives each prototype in an inheritance chain its own copy of the list, seeded
25
+ * from the parent's. Without the `hasOwnProperty` check a subclass would push
26
+ * onto the parent's array and every sibling would inherit its hooks.
27
+ */
28
+ function initMappedMethodList(slimmerPrototype) {
29
+ if (!Object.prototype.hasOwnProperty.call(slimmerPrototype, SlimmerMappedMethod)) {
30
+ const inherited = slimmerPrototype[SlimmerMappedMethod];
31
+ slimmerPrototype[SlimmerMappedMethod] = inherited ? [...inherited] : [];
32
+ }
33
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Base class for every slimmer.
3
+ *
4
+ * A slimmer owns exactly one responsibility lifted out of a component class —
5
+ * the workflow machine, OTP input behaviour, a throttle timer. It reaches back
6
+ * into its host component only through the two mapping decorators, which keeps
7
+ * the coupling declarative and greppable.
8
+ */
9
+ export class UdsSlimmer {
10
+ }
@@ -0,0 +1,5 @@
1
+ export * from './decorators/slimmer';
2
+ export * from './decorators/inject-slimmer';
3
+ export * from './decorators/map-to-component-field';
4
+ export * from './decorators/map-to-component-method';
5
+ export * from './common/symbols';
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Default (en-US) copy for the login workflow pattern.
3
+ *
4
+ * Wording mirrors the approved Global Payments sign-in design
5
+ * (Figma: "Design System and Pilot Portals Rollout", node 14:2748 / 14:2765).
6
+ *
7
+ * The `errors` map is part of the pattern, not the consumer: shipping approved
8
+ * failure copy is how every GP product ends up failing in the same words.
9
+ */
10
+ export const DEFAULT_LOGIN_LABELS = {
11
+ identifierHeading: 'Sign In to My Account',
12
+ identifierFieldLabel: 'Email address',
13
+ rememberIdentifier: 'Remember my email',
14
+ passwordHeading: 'Enter your password',
15
+ passwordFieldLabel: 'Password',
16
+ showPassword: 'Show password',
17
+ hidePassword: 'Hide password',
18
+ forgotPassword: 'Forgot password?',
19
+ forgotUsername: 'Forgot username?',
20
+ mfaMethodHeading: 'How do you want to receive your security code?',
21
+ mfaMethodDescription: 'Choose a delivery method to continue signing in.',
22
+ otpHeading: 'Verify your security code',
23
+ otpDescription: 'Enter the security code generated from your authenticator app.',
24
+ otpDescriptionForMethod: 'Enter the security code sent via {method}.',
25
+ otpFieldLabel: 'Security code',
26
+ otpIncomplete: 'Enter all {count} digits of your security code.',
27
+ otpSubmit: 'Verify and sign in',
28
+ showCode: 'Show security code',
29
+ hideCode: 'Hide security code',
30
+ resendCode: 'Resend code',
31
+ resendCodeIn: 'Resend code in {seconds}s',
32
+ changeMfaMethodPrompt: 'Want to change how you receive your security code?',
33
+ changeMfaMethod: 'Change security method',
34
+ forgotPasswordHeading: 'Reset your password',
35
+ forgotPasswordDescription: 'Enter your email address and we will send you a link to reset your password.',
36
+ forgotUsernameHeading: 'Find your username',
37
+ forgotUsernameDescription: 'Enter the email address associated with your account.',
38
+ checkEmailHeading: 'Check your email',
39
+ checkEmailDescription: 'If an account matches what you entered, we have sent you an email with next steps.',
40
+ checkEmailDescriptionWithDestination: 'If an account matches {destination}, we have sent an email with next steps.',
41
+ lockedHeading: 'Your account is temporarily locked',
42
+ lockedDescription: 'For your security we have paused sign-in after too many attempts. Try again later.',
43
+ lockedDescriptionWithTime: 'For your security we have paused sign-in after too many attempts. Try again in {minutes} minutes.',
44
+ resetPasswordHeading: 'Create a new password',
45
+ newPasswordFieldLabel: 'New password',
46
+ confirmPasswordFieldLabel: 'Confirm new password',
47
+ signUpHeading: 'Create your account',
48
+ signUpDescription: 'Tell us a little about you to get started.',
49
+ firstNameFieldLabel: 'First name',
50
+ lastNameFieldLabel: 'Last name',
51
+ signUpSubmit: 'Create account',
52
+ haveAccountPrompt: 'Already have an account?',
53
+ signIn: 'Sign in',
54
+ successHeading: "You're signed in",
55
+ continue: 'Continue',
56
+ back: 'Back',
57
+ troubleSigningInPrompt: 'Forgot password? Account locked? Change security method?',
58
+ troubleSigningIn: 'Trouble Signing In?',
59
+ helpPrompt: 'Need help signing in? Check out our',
60
+ help: 'Login help',
61
+ noAccountPrompt: "Don't have an account?",
62
+ createAccount: 'Create one',
63
+ errors: {
64
+ invalid_credentials: "That email address and password don't match. Try again.",
65
+ invalid_identifier: 'Enter a valid email address.',
66
+ invalid_code: "That security code isn't right. Check it and try again.",
67
+ code_expired: 'That security code has expired. Request a new one.',
68
+ account_locked: 'Your account is temporarily locked. Try again later.',
69
+ account_not_found: "We couldn't find an account for that email address.",
70
+ account_exists: 'An account already exists for that email address.',
71
+ password_policy: "That password doesn't meet the security requirements.",
72
+ passwords_do_not_match: "Those passwords don't match.",
73
+ rate_limited: 'Too many attempts. Wait a moment and try again.',
74
+ network: "We couldn't reach the server. Check your connection and try again.",
75
+ unknown: 'Something went wrong. Try again.',
76
+ },
77
+ };
78
+ /** Substitutes `{name}` placeholders in a label template. */
79
+ export function formatLabel(template, values) {
80
+ return template.replace(/\{(\w+)\}/g, (match, key) => key in values ? String(values[key]) : match);
81
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Get the base path to where the assets can be found. Use "setAssetPath(path)"
3
+ * if the path needs to be customized.
4
+ */
5
+ export declare const getAssetPath: (path: string) => string;
6
+
7
+ /**
8
+ * Used to manually set the base path where assets can be found.
9
+ * If the script is used as "module", it's recommended to use "import.meta.url",
10
+ * such as "setAssetPath(import.meta.url)". Other options include
11
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
12
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
13
+ * But do note that this configuration depends on how your script is bundled, or lack of
14
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
15
+ * will have to ensure the static assets are copied to its build directory.
16
+ */
17
+ export declare const setAssetPath: (path: string) => void;
18
+
19
+ /**
20
+ * Used to specify a nonce value that corresponds with an application's CSP.
21
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
22
+ * Alternatively, the nonce value can be set on a meta tag in the DOM head
23
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) which
24
+ * will result in the same behavior.
25
+ */
26
+ export declare const setNonce: (nonce: string) => void
27
+
28
+ export interface SetPlatformOptions {
29
+ raf?: (c: FrameRequestCallback) => number;
30
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
31
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
32
+ }
33
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
34
+
35
+ export * from '../types';
@@ -0,0 +1 @@
1
+ export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-_G8A9gg0.js";export{D as DEFAULT_LOGIN_LABELS,c as createControlStrategy,a as fail,f as formatLabel,g as goTo,s as stay}from"./p-DOrg55po.js";function e(s){return s}const t={identifier:"ada@example.com",password:"correct-horse",mfaMethods:[{id:"app",label:"Authenticator app",description:"Use the code from your authenticator app"},{id:"sms",label:"Text message",description:"Ending in ••3312"}],otpCode:"555555"};function o(s={}){const e=s.users??[t],r=s.maxAttempts??3,a=s.resendAfterMs??3e4,o={signUp:!0,requestPasswordReset:!0,requestUsernameReminder:!0,resendOtp:!0,...s.capabilities};let n,i=0,d=!1;const c=s=>e.find((e=>e.identifier.toLowerCase()===s.trim().toLowerCase())),u={async signIn({identifier:s,password:e}){if(d)return{status:"locked"};const t=c(s);return t?(n=t,void 0===e?{status:"password_required"}:u.verifyPassword({identifier:s,password:e})):{status:"error",code:"account_not_found"}},verifyPassword:async({password:s})=>d?{status:"locked"}:n?s!==n.password?(i+=1,i>=r?(d=!0,{status:"locked",unlockAfterMs:9e5}):{status:"error",code:"invalid_credentials"}):(s=>(i=0,s.mustResetPassword?{status:"password_reset_required"}:s.mfaMethods?.length?{status:"mfa_required",methods:s.mfaMethods}:{status:"success",session:{identifier:s.identifier}}))(n):{status:"error",code:"unknown"},async selectMfaMethod({methodId:s}){const e=n?.mfaMethods?.find((e=>e.id===s));return{status:"otp_required",method:e,codeLength:6,resendAfterMs:a}},verifyOtp:async({code:s})=>s!==(n?.otpCode??t.otpCode)?(i+=1,i>=r?(d=!0,{status:"locked"}):{status:"error",code:"invalid_code"}):(i=0,{status:"success",session:{identifier:n?.identifier}}),resetPassword:async({password:s})=>s.length<8?{status:"error",code:"password_policy"}:(n&&(n.password=s,n.mustResetPassword=!1),{status:"success",session:{identifier:n?.identifier}})};return o.resendOtp&&(u.resendOtp=async()=>({status:"otp_required",codeLength:6,resendAfterMs:a})),o.requestPasswordReset&&(u.requestPasswordReset=async({identifier:s})=>{const e=c(s);return e?{status:"reset_link_sent",destination:e.identifier}:{status:"error",code:"account_not_found"}}),o.requestUsernameReminder&&(u.requestUsernameReminder=async({email:s})=>({status:"username_sent",destination:s})),o.signUp&&(u.signUp=async({firstName:s,lastName:r,identifier:a})=>{if(c(a))return{status:"error",code:"account_exists"};const o={identifier:a,password:"",otpCode:t.otpCode};return e.push(o),n=o,{status:"success",session:{identifier:a,firstName:s,lastName:r}}}),u}function n(s){return s}export{e as createAuthProvider,n as createLoginConfig,o as createMemoryAuthProvider}
@@ -0,0 +1 @@
1
+ const e={identifierHeading:"Sign In to My Account",identifierFieldLabel:"Email address",rememberIdentifier:"Remember my email",passwordHeading:"Enter your password",passwordFieldLabel:"Password",showPassword:"Show password",hidePassword:"Hide password",forgotPassword:"Forgot password?",forgotUsername:"Forgot username?",mfaMethodHeading:"How do you want to receive your security code?",mfaMethodDescription:"Choose a delivery method to continue signing in.",otpHeading:"Verify your security code",otpDescription:"Enter the security code generated from your authenticator app.",otpDescriptionForMethod:"Enter the security code sent via {method}.",otpFieldLabel:"Security code",otpIncomplete:"Enter all {count} digits of your security code.",otpSubmit:"Verify and sign in",showCode:"Show security code",hideCode:"Hide security code",resendCode:"Resend code",resendCodeIn:"Resend code in {seconds}s",changeMfaMethodPrompt:"Want to change how you receive your security code?",changeMfaMethod:"Change security method",forgotPasswordHeading:"Reset your password",forgotPasswordDescription:"Enter your email address and we will send you a link to reset your password.",forgotUsernameHeading:"Find your username",forgotUsernameDescription:"Enter the email address associated with your account.",checkEmailHeading:"Check your email",checkEmailDescription:"If an account matches what you entered, we have sent you an email with next steps.",checkEmailDescriptionWithDestination:"If an account matches {destination}, we have sent an email with next steps.",lockedHeading:"Your account is temporarily locked",lockedDescription:"For your security we have paused sign-in after too many attempts. Try again later.",lockedDescriptionWithTime:"For your security we have paused sign-in after too many attempts. Try again in {minutes} minutes.",resetPasswordHeading:"Create a new password",newPasswordFieldLabel:"New password",confirmPasswordFieldLabel:"Confirm new password",signUpHeading:"Create your account",signUpDescription:"Tell us a little about you to get started.",firstNameFieldLabel:"First name",lastNameFieldLabel:"Last name",signUpSubmit:"Create account",haveAccountPrompt:"Already have an account?",signIn:"Sign in",successHeading:"You're signed in",continue:"Continue",back:"Back",troubleSigningInPrompt:"Forgot password? Account locked? Change security method?",troubleSigningIn:"Trouble Signing In?",helpPrompt:"Need help signing in? Check out our",help:"Login help",noAccountPrompt:"Don't have an account?",createAccount:"Create one",errors:{invalid_credentials:"That email address and password don't match. Try again.",invalid_identifier:"Enter a valid email address.",invalid_code:"That security code isn't right. Check it and try again.",code_expired:"That security code has expired. Request a new one.",account_locked:"Your account is temporarily locked. Try again later.",account_not_found:"We couldn't find an account for that email address.",account_exists:"An account already exists for that email address.",password_policy:"That password doesn't meet the security requirements.",passwords_do_not_match:"Those passwords don't match.",rate_limited:"Too many attempts. Wait a moment and try again.",network:"We couldn't reach the server. Check your connection and try again.",unknown:"Something went wrong. Try again."}};function t(e,t){return e.replace(/\{(\w+)\}/g,((e,o)=>o in t?String(t[o]):e))}const o=e=>({type:"goto",step:e}),a=()=>({type:"stay"}),n=(e,t)=>({type:"fail",code:e,message:t});function i(e,t,o){return e?e(t,o):o()}function r(e){return e}export{e as D,n as a,r as c,t as f,o as g,i,a as s}
@@ -0,0 +1 @@
1
+ const e=":root{--uds-pattern-color-background:#f2f3f4;--uds-pattern-color-surface:#ffffff;--uds-pattern-color-border:#d5d7da;--uds-pattern-color-text:#181d27;--uds-pattern-color-text-subtle:#535862;--uds-pattern-font-family:'Inter', 'Helvetica Neue', Arial, sans-serif;--uds-pattern-font-size-sm:0.875rem;--uds-pattern-font-size-lg:1.5rem;--uds-pattern-font-weight-bold:700;--uds-pattern-line-height-md:1.5;--uds-pattern-space-xs:0.25rem;--uds-pattern-space-sm:0.5rem;--uds-pattern-space-md:1rem;--uds-pattern-space-lg:1.5rem;--uds-pattern-space-xl:2rem;--uds-pattern-space-2xl:3rem;--uds-pattern-radius-lg:12px;--uds-pattern-shadow-card:0 2px 6px rgba(0, 0, 0, 0.1)}";function t(e,t,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;e&&e!==l;){const l=Object.getOwnPropertyDescriptor(e,t);if(l&&(!n||l.get))return l;e=Object.getPrototypeOf(e)}}var n,l=(e,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=e[l],s=t(Object.getPrototypeOf(e),l,!0)||Object.getOwnPropertyDescriptor(e,l);s&&Object.defineProperty(e,l,{get(){return s.get.call(this)},set(e){s.set.call(this,e)},configurable:!0,enumerable:!0}),n.o.has(l)?e[l]=n.o.get(l):void 0!==o&&(e[l]=o)}}))},o=e=>{if(e.__stencil__getHostRef)return e.__stencil__getHostRef()},s=(e,t)=>t in e,r=(e,t)=>(0,console.error)(e,t),i=new Map,c="undefined"!=typeof window?window:{},u=c.HTMLElement||class{},a={i:0,u:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},f=(()=>{try{return!!c.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(e){}return!1})(),d=!!f&&(()=>!!c.document&&Object.getOwnPropertyDescriptor(c.document.adoptedStyleSheets,"length").writable)(),p=!1,h=[],m=[],b=()=>{var e;return(null==(e=c.document)?void 0:e.hidden)?setTimeout($,16):a.raf($)},y=(e,t)=>n=>{e.push(n),p||(p=!0,t&&4&a.i?g($):b())},v=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){r(e)}e.length=0},$=()=>{v(h),v(m),(p=h.length>0)&&b()},g=e=>Promise.resolve(undefined).then(e),w=y(m,!0),j=e=>{const t=new URL(e,a.u);return t.origin!==c.location.origin?t.href:t.pathname},S=e=>a.u=e;function O(){var t;const l=this.attachShadow({mode:"open"});if(void 0===n&&(n=null!=(t=function(e){if(!f)return;const t=new CSSStyleSheet;return t.replaceSync(e),t}(e))?t:null),n)d?l.adoptedStyleSheets.push(n):l.adoptedStyleSheets=[...l.adoptedStyleSheets,n];else if(!f){const t=document.createElement("style");t.innerHTML=e,l.prepend(t)}}var k,x=new WeakMap,M=e=>"sc-"+e.p,E=e=>"object"==(e=typeof e)||"function"===e,A=(e,t,...n)=>{let l=null,o=null,s=!1,i=!1;const c=[],u=t=>{for(let n=0;n<t.length;n++)if(l=t[n],Array.isArray(l))u(l);else if(null!=l&&"boolean"!=typeof l){if(s="function"!=typeof e&&!E(l))l=String(l);else if("function"!=typeof e&&void 0===l.i){r("Invalid vNode child");continue}s&&i?c[c.length-1].h+=l:c.push(s?C(null,l):l),i=s}};if(u(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const a=C(e,null);return a.m=t,c.length>0&&(a.v=c),a.$=o,a},C=(e,t)=>({i:0,j:e,h:null!=t?t:null,S:null,v:null,m:null,$:null}),N={},H=(e,t)=>null==e||E(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?"string"==typeof e?parseFloat(e):"number"==typeof e?e:NaN:1&t?String(e):e,L=(e,t)=>{const n=e;return{emit:e=>_(n,t,{bubbles:!0,composed:!0,cancelable:!0,detail:e})}},_=(e,t,n)=>{const l=a.ce(t,n);return e.dispatchEvent(l),l},D=(e,t,n,l,r,i)=>{if(n===l)return;let u=s(e,t),f=t.toLowerCase();if("class"===t){const t=e.classList,o=W(n);let s=W(l);{let e=o.filter((e=>e&&!s.includes(e)));t.remove(...e),t.add(...s.filter((e=>e&&!o.includes(e))))}}else if("key"===t);else if(e.__lookupSetter__(t)||"o"!==t[0]||"n"!==t[1]){if("a"===t[0]&&t.startsWith("attr:")){const n=t.slice(5);let s;{const t=o(e);if(t&&t.l&&t.l.t){const e=t.l.t[n];e&&e[1]&&(s=e[1])}}return s||(s=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==e.getAttribute(s)||e.removeAttribute(s):e.setAttribute(s,!0===l?"":l))}if("p"===t[0]&&t.startsWith("prop:")){const n=t.slice(5);try{e[n]=l}catch(e){}return}{const o=E(l);if((u||o&&null!==l)&&!r)try{if(e.tagName.includes("-"))e[t]!==l&&(e[t]=l);else{const o=null==l?"":l;"list"===t?u=!1:null!=n&&e[t]===o||("function"==typeof e.__lookupSetter__(t)?e[t]=o:e.setAttribute(t,o))}}catch(e){}null==l||!1===l?(!1!==l||""===e.getAttribute(t)||4&i&&!R(t))&&e.removeAttribute(t):(!u||4&i||r)&&!o&&1===e.nodeType&&e.setAttribute(t,l=!0===l?"":l)}}else if(t="-"===t[2]?t.slice(3):s(c,f)?f.slice(2):f[2]+t.slice(3),n||l){const o=t.endsWith(z);t=t.replace(T,""),n&&a.rel(e,t,n,o),l&&a.ael(e,t,l,o)}},P=new Set(["draggable","contenteditable","spellcheck"]),R=e=>P.has(e)||e.startsWith("aria-"),U=/\s/,W=e=>("object"==typeof e&&e&&"baseVal"in e&&(e=e.baseVal),e&&"string"==typeof e?e.split(U):[]),z="Capture",T=new RegExp(z+"$"),F=(e,t,n)=>{const l=11===t.S.nodeType&&t.S.host?t.S.host:t.S,o=e&&e.m||{},s=t.m||{};for(const e of V(Object.keys(o)))e in s||D(l,e,o[e],void 0,n,t.i);for(const e of V(Object.keys(s)))D(l,e,o[e],s[e],n,t.i)};function V(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var q=!1,I=!1,Y=(e,t,n)=>{const l=t.v[n];let o,s,r=0;if(null!=l.h)o=l.S=c.document.createTextNode(l.h);else{if(!c.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.S=c.document.createElement(l.j),F(null,l,I),l.v){const t="template"===l.j?o.content:o;for(r=0;r<l.v.length;++r)s=Y(e,l,r),s&&t.appendChild(s)}}return o["s-hn"]=k,o},Z=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===k&&(i=i.shadowRoot),"template"===n.j&&(i=i.content);o<=s;++o)l[o]&&(r=Y(null,n,o),r&&(l[o].S=r,K(i,r,t)))},B=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.S;e&&e.remove()}}},G=(e,t,n=!1)=>e.j===t.j&&(n?(n&&!e.$&&t.$&&(e.$=t.$),!0):e.$===t.$),J=(e,t,n=!1)=>{const l=t.S=e.S,o=e.v,s=t.v,r=t.h;null==r?("slot"!==t.j||q||e.O!==t.O&&(t.S["s-sn"]=t.O||"",(e=>{a.i|=1;const t=e.closest(k.toLowerCase());if(null!=t){const n=Array.from(t.__childNodes||t.childNodes).find((e=>e["s-cr"])),l=Array.from(e.__childNodes||e.childNodes);for(const e of n?l.reverse():l)null!=e["s-sh"]&&(K(t,e,null!=n?n:null),e["s-sh"]=void 0)}a.i&=-2})(t.S.parentElement)),F(e,t,I),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,d=t[0],p=t[f],h=l.length-1,m=l[0],b=l[h];const y="template"===n.j?e.content:e;for(;i<=f&&c<=h;)if(null==d)d=t[++i];else if(null==p)p=t[--f];else if(null==m)m=l[++c];else if(null==b)b=l[--h];else if(G(d,m,o))J(d,m,o),d=t[++i],m=l[++c];else if(G(p,b,o))J(p,b,o),p=t[--f],b=l[--h];else if(G(d,b,o))J(d,b,o),K(y,d.S,p.S.nextSibling),d=t[++i],b=l[--h];else if(G(p,m,o))J(p,m,o),K(y,p.S,d.S),p=t[--f],m=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].$&&t[a].$===m.$){u=a;break}u>=0?(r=t[u],r.j!==m.j?s=Y(t&&t[c],n,c):(J(r,m,o),t[u]=void 0,s=r.S),m=l[++c]):(s=Y(t&&t[c],n,c),m=l[++c]),s&&K(d.S.parentNode,s,d.S)}i>f?Z(e,null==l[h+1]?null:l[h+1].S,n,l,c,h):c>h&&B(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.h&&(l.textContent=""),Z(l,null,t,s,0,s.length-1)):!n&&null!==o&&B(o,0,o.length-1)):e.h!==r&&(l.data=r)},K=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),Q=(e,t,n=!1)=>{const l=e.$hostElement$,o=e.l,s=e.k||C(null,null);var r;const i=(r=t)&&r.j===N?t:A(null,null,t);if(k=l.tagName,n&&i.m)for(const e of Object.keys(i.m))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(i.m[e]=l[e]);i.j=null,i.i|=4,e.k=i,i.S=s.S=l.shadowRoot||l,q=!(!(1&o.i)||128&o.i),J(s,i,n)},X=(e,t)=>{if(t&&!e.M&&t["s-p"]){const n=t["s-p"].push(new Promise((l=>e.M=()=>{t["s-p"].splice(n-1,1),l()})))}},ee=(e,t)=>{if(e.i|=16,4&e.i)return void(e.i|=512);X(e,e.A);const n=()=>te(e,t);if(!t)return w(n);queueMicrotask((()=>{n()}))},te=(e,t)=>{const n=e.$hostElement$,l=n;if(!l)throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return o=ce(l,t?"componentWillLoad":"componentWillUpdate",void 0,n),o=ne(o,(()=>ce(l,"componentWillRender",void 0,n))),ne(o,(()=>oe(e,l,t)))},ne=(e,t)=>le(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),le=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,oe=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.l,n=e.$hostElement$,l=t.i,o=((e,t)=>{var n,l,o;const s=M(t),r=i.get(s);if(!c.document)return s;if(e=11===e.nodeType?e:c.document,r)if("string"==typeof r){let o,i=x.get(e=e.head||e);if(i||x.set(e,i=new Set),!i.has(s)){o=c.document.createElement("style"),o.textContent=r;const u=null!=(n=a.C)?n:function(){var e,t,n;return null!=(n=null==(t=null==(e=c.document.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:t.getAttribute("content"))?n:void 0}();if(null!=u&&o.setAttribute("nonce",u),!(1&t.i))if("HEAD"===e.nodeName){const t=e.querySelectorAll("link[rel=preconnect]"),n=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(o,(null==n?void 0:n.parentNode)===e?n:null)}else if("host"in e)if(f){const t=new(null!=(l=e.defaultView)?l:e.ownerDocument.defaultView).CSSStyleSheet;t.replaceSync(r),d?e.adoptedStyleSheets.unshift(t):e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");t?t.textContent=r+t.textContent:e.prepend(o)}else e.append(o);1&t.i&&e.insertBefore(o,null),4&t.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let t=x.get(e);if(t||x.set(e,t=new Set),!t.has(s)){const n=null!=(o=e.defaultView)?o:e.ownerDocument.defaultView;let l;if(r.constructor===n.CSSStyleSheet)l=r;else{l=new n.CSSStyleSheet;for(let e=0;e<r.cssRules.length;e++)l.insertRule(r.cssRules[e].cssText,e)}d?e.adoptedStyleSheets.push(l):e.adoptedStyleSheets=[...e.adoptedStyleSheets,l],t.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);se(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>re(e);0===t.length?n():(Promise.all(t).then(n).catch(n),e.i|=4,t.length=0)}},se=(e,t,n,l)=>{try{t=t.render(),e.i&=-17,e.i|=2,Q(e,t,l)}catch(t){r(t,e.$hostElement$)}return null},re=e=>{const t=e.$hostElement$,n=t,l=e.A;ce(n,"componentDidRender",void 0,t),64&e.i?ce(n,"componentDidUpdate",void 0,t):(e.i|=64,ue(t),ce(n,"componentDidLoad",void 0,t),e.N(t),l||ie()),e.M&&(e.M(),e.M=void 0),512&e.i&&g((()=>ee(e,!1))),e.i&=-517},ie=()=>{g((()=>_(c,"appload",{detail:{namespace:"gpds-pattern-web"}})))},ce=(e,t,n,l)=>{if(e&&e[t])try{return e[t](n)}catch(e){r(e,l)}},ue=e=>e.classList.add("hydrated"),ae=(e,t,n,l)=>{const s=o(e);if(!s)return;const r=e,i=s.o.get(t),c=s.i,u=r;n=H(n,l.t[t][0]);const a=Number.isNaN(i)&&Number.isNaN(n);if(n!==i&&!a&&(s.o.set(t,n),2&c)){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,i,t)&&!(16&c))return;16&c||ee(s,!1)}},fe=(e,n)=>{var l,s;const r=e.prototype;if(n.t){const i=Object.entries(null!=(l=n.t)?l:{});i.map((([e,[l]])=>{if(31&l||32&l){const{get:s,set:i}=t(r,e)||{};s&&(n.t[e][0]|=2048),i&&(n.t[e][0]|=4096),Object.defineProperty(r,e,{get(){return s?s.apply(this):(t=e,o(this).o.get(t));var t},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const s=o(this);if(s){if(i)return void 0===(32&l?this[e]:s.$hostElement$[e])&&s.o.get(e)&&(t=s.o.get(e)),i.apply(this,[H(t,l)]),void ae(this,e,t=32&l?this[e]:s.$hostElement$[e],n);ae(this,e,t,n)}}})}}));{const t=new Map;r.attributeChangedCallback=function(e,l,s){a.jmp((()=>{var c;const u=t.get(e),a=o(this);if(this.hasOwnProperty(u),r.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==a?void 0:a.i;if(a&&t&&!(8&t)&&s!==l){const o=this,r=null==(c=n.H)?void 0:c[e];null==r||r.forEach((n=>{const[[r,i]]=Object.entries(n);null!=o[r]&&(128&t||1&i)&&o[r].call(o,s,l,e)}))}return}const f=i.find((([e])=>e===u)),d=4&(f?f[1][0]:0),p=d&&null===s&&void 0===this[u];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(r,u);p||s==this[u]||h.get&&!h.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.H)?s:{}),...i.filter((([e,t])=>31&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))]))}}return e},de=async(e,t,n)=>{let l;try{if(!(32&t.i)&&(t.i|=32,t.i&=-1025,l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.i|=128)),l&&l.style)){let e;"string"==typeof l.style&&(e=l.style);const t=M(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);f&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.i)),l()}}const o=t.A,s=()=>ee(t,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()}catch(n){r(n,e),t.M&&(t.M(),t.M=void 0),!t.N||1024&t.i||t.N(e)}},pe=(e,t)=>{const n={i:t[0],p:t[1]};try{n.t=t[2];const s=e.prototype.connectedCallback,r=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__hasHostListenerAttached:!1,__registerHost(){((e,t)=>{const n={i:0,$hostElement$:e,l:t,o:new Map,L:new Map};n._=new Promise((e=>n.N=e)),e["s-p"]=[],e["s-rc"]=[];const o=n;e.__stencil__getHostRef=()=>o,512&t.i&&l(e,n)})(this,n)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!o(this))return;this.__hasHostListenerAttached=!0}(e=>{if(!(1&a.i)){const t=o(e);if(!t)return;const n=t.l,l=()=>{};if(1&t.i)(null==t?void 0:t.D)||(1024&t.i?setTimeout((()=>de(e,t,n)),1e3):(null==t?void 0:t._)&&t._.then((()=>{})));else{t.i|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){X(t,t.A=n);break}}n.t&&Object.entries(n.t).map((([t,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];delete e[t],e[t]=n}})),de(e,t,n)}l()}})(this),s&&s.call(this)},disconnectedCallback(){(async e=>{1&a.i||o(e),x.has(e)&&x.delete(e),e.shadowRoot&&x.has(e.shadowRoot)&&x.delete(e.shadowRoot)})(this),r&&r.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${n.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(this,n)}}),Object.defineProperty(e,"is",{value:n.p,configurable:!0}),fe(e,n)}catch(t){return r(t),e}},he=e=>a.C=e,me=e=>Object.assign(a,e),be=new WeakMap;function ye(e,t){let n=be.get(t);n||(n={i:0,l:{i:0,p:t.tagName},$hostElement$:t},be.set(t,n)),Q(n,e)}function ve(e){return e}export{u as H,he as a,me as b,L as c,N as d,j as g,A as h,pe as p,ye as r,S as s,ve as t}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface UdsPatternLoginCard extends Components.UdsPatternLoginCard, HTMLElement {}
4
+ export const UdsPatternLoginCard: {
5
+ prototype: UdsPatternLoginCard;
6
+ new (): UdsPatternLoginCard;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1 @@
1
+ import{h as t,p as e,t as s,H as i,c as r,d as o}from"./p-_G8A9gg0.js";import{g as n,i as a,a as c,s as d,f as h,D as l}from"./p-DOrg55po.js";class u{}const f=Symbol("SlimmerMappedMethod"),p=Symbol("SlimmerConsumedBy"),m=Symbol("ConsumerSlimmers");function v(){return function(t,e){Object.defineProperty(t,e,{set:b(e),get:g(e),configurable:!0})}}function b(t){return function(e){this[m]||(this[m]=new Map),this[m].set(t,e),e[p]=this,function(t,e){const s=Object.getPrototypeOf(t)[f];if(s)for(const i of s)e[i.componentMethodName]=w(e,t,e[i.componentMethodName],i)}(e,this)}}function g(t){return function(){return this[m]?.get(t)}}function w(t,e,s,i){return function(...r){const o=s?.apply(t,r),n=e[i.slimmerMethodName];return o&&"function"==typeof o.then?o.then((()=>n.apply(e,r))):n.apply(e,r)}}class y{static log(...t){console.log("%c"+this.PREFIX,this.PREFIX_STYLE,...t)}static warn(...t){console.warn("%c"+this.PREFIX,this.PREFIX_STYLE,...t)}static error(...t){console.error("%c"+this.PREFIX,this.PREFIX_STYLE,...t)}}function k(t){return function(e,s){Object.defineProperty(e,s,{get:x(s,t),set:_(s,t),configurable:!0})}}function _(t,e={}){return function(s){e.writable?this[p][e.componentFieldName??t]=s:y.error(t+" is not writable")}}function x(t,e={}){return function(){return this[p][e.componentFieldName??t]}}function M(t){return function(e,s){const i=e;!function(t){if(!Object.prototype.hasOwnProperty.call(t,f)){const e=t[f];t[f]=e?[...e]:[]}}(i),i[f].push({componentMethodName:t,slimmerMethodName:s+""})}}y.PREFIX="[GP]",y.PREFIX_STYLE="font-weight: bold";const R=["success","password_required","mfa_required","otp_required","password_reset_required","reset_link_sent","username_sent","locked","error"],S=["invalid_credentials","invalid_identifier","invalid_code","code_expired","account_locked","account_not_found","account_exists","password_policy","passwords_do_not_match","rate_limited","network","unknown"];class j extends Error{}function O(t,e,s){if(!t||"object"!=typeof t||"string"!=typeof t.id||"string"!=typeof t.label)throw new j(`${e} resolved with ${s} = ${$(t)}. Expected { id: string, label: string }.`)}function C(t,e,s){if(void 0!==t&&("number"!=typeof t||!Number.isFinite(t)))throw new j(`${e} resolved with ${s} = ${$(t)}. Expected a finite number or undefined.`)}function $(t){return null===t?"null":void 0===t?"undefined":"string"==typeof t?`'${t}'`:Array.isArray(t)?"an array of "+t.length:"object"==typeof t?"an object":t+""}var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class T extends u{constructor(){super(),this.pendingIdentifier=""}start(){this.step=this.initialStep,this.pendingIdentifier=this.memory.initialIdentifier(),this.resetStepState()}async restart(){this.methods=[],this.errorText=void 0,this.destination=void 0,this.unlockMinutes=void 0,this.otpCount=void 0,this.resend.stop(),this.applyTransition(n(this.initialStep),"reset")}get capabilities(){const t=this.auth;return{signUp:"function"==typeof t?.signUp,reset:"function"==typeof t?.requestPasswordReset,username:"function"==typeof t?.requestUsernameReminder,resend:"function"==typeof t?.resendOtp}}navigateTo(t){this.errorText=void 0,this.applyTransition(n(t),"link")}applyTransition(t,e){if("stay"===t.type)return;if("fail"===t.type)return void this.showError(t.code,t.message);const s=a(this.controlStrategy?.navigate,{from:this.step,to:t.step,cause:e},(()=>t));"stay"!==s.type&&("fail"!==s.type?this.setStep(s.step):this.showError(s.code,s.message))}setStep(t){const e=this.step;this.step=t,this.resetStepState(),e!==t&&this.udsLoginStepChange.emit({step:t,previousStep:e})}resetStepState(){this.values="identifier"!==this.step&&"forgot-password"!==this.step||!this.pendingIdentifier?{}:{identifier:this.pendingIdentifier}}get codeLength(){return Math.max(1,this.otpCount??this.otpLength)}applyResult(t){this.errorText=void 0;const e=a(this.controlStrategy?.transition,{result:t,from:this.step},(()=>this.defaultTransitionFor(t)));this.stageResultState(t),"mfa_required"!==t.status||1!==this.methods.length||"stay"!==e.type?(this.applyTransition(e,"auto"),"success"===t.status&&"goto"===e.type&&"success"===e.step&&a(this.controlStrategy?.complete,{session:t.session},(()=>this.udsLoginSuccess.emit({session:t.session})))):this.selectMfaMethod(this.methods[0].id)}defaultTransitionFor(t){switch(t.status){case"success":return n("success");case"password_required":return n("password");case"mfa_required":return 1===t.methods.length?d():n("mfa-method");case"otp_required":return n("otp");case"password_reset_required":return n("reset-password");case"reset_link_sent":case"username_sent":return n("check-email");case"locked":return n("locked");case"error":return c(t.code,t.message)}}stageResultState(t){switch(t.status){case"mfa_required":return void(this.methods=t.methods);case"otp_required":return this.otpMethodLabel=t.method?.label,this.otpCount=t.codeLength??this.otpLength,void this.resend.start(t.resendAfterMs);case"reset_link_sent":case"username_sent":return void(this.destination=t.destination);case"locked":return void(this.unlockMinutes=t.unlockAfterMs?Math.ceil(t.unlockAfterMs/6e4):void 0);default:return}}showError(t,e){const s=a(this.controlStrategy?.failure,{code:t,step:this.step,message:e},(()=>({text:this.copy.errors[t]??this.copy.errors.unknown})));this.errorText=s.text,this.udsLoginError.emit({code:t,step:this.step,message:e}),s.transition&&this.applyTransition(s.transition,"auto")}async run(t,e){if(this.busy)return;let s;this.busy=!0;try{s=function(t,e){try{return function(t,e){const s=t;if(!s||"object"!=typeof s)throw new j(`${e} resolved with ${$(t)}, expected a UdsAuthResult object.`);const i=s.status;if(!R.includes(i))throw new j(`${e} resolved with status ${$(i)}. Expected one of: ${R.join(", ")}.`);switch(i){case"mfa_required":!function(t,e){if(!Array.isArray(t)||0===t.length)throw new j(`${e} resolved with status 'mfa_required' but methods was ${$(t)}. Expected a non-empty array of UdsMfaMethod — the card has nothing to offer the user otherwise.`);t.forEach(((t,s)=>O(t,e,`methods[${s}]`)))}(s.methods,e);break;case"otp_required":void 0!==s.method&&O(s.method,e,"method"),C(s.codeLength,e,"codeLength"),C(s.resendAfterMs,e,"resendAfterMs");break;case"locked":C(s.unlockAfterMs,e,"unlockAfterMs");break;case"error":if(!S.includes(s.code))throw new j(`${e} resolved with error code ${$(s.code)}. Expected one of: ${S.join(", ")}.`)}return s}(t,e)}catch(e){if(!(e instanceof j))throw e;return console.error("[uds-pattern-login-card] "+e.message,t),{status:"error",code:"unknown"}}}(await t(),"auth."+e)}catch{return this.busy=!1,void this.showError("network")}this.busy=!1,this.applyResult(s)}async selectMfaMethod(t){this.auth?.selectMfaMethod?await this.run((()=>this.auth.selectMfaMethod({methodId:t})),"selectMfaMethod"):this.showError("unknown")}async resendCode(){this.resend.canResend&&this.auth?.resendOtp&&await this.run((()=>this.auth.resendOtp()),"resendOtp")}async submit(){if(this.busy)return;const t=this.step,e={...this.values};this.rememberIdentifierIfRequested(t),await this.run((()=>a(this.controlStrategy?.submit,{step:t,values:e,identifier:this.pendingIdentifier},(()=>this.callProvider(t)))),`submit(${t})`)}rememberIdentifierIfRequested(t){if("identifier"!==t)return;const e=this.str("identifier").trim();this.pendingIdentifier=e,this.memory.remember(e,!0===this.values.rememberIdentifier)}callProvider(t){const e=this.auth;if(!e)return Promise.resolve({status:"error",code:"unknown"});const s=Promise.resolve({status:"error",code:"unknown"});switch(t){case"identifier":return e.signIn({identifier:this.pendingIdentifier,rememberIdentifier:!0===this.values.rememberIdentifier});case"password":{const t=this.str("password"),s=this.pendingIdentifier;return e.verifyPassword?e.verifyPassword({identifier:s,password:t}):e.signIn({identifier:s,password:t})}case"mfa-method":return e.selectMfaMethod?.({methodId:this.str("mfaMethod")})??s;case"otp":return e.verifyOtp?.({code:this.str("code")})??s;case"forgot-password":return e.requestPasswordReset?.({identifier:this.str("identifier").trim()})??s;case"forgot-username":return e.requestUsernameReminder?.({email:this.str("email").trim()})??s;case"reset-password":return e.resetPassword?.({password:this.str("password")})??s;case"sign-up":return e.signUp?.({firstName:this.str("firstName"),lastName:this.str("lastName"),identifier:this.str("identifier").trim()})??s;default:return s}}str(t){return(this.values[t]??"")+""}}q([k()],T.prototype,"resend",void 0),q([k()],T.prototype,"memory",void 0),q([k()],T.prototype,"udsLoginStepChange",void 0),q([k()],T.prototype,"udsLoginError",void 0),q([k()],T.prototype,"udsLoginSuccess",void 0),q([k()],T.prototype,"auth",void 0),q([k()],T.prototype,"controlStrategy",void 0),q([k()],T.prototype,"initialStep",void 0),q([k()],T.prototype,"otpLength",void 0),q([k()],T.prototype,"copy",void 0),q([k({writable:!0})],T.prototype,"step",void 0),q([k({writable:!0})],T.prototype,"busy",void 0),q([k({writable:!0})],T.prototype,"errorText",void 0),q([k({writable:!0})],T.prototype,"methods",void 0),q([k({writable:!0})],T.prototype,"otpMethodLabel",void 0),q([k({writable:!0})],T.prototype,"destination",void 0),q([k({writable:!0})],T.prototype,"unlockMinutes",void 0),q([k({writable:!0})],T.prototype,"values",void 0),q([M("componentWillLoad")],T.prototype,"start",null),q([M("reset")],T.prototype,"restart",null);var L=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class E extends u{constructor(){super()}start(t){this.stop(),!t||t<=0?this.resendAt=void 0:(this.resendAt=Date.now()+t,this.nowTick=Date.now(),this.timer=setInterval((()=>{this.nowTick=Date.now(),void 0!==this.resendAt&&this.nowTick>=this.resendAt&&(this.stop(),this.resendAt=void 0)}),1e3))}stop(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}get secondsRemaining(){return void 0===this.resendAt?0:Math.max(0,Math.ceil((this.resendAt-this.nowTick)/1e3))}get canResend(){return 0===this.secondsRemaining}}L([k({writable:!0})],E.prototype,"resendAt",void 0),L([k({writable:!0})],E.prototype,"nowTick",void 0),L([M("disconnectedCallback")],E.prototype,"stop",null);var V=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class N extends u{constructor(){super()}initialIdentifier(){return this.identifier||this.read()||""}read(){if(!this.rememberStorageKey)return"";try{return globalThis.localStorage?.getItem(this.rememberStorageKey)??""}catch{return""}}remember(t,e){if(this.rememberStorageKey)try{e?globalThis.localStorage?.setItem(this.rememberStorageKey,t):globalThis.localStorage?.removeItem(this.rememberStorageKey)}catch{}}}V([k()],N.prototype,"rememberStorageKey",void 0),V([k()],N.prototype,"identifier",void 0);class z{canEvaluate(t,e){return"string"==typeof t&&0!==t.length&&(!e||!e.disabled&&e.visible)}shouldShowError(t){return!t||!t.disabled&&t.visible&&(t.touched||t.modified)}}class A extends z{constructor(t,e){super(),this.expected=t,this.message=e}evaluate(t){const e=t===this.expected();return{isValid:e,message:e?"":this.message()}}}class I extends z{constructor(t,e){super(),this.length=t,this.message=e}evaluate(t){const e=this.length(),s=t.length>=e;return{isValid:s,message:s?"":this.message(e)}}}var F=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class D extends u{constructor(){super(),this.matchRules=new Map,this.completeCode=[new I((()=>this.viewModel.otpLength),(t=>h(this.viewModel.copy.otpIncomplete,{count:t})))]}matchRuleFor(t){let e=this.matchRules.get(t);return e||(e=[new A((()=>this.viewModel.valueOf(t)),(()=>this.viewModel.copy.errors.passwords_do_not_match))],this.matchRules.set(t,e)),e}textField(e){const s=this.viewModel,{name:i,label:r,type:o="text",autocomplete:n,mustMatch:a}=e;return t("vega-input",{key:i,class:"field",name:i,label:r,type:o,autocomplete:n,value:s.valueOf(i),disabled:s.busy,showClearIcon:!1,required:!0,autoValidation:!0,validationRules:a?this.matchRuleFor(a):void 0,onVegaChange:t=>this.handlers.onValueChange(i,t.detail)})}passcodeField(){const e=this.viewModel;return t("vega-input-passcode",{class:"field",name:"code",label:e.copy.otpFieldLabel,length:e.otpLength,inputType:"numeric",disabled:e.busy,required:!0,autoValidation:!0,validationRules:this.completeCode,value:e.valueOf("code"),onVegaChange:t=>this.handlers.onValueChange("code",t.detail)})}checkbox(e,s){const i=this.viewModel;return t("vega-checkbox",{class:"field",name:e,identifier:e,checked:i.isChecked(e),disabled:i.busy,onVegaUserChange:t=>this.handlers.onValueChange(e,!1!==t.detail)},s)}submit(e){return t("vega-button",{class:"submit",type:"submit",variant:"primary",block:!0,label:e,loading:this.viewModel.busy})}link(e,s){return t("vega-button-link",{class:"link",label:e,eventful:!0,disabled:this.viewModel.busy,onVegaClick:t=>s(t)})}methodGroup(e,s){const i=this.viewModel;return t("vega-selection-tile-group",{class:"options",name:"mfaMethod",label:s,selectType:"radio",layout:"vertical",disabled:i.busy,required:!0,value:i.valueOf("mfaMethod"),onVegaChange:t=>this.handlers.onValueChange("mfaMethod",t.detail)},e.map((e=>t("vega-selection-tile",{key:e.id,class:"option",value:e.id,titleText:e.label,note:e.description,selectType:"radio",checked:i.valueOf("mfaMethod")===e.id,disabled:!0===e.disabled||i.busy}))))}}F([k()],D.prototype,"viewModel",void 0),F([k()],D.prototype,"handlers",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class U extends u{constructor(){super(),this.fields=new D}render(){const t=this.viewModel;switch(t.step){case"identifier":return this.identifierStep(t);case"password":return this.passwordStep(t);case"mfa-method":return this.mfaMethodStep(t);case"otp":return this.otpStep(t);case"forgot-password":case"forgot-username":return this.forgotStep(t);case"reset-password":return this.resetPasswordStep(t);case"sign-up":return this.signUpStep(t);default:return[]}}identifierStep(e){const{copy:s}=e;return[this.fields.textField({name:"identifier",label:s.identifierFieldLabel,type:"email",autocomplete:"username"}),this.fields.checkbox("rememberIdentifier",s.rememberIdentifier),this.fields.submit(s.continue),t("div",{class:"prose"},t("p",{class:"prose__lead"},s.troubleSigningInPrompt),t("p",null,"Follow the steps in “",this.fields.link(s.troubleSigningIn,this.handlers.onAction("trouble-signing-in")),"”."),e.can.signUp&&t("p",null,s.noAccountPrompt," ",this.fields.link(s.createAccount,this.handlers.onNavigate("sign-up"))))]}passwordStep(e){const{copy:s,can:i}=e,r=[];return i.reset&&r.push(this.fields.link(s.forgotPassword,this.handlers.onNavigate("forgot-password"))),i.username&&r.push(this.fields.link(s.forgotUsername,this.handlers.onNavigate("forgot-username"))),[this.fields.textField({name:"password",label:s.passwordFieldLabel,type:"password",autocomplete:"current-password"}),...r.length?[t("div",{class:"inline-links"},r)]:[],this.fields.submit(s.continue)]}mfaMethodStep(t){const{copy:e}=t;return[this.fields.methodGroup(t.methods,e.mfaMethodHeading),this.fields.submit(e.continue)]}otpStep(e){const{copy:s}=e,i=[];return e.methods.length>1&&i.push(this.fields.link(s.changeMfaMethod,this.handlers.onNavigate("mfa-method"))),e.can.resend&&i.push(e.isResendThrottled?t("span",{class:"countdown","aria-live":"polite"},e.resendCountdownText):this.fields.link(s.resendCode,this.handlers.onResend)),[this.fields.passcodeField(),this.fields.submit(s.otpSubmit),...i.length?[t("div",{class:"prose"},t("p",null,s.changeMfaMethodPrompt),t("p",{class:"inline-links"},i))]:[]]}forgotStep(e){const{copy:s}=e;return[this.fields.textField({name:"forgot-password"===e.step?"identifier":"email",label:s.identifierFieldLabel,type:"email",autocomplete:"username"}),this.fields.submit(s.continue),t("p",{class:"prose"},this.fields.link(s.back,this.handlers.onNavigate("identifier")))]}resetPasswordStep(t){const{copy:e}=t;return[this.fields.textField({name:"password",label:e.newPasswordFieldLabel,type:"password",autocomplete:"new-password"}),this.fields.textField({name:"confirmPassword",label:e.confirmPasswordFieldLabel,type:"password",autocomplete:"new-password",mustMatch:"password"}),this.fields.submit(e.continue)]}signUpStep(e){const{copy:s}=e;return[this.fields.textField({name:"firstName",label:s.firstNameFieldLabel,autocomplete:"given-name"}),this.fields.textField({name:"lastName",label:s.lastNameFieldLabel,autocomplete:"family-name"}),this.fields.textField({name:"identifier",label:s.identifierFieldLabel,type:"email",autocomplete:"email"}),this.fields.submit(s.signUpSubmit),t("p",{class:"prose"},s.haveAccountPrompt," ",this.fields.link(s.signIn,this.handlers.onNavigate("identifier")))]}}P([v()],U.prototype,"fields",void 0),P([k()],U.prototype,"viewModel",void 0),P([k()],U.prototype,"handlers",void 0);var B=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class G extends u{constructor(){super(),this.steps=new U}render(){const e=this.viewModel;return[t("h1",{class:"card__heading",id:"uds-pattern-login-heading",tabindex:"-1"},e.heading),...e.description?[t("p",{class:"card__description"},e.description)]:[],...e.errorText?[t("vega-banner",{class:"alert",type:"error",content:e.errorText,isOpen:!0,showCloseButton:!1})]:[],...e.isTerminal?this.terminalBody(e):[this.form()]]}form(){return t("vega-form",{class:"form",useNativeForm:!0,disableBlurValidation:!0,onVegaFormSubmit:t=>this.handlers.onSubmit(t)},t("div",{class:"form__body"},this.steps.render()))}terminalBody(e){return"check-email"!==e.step?[]:[t("p",{class:"prose"},t("vega-button-link",{class:"link",label:e.copy.back,eventful:!0,onVegaClick:t=>this.handlers.onNavigate("identifier")(t)}))]}}B([v()],G.prototype,"steps",void 0),B([k()],G.prototype,"viewModel",void 0),B([k()],G.prototype,"handlers",void 0);class K{constructor(t,e,s,i,r,o,n,a,c,d,h){this.step=t,this.copy=e,this.heading=s,this.description=i,this.errorText=r,this.busy=o,this.can=n,this.methods=a,this.values=c,this.otpLength=d,this.resendSeconds=h}static from(t){const{step:e,copy:s}=t;return new K(e,s,function(t,e){return{identifier:e.identifierHeading,password:e.passwordHeading,"mfa-method":e.mfaMethodHeading,otp:e.otpHeading,"forgot-password":e.forgotPasswordHeading,"forgot-username":e.forgotUsernameHeading,"reset-password":e.resetPasswordHeading,"sign-up":e.signUpHeading,"check-email":e.checkEmailHeading,locked:e.lockedHeading,success:e.successHeading}[t]}(e,s),function(t,e,s){switch(t){case"mfa-method":return e.mfaMethodDescription;case"otp":return s.otpMethodLabel?h(e.otpDescriptionForMethod,{method:s.otpMethodLabel}):e.otpDescription;case"forgot-password":return e.forgotPasswordDescription;case"forgot-username":return e.forgotUsernameDescription;case"sign-up":return e.signUpDescription;case"check-email":return s.destination?h(e.checkEmailDescriptionWithDestination,{destination:s.destination}):e.checkEmailDescription;case"locked":return s.unlockMinutes?h(e.lockedDescriptionWithTime,{minutes:s.unlockMinutes}):e.lockedDescription;default:return}}(e,s,t),t.errorText,t.busy,t.can,t.methods,t.values,t.otpLength,t.resendSeconds)}get isTerminal(){return"success"===this.step||"locked"===this.step||"check-email"===this.step}get isResendThrottled(){return this.resendSeconds>0}get resendCountdownText(){return h(this.copy.resendCodeIn,{seconds:this.resendSeconds})}valueOf(t){const e=this.values[t];return"string"==typeof e?e:""}isChecked(t){return!0===this.values[t]}}var W=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};const H=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.udsLoginSuccess=r(this,"udsLoginSuccess"),this.udsLoginStepChange=r(this,"udsLoginStepChange"),this.udsLoginError=r(this,"udsLoginError"),this.udsLoginAction=r(this,"udsLoginAction"),this.workflow=new T,this.resend=new E,this.memory=new N,this.renderer=new G,this.config={},this.initialStep="identifier",this.identifier="",this.otpLength=6,this.rememberStorageKey="uds-pattern-login.identifier",this.showHelpFooter=!0,this.step="identifier",this.busy=!1,this.methods=[],this.nowTick=Date.now(),this.values={},this.handlers={onSubmit:t=>{t.preventDefault(),this.workflow.submit()},onNavigate:t=>e=>{e.preventDefault(),this.workflow.navigateTo(t)},onAction:t=>e=>{e.preventDefault(),this.udsLoginAction.emit({action:t,step:this.step})},onResend:t=>{t.preventDefault(),this.workflow.resendCode()},onValueChange:(t,e)=>{this.values={...this.values,[t]:e}}}}componentWillLoad(){}disconnectedCallback(){}componentDidRender(){void 0!==this.lastRenderedStep&&this.lastRenderedStep!==this.step&&this.focusFirstControl(),this.lastRenderedStep=this.step}async reset(){}get resolvedConfig(){return function(t,e){if("string"!=typeof t)return t??e;try{return JSON.parse(t)}catch{return e}}(this.config,{})}get auth(){return this.resolvedConfig.auth}get controlStrategy(){return this.resolvedConfig.control}get copy(){const t=this.resolvedConfig.labels??{};return{...l,...t,errors:{...l.errors,...t.errors??{}}}}get viewModel(){return K.from({step:this.step,copy:this.copy,errorText:this.errorText,busy:this.busy,can:this.workflow.capabilities,methods:this.methods,values:this.values,otpLength:this.workflow.codeLength,resendSeconds:this.resend.secondsRemaining,otpMethodLabel:this.otpMethodLabel,destination:this.destination,unlockMinutes:this.unlockMinutes})}focusFirstControl(){const t=this.hostEl.shadowRoot;(t.querySelector(".form .field:not([disabled])")??t.querySelector(".card__heading")).focus()}render(){return t(o,{key:"e8d37d2f818b9b2260fb2ccd3d784393a28385c4"},t("section",{key:"1c0ce6ee5c73d24b06212d8a4b2f293c89e6cb70",class:"card","aria-busy":this.busy+""},t("slot",{key:"c87b3ceba0d974e15958aec53c19e76dc3996096",name:"brand"}),this.renderer.render(),this.showHelpFooter&&t("div",{key:"003268c5b8abf8755d55ba54e433fc8114171113",class:"card__footer"},t("slot",{key:"376accf53b60a5cb489abde889ff74bf7fab3fe6",name:"footer"},t("p",{key:"a6834071896f9a3d988c089807fc6a77ee928ffc"},this.copy.helpPrompt," ",t("vega-button-link",{key:"4645b67e1ccf70b0b386a516025659540a9308a9",class:"link",label:this.copy.help,eventful:!0,onVegaClick:t=>this.handlers.onAction("login-help")(t)}))))))}get hostEl(){return this}static get style(){return":host{display:block;width:100%;max-width:var(--uds-pattern-login-card-max-width);box-sizing:border-box;--uds-pattern-login-card-max-width:35rem}:host *,:host *::before,:host *::after{box-sizing:inherit}.card{padding:var(--uds-pattern-space-2xl);background:var(--uds-pattern-color-surface);border-radius:var(--uds-pattern-radius-lg);box-shadow:var(--uds-pattern-shadow-card)}.card__heading{margin:0 0 var(--uds-pattern-space-sm);font-size:var(--uds-pattern-font-size-lg);font-weight:var(--uds-pattern-font-weight-bold);line-height:var(--uds-pattern-line-height-md)}.card__heading:focus,.card__heading:focus-visible{outline:none}.card__description{margin:0 0 var(--uds-pattern-space-lg);font-size:var(--uds-pattern-font-size-sm);color:var(--uds-pattern-color-text-subtle)}.card__footer{margin-top:var(--uds-pattern-space-xl);padding-top:var(--uds-pattern-space-xl);border-top:1px solid var(--uds-pattern-color-border);font-size:var(--uds-pattern-font-size-sm);color:var(--uds-pattern-color-text-subtle)}.card__footer p{margin:0}.form{margin-top:var(--uds-pattern-space-lg)}.form__body{display:flex;flex-direction:column;gap:var(--uds-pattern-space-xl);align-items:stretch}.alert{display:block;margin-bottom:var(--uds-pattern-space-md)}.options{display:block}.prose{margin:0;font-size:var(--uds-pattern-font-size-sm);color:var(--uds-pattern-color-text-subtle)}.prose p{margin:0 0 var(--uds-pattern-space-xs)}.prose p:last-child{margin-bottom:0}.prose__lead{font-weight:var(--uds-pattern-font-weight-bold);color:var(--uds-pattern-color-text)}.link{display:inline-block;vertical-align:baseline}.inline-links{display:flex;flex-wrap:wrap;gap:var(--uds-pattern-space-md)}.countdown{color:var(--uds-pattern-color-text-subtle)}"}},[257,"uds-pattern-login-card",{config:[1],initialStep:[1,"initial-step"],identifier:[1],otpLength:[2,"otp-length"],rememberStorageKey:[1,"remember-storage-key"],showHelpFooter:[4,"show-help-footer"],step:[32],busy:[32],errorText:[32],methods:[32],otpMethodLabel:[32],destination:[32],unlockMinutes:[32],resendAt:[32],nowTick:[32],values:[32],reset:[64]}]);function J(){"undefined"!=typeof customElements&&["uds-pattern-login-card"].forEach((t=>{"uds-pattern-login-card"===t&&(customElements.get(s(t))||customElements.define(s(t),H))}))}W([v()],H.prototype,"workflow",void 0),W([v()],H.prototype,"resend",void 0),W([v()],H.prototype,"memory",void 0),W([v()],H.prototype,"renderer",void 0),J();const Q=H,X=J;export{Q as UdsPatternLoginCard,X as defineCustomElement}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface UdsPatternLoginPage extends Components.UdsPatternLoginPage, HTMLElement {}
4
+ export const UdsPatternLoginPage: {
5
+ prototype: UdsPatternLoginPage;
6
+ new (): UdsPatternLoginPage;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1 @@
1
+ import{t as e,p as t,H as a,h as s,d as o}from"./p-_G8A9gg0.js";const r=t(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.logoAlt=""}render(){const e=this.logoSrc?s("img",{class:"masthead__logo",src:this.logoSrc,alt:this.logoAlt}):null;return s(o,{key:"7c2d0d6ae80dc7e52c0780c457de982738ef8faa"},s("header",{key:"7eac231827e53a5e4018591506f7632aff8ddda5",class:"masthead"},s("slot",{key:"e80b31f6301079a15f45066189c646ed4c444e24",name:"brand"},this.logoHref&&e?s("a",{href:this.logoHref},e):e)),s("main",{key:"3081bf6ec017cff44900f6cd0d9c98b38baf5126",class:"content"},s("slot",{key:"3c84048fae834578b00254e6bdbad4eecc74b5e2"})),s("footer",{key:"dfb064a71e3f39c8e99212b523d043f9f9f20538",class:"page-footer"},s("slot",{key:"5ea9ef897c20a96f3c42b2b4f54496155516a423",name:"footer"})))}static get style(){return":host{display:flex;flex-direction:column;min-height:100vh;box-sizing:border-box;font-family:var(--uds-pattern-font-family);color:var(--uds-pattern-color-text);background:var(--uds-pattern-color-background)}.masthead{display:flex;justify-content:center;align-items:center;padding:var(--uds-pattern-space-md) var(--uds-pattern-space-lg);background:var(--uds-pattern-color-surface)}.masthead__logo{display:block;max-height:2rem}.content{display:flex;flex:1;justify-content:center;align-items:center;padding:var(--uds-pattern-space-xl) var(--uds-pattern-space-md)}.page-footer:not(:empty){padding:var(--uds-pattern-space-md) var(--uds-pattern-space-lg);text-align:center;font-size:var(--uds-pattern-font-size-sm);color:var(--uds-pattern-color-text-subtle)}"}},[257,"uds-pattern-login-page",{logoSrc:[1,"logo-src"],logoAlt:[1,"logo-alt"],logoHref:[1,"logo-href"]}]);function n(){"undefined"!=typeof customElements&&["uds-pattern-login-page"].forEach((t=>{"uds-pattern-login-page"===t&&(customElements.get(e(t))||customElements.define(e(t),r))}))}n();const c=r,d=n;export{c as UdsPatternLoginPage,d as defineCustomElement}