@forgerock/login-widget 1.0.0-beta.11 → 1.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -16726,6 +16726,8 @@ var backToDefault = "Back to Sign In";
16726
16726
  var backToLogin = "Back to Sign In";
16727
16727
  var dontHaveAnAccount = "No account? <a href='?journey=Registration'>Register here!</a>";
16728
16728
  var closeModal = "Close";
16729
+ var charactersCannotRepeatMoreThan = "Character cannot repeat more than {max} times";
16730
+ var charactersCannotRepeatMoreThanCaseInsensitive = "Character cannot repeat more than {max} times (case insensitive)";
16729
16731
  var chooseDifferentUsername = "Please choose a different username.";
16730
16732
  var confirmPassword = "Confirm password";
16731
16733
  var constraintViolationForPassword = "Password does not meet the requirements.";
@@ -16758,6 +16760,9 @@ var nextButton = "Next";
16758
16760
  var notToExceedMaximumCharacterLength = "No more than {max} characters";
16759
16761
  var noLessThanMinimumCharacterLength = "At least {min} character(s)";
16760
16762
  var passwordCallback = "Password";
16763
+ var passwordCannotContainCommonPasswords = "Password cannot contain common passwords";
16764
+ var passwordCannotContainCommonPasswordsOrBeReversible = "Password cannot contain common passwords or reversible text";
16765
+ var passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan = "Password cannot contain common passwords or reversible text less than {min} characters";
16761
16766
  var passwordRequirements = "Password requirements:";
16762
16767
  var pleaseCheckValue = "Please check this value";
16763
16768
  var pleaseConfirm = "Please confirm";
@@ -16772,6 +16777,10 @@ var requiredField = "Value is required";
16772
16777
  var securityAnswer = "Security answer";
16773
16778
  var securityQuestions = "Security question(s)";
16774
16779
  var securityQuestionsPrompt = "Provide security question(s) and answer(s):";
16780
+ var shouldContainANumber = "Should contain a number";
16781
+ var shouldContainAnUppercase = "Should contain an uppercase letter";
16782
+ var shouldContainALowercase = "Should contain a lowercase letter";
16783
+ var shouldContainASymbol = "Should contain a symbol";
16775
16784
  var showPassword = "Show password";
16776
16785
  var sn = "Last name";
16777
16786
  var submitButton = "Submit";
@@ -16795,6 +16804,8 @@ var fallback = {
16795
16804
  backToLogin: backToLogin,
16796
16805
  dontHaveAnAccount: dontHaveAnAccount,
16797
16806
  closeModal: closeModal,
16807
+ charactersCannotRepeatMoreThan: charactersCannotRepeatMoreThan,
16808
+ charactersCannotRepeatMoreThanCaseInsensitive: charactersCannotRepeatMoreThanCaseInsensitive,
16798
16809
  chooseDifferentUsername: chooseDifferentUsername,
16799
16810
  confirmPassword: confirmPassword,
16800
16811
  constraintViolationForPassword: constraintViolationForPassword,
@@ -16827,6 +16838,9 @@ var fallback = {
16827
16838
  notToExceedMaximumCharacterLength: notToExceedMaximumCharacterLength,
16828
16839
  noLessThanMinimumCharacterLength: noLessThanMinimumCharacterLength,
16829
16840
  passwordCallback: passwordCallback,
16841
+ passwordCannotContainCommonPasswords: passwordCannotContainCommonPasswords,
16842
+ passwordCannotContainCommonPasswordsOrBeReversible: passwordCannotContainCommonPasswordsOrBeReversible,
16843
+ passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan: passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan,
16830
16844
  passwordRequirements: passwordRequirements,
16831
16845
  pleaseCheckValue: pleaseCheckValue,
16832
16846
  pleaseConfirm: pleaseConfirm,
@@ -16841,6 +16855,10 @@ var fallback = {
16841
16855
  securityAnswer: securityAnswer,
16842
16856
  securityQuestions: securityQuestions,
16843
16857
  securityQuestionsPrompt: securityQuestionsPrompt,
16858
+ shouldContainANumber: shouldContainANumber,
16859
+ shouldContainAnUppercase: shouldContainAnUppercase,
16860
+ shouldContainALowercase: shouldContainALowercase,
16861
+ shouldContainASymbol: shouldContainASymbol,
16844
16862
  showPassword: showPassword,
16845
16863
  sn: sn,
16846
16864
  submitButton: submitButton,
@@ -16867,6 +16885,8 @@ const stringsSchema = z
16867
16885
  backToLogin: z.string(),
16868
16886
  dontHaveAnAccount: z.string(),
16869
16887
  closeModal: z.string(),
16888
+ charactersCannotRepeatMoreThan: z.string(),
16889
+ charactersCannotRepeatMoreThanCaseInsensitive: z.string(),
16870
16890
  chooseDifferentUsername: z.string(),
16871
16891
  confirmPassword: z.string(),
16872
16892
  constraintViolationForPassword: z.string(),
@@ -16899,6 +16919,9 @@ const stringsSchema = z
16899
16919
  notToExceedMaximumCharacterLength: z.string(),
16900
16920
  noLessThanMinimumCharacterLength: z.string(),
16901
16921
  passwordCallback: z.string(),
16922
+ passwordCannotContainCommonPasswords: z.string(),
16923
+ passwordCannotContainCommonPasswordsOrBeReversible: z.string(),
16924
+ passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan: z.string(),
16902
16925
  passwordRequirements: z.string(),
16903
16926
  pleaseCheckValue: z.string(),
16904
16927
  pleaseConfirm: z.string(),
@@ -16913,6 +16936,10 @@ const stringsSchema = z
16913
16936
  securityAnswer: z.string(),
16914
16937
  securityQuestions: z.string(),
16915
16938
  securityQuestionsPrompt: z.string(),
16939
+ shouldContainANumber: z.string(),
16940
+ shouldContainAnUppercase: z.string(),
16941
+ shouldContainALowercase: z.string(),
16942
+ shouldContainASymbol: z.string(),
16916
16943
  showPassword: z.string(),
16917
16944
  sn: z.string(),
16918
16945
  submitButton: z.string(),
@@ -20606,12 +20633,41 @@ function getInputTypeFromPolicies(policies) {
20606
20633
  return 'text';
20607
20634
  }
20608
20635
  function getValidationFailureParams(failedPolicy) {
20609
- if (failedPolicy?.policyRequirement === 'CHARACTER_SET') {
20610
- const params = failedPolicy?.params;
20636
+ if (failedPolicy?.policyRequirement === 'DICTIONARY') {
20637
+ const params = failedPolicy.params;
20638
+ const min = params?.['min-substring-length'] || 0;
20639
+ const arr = [];
20640
+ if (params?.['check-substrings'] && params?.['test-reversed-password']) {
20641
+ arr.push({
20642
+ length: min,
20643
+ message: interpolate('passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan', {
20644
+ min: String(min),
20645
+ }),
20646
+ rule: 'reversibleSubstrings',
20647
+ });
20648
+ }
20649
+ else if (params?.['test-reversed-password']) {
20650
+ arr.push({
20651
+ length: null,
20652
+ message: interpolate('passwordCannotContainCommonPasswordsOrBeReversible'),
20653
+ rule: 'reversibleSubstrings',
20654
+ });
20655
+ }
20656
+ else {
20657
+ arr.push({
20658
+ length: null,
20659
+ message: interpolate('passwordCannotContainCommonPasswords'),
20660
+ rule: 'reversibleSubstrings',
20661
+ });
20662
+ }
20663
+ return arr;
20664
+ }
20665
+ else if (failedPolicy?.policyRequirement === 'CHARACTER_SET') {
20666
+ const params = failedPolicy.params;
20611
20667
  return params?.['character-sets'].map(convertCharacterSetToRuleObj);
20612
20668
  }
20613
20669
  else if (failedPolicy?.policyRequirement === 'LENGTH_BASED') {
20614
- const params = failedPolicy?.params;
20670
+ const params = failedPolicy.params;
20615
20671
  const min = params?.['min-password-length'] || 0;
20616
20672
  const max = params?.['max-password-length'] || null;
20617
20673
  const arr = [];
@@ -20631,6 +20687,26 @@ function getValidationFailureParams(failedPolicy) {
20631
20687
  }
20632
20688
  return arr;
20633
20689
  }
20690
+ else if (failedPolicy?.policyRequirement === 'REPEATED_CHARACTERS') {
20691
+ const params = failedPolicy.params;
20692
+ const max = params['max-consecutive-length'] || 0;
20693
+ const arr = [];
20694
+ if (!params['case-sensitive-validation']) {
20695
+ arr.push({
20696
+ length: max,
20697
+ message: interpolate('charactersCannotRepeatMoreThanCaseInsensitive', { max: String(max) }),
20698
+ rule: 'repeatedCharactersCaseInsensitive',
20699
+ });
20700
+ }
20701
+ else {
20702
+ arr.push({
20703
+ length: max,
20704
+ message: interpolate('charactersCannotRepeatMoreThan', { max: String(max) }),
20705
+ rule: 'repeatedCharacters',
20706
+ });
20707
+ }
20708
+ return arr;
20709
+ }
20634
20710
  else if (failedPolicy?.policyRequirement === 'VALID_USERNAME') {
20635
20711
  return [
20636
20712
  {
@@ -20787,36 +20863,72 @@ function convertCharacterSetToRuleObj(set) {
20787
20863
  const num = arr[0];
20788
20864
  const type = arr[1];
20789
20865
  if (type === '0123456789') {
20790
- return {
20791
- length: Number(num),
20792
- message: interpolate('minimumNumberOfNumbers', { num: String(num) }),
20793
- rule: 'numbers',
20794
- };
20866
+ if (num === '0') {
20867
+ return {
20868
+ length: null,
20869
+ message: interpolate('shouldContainANumber'),
20870
+ rule: 'numbers',
20871
+ };
20872
+ }
20873
+ else {
20874
+ return {
20875
+ length: Number(num),
20876
+ message: interpolate('minimumNumberOfNumbers', { num: String(num) }),
20877
+ rule: 'numbers',
20878
+ };
20879
+ }
20795
20880
  }
20796
20881
  else if (type === 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') {
20797
- return {
20798
- length: Number(num),
20799
- message: interpolate('minimumNumberOfUppercase', { num: String(num) }),
20800
- rule: 'uppercase',
20801
- };
20882
+ if (num === '0') {
20883
+ return {
20884
+ length: null,
20885
+ message: interpolate('shouldContainAnUppercase'),
20886
+ rule: 'uppercase',
20887
+ };
20888
+ }
20889
+ else {
20890
+ return {
20891
+ length: Number(num),
20892
+ message: interpolate('minimumNumberOfUppercase', { num: String(num) }),
20893
+ rule: 'uppercase',
20894
+ };
20895
+ }
20802
20896
  }
20803
20897
  else if (type === 'abcdefghijklmnopqrstuvwxyz') {
20804
- return {
20805
- length: Number(num),
20806
- message: interpolate('minimumNumberOfLowercase', { num: String(num) }),
20807
- rule: 'lowercase',
20808
- };
20898
+ if (num === '0') {
20899
+ return {
20900
+ length: null,
20901
+ message: interpolate('shouldContainALowercase'),
20902
+ rule: 'lowercase',
20903
+ };
20904
+ }
20905
+ else {
20906
+ return {
20907
+ length: Number(num),
20908
+ message: interpolate('minimumNumberOfLowercase', { num: String(num) }),
20909
+ rule: 'lowercase',
20910
+ };
20911
+ }
20809
20912
  }
20810
20913
  else if (type.includes('@') || type.includes('!') || type.includes('*') || type.includes('#')) {
20811
- return {
20812
- length: Number(num),
20813
- message: interpolate('minimumNumberOfSymbols', { num: String(num) }),
20814
- rule: 'symbols',
20815
- };
20914
+ if (num === '0') {
20915
+ return {
20916
+ length: null,
20917
+ message: interpolate('shouldContainASymbol'),
20918
+ rule: 'symbols',
20919
+ };
20920
+ }
20921
+ else {
20922
+ return {
20923
+ length: Number(num),
20924
+ message: interpolate('minimumNumberOfSymbols', { num: String(num) }),
20925
+ rule: 'symbols',
20926
+ };
20927
+ }
20816
20928
  }
20817
20929
  else {
20818
20930
  return {
20819
- length: Number(num),
20931
+ length: null,
20820
20932
  message: interpolate('pleaseCheckValue'),
20821
20933
  rule: 'unknown',
20822
20934
  };
@@ -27131,8 +27243,8 @@ class Eye_icon extends SvelteComponent {
27131
27243
 
27132
27244
  function create_default_slot_1$8(ctx) {
27133
27245
  let current;
27134
- const default_slot_template = /*#slots*/ ctx[12].default;
27135
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[13], null);
27246
+ const default_slot_template = /*#slots*/ ctx[14].default;
27247
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[15], null);
27136
27248
 
27137
27249
  return {
27138
27250
  c() {
@@ -27147,15 +27259,15 @@ function create_default_slot_1$8(ctx) {
27147
27259
  },
27148
27260
  p(ctx, dirty) {
27149
27261
  if (default_slot) {
27150
- if (default_slot.p && (!current || dirty & /*$$scope*/ 8192)) {
27262
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 32768)) {
27151
27263
  update_slot_base(
27152
27264
  default_slot,
27153
27265
  default_slot_template,
27154
27266
  ctx,
27155
- /*$$scope*/ ctx[13],
27267
+ /*$$scope*/ ctx[15],
27156
27268
  !current
27157
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[13])
27158
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[13], dirty, null),
27269
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[15])
27270
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[15], dirty, null),
27159
27271
  null
27160
27272
  );
27161
27273
  }
@@ -27176,7 +27288,7 @@ function create_default_slot_1$8(ctx) {
27176
27288
  };
27177
27289
  }
27178
27290
 
27179
- // (47:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible} >
27291
+ // (59:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
27180
27292
  function create_default_slot$f(ctx) {
27181
27293
  let t;
27182
27294
  let current;
@@ -27206,7 +27318,7 @@ function create_default_slot$f(ctx) {
27206
27318
  };
27207
27319
  }
27208
27320
 
27209
- // (41:2)
27321
+ // (53:2)
27210
27322
  function create_input_button_slot$1(ctx) {
27211
27323
  let button;
27212
27324
  let eyeicon;
@@ -27245,7 +27357,7 @@ function create_input_button_slot$1(ctx) {
27245
27357
  const eyeicon_changes = {};
27246
27358
  if (dirty & /*isVisible*/ 64) eyeicon_changes.visible = /*isVisible*/ ctx[6];
27247
27359
 
27248
- if (dirty & /*$$scope*/ 8192) {
27360
+ if (dirty & /*$$scope*/ 32768) {
27249
27361
  eyeicon_changes.$$scope = { dirty, ctx };
27250
27362
  }
27251
27363
 
@@ -27278,18 +27390,18 @@ function create_fragment$q(ctx) {
27278
27390
  forceValidityFailure: /*forceValidityFailure*/ ctx[0],
27279
27391
  isFirstInvalidInput: false,
27280
27392
  hasRightIcon: true,
27281
- key: `${/*key*/ ctx[1]}-confirm`,
27393
+ key: `${/*key*/ ctx[3]}-confirm`,
27282
27394
  label: interpolate('confirmPassword', null, 'Confirm Password'),
27283
- message: /*isInvalid*/ ctx[3]
27395
+ message: /*isInvalid*/ ctx[1]
27284
27396
  ? interpolate('passwordConfirmationError', null, 'Passwords do not match')
27285
27397
  : undefined,
27286
- onChange: /*onChange*/ ctx[2],
27287
- isInvalid: /*isInvalid*/ ctx[3],
27288
- isRequired: /*isRequired*/ ctx[4],
27289
- showMessage: /*showMessage*/ ctx[5],
27398
+ onChange: /*onChangeWrapper*/ ctx[9],
27399
+ isInvalid: /*isInvalid*/ ctx[1],
27400
+ isRequired: /*isRequired*/ ctx[2],
27401
+ showMessage: /*showMessage*/ ctx[4],
27290
27402
  type: /*type*/ ctx[7],
27291
- value: typeof /*value*/ ctx[9] === 'string'
27292
- ? /*value*/ ctx[9]
27403
+ value: typeof /*value*/ ctx[5] === 'string'
27404
+ ? /*value*/ ctx[5]
27293
27405
  : '',
27294
27406
  $$slots: {
27295
27407
  "input-button": [create_input_button_slot$1],
@@ -27310,19 +27422,22 @@ function create_fragment$q(ctx) {
27310
27422
  p(ctx, [dirty]) {
27311
27423
  const input_changes = {};
27312
27424
  if (dirty & /*forceValidityFailure*/ 1) input_changes.forceValidityFailure = /*forceValidityFailure*/ ctx[0];
27313
- if (dirty & /*key*/ 2) input_changes.key = `${/*key*/ ctx[1]}-confirm`;
27425
+ if (dirty & /*key*/ 8) input_changes.key = `${/*key*/ ctx[3]}-confirm`;
27314
27426
 
27315
- if (dirty & /*isInvalid*/ 8) input_changes.message = /*isInvalid*/ ctx[3]
27427
+ if (dirty & /*isInvalid*/ 2) input_changes.message = /*isInvalid*/ ctx[1]
27316
27428
  ? interpolate('passwordConfirmationError', null, 'Passwords do not match')
27317
27429
  : undefined;
27318
27430
 
27319
- if (dirty & /*onChange*/ 4) input_changes.onChange = /*onChange*/ ctx[2];
27320
- if (dirty & /*isInvalid*/ 8) input_changes.isInvalid = /*isInvalid*/ ctx[3];
27321
- if (dirty & /*isRequired*/ 16) input_changes.isRequired = /*isRequired*/ ctx[4];
27322
- if (dirty & /*showMessage*/ 32) input_changes.showMessage = /*showMessage*/ ctx[5];
27431
+ if (dirty & /*isInvalid*/ 2) input_changes.isInvalid = /*isInvalid*/ ctx[1];
27432
+ if (dirty & /*isRequired*/ 4) input_changes.isRequired = /*isRequired*/ ctx[2];
27433
+ if (dirty & /*showMessage*/ 16) input_changes.showMessage = /*showMessage*/ ctx[4];
27323
27434
  if (dirty & /*type*/ 128) input_changes.type = /*type*/ ctx[7];
27324
27435
 
27325
- if (dirty & /*$$scope, isVisible*/ 8256) {
27436
+ if (dirty & /*value*/ 32) input_changes.value = typeof /*value*/ ctx[5] === 'string'
27437
+ ? /*value*/ ctx[5]
27438
+ : '';
27439
+
27440
+ if (dirty & /*$$scope, isVisible*/ 32832) {
27326
27441
  input_changes.$$scope = { dirty, ctx };
27327
27442
  }
27328
27443
 
@@ -27346,10 +27461,11 @@ function create_fragment$q(ctx) {
27346
27461
  function instance$q($$self, $$props, $$invalidate) {
27347
27462
  let { $$slots: slots = {}, $$scope } = $$props;
27348
27463
  let { forceValidityFailure = false } = $$props;
27349
- let { key } = $$props;
27350
- let { onChange } = $$props;
27351
27464
  let { isInvalid = false } = $$props;
27352
27465
  let { isRequired = true } = $$props;
27466
+ let { key } = $$props;
27467
+ let { onChange } = $$props;
27468
+ let { resetValue } = $$props;
27353
27469
  let { style = {} } = $$props;
27354
27470
  const Input = style.labels === 'stacked' ? Stacked_label : Floating_label;
27355
27471
  let { showMessage = undefined } = $$props;
@@ -27357,6 +27473,13 @@ function instance$q($$self, $$props, $$invalidate) {
27357
27473
  let type = 'password';
27358
27474
  let value;
27359
27475
 
27476
+ function onChangeWrapper(event) {
27477
+ $$invalidate(5, value = event.target?.value);
27478
+
27479
+ // TODO: revisit this logic to avoid unnecessary ternary
27480
+ onChange(typeof value === 'string' ? value : undefined);
27481
+ }
27482
+
27360
27483
  /**
27361
27484
  * @function toggleVisibility - toggles the password from masked to plaintext
27362
27485
  */
@@ -27367,27 +27490,41 @@ function instance$q($$self, $$props, $$invalidate) {
27367
27490
 
27368
27491
  $$self.$$set = $$props => {
27369
27492
  if ('forceValidityFailure' in $$props) $$invalidate(0, forceValidityFailure = $$props.forceValidityFailure);
27370
- if ('key' in $$props) $$invalidate(1, key = $$props.key);
27371
- if ('onChange' in $$props) $$invalidate(2, onChange = $$props.onChange);
27372
- if ('isInvalid' in $$props) $$invalidate(3, isInvalid = $$props.isInvalid);
27373
- if ('isRequired' in $$props) $$invalidate(4, isRequired = $$props.isRequired);
27374
- if ('style' in $$props) $$invalidate(11, style = $$props.style);
27375
- if ('showMessage' in $$props) $$invalidate(5, showMessage = $$props.showMessage);
27376
- if ('$$scope' in $$props) $$invalidate(13, $$scope = $$props.$$scope);
27493
+ if ('isInvalid' in $$props) $$invalidate(1, isInvalid = $$props.isInvalid);
27494
+ if ('isRequired' in $$props) $$invalidate(2, isRequired = $$props.isRequired);
27495
+ if ('key' in $$props) $$invalidate(3, key = $$props.key);
27496
+ if ('onChange' in $$props) $$invalidate(11, onChange = $$props.onChange);
27497
+ if ('resetValue' in $$props) $$invalidate(12, resetValue = $$props.resetValue);
27498
+ if ('style' in $$props) $$invalidate(13, style = $$props.style);
27499
+ if ('showMessage' in $$props) $$invalidate(4, showMessage = $$props.showMessage);
27500
+ if ('$$scope' in $$props) $$invalidate(15, $$scope = $$props.$$scope);
27501
+ };
27502
+
27503
+ $$self.$$.update = () => {
27504
+ if ($$self.$$.dirty & /*resetValue, onChange, value*/ 6176) {
27505
+ {
27506
+ if (resetValue) {
27507
+ $$invalidate(5, value = undefined);
27508
+ onChange(value);
27509
+ }
27510
+ }
27511
+ }
27377
27512
  };
27378
27513
 
27379
27514
  return [
27380
27515
  forceValidityFailure,
27381
- key,
27382
- onChange,
27383
27516
  isInvalid,
27384
27517
  isRequired,
27518
+ key,
27385
27519
  showMessage,
27520
+ value,
27386
27521
  isVisible,
27387
27522
  type,
27388
27523
  Input,
27389
- value,
27524
+ onChangeWrapper,
27390
27525
  toggleVisibility,
27526
+ onChange,
27527
+ resetValue,
27391
27528
  style,
27392
27529
  slots,
27393
27530
  $$scope
@@ -27400,12 +27537,13 @@ class Confirm_input extends SvelteComponent {
27400
27537
 
27401
27538
  init(this, options, instance$q, create_fragment$q, safe_not_equal, {
27402
27539
  forceValidityFailure: 0,
27403
- key: 1,
27404
- onChange: 2,
27405
- isInvalid: 3,
27406
- isRequired: 4,
27407
- style: 11,
27408
- showMessage: 5
27540
+ isInvalid: 1,
27541
+ isRequired: 2,
27542
+ key: 3,
27543
+ onChange: 11,
27544
+ resetValue: 12,
27545
+ style: 13,
27546
+ showMessage: 4
27409
27547
  });
27410
27548
  }
27411
27549
  }
@@ -27414,8 +27552,8 @@ class Confirm_input extends SvelteComponent {
27414
27552
 
27415
27553
  function create_default_slot_1$7(ctx) {
27416
27554
  let current;
27417
- const default_slot_template = /*#slots*/ ctx[19].default;
27418
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[20], null);
27555
+ const default_slot_template = /*#slots*/ ctx[21].default;
27556
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[22], null);
27419
27557
 
27420
27558
  return {
27421
27559
  c() {
@@ -27430,15 +27568,15 @@ function create_default_slot_1$7(ctx) {
27430
27568
  },
27431
27569
  p(ctx, dirty) {
27432
27570
  if (default_slot) {
27433
- if (default_slot.p && (!current || dirty & /*$$scope*/ 1048576)) {
27571
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 4194304)) {
27434
27572
  update_slot_base(
27435
27573
  default_slot,
27436
27574
  default_slot_template,
27437
27575
  ctx,
27438
- /*$$scope*/ ctx[20],
27576
+ /*$$scope*/ ctx[22],
27439
27577
  !current
27440
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[20])
27441
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[20], dirty, null),
27578
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[22])
27579
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[22], dirty, null),
27442
27580
  null
27443
27581
  );
27444
27582
  }
@@ -27459,7 +27597,7 @@ function create_default_slot_1$7(ctx) {
27459
27597
  };
27460
27598
  }
27461
27599
 
27462
- // (82:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible} >
27600
+ // (94:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
27463
27601
  function create_default_slot$e(ctx) {
27464
27602
  let t;
27465
27603
  let current;
@@ -27489,7 +27627,7 @@ function create_default_slot$e(ctx) {
27489
27627
  };
27490
27628
  }
27491
27629
 
27492
- // (76:2)
27630
+ // (88:2)
27493
27631
  function create_input_button_slot(ctx) {
27494
27632
  let button;
27495
27633
  let eyeicon;
@@ -27520,7 +27658,7 @@ function create_input_button_slot(ctx) {
27520
27658
  current = true;
27521
27659
 
27522
27660
  if (!mounted) {
27523
- dispose = listen(button, "click", /*toggleVisibility*/ ctx[16]);
27661
+ dispose = listen(button, "click", /*toggleVisibility*/ ctx[17]);
27524
27662
  mounted = true;
27525
27663
  }
27526
27664
  },
@@ -27528,7 +27666,7 @@ function create_input_button_slot(ctx) {
27528
27666
  const eyeicon_changes = {};
27529
27667
  if (dirty & /*isVisible*/ 1024) eyeicon_changes.visible = /*isVisible*/ ctx[10];
27530
27668
 
27531
- if (dirty & /*$$scope*/ 1048576) {
27669
+ if (dirty & /*$$scope*/ 4194304) {
27532
27670
  eyeicon_changes.$$scope = { dirty, ctx };
27533
27671
  }
27534
27672
 
@@ -27552,7 +27690,7 @@ function create_input_button_slot(ctx) {
27552
27690
  };
27553
27691
  }
27554
27692
 
27555
- // (89:0) {#if callbackMetadata?.platform?.confirmPassword}
27693
+ // (101:0) {#if callbackMetadata?.platform?.confirmPassword}
27556
27694
  function create_if_block$a(ctx) {
27557
27695
  let confirminput;
27558
27696
  let current;
@@ -27562,7 +27700,8 @@ function create_if_block$a(ctx) {
27562
27700
  forceValidityFailure: /*doPasswordsMatch*/ ctx[9] === false,
27563
27701
  isInvalid: /*doPasswordsMatch*/ ctx[9] === false,
27564
27702
  key: /*key*/ ctx[0],
27565
- onChange: /*confirmInput*/ ctx[14],
27703
+ onChange: /*confirmInput*/ ctx[15],
27704
+ resetValue: /*resetValue*/ ctx[11],
27566
27705
  showMessage: /*doPasswordsMatch*/ ctx[9] === false,
27567
27706
  style: /*style*/ ctx[4]
27568
27707
  }
@@ -27581,6 +27720,7 @@ function create_if_block$a(ctx) {
27581
27720
  if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.forceValidityFailure = /*doPasswordsMatch*/ ctx[9] === false;
27582
27721
  if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.isInvalid = /*doPasswordsMatch*/ ctx[9] === false;
27583
27722
  if (dirty & /*key*/ 1) confirminput_changes.key = /*key*/ ctx[0];
27723
+ if (dirty & /*resetValue*/ 2048) confirminput_changes.resetValue = /*resetValue*/ ctx[11];
27584
27724
  if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.showMessage = /*doPasswordsMatch*/ ctx[9] === false;
27585
27725
  if (dirty & /*style*/ 16) confirminput_changes.style = /*style*/ ctx[4];
27586
27726
  confirminput.$set(confirminput_changes);
@@ -27606,20 +27746,20 @@ function create_fragment$p(ctx) {
27606
27746
  let if_block_anchor;
27607
27747
  let current;
27608
27748
 
27609
- input = new /*Input*/ ctx[13]({
27749
+ input = new /*Input*/ ctx[14]({
27610
27750
  props: {
27611
27751
  isFirstInvalidInput: /*callbackMetadata*/ ctx[1]?.derived.isFirstInvalidInput || false,
27612
27752
  hasRightIcon: true,
27613
27753
  key: /*key*/ ctx[0],
27614
- label: interpolate(textToKey(/*callbackType*/ ctx[8]), null, /*textInputLabel*/ ctx[11]),
27754
+ label: interpolate(textToKey(/*callbackType*/ ctx[8]), null, /*textInputLabel*/ ctx[12]),
27615
27755
  message: /*validationFailure*/ ctx[6] || (/*isRequired*/ ctx[3]
27616
27756
  ? interpolate('inputRequiredError')
27617
27757
  : undefined),
27618
- onChange: /*setValue*/ ctx[15],
27758
+ onChange: /*setValue*/ ctx[16],
27619
27759
  isInvalid: /*isInvalid*/ ctx[2],
27620
27760
  isRequired: /*isRequired*/ ctx[3],
27621
27761
  showMessage: /*showMessage*/ ctx[5],
27622
- type: /*type*/ ctx[12],
27762
+ type: /*type*/ ctx[13],
27623
27763
  value: typeof /*value*/ ctx[7] === 'string'
27624
27764
  ? /*value*/ ctx[7]
27625
27765
  : '',
@@ -27651,7 +27791,7 @@ function create_fragment$p(ctx) {
27651
27791
  const input_changes = {};
27652
27792
  if (dirty & /*callbackMetadata*/ 2) input_changes.isFirstInvalidInput = /*callbackMetadata*/ ctx[1]?.derived.isFirstInvalidInput || false;
27653
27793
  if (dirty & /*key*/ 1) input_changes.key = /*key*/ ctx[0];
27654
- if (dirty & /*callbackType, textInputLabel*/ 2304) input_changes.label = interpolate(textToKey(/*callbackType*/ ctx[8]), null, /*textInputLabel*/ ctx[11]);
27794
+ if (dirty & /*callbackType, textInputLabel*/ 4352) input_changes.label = interpolate(textToKey(/*callbackType*/ ctx[8]), null, /*textInputLabel*/ ctx[12]);
27655
27795
 
27656
27796
  if (dirty & /*validationFailure, isRequired*/ 72) input_changes.message = /*validationFailure*/ ctx[6] || (/*isRequired*/ ctx[3]
27657
27797
  ? interpolate('inputRequiredError')
@@ -27660,13 +27800,13 @@ function create_fragment$p(ctx) {
27660
27800
  if (dirty & /*isInvalid*/ 4) input_changes.isInvalid = /*isInvalid*/ ctx[2];
27661
27801
  if (dirty & /*isRequired*/ 8) input_changes.isRequired = /*isRequired*/ ctx[3];
27662
27802
  if (dirty & /*showMessage*/ 32) input_changes.showMessage = /*showMessage*/ ctx[5];
27663
- if (dirty & /*type*/ 4096) input_changes.type = /*type*/ ctx[12];
27803
+ if (dirty & /*type*/ 8192) input_changes.type = /*type*/ ctx[13];
27664
27804
 
27665
27805
  if (dirty & /*value*/ 128) input_changes.value = typeof /*value*/ ctx[7] === 'string'
27666
27806
  ? /*value*/ ctx[7]
27667
27807
  : '';
27668
27808
 
27669
- if (dirty & /*$$scope, isVisible*/ 1049600) {
27809
+ if (dirty & /*$$scope, isVisible*/ 4195328) {
27670
27810
  input_changes.$$scope = { dirty, ctx };
27671
27811
  }
27672
27812
 
@@ -27730,6 +27870,8 @@ function instance$p($$self, $$props, $$invalidate) {
27730
27870
  let callbackType;
27731
27871
  let doPasswordsMatch;
27732
27872
  let isVisible = false;
27873
+ let resetValue = false;
27874
+ let savedValue = '';
27733
27875
  let textInputLabel;
27734
27876
  let type = 'password';
27735
27877
  let value;
@@ -27738,8 +27880,8 @@ function instance$p($$self, $$props, $$invalidate) {
27738
27880
  * @function confirmInput - ensures the second password input matches the first
27739
27881
  * @param event
27740
27882
  */
27741
- function confirmInput(event) {
27742
- $$invalidate(18, confirmValue = event.target?.value);
27883
+ function confirmInput(val) {
27884
+ $$invalidate(19, confirmValue = val);
27743
27885
  }
27744
27886
 
27745
27887
  /**
@@ -27757,6 +27899,8 @@ function instance$p($$self, $$props, $$invalidate) {
27757
27899
  * for writing values to the callbacks received from AM
27758
27900
  *********************************************************************** */
27759
27901
  callback.setInputValue(value);
27902
+
27903
+ $$invalidate(20, savedValue = String(value));
27760
27904
  }
27761
27905
 
27762
27906
  /**
@@ -27764,11 +27908,11 @@ function instance$p($$self, $$props, $$invalidate) {
27764
27908
  */
27765
27909
  function toggleVisibility() {
27766
27910
  $$invalidate(10, isVisible = !isVisible);
27767
- $$invalidate(12, type = isVisible ? 'text' : 'password');
27911
+ $$invalidate(13, type = isVisible ? 'text' : 'password');
27768
27912
  }
27769
27913
 
27770
27914
  $$self.$$set = $$props => {
27771
- if ('callback' in $$props) $$invalidate(17, callback = $$props.callback);
27915
+ if ('callback' in $$props) $$invalidate(18, callback = $$props.callback);
27772
27916
  if ('callbackMetadata' in $$props) $$invalidate(1, callbackMetadata = $$props.callbackMetadata);
27773
27917
  if ('key' in $$props) $$invalidate(0, key = $$props.key);
27774
27918
  if ('isInvalid' in $$props) $$invalidate(2, isInvalid = $$props.isInvalid);
@@ -27776,18 +27920,28 @@ function instance$p($$self, $$props, $$invalidate) {
27776
27920
  if ('style' in $$props) $$invalidate(4, style = $$props.style);
27777
27921
  if ('showMessage' in $$props) $$invalidate(5, showMessage = $$props.showMessage);
27778
27922
  if ('validationFailure' in $$props) $$invalidate(6, validationFailure = $$props.validationFailure);
27779
- if ('$$scope' in $$props) $$invalidate(20, $$scope = $$props.$$scope);
27923
+ if ('$$scope' in $$props) $$invalidate(22, $$scope = $$props.$$scope);
27780
27924
  };
27781
27925
 
27782
27926
  $$self.$$.update = () => {
27783
- if ($$self.$$.dirty & /*callback, callbackMetadata, confirmValue, value*/ 393346) {
27927
+ if ($$self.$$.dirty & /*callback, callbackMetadata, savedValue, value, confirmValue*/ 1835138) {
27784
27928
  {
27785
27929
  $$invalidate(8, callbackType = callback.getType());
27786
27930
  $$invalidate(0, key = callback?.payload?.input?.[0].name || `password-${callbackMetadata?.idx}`);
27787
- $$invalidate(11, textInputLabel = callback.getPrompt());
27931
+ $$invalidate(12, textInputLabel = callback.getPrompt());
27788
27932
  $$invalidate(7, value = callback?.getInputValue());
27789
27933
 
27790
- // Only assign a boolean if the confirm input has an actual value
27934
+ /**
27935
+ * `savedValue` represents what the user set after blur (local component state)
27936
+ * `value` represents what's in the callback (empties from AM response)
27937
+ *
27938
+ * This unique combination is what produces the most reliable reset flag
27939
+ */
27940
+ $$invalidate(11, resetValue = !!savedValue && value === '');
27941
+
27942
+ /**
27943
+ * Only assign a boolean if the confirm input has an actual value.
27944
+ */
27791
27945
  $$invalidate(9, doPasswordsMatch = confirmValue !== undefined
27792
27946
  ? confirmValue === value
27793
27947
  : undefined);
@@ -27807,6 +27961,7 @@ function instance$p($$self, $$props, $$invalidate) {
27807
27961
  callbackType,
27808
27962
  doPasswordsMatch,
27809
27963
  isVisible,
27964
+ resetValue,
27810
27965
  textInputLabel,
27811
27966
  type,
27812
27967
  Input,
@@ -27815,6 +27970,7 @@ function instance$p($$self, $$props, $$invalidate) {
27815
27970
  toggleVisibility,
27816
27971
  callback,
27817
27972
  confirmValue,
27973
+ savedValue,
27818
27974
  slots,
27819
27975
  $$scope
27820
27976
  ];
@@ -27825,7 +27981,7 @@ class Base extends SvelteComponent {
27825
27981
  super();
27826
27982
 
27827
27983
  init(this, options, instance$p, create_fragment$p, safe_not_equal, {
27828
- callback: 17,
27984
+ callback: 18,
27829
27985
  callbackMetadata: 1,
27830
27986
  key: 0,
27831
27987
  isInvalid: 2,