@mj-biz-apps/orders-ng 5.20.0 → 5.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/checkout-element/main.js +1396 -134
  2. package/dist/lib/checkout-widget/checkout-account.d.ts +35 -0
  3. package/dist/lib/checkout-widget/checkout-account.d.ts.map +1 -0
  4. package/dist/lib/checkout-widget/checkout-account.js +67 -0
  5. package/dist/lib/checkout-widget/checkout-account.js.map +1 -0
  6. package/dist/lib/checkout-widget/checkout-events.d.ts +52 -0
  7. package/dist/lib/checkout-widget/checkout-events.d.ts.map +1 -0
  8. package/dist/lib/checkout-widget/checkout-events.js +39 -0
  9. package/dist/lib/checkout-widget/checkout-events.js.map +1 -0
  10. package/dist/lib/checkout-widget/checkout-public-host.component.d.ts +80 -0
  11. package/dist/lib/checkout-widget/checkout-public-host.component.d.ts.map +1 -1
  12. package/dist/lib/checkout-widget/checkout-public-host.component.js +429 -17
  13. package/dist/lib/checkout-widget/checkout-public-host.component.js.map +1 -1
  14. package/dist/lib/checkout-widget/checkout-widget.component.d.ts +18 -1
  15. package/dist/lib/checkout-widget/checkout-widget.component.d.ts.map +1 -1
  16. package/dist/lib/checkout-widget/checkout-widget.component.js +160 -23
  17. package/dist/lib/checkout-widget/checkout-widget.component.js.map +1 -1
  18. package/dist/lib/form-panels/document-forms.module.d.ts +19 -17
  19. package/dist/lib/form-panels/document-forms.module.d.ts.map +1 -1
  20. package/dist/lib/form-panels/document-forms.module.js +8 -0
  21. package/dist/lib/form-panels/document-forms.module.js.map +1 -1
  22. package/dist/lib/form-panels/order-access-overrides.panel.d.ts +41 -0
  23. package/dist/lib/form-panels/order-access-overrides.panel.d.ts.map +1 -0
  24. package/dist/lib/form-panels/order-access-overrides.panel.js +366 -0
  25. package/dist/lib/form-panels/order-access-overrides.panel.js.map +1 -0
  26. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.d.ts.map +1 -1
  27. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.js +24 -5
  28. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.js.map +1 -1
  29. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSessionStep/mjbizappsorderscheckoutsessionstep.form.component.d.ts +10 -0
  30. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSessionStep/mjbizappsorderscheckoutsessionstep.form.component.d.ts.map +1 -0
  31. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSessionStep/mjbizappsorderscheckoutsessionstep.form.component.js +77 -0
  32. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSessionStep/mjbizappsorderscheckoutsessionstep.form.component.js.map +1 -0
  33. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementAccessOverride/mjbizappsordersentitlementaccessoverride.form.component.d.ts +10 -0
  34. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementAccessOverride/mjbizappsordersentitlementaccessoverride.form.component.d.ts.map +1 -0
  35. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementAccessOverride/mjbizappsordersentitlementaccessoverride.form.component.js +79 -0
  36. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementAccessOverride/mjbizappsordersentitlementaccessoverride.form.component.js.map +1 -0
  37. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementGrant/mjbizappsordersentitlementgrant.form.component.d.ts.map +1 -1
  38. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementGrant/mjbizappsordersentitlementgrant.form.component.js +25 -6
  39. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementGrant/mjbizappsordersentitlementgrant.form.component.js.map +1 -1
  40. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCheckoutAnswer/mjbizappsordersordercheckoutanswer.form.component.d.ts +10 -0
  41. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCheckoutAnswer/mjbizappsordersordercheckoutanswer.form.component.d.ts.map +1 -0
  42. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCheckoutAnswer/mjbizappsordersordercheckoutanswer.form.component.js +65 -0
  43. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCheckoutAnswer/mjbizappsordersordercheckoutanswer.form.component.js.map +1 -0
  44. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.d.ts.map +1 -1
  45. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js +70 -16
  46. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js.map +1 -1
  47. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.d.ts.map +1 -1
  48. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.js +34 -16
  49. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.js.map +1 -1
  50. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLineChoice/mjbizappsordersorderlinechoice.form.component.d.ts +10 -0
  51. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLineChoice/mjbizappsordersorderlinechoice.form.component.d.ts.map +1 -0
  52. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLineChoice/mjbizappsordersorderlinechoice.form.component.js +65 -0
  53. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLineChoice/mjbizappsordersorderlinechoice.form.component.js.map +1 -0
  54. package/dist/lib/generated/Entities/mjBizAppsOrdersOutboundDelivery/mjbizappsordersoutbounddelivery.form.component.d.ts +10 -0
  55. package/dist/lib/generated/Entities/mjBizAppsOrdersOutboundDelivery/mjbizappsordersoutbounddelivery.form.component.d.ts.map +1 -0
  56. package/dist/lib/generated/Entities/mjBizAppsOrdersOutboundDelivery/mjbizappsordersoutbounddelivery.form.component.js +77 -0
  57. package/dist/lib/generated/Entities/mjBizAppsOrdersOutboundDelivery/mjbizappsordersoutbounddelivery.form.component.js.map +1 -0
  58. package/dist/lib/generated/Entities/mjBizAppsOrdersOutboundEvent/mjbizappsordersoutboundevent.form.component.d.ts +10 -0
  59. package/dist/lib/generated/Entities/mjBizAppsOrdersOutboundEvent/mjbizappsordersoutboundevent.form.component.d.ts.map +1 -0
  60. package/dist/lib/generated/Entities/mjBizAppsOrdersOutboundEvent/mjbizappsordersoutboundevent.form.component.js +84 -0
  61. package/dist/lib/generated/Entities/mjBizAppsOrdersOutboundEvent/mjbizappsordersoutboundevent.form.component.js.map +1 -0
  62. package/dist/lib/generated/Entities/mjBizAppsOrdersProductEntitlement/mjbizappsordersproductentitlement.form.component.d.ts.map +1 -1
  63. package/dist/lib/generated/Entities/mjBizAppsOrdersProductEntitlement/mjbizappsordersproductentitlement.form.component.js +20 -10
  64. package/dist/lib/generated/Entities/mjBizAppsOrdersProductEntitlement/mjbizappsordersproductentitlement.form.component.js.map +1 -1
  65. package/dist/lib/generated/generated-forms.module.d.ts +88 -82
  66. package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
  67. package/dist/lib/generated/generated-forms.module.js +22 -4
  68. package/dist/lib/generated/generated-forms.module.js.map +1 -1
  69. package/package.json +2 -2
@@ -5199,13 +5199,13 @@ function createRuntimeError(message, code, path) {
5199
5199
  function getRuntimeErrorCode(error) {
5200
5200
  return error[NG_RUNTIME_ERROR_CODE];
5201
5201
  }
5202
- function formatErrorMessage(text, code, path = [], source = null) {
5202
+ function formatErrorMessage(text2, code, path = [], source = null) {
5203
5203
  let pathDetails = "";
5204
5204
  if (path && path.length > 1) {
5205
5205
  pathDetails = ` Path: ${path.join(" -> ")}.`;
5206
5206
  }
5207
5207
  const sourceDetails = source ? ` Source: ${source}.` : "";
5208
- return formatRuntimeError(code, `${text}${sourceDetails}${pathDetails}`);
5208
+ return formatRuntimeError(code, `${text2}${sourceDetails}${pathDetails}`);
5209
5209
  }
5210
5210
  var _injectImplementation;
5211
5211
  function getInjectImplementation() {
@@ -7930,16 +7930,16 @@ var NodeInjectorFactory = class {
7930
7930
  }
7931
7931
  };
7932
7932
  function toTNodeTypeAsString(tNodeType) {
7933
- let text = "";
7934
- tNodeType & 1 && (text += "|Text");
7935
- tNodeType & 2 && (text += "|Element");
7936
- tNodeType & 4 && (text += "|Container");
7937
- tNodeType & 8 && (text += "|ElementContainer");
7938
- tNodeType & 16 && (text += "|Projection");
7939
- tNodeType & 32 && (text += "|IcuContainer");
7940
- tNodeType & 64 && (text += "|Placeholder");
7941
- tNodeType & 128 && (text += "|LetDeclaration");
7942
- return text.length > 0 ? text.substring(1) : text;
7933
+ let text2 = "";
7934
+ tNodeType & 1 && (text2 += "|Text");
7935
+ tNodeType & 2 && (text2 += "|Element");
7936
+ tNodeType & 4 && (text2 += "|Container");
7937
+ tNodeType & 8 && (text2 += "|ElementContainer");
7938
+ tNodeType & 16 && (text2 += "|Projection");
7939
+ tNodeType & 32 && (text2 += "|IcuContainer");
7940
+ tNodeType & 64 && (text2 += "|Placeholder");
7941
+ tNodeType & 128 && (text2 += "|LetDeclaration");
7942
+ return text2.length > 0 ? text2.substring(1) : text2;
7943
7943
  }
7944
7944
  function isTNodeShape(value) {
7945
7945
  return value != null && typeof value === "object" && (value.insertBeforeIndex === null || typeof value.insertBeforeIndex === "number" || Array.isArray(value.insertBeforeIndex));
@@ -9988,7 +9988,7 @@ var COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;
9988
9988
  var COMMENT_DELIMITER = /(<|>)/g;
9989
9989
  var COMMENT_DELIMITER_ESCAPED = "\u200B$1\u200B";
9990
9990
  function escapeCommentText(value) {
9991
- return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
9991
+ return value.replace(COMMENT_DISALLOWED, (text2) => text2.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
9992
9992
  }
9993
9993
  function createTextNode(renderer, value) {
9994
9994
  return renderer.createText(value);
@@ -20222,14 +20222,14 @@ function applyCreateOpCodes(lView, createOpCodes, parentRNode, insertInFrontOf)
20222
20222
  const renderer = lView[RENDERER];
20223
20223
  for (let i = 0; i < createOpCodes.length; i++) {
20224
20224
  const opCode = createOpCodes[i++];
20225
- const text = createOpCodes[i];
20225
+ const text2 = createOpCodes[i];
20226
20226
  const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;
20227
20227
  const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;
20228
20228
  const index = opCode >>> I18nCreateOpCode.SHIFT;
20229
20229
  let rNode = lView[index];
20230
20230
  let lastNodeWasCreated2 = false;
20231
20231
  if (rNode === null) {
20232
- rNode = lView[index] = _locateOrCreateNode(lView, index, text, isComment ? Node.COMMENT_NODE : Node.TEXT_NODE);
20232
+ rNode = lView[index] = _locateOrCreateNode(lView, index, text2, isComment ? Node.COMMENT_NODE : Node.TEXT_NODE);
20233
20233
  lastNodeWasCreated2 = wasLastNodeCreated();
20234
20234
  }
20235
20235
  if (appendNow && parentRNode !== null && lastNodeWasCreated2) {
@@ -20446,11 +20446,11 @@ function i18nCreateOpCodesToString(opcodes) {
20446
20446
  let lines = [];
20447
20447
  for (let i = 0; i < createOpCodes.length; i++) {
20448
20448
  const opCode = createOpCodes[i++];
20449
- const text = createOpCodes[i];
20449
+ const text2 = createOpCodes[i];
20450
20450
  const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;
20451
20451
  const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;
20452
20452
  const index = opCode >>> I18nCreateOpCode.SHIFT;
20453
- lines.push(`lView[${index}] = document.${isComment ? "createComment" : "createText"}(${JSON.stringify(text)});`);
20453
+ lines.push(`lView[${index}] = document.${isComment ? "createComment" : "createText"}(${JSON.stringify(text2)});`);
20454
20454
  if (appendNow) {
20455
20455
  lines.push(`parent.appendChild(lView[${index}]);`);
20456
20456
  }
@@ -20518,13 +20518,13 @@ function icuCreateOpCodesToString(opcodes) {
20518
20518
  while (parser.hasMore()) {
20519
20519
  let value = parser.consumeNumberStringOrMarker();
20520
20520
  if (value === ICU_MARKER) {
20521
- const text = parser.consumeString();
20521
+ const text2 = parser.consumeString();
20522
20522
  lastRef = parser.consumeNumber();
20523
- lines.push(`lView[${lastRef}] = document.createComment("${text}")`);
20523
+ lines.push(`lView[${lastRef}] = document.createComment("${text2}")`);
20524
20524
  } else if (value === ELEMENT_MARKER) {
20525
- const text = parser.consumeString();
20525
+ const text2 = parser.consumeString();
20526
20526
  lastRef = parser.consumeNumber();
20527
- lines.push(`lView[${lastRef}] = document.createElement("${text}")`);
20527
+ lines.push(`lView[${lastRef}] = document.createElement("${text2}")`);
20528
20528
  } else if (typeof value === "string") {
20529
20529
  lastRef = parser.consumeNumber();
20530
20530
  lines.push(`lView[${lastRef}] = document.createTextNode("${value}")`);
@@ -20633,10 +20633,10 @@ function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message
20633
20633
  for (let j = 0; j < parts.length; j++) {
20634
20634
  let part = parts[j];
20635
20635
  if ((j & 1) === 0) {
20636
- const text = part;
20637
- ngDevMode && assertString(text, "Parsed ICU part should be string");
20638
- if (text !== "") {
20639
- i18nStartFirstCreatePassProcessTextNode(astStack[0], tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text);
20636
+ const text2 = part;
20637
+ ngDevMode && assertString(text2, "Parsed ICU part should be string");
20638
+ if (text2 !== "") {
20639
+ i18nStartFirstCreatePassProcessTextNode(astStack[0], tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text2);
20640
20640
  }
20641
20641
  } else {
20642
20642
  const icuExpression = part;
@@ -20680,7 +20680,7 @@ function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message
20680
20680
  parentTNodeIndex
20681
20681
  };
20682
20682
  }
20683
- function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {
20683
+ function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text2, isICU) {
20684
20684
  const i18nNodeIdx = allocExpando(tView, lView, 1, null);
20685
20685
  let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;
20686
20686
  let parentTNode = getCurrentParentTNode();
@@ -20694,8 +20694,8 @@ function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, create
20694
20694
  opCode |= I18nCreateOpCode.COMMENT;
20695
20695
  ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);
20696
20696
  }
20697
- createOpCodes.push(opCode, text === null ? "" : text);
20698
- const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 : 1, text === null ? ngDevMode ? "{{?}}" : "" : text, null);
20697
+ createOpCodes.push(opCode, text2 === null ? "" : text2);
20698
+ const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 : 1, text2 === null ? ngDevMode ? "{{?}}" : "" : text2, null);
20699
20699
  addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);
20700
20700
  const tNodeIdx = tNode.index;
20701
20701
  setCurrentTNode(tNode, false);
@@ -20704,12 +20704,12 @@ function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, create
20704
20704
  }
20705
20705
  return tNode;
20706
20706
  }
20707
- function i18nStartFirstCreatePassProcessTextNode(ast, tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text) {
20708
- const hasBinding = text.match(BINDING_REGEXP);
20709
- const tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text, false);
20707
+ function i18nStartFirstCreatePassProcessTextNode(ast, tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text2) {
20708
+ const hasBinding = text2.match(BINDING_REGEXP);
20709
+ const tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text2, false);
20710
20710
  const index = tNode.index;
20711
20711
  if (hasBinding) {
20712
- generateBindingUpdateOpCodes(updateOpCodes, text, index, null, 0, null);
20712
+ generateBindingUpdateOpCodes(updateOpCodes, text2, index, null, 0, null);
20713
20713
  }
20714
20714
  ast.push({
20715
20715
  kind: 0,
@@ -21030,11 +21030,11 @@ function addUpdateIcuSwitch(update, icuExpression, index) {
21030
21030
  function addUpdateIcuUpdate(update, bindingMask, index) {
21031
21031
  update.push(bindingMask, 1, index << 2 | 3);
21032
21032
  }
21033
- function addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createAtIdx) {
21033
+ function addCreateNodeAndAppend(create, marker, text2, appendToParentIdx, createAtIdx) {
21034
21034
  if (marker !== null) {
21035
21035
  create.push(marker);
21036
21036
  }
21037
- create.push(text, createAtIdx, icuCreateOpCode(0, appendToParentIdx, createAtIdx));
21037
+ create.push(text2, createAtIdx, icuCreateOpCode(0, appendToParentIdx, createAtIdx));
21038
21038
  }
21039
21039
  function addCreateAttribute(create, newIndex, attr) {
21040
21040
  create.push(newIndex << 1 | 1, attr.name, attr.value);
@@ -21464,90 +21464,90 @@ var parserState = {
21464
21464
  value: 0,
21465
21465
  valueEnd: 0
21466
21466
  };
21467
- function getLastParsedKey(text) {
21468
- return text.substring(parserState.key, parserState.keyEnd);
21467
+ function getLastParsedKey(text2) {
21468
+ return text2.substring(parserState.key, parserState.keyEnd);
21469
21469
  }
21470
- function getLastParsedValue(text) {
21471
- return text.substring(parserState.value, parserState.valueEnd);
21470
+ function getLastParsedValue(text2) {
21471
+ return text2.substring(parserState.value, parserState.valueEnd);
21472
21472
  }
21473
- function parseClassName(text) {
21474
- resetParserState(text);
21475
- return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));
21473
+ function parseClassName(text2) {
21474
+ resetParserState(text2);
21475
+ return parseClassNameNext(text2, consumeWhitespace(text2, 0, parserState.textEnd));
21476
21476
  }
21477
- function parseClassNameNext(text, index) {
21477
+ function parseClassNameNext(text2, index) {
21478
21478
  const end = parserState.textEnd;
21479
21479
  if (end === index) {
21480
21480
  return -1;
21481
21481
  }
21482
- index = parserState.keyEnd = consumeClassToken(text, parserState.key = index, end);
21483
- return consumeWhitespace(text, index, end);
21482
+ index = parserState.keyEnd = consumeClassToken(text2, parserState.key = index, end);
21483
+ return consumeWhitespace(text2, index, end);
21484
21484
  }
21485
- function parseStyle(text) {
21486
- resetParserState(text);
21487
- return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));
21485
+ function parseStyle(text2) {
21486
+ resetParserState(text2);
21487
+ return parseStyleNext(text2, consumeWhitespace(text2, 0, parserState.textEnd));
21488
21488
  }
21489
- function parseStyleNext(text, startIndex) {
21489
+ function parseStyleNext(text2, startIndex) {
21490
21490
  const end = parserState.textEnd;
21491
- let index = parserState.key = consumeWhitespace(text, startIndex, end);
21491
+ let index = parserState.key = consumeWhitespace(text2, startIndex, end);
21492
21492
  if (end === index) {
21493
21493
  return -1;
21494
21494
  }
21495
- index = parserState.keyEnd = consumeStyleKey(text, index, end);
21496
- index = consumeSeparator(text, index, end, 58);
21497
- index = parserState.value = consumeWhitespace(text, index, end);
21498
- index = parserState.valueEnd = consumeStyleValue(text, index, end);
21499
- return consumeSeparator(text, index, end, 59);
21495
+ index = parserState.keyEnd = consumeStyleKey(text2, index, end);
21496
+ index = consumeSeparator(text2, index, end, 58);
21497
+ index = parserState.value = consumeWhitespace(text2, index, end);
21498
+ index = parserState.valueEnd = consumeStyleValue(text2, index, end);
21499
+ return consumeSeparator(text2, index, end, 59);
21500
21500
  }
21501
- function resetParserState(text) {
21501
+ function resetParserState(text2) {
21502
21502
  parserState.key = 0;
21503
21503
  parserState.keyEnd = 0;
21504
21504
  parserState.value = 0;
21505
21505
  parserState.valueEnd = 0;
21506
- parserState.textEnd = text.length;
21506
+ parserState.textEnd = text2.length;
21507
21507
  }
21508
- function consumeWhitespace(text, startIndex, endIndex) {
21509
- while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32) {
21508
+ function consumeWhitespace(text2, startIndex, endIndex) {
21509
+ while (startIndex < endIndex && text2.charCodeAt(startIndex) <= 32) {
21510
21510
  startIndex++;
21511
21511
  }
21512
21512
  return startIndex;
21513
21513
  }
21514
- function consumeClassToken(text, startIndex, endIndex) {
21515
- while (startIndex < endIndex && text.charCodeAt(startIndex) > 32) {
21514
+ function consumeClassToken(text2, startIndex, endIndex) {
21515
+ while (startIndex < endIndex && text2.charCodeAt(startIndex) > 32) {
21516
21516
  startIndex++;
21517
21517
  }
21518
21518
  return startIndex;
21519
21519
  }
21520
- function consumeStyleKey(text, startIndex, endIndex) {
21520
+ function consumeStyleKey(text2, startIndex, endIndex) {
21521
21521
  let ch;
21522
- while (startIndex < endIndex && ((ch = text.charCodeAt(startIndex)) === 45 || ch === 95 || (ch & -33) >= 65 && (ch & -33) <= 90 || ch >= 48 && ch <= 57)) {
21522
+ while (startIndex < endIndex && ((ch = text2.charCodeAt(startIndex)) === 45 || ch === 95 || (ch & -33) >= 65 && (ch & -33) <= 90 || ch >= 48 && ch <= 57)) {
21523
21523
  startIndex++;
21524
21524
  }
21525
21525
  return startIndex;
21526
21526
  }
21527
- function consumeSeparator(text, startIndex, endIndex, separator) {
21528
- startIndex = consumeWhitespace(text, startIndex, endIndex);
21527
+ function consumeSeparator(text2, startIndex, endIndex, separator) {
21528
+ startIndex = consumeWhitespace(text2, startIndex, endIndex);
21529
21529
  if (startIndex < endIndex) {
21530
- if (ngDevMode && text.charCodeAt(startIndex) !== separator) {
21531
- malformedStyleError(text, String.fromCharCode(separator), startIndex);
21530
+ if (ngDevMode && text2.charCodeAt(startIndex) !== separator) {
21531
+ malformedStyleError(text2, String.fromCharCode(separator), startIndex);
21532
21532
  }
21533
21533
  startIndex++;
21534
21534
  }
21535
21535
  return startIndex;
21536
21536
  }
21537
- function consumeStyleValue(text, startIndex, endIndex) {
21537
+ function consumeStyleValue(text2, startIndex, endIndex) {
21538
21538
  let ch1 = -1;
21539
21539
  let ch2 = -1;
21540
21540
  let ch3 = -1;
21541
21541
  let i = startIndex;
21542
21542
  let lastChIndex = i;
21543
21543
  while (i < endIndex) {
21544
- const ch = text.charCodeAt(i++);
21544
+ const ch = text2.charCodeAt(i++);
21545
21545
  if (ch === 59) {
21546
21546
  return lastChIndex;
21547
21547
  } else if (ch === 34 || ch === 39) {
21548
- lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);
21548
+ lastChIndex = i = consumeQuotedText(text2, ch, i, endIndex);
21549
21549
  } else if (startIndex === i - 4 && ch3 === 85 && ch2 === 82 && ch1 === 76 && ch === 40) {
21550
- lastChIndex = i = consumeQuotedText(text, 41, i, endIndex);
21550
+ lastChIndex = i = consumeQuotedText(text2, 41, i, endIndex);
21551
21551
  } else if (ch > 32) {
21552
21552
  lastChIndex = i;
21553
21553
  }
@@ -21557,11 +21557,11 @@ function consumeStyleValue(text, startIndex, endIndex) {
21557
21557
  }
21558
21558
  return lastChIndex;
21559
21559
  }
21560
- function consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {
21560
+ function consumeQuotedText(text2, quoteCharCode, startIndex, endIndex) {
21561
21561
  let ch1 = -1;
21562
21562
  let index = startIndex;
21563
21563
  while (index < endIndex) {
21564
- const ch = text.charCodeAt(index++);
21564
+ const ch = text2.charCodeAt(index++);
21565
21565
  if (ch == quoteCharCode && ch1 !== 92) {
21566
21566
  return index;
21567
21567
  }
@@ -21571,11 +21571,11 @@ function consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {
21571
21571
  ch1 = ch;
21572
21572
  }
21573
21573
  }
21574
- throw ngDevMode ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex) : new Error();
21574
+ throw ngDevMode ? malformedStyleError(text2, String.fromCharCode(quoteCharCode), endIndex) : new Error();
21575
21575
  }
21576
- function malformedStyleError(text, expecting, index) {
21577
- ngDevMode && assertEqual(typeof text === "string", true, "String expected here");
21578
- throw throwError(`Malformed style at location ${index} in string '` + text.substring(0, index) + "[>>" + text.substring(index, index + 1) + "<<]" + text.slice(index + 1) + `'. Expecting '${expecting}'.`);
21576
+ function malformedStyleError(text2, expecting, index) {
21577
+ ngDevMode && assertEqual(typeof text2 === "string", true, "String expected here");
21578
+ throw throwError(`Malformed style at location ${index} in string '` + text2.substring(0, index) + "[>>" + text2.substring(index, index + 1) + "<<]" + text2.slice(index + 1) + `'. Expecting '${expecting}'.`);
21579
21579
  }
21580
21580
  function \u0275\u0275styleProp(prop, value, suffix) {
21581
21581
  checkStylingProperty(prop, value, suffix, false);
@@ -21588,17 +21588,17 @@ function \u0275\u0275classProp(className, value) {
21588
21588
  function \u0275\u0275styleMap(styles) {
21589
21589
  checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);
21590
21590
  }
21591
- function styleStringParser(keyValueArray, text) {
21592
- for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) {
21593
- styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));
21591
+ function styleStringParser(keyValueArray, text2) {
21592
+ for (let i = parseStyle(text2); i >= 0; i = parseStyleNext(text2, i)) {
21593
+ styleKeyValueArraySet(keyValueArray, getLastParsedKey(text2), getLastParsedValue(text2));
21594
21594
  }
21595
21595
  }
21596
21596
  function \u0275\u0275classMap(classes) {
21597
21597
  checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);
21598
21598
  }
21599
- function classStringParser(keyValueArray, text) {
21600
- for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {
21601
- keyValueArraySet(keyValueArray, getLastParsedKey(text), true);
21599
+ function classStringParser(keyValueArray, text2) {
21600
+ for (let i = parseClassName(text2); i >= 0; i = parseClassNameNext(text2, i)) {
21601
+ keyValueArraySet(keyValueArray, getLastParsedKey(text2), true);
21602
21602
  }
21603
21603
  }
21604
21604
  function checkStylingProperty(prop, value, suffix, isClassBased) {
@@ -26356,12 +26356,12 @@ function formatDate(value, format, locale, timezone) {
26356
26356
  dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
26357
26357
  date = convertTimezoneToLocal(date, timezone);
26358
26358
  }
26359
- let text = "";
26359
+ let text2 = "";
26360
26360
  parts.forEach((value2) => {
26361
26361
  const dateFormatter = getDateFormatter(value2);
26362
- text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value2 === "''" ? "'" : value2.replace(/(^'|'$)/g, "").replace(/''/g, "'");
26362
+ text2 += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value2 === "''" ? "'" : value2.replace(/(^'|'$)/g, "").replace(/''/g, "'");
26363
26363
  });
26364
- return text;
26364
+ return text2;
26365
26365
  }
26366
26366
  function assertValidDateFormat(parts) {
26367
26367
  if (parts.some((part) => /^Y+$/.test(part)) && !parts.some((part) => /^w+$/.test(part))) {
@@ -27136,10 +27136,10 @@ function roundNumber(parsedNumber, minFrac, maxFrac) {
27136
27136
  parsedNumber.integerLen++;
27137
27137
  }
27138
27138
  }
27139
- function parseIntAutoRadix(text) {
27140
- const result = parseInt(text);
27139
+ function parseIntAutoRadix(text2) {
27140
+ const result = parseInt(text2);
27141
27141
  if (isNaN(result)) {
27142
- throw new RuntimeError(2305, ngDevMode && "Invalid integer literal when parsing " + text);
27142
+ throw new RuntimeError(2305, ngDevMode && "Invalid integer literal when parsing " + text2);
27143
27143
  }
27144
27144
  return result;
27145
27145
  }
@@ -31679,6 +31679,78 @@ function createCustomElement(component, config2) {
31679
31679
  return NgElementImpl;
31680
31680
  }
31681
31681
 
31682
+ // dist/lib/checkout-widget/checkout-account.js
31683
+ var ACCOUNT_STEP_FAILED = { Outcome: "Failed", CanSetPassword: false };
31684
+ function ReadCheckoutAccount(raw) {
31685
+ if (!raw || typeof raw !== "object")
31686
+ return null;
31687
+ const a = raw;
31688
+ if (a["Outcome"] !== "Created" && a["Outcome"] !== "Exists" && a["Outcome"] !== "Failed")
31689
+ return null;
31690
+ return {
31691
+ Outcome: a["Outcome"],
31692
+ Message: typeof a["Message"] === "string" && a["Message"] ? a["Message"] : void 0,
31693
+ CanSetPassword: a["CanSetPassword"] === true,
31694
+ VerificationRequired: a["Outcome"] === "Created" && a["VerificationRequired"] === true
31695
+ };
31696
+ }
31697
+ var VERIFY_NOTE = "We are sending a link to your e-mail. Use it to verify your account before you sign in.";
31698
+ function VerificationNote(account) {
31699
+ return account?.VerificationRequired ? VERIFY_NOTE : null;
31700
+ }
31701
+ function AccountMessage(account, passwordSet) {
31702
+ if (passwordSet) {
31703
+ return account.VerificationRequired ? "Your password is set. Check your e-mail for the link to verify your account, then sign in with the e-mail you used here." : "Your password is set. You can now sign in with the e-mail you used here.";
31704
+ }
31705
+ if (account.Message)
31706
+ return account.Message;
31707
+ if (account.Outcome === "Exists")
31708
+ return "You already have an account with this e-mail. Sign in, or reset your password if you have forgotten it.";
31709
+ if (account.Outcome === "Failed")
31710
+ return "We could not set up your account just now. Your order is confirmed. Please try again in a moment.";
31711
+ return VerificationNote(account);
31712
+ }
31713
+ function CheckPasswordEntry(password, confirmation) {
31714
+ if (!password)
31715
+ return "Please enter a password.";
31716
+ if (password !== confirmation)
31717
+ return "The two passwords do not match.";
31718
+ return null;
31719
+ }
31720
+ function MayRedirect(account, dismissed = false) {
31721
+ if (dismissed || !account)
31722
+ return true;
31723
+ return !account.CanSetPassword && account.Outcome !== "Failed";
31724
+ }
31725
+ function IsAccountSettled(account) {
31726
+ return !account || account.Outcome !== "Failed" && !account.CanSetPassword;
31727
+ }
31728
+
31729
+ // dist/lib/checkout-widget/checkout-events.js
31730
+ var CHECKOUT_STATE_CHANGE_EVENT = "checkout-state-change";
31731
+ var CHECKOUT_COMPLETE_EVENT = "checkout-complete";
31732
+ var CHECKOUT_ERROR_EVENT = "checkout-error";
31733
+ var CHECKOUT_CANCEL_EVENT = "checkout-cancel";
31734
+ var CHECKOUT_CLOSE_EVENT = "checkout-close";
31735
+ var CHECKOUT_RESET_REQUEST_EVENT = "checkout-reset";
31736
+ var CHECKOUT_RESET_REFUSED_EVENT = "checkout-reset-refused";
31737
+ var text = (value) => typeof value === "string" && value.trim() ? value.trim() : null;
31738
+ function BuildCheckoutCompleteDetail(source) {
31739
+ const amount = typeof source.totalGross === "number" && Number.isFinite(source.totalGross) ? source.totalGross : null;
31740
+ const currency = text(source.currency);
31741
+ return {
31742
+ sessionId: source.sessionId,
31743
+ productName: text(source.productName),
31744
+ productId: text(source.productId),
31745
+ amount: amount === null ? null : Math.round(amount * 100) / 100,
31746
+ currency: currency === null ? null : currency.toUpperCase(),
31747
+ coupon: text(source.coupon)
31748
+ };
31749
+ }
31750
+ function CheckoutElementEvent(name, detail) {
31751
+ return new CustomEvent(name, { detail, bubbles: true, composed: true });
31752
+ }
31753
+
31682
31754
  // ../../node_modules/.pnpm/@angular+forms@21.1.3_@angular+common@21.1.3_@angular+core@21.1.3_@angular+compiler@21._c9921256e4e117964abeb4c1b7e7fb5a/node_modules/@angular/forms/fesm2022/forms.mjs
31683
31755
  var BaseControlValueAccessor = class _BaseControlValueAccessor {
31684
31756
  _renderer;
@@ -36331,9 +36403,116 @@ var ReactiveFormsModule = class _ReactiveFormsModule {
36331
36403
  }], null, null);
36332
36404
  })();
36333
36405
 
36406
+ // ../Entities/dist/checkout-questions.js
36407
+ var MAX_CHECKOUT_QUESTION_KEY_LENGTH = 100;
36408
+ var MAX_CHECKOUT_QUESTION_LABEL_LENGTH = 500;
36409
+ var MAX_CHECKOUT_ANSWER_LENGTH = 1e3;
36410
+ var INVALID_CHECKOUT_QUESTIONS_MESSAGE = "This checkout is not configured correctly (its questions are invalid).";
36411
+ function CheckoutQuestionOptionValue(option) {
36412
+ return typeof option === "string" ? option : option.value;
36413
+ }
36414
+ function CheckoutQuestionOptionLabel(option) {
36415
+ return typeof option === "string" ? option : option.label;
36416
+ }
36417
+ function ReadCheckoutQuestions(raw) {
36418
+ if (raw === void 0 || raw === null)
36419
+ return { Questions: [] };
36420
+ if (!Array.isArray(raw))
36421
+ return { Questions: [], Error: INVALID_CHECKOUT_QUESTIONS_MESSAGE };
36422
+ const keys = /* @__PURE__ */ new Set();
36423
+ for (const q of raw) {
36424
+ if (!IsValidQuestion(q) || keys.has(q.key)) {
36425
+ return { Questions: [], Error: INVALID_CHECKOUT_QUESTIONS_MESSAGE };
36426
+ }
36427
+ keys.add(q.key);
36428
+ }
36429
+ return { Questions: raw };
36430
+ }
36431
+ function IsValidQuestion(q) {
36432
+ if (!q || typeof q !== "object")
36433
+ return false;
36434
+ const c = q;
36435
+ if (typeof c.key !== "string" || !c.key.trim() || c.key.length > MAX_CHECKOUT_QUESTION_KEY_LENGTH)
36436
+ return false;
36437
+ if (typeof c.label !== "string" || !c.label.trim() || c.label.length > MAX_CHECKOUT_QUESTION_LABEL_LENGTH)
36438
+ return false;
36439
+ if (c.maxLength !== void 0 && (!Number.isInteger(c.maxLength) || c.maxLength < 1))
36440
+ return false;
36441
+ if (c.type === "text")
36442
+ return c.options === void 0 && c.otherOptionKey === void 0;
36443
+ if (c.type !== "select")
36444
+ return false;
36445
+ if (!Array.isArray(c.options) || c.options.length === 0)
36446
+ return false;
36447
+ const values = /* @__PURE__ */ new Set();
36448
+ for (const o of c.options) {
36449
+ const value = typeof o === "string" ? o : o && typeof o === "object" ? o.value : void 0;
36450
+ const label = typeof o === "string" ? o : o && typeof o === "object" ? o.label : void 0;
36451
+ if (typeof value !== "string" || !value || typeof label !== "string" || !label || values.has(value))
36452
+ return false;
36453
+ if (value.length > MAX_CHECKOUT_ANSWER_LENGTH)
36454
+ return false;
36455
+ values.add(value);
36456
+ }
36457
+ return c.otherOptionKey === void 0 || values.has(c.otherOptionKey);
36458
+ }
36459
+ function CheckoutAnswerMaxLength(question) {
36460
+ return Math.min(question.maxLength ?? MAX_CHECKOUT_ANSWER_LENGTH, MAX_CHECKOUT_ANSWER_LENGTH);
36461
+ }
36462
+ function CheckAnswersAgainstQuestions(questions, answers) {
36463
+ const refuse = (error) => ({ Answers: [], Error: error });
36464
+ if (answers !== void 0 && answers !== null && (typeof answers !== "object" || Array.isArray(answers))) {
36465
+ return refuse("The checkout answers could not be read.");
36466
+ }
36467
+ const input2 = answers ?? {};
36468
+ const asked = new Set(questions.map((q) => q.key));
36469
+ for (const key of Object.keys(input2)) {
36470
+ if (!asked.has(key))
36471
+ return refuse("An answer was sent for a question this checkout does not ask.");
36472
+ }
36473
+ const resolved = [];
36474
+ for (const q of questions) {
36475
+ const raw = input2[q.key];
36476
+ if (raw !== void 0 && raw !== null && (typeof raw !== "object" || Array.isArray(raw))) {
36477
+ return refuse(`The answer to "${q.label}" could not be read.`);
36478
+ }
36479
+ const entry = raw ?? {};
36480
+ const value = typeof entry.Value === "string" ? entry.Value.trim() : "";
36481
+ const otherText = typeof entry.OtherText === "string" ? entry.OtherText.trim() : "";
36482
+ if (!value) {
36483
+ if (q.required)
36484
+ return refuse(`"${q.label}" needs an answer.`);
36485
+ continue;
36486
+ }
36487
+ if (value.length > CheckoutAnswerMaxLength(q)) {
36488
+ return refuse(`The answer to "${q.label}" is too long (at most ${CheckoutAnswerMaxLength(q)} characters).`);
36489
+ }
36490
+ let recordedOther = null;
36491
+ if (q.type === "select") {
36492
+ if (!(q.options ?? []).some((o) => CheckoutQuestionOptionValue(o) === value)) {
36493
+ return refuse(`"${value}" is not one of the choices for "${q.label}".`);
36494
+ }
36495
+ if (q.otherOptionKey !== void 0 && value === q.otherOptionKey) {
36496
+ if (!otherText)
36497
+ return refuse(`Please say more about your answer to "${q.label}".`);
36498
+ if (otherText.length > MAX_CHECKOUT_ANSWER_LENGTH) {
36499
+ return refuse(`The answer to "${q.label}" is too long (at most ${MAX_CHECKOUT_ANSWER_LENGTH} characters).`);
36500
+ }
36501
+ recordedOther = otherText;
36502
+ }
36503
+ }
36504
+ resolved.push({ QuestionKey: q.key, QuestionLabel: q.label, Answer: value, OtherText: recordedOther });
36505
+ }
36506
+ return { Answers: resolved };
36507
+ }
36508
+
36334
36509
  // dist/lib/checkout-widget/checkout-widget.component.js
36335
36510
  var _forTrack0 = ($index, $item) => $item.name;
36336
36511
  var _forTrack1 = ($index, $item) => $item.value;
36512
+ var _forTrack2 = ($index, $item) => $item.key;
36513
+ function _forTrack3($index, $item) {
36514
+ return this.optionValue($item);
36515
+ }
36337
36516
  function MJCheckoutWidgetComponent_Conditional_4_Template(rf, ctx) {
36338
36517
  if (rf & 1) {
36339
36518
  \u0275\u0275elementStart(0, "p", 3);
@@ -36836,23 +37015,148 @@ function MJCheckoutWidgetComponent_Conditional_18_Template(rf, ctx) {
36836
37015
  \u0275\u0275repeater(ctx_r0.units());
36837
37016
  }
36838
37017
  }
37018
+ function MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_3_Template(rf, ctx) {
37019
+ if (rf & 1) {
37020
+ \u0275\u0275elementStart(0, "span", 28);
37021
+ \u0275\u0275text(1, "*");
37022
+ \u0275\u0275elementEnd();
37023
+ }
37024
+ }
37025
+ function MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_4_For_4_Template(rf, ctx) {
37026
+ if (rf & 1) {
37027
+ \u0275\u0275elementStart(0, "option", 37);
37028
+ \u0275\u0275text(1);
37029
+ \u0275\u0275elementEnd();
37030
+ }
37031
+ if (rf & 2) {
37032
+ const opt_r26 = ctx.$implicit;
37033
+ const ctx_r0 = \u0275\u0275nextContext(4);
37034
+ \u0275\u0275property("ngValue", ctx_r0.optionValue(opt_r26));
37035
+ \u0275\u0275advance();
37036
+ \u0275\u0275textInterpolate(ctx_r0.optionLabel(opt_r26));
37037
+ }
37038
+ }
37039
+ function MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_4_Conditional_5_Template(rf, ctx) {
37040
+ if (rf & 1) {
37041
+ const _r27 = \u0275\u0275getCurrentView();
37042
+ \u0275\u0275elementStart(0, "input", 51);
37043
+ \u0275\u0275listener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_4_Conditional_5_Template_input_ngModelChange_0_listener($event) {
37044
+ \u0275\u0275restoreView(_r27);
37045
+ const question_r25 = \u0275\u0275nextContext(2).$implicit;
37046
+ const ctx_r0 = \u0275\u0275nextContext(2);
37047
+ return \u0275\u0275resetView(ctx_r0.updateAnswer(question_r25.key, { OtherText: $event }));
37048
+ });
37049
+ \u0275\u0275elementEnd();
37050
+ }
37051
+ if (rf & 2) {
37052
+ const question_r25 = \u0275\u0275nextContext(2).$implicit;
37053
+ const ctx_r0 = \u0275\u0275nextContext(2);
37054
+ \u0275\u0275property("ngModel", ctx_r0.answerFor(question_r25.key).OtherText ?? "");
37055
+ \u0275\u0275attribute("aria-label", question_r25.label + " (please specify)")("maxlength", ctx_r0.answerMaxLength(question_r25));
37056
+ }
37057
+ }
37058
+ function MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_4_Template(rf, ctx) {
37059
+ if (rf & 1) {
37060
+ const _r24 = \u0275\u0275getCurrentView();
37061
+ \u0275\u0275elementStart(0, "select", 49);
37062
+ \u0275\u0275listener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_4_Template_select_ngModelChange_0_listener($event) {
37063
+ \u0275\u0275restoreView(_r24);
37064
+ const question_r25 = \u0275\u0275nextContext().$implicit;
37065
+ const ctx_r0 = \u0275\u0275nextContext(2);
37066
+ return \u0275\u0275resetView(ctx_r0.updateAnswer(question_r25.key, { Value: $event }));
37067
+ });
37068
+ \u0275\u0275elementStart(1, "option", 37);
37069
+ \u0275\u0275text(2, "Select an answer");
37070
+ \u0275\u0275elementEnd();
37071
+ \u0275\u0275repeaterCreate(3, MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_4_For_4_Template, 2, 2, "option", 37, _forTrack3, true);
37072
+ \u0275\u0275elementEnd();
37073
+ \u0275\u0275conditionalCreate(5, MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_4_Conditional_5_Template, 1, 3, "input", 50);
37074
+ }
37075
+ if (rf & 2) {
37076
+ const question_r25 = \u0275\u0275nextContext().$implicit;
37077
+ const ctx_r0 = \u0275\u0275nextContext(2);
37078
+ \u0275\u0275property("id", ctx_r0.widgetInstanceId + "-q-" + question_r25.key)("ngModel", ctx_r0.answerFor(question_r25.key).Value ?? "")("required", question_r25.required || false);
37079
+ \u0275\u0275advance();
37080
+ \u0275\u0275property("ngValue", "");
37081
+ \u0275\u0275advance(2);
37082
+ \u0275\u0275repeater(question_r25.options);
37083
+ \u0275\u0275advance(2);
37084
+ \u0275\u0275conditional(ctx_r0.isOtherChosen(question_r25) ? 5 : -1);
37085
+ }
37086
+ }
37087
+ function MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_5_Template(rf, ctx) {
37088
+ if (rf & 1) {
37089
+ const _r28 = \u0275\u0275getCurrentView();
37090
+ \u0275\u0275elementStart(0, "input", 52);
37091
+ \u0275\u0275listener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_5_Template_input_ngModelChange_0_listener($event) {
37092
+ \u0275\u0275restoreView(_r28);
37093
+ const question_r25 = \u0275\u0275nextContext().$implicit;
37094
+ const ctx_r0 = \u0275\u0275nextContext(2);
37095
+ return \u0275\u0275resetView(ctx_r0.updateAnswer(question_r25.key, { Value: $event }));
37096
+ });
37097
+ \u0275\u0275elementEnd();
37098
+ }
37099
+ if (rf & 2) {
37100
+ const question_r25 = \u0275\u0275nextContext().$implicit;
37101
+ const ctx_r0 = \u0275\u0275nextContext(2);
37102
+ \u0275\u0275property("id", ctx_r0.widgetInstanceId + "-q-" + question_r25.key)("ngModel", ctx_r0.answerFor(question_r25.key).Value ?? "")("required", question_r25.required || false);
37103
+ \u0275\u0275attribute("maxlength", ctx_r0.answerMaxLength(question_r25));
37104
+ }
37105
+ }
37106
+ function MJCheckoutWidgetComponent_Conditional_19_For_5_Template(rf, ctx) {
37107
+ if (rf & 1) {
37108
+ \u0275\u0275elementStart(0, "div", 47)(1, "label", 27);
37109
+ \u0275\u0275text(2);
37110
+ \u0275\u0275conditionalCreate(3, MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_3_Template, 2, 0, "span", 28);
37111
+ \u0275\u0275elementEnd();
37112
+ \u0275\u0275conditionalCreate(4, MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_4_Template, 6, 5)(5, MJCheckoutWidgetComponent_Conditional_19_For_5_Conditional_5_Template, 1, 4, "input", 48);
37113
+ \u0275\u0275elementEnd();
37114
+ }
37115
+ if (rf & 2) {
37116
+ const question_r25 = ctx.$implicit;
37117
+ const ctx_r0 = \u0275\u0275nextContext(2);
37118
+ \u0275\u0275advance();
37119
+ \u0275\u0275attribute("for", ctx_r0.widgetInstanceId + "-q-" + question_r25.key);
37120
+ \u0275\u0275advance();
37121
+ \u0275\u0275textInterpolate1(" ", question_r25.label, " ");
37122
+ \u0275\u0275advance();
37123
+ \u0275\u0275conditional(question_r25.required ? 3 : -1);
37124
+ \u0275\u0275advance();
37125
+ \u0275\u0275conditional(question_r25.type === "select" ? 4 : 5);
37126
+ }
37127
+ }
36839
37128
  function MJCheckoutWidgetComponent_Conditional_19_Template(rf, ctx) {
36840
37129
  if (rf & 1) {
36841
- \u0275\u0275elementStart(0, "section", 47)(1, "h3", 23);
37130
+ \u0275\u0275elementStart(0, "section", 14)(1, "h3", 23);
37131
+ \u0275\u0275text(2, "A few questions");
37132
+ \u0275\u0275elementEnd();
37133
+ \u0275\u0275elementStart(3, "div", 24);
37134
+ \u0275\u0275repeaterCreate(4, MJCheckoutWidgetComponent_Conditional_19_For_5_Template, 6, 4, "div", 47, _forTrack2);
37135
+ \u0275\u0275elementEnd()();
37136
+ }
37137
+ if (rf & 2) {
37138
+ const ctx_r0 = \u0275\u0275nextContext();
37139
+ \u0275\u0275advance(4);
37140
+ \u0275\u0275repeater(ctx_r0.questions());
37141
+ }
37142
+ }
37143
+ function MJCheckoutWidgetComponent_Conditional_20_Template(rf, ctx) {
37144
+ if (rf & 1) {
37145
+ \u0275\u0275elementStart(0, "section", 53)(1, "h3", 23);
36842
37146
  \u0275\u0275text(2, "Payment");
36843
37147
  \u0275\u0275elementEnd();
36844
- \u0275\u0275elementStart(3, "div", 48);
36845
- \u0275\u0275element(4, "div", 49);
36846
- \u0275\u0275elementStart(5, "div", 50)(6, "span", 51);
37148
+ \u0275\u0275elementStart(3, "div", 54);
37149
+ \u0275\u0275element(4, "div", 55);
37150
+ \u0275\u0275elementStart(5, "div", 56)(6, "span", 57);
36847
37151
  \u0275\u0275text(7, "\u{1F512}");
36848
37152
  \u0275\u0275elementEnd();
36849
37153
  \u0275\u0275elementStart(8, "span");
36850
37154
  \u0275\u0275text(9, "Secured by Stripe \u2022 PCI-DSS Level 1 Certified \u2022 End-to-end Encrypted");
36851
37155
  \u0275\u0275elementEnd()()()();
36852
- \u0275\u0275elementStart(10, "div", 52)(11, "span", 53);
37156
+ \u0275\u0275elementStart(10, "div", 58)(11, "span", 59);
36853
37157
  \u0275\u0275text(12, "Total Due");
36854
37158
  \u0275\u0275elementEnd();
36855
- \u0275\u0275elementStart(13, "span", 54);
37159
+ \u0275\u0275elementStart(13, "span", 60);
36856
37160
  \u0275\u0275text(14);
36857
37161
  \u0275\u0275elementEnd()();
36858
37162
  }
@@ -36862,22 +37166,22 @@ function MJCheckoutWidgetComponent_Conditional_19_Template(rf, ctx) {
36862
37166
  \u0275\u0275textInterpolate2("", ctx_r0.currencySymbol(), "", ctx_r0.totalGross().toFixed(2));
36863
37167
  }
36864
37168
  }
36865
- function MJCheckoutWidgetComponent_Conditional_22_Template(rf, ctx) {
37169
+ function MJCheckoutWidgetComponent_Conditional_23_Template(rf, ctx) {
36866
37170
  if (rf & 1) {
36867
- \u0275\u0275element(0, "span", 55);
37171
+ \u0275\u0275element(0, "span", 61);
36868
37172
  \u0275\u0275elementStart(1, "span");
36869
37173
  \u0275\u0275text(2, "Processing...");
36870
37174
  \u0275\u0275elementEnd();
36871
37175
  }
36872
37176
  }
36873
- function MJCheckoutWidgetComponent_Conditional_23_Template(rf, ctx) {
37177
+ function MJCheckoutWidgetComponent_Conditional_24_Template(rf, ctx) {
36874
37178
  if (rf & 1) {
36875
37179
  \u0275\u0275elementStart(0, "span");
36876
37180
  \u0275\u0275text(1, "Complete Free Registration");
36877
37181
  \u0275\u0275elementEnd();
36878
37182
  }
36879
37183
  }
36880
- function MJCheckoutWidgetComponent_Conditional_24_Template(rf, ctx) {
37184
+ function MJCheckoutWidgetComponent_Conditional_25_Template(rf, ctx) {
36881
37185
  if (rf & 1) {
36882
37186
  \u0275\u0275elementStart(0, "span");
36883
37187
  \u0275\u0275text(1);
@@ -36920,11 +37224,32 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
36920
37224
  }
36921
37225
  isPaymentReady = false;
36922
37226
  stripePaymentMethodId = null;
37227
+ /** An e-mail the embedding host already knows. Fills the field only while it is empty. */
37228
+ prefillEmail = null;
36923
37229
  submitted = new EventEmitter();
36924
37230
  cancelled = new EventEmitter();
36925
37231
  // Internal error message for client-side validation failures
36926
37232
  internalErrorMessage = signal(null, ...ngDevMode ? [{ debugName: "internalErrorMessage" }] : []);
36927
37233
  displayErrorMessage = computed(() => this._errorMessage() || this.internalErrorMessage(), ...ngDevMode ? [{ debugName: "displayErrorMessage" }] : []);
37234
+ /** The widget's questions. A malformed list shows none here; the server refuses the checkout. */
37235
+ questions = computed(() => ReadCheckoutQuestions(this._config()?.questions).Questions, ...ngDevMode ? [{ debugName: "questions" }] : []);
37236
+ answers = signal({}, ...ngDevMode ? [{ debugName: "answers" }] : []);
37237
+ optionValue = CheckoutQuestionOptionValue;
37238
+ optionLabel = CheckoutQuestionOptionLabel;
37239
+ answerMaxLength = CheckoutAnswerMaxLength;
37240
+ answerFor(key) {
37241
+ return this.answers()[key] ?? {};
37242
+ }
37243
+ updateAnswer(key, patch) {
37244
+ this.answers.update((current) => ({ ...current, [key]: { ...current[key], ...patch } }));
37245
+ }
37246
+ /** True when the buyer chose the question's "Other" option, which needs a text answer. */
37247
+ isOtherChosen(question) {
37248
+ return question.otherOptionKey !== void 0 && this.answerFor(question.key).Value === question.otherOptionKey;
37249
+ }
37250
+ answersAreComplete() {
37251
+ return !CheckAnswersAgainstQuestions(this.questions(), this.answers()).Error;
37252
+ }
36928
37253
  // Form state signals
36929
37254
  email = signal("", ...ngDevMode ? [{ debugName: "email" }] : []);
36930
37255
  firstName = signal("", ...ngDevMode ? [{ debugName: "firstName" }] : []);
@@ -37001,6 +37326,7 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37001
37326
  }
37002
37327
  }, ...ngDevMode ? [{ debugName: "currencySymbol" }] : []);
37003
37328
  ngOnInit() {
37329
+ this.applyPrefillEmail();
37004
37330
  this.syncUnits();
37005
37331
  this.applyCustomCSS(this.activeCSS());
37006
37332
  if (this.activeJS() && this.activeJS() !== this._lastMountedJS) {
@@ -37011,7 +37337,16 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37011
37337
  distributionSlug: this.distributionSlug
37012
37338
  });
37013
37339
  }
37340
+ applyPrefillEmail() {
37341
+ const prefill = (this.prefillEmail ?? "").trim();
37342
+ if (prefill && !this.email().trim()) {
37343
+ this.email.set(prefill);
37344
+ }
37345
+ }
37014
37346
  ngOnChanges(changes) {
37347
+ if (changes["prefillEmail"]) {
37348
+ this.applyPrefillEmail();
37349
+ }
37015
37350
  if (changes["config"]) {
37016
37351
  this.syncUnits();
37017
37352
  this.applyCustomCSS(this.activeCSS());
@@ -37195,6 +37530,8 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37195
37530
  const ln = this.lastName().trim();
37196
37531
  if (!em || !em.includes("@") || !fn || !ln)
37197
37532
  return false;
37533
+ if (!this.answersAreComplete())
37534
+ return false;
37198
37535
  if (!this.isFree() && !this.isPaymentReady)
37199
37536
  return false;
37200
37537
  return true;
@@ -37232,6 +37569,9 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37232
37569
  }
37233
37570
  }
37234
37571
  }
37572
+ if (!this.answersAreComplete()) {
37573
+ return false;
37574
+ }
37235
37575
  if (!this.isFree() && !this.isPaymentReady) {
37236
37576
  return false;
37237
37577
  }
@@ -37254,6 +37594,7 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37254
37594
  units: isPerUnit ? currentUnits : void 0
37255
37595
  },
37256
37596
  totalGross: this.totalGross(),
37597
+ answers: this.answers(),
37257
37598
  stripePaymentMethodId: this.isFree() ? void 0 : this.stripePaymentMethodId ?? void 0,
37258
37599
  sessionKey: finalSessionKey
37259
37600
  };
@@ -37273,7 +37614,7 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37273
37614
  static \u0275fac = function MJCheckoutWidgetComponent_Factory(__ngFactoryType__) {
37274
37615
  return new (__ngFactoryType__ || _MJCheckoutWidgetComponent)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Renderer2));
37275
37616
  };
37276
- static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _MJCheckoutWidgetComponent, selectors: [["mj-checkout-widget"]], inputs: { config: "config", distributionSlug: "distributionSlug", sessionKey: "sessionKey", isProcessing: "isProcessing", errorMessage: "errorMessage", isPaymentReady: "isPaymentReady", stripePaymentMethodId: "stripePaymentMethodId" }, outputs: { submitted: "submitted", cancelled: "cancelled" }, features: [\u0275\u0275NgOnChangesFeature], decls: 27, vars: 24, consts: [[1, "mj-checkout-widget-container"], [1, "mj-widget-header"], [1, "mj-widget-title"], [1, "mj-widget-description"], ["role", "alert", 1, "mj-widget-error-banner"], [1, "mj-widget-summary-card"], [1, "mj-summary-row"], [1, "mj-summary-item-info"], [1, "mj-product-name"], [1, "mj-badge-free"], [1, "mj-summary-price"], [1, "mj-price-free"], [1, "mj-price-amount"], [1, "mj-quantity-selector-row"], [1, "mj-widget-form-section"], [1, "mj-widget-actions"], ["type", "button", 1, "mj-btn-submit", 3, "click", "disabled"], ["type", "button", 1, "mj-btn-cancel", 3, "click", "disabled"], [1, "mj-error-icon"], ["for", "quantityInput", 1, "mj-label"], [1, "mj-qty-controls"], ["type", "button", 1, "mj-qty-btn", 3, "click", "disabled"], ["id", "quantityInput", "type", "number", "min", "1", 1, "mj-qty-input", 3, "ngModelChange", "ngModel", "max"], [1, "mj-section-title"], [1, "mj-form-grid"], [1, "mj-form-group", 3, "full-width"], [1, "mj-form-group"], [1, "mj-label"], [1, "mj-required"], [1, "mj-input", "mj-textarea", 3, "ngModel", "placeholder", "required"], [1, "mj-select", 3, "ngModel", "required"], [1, "mj-checkbox-label"], ["type", "number", 1, "mj-input", 3, "ngModel", "placeholder", "required"], ["type", "date", 1, "mj-input", 3, "ngModel", "required"], [1, "mj-input", 3, "type", "ngModel", "placeholder", "required"], [1, "mj-input", "mj-textarea", 3, "ngModelChange", "ngModel", "placeholder", "required"], [1, "mj-select", 3, "ngModelChange", "ngModel", "required"], [3, "ngValue"], ["type", "checkbox", 3, "ngModelChange", "ngModel"], ["type", "number", 1, "mj-input", 3, "ngModelChange", "ngModel", "placeholder", "required"], ["type", "date", 1, "mj-input", 3, "ngModelChange", "ngModel", "required"], [1, "mj-input", 3, "ngModelChange", "type", "ngModel", "placeholder", "required"], [1, "mj-multi-attendee-header"], ["type", "button", 1, "mj-btn-link", 3, "click"], [1, "mj-attendee-matrix"], [1, "mj-attendee-card"], [1, "mj-attendee-card-title"], [1, "mj-widget-payment-section"], [1, "mj-stripe-container"], ["id", "stripe-card-element", 1, "mj-stripe-mount-point"], [1, "mj-stripe-badge"], [1, "mj-stripe-lock-icon"], [1, "mj-checkout-total-row"], [1, "mj-total-label"], [1, "mj-total-amount"], [1, "mj-spinner"]], template: function MJCheckoutWidgetComponent_Template(rf, ctx) {
37617
+ static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _MJCheckoutWidgetComponent, selectors: [["mj-checkout-widget"]], inputs: { config: "config", distributionSlug: "distributionSlug", sessionKey: "sessionKey", isProcessing: "isProcessing", errorMessage: "errorMessage", isPaymentReady: "isPaymentReady", stripePaymentMethodId: "stripePaymentMethodId", prefillEmail: "prefillEmail" }, outputs: { submitted: "submitted", cancelled: "cancelled" }, features: [\u0275\u0275NgOnChangesFeature], decls: 28, vars: 25, consts: [[1, "mj-checkout-widget-container"], [1, "mj-widget-header"], [1, "mj-widget-title"], [1, "mj-widget-description"], ["role", "alert", 1, "mj-widget-error-banner"], [1, "mj-widget-summary-card"], [1, "mj-summary-row"], [1, "mj-summary-item-info"], [1, "mj-product-name"], [1, "mj-badge-free"], [1, "mj-summary-price"], [1, "mj-price-free"], [1, "mj-price-amount"], [1, "mj-quantity-selector-row"], [1, "mj-widget-form-section"], [1, "mj-widget-actions"], ["type", "button", 1, "mj-btn-submit", 3, "click", "disabled"], ["type", "button", 1, "mj-btn-cancel", 3, "click", "disabled"], [1, "mj-error-icon"], ["for", "quantityInput", 1, "mj-label"], [1, "mj-qty-controls"], ["type", "button", 1, "mj-qty-btn", 3, "click", "disabled"], ["id", "quantityInput", "type", "number", "min", "1", 1, "mj-qty-input", 3, "ngModelChange", "ngModel", "max"], [1, "mj-section-title"], [1, "mj-form-grid"], [1, "mj-form-group", 3, "full-width"], [1, "mj-form-group"], [1, "mj-label"], [1, "mj-required"], [1, "mj-input", "mj-textarea", 3, "ngModel", "placeholder", "required"], [1, "mj-select", 3, "ngModel", "required"], [1, "mj-checkbox-label"], ["type", "number", 1, "mj-input", 3, "ngModel", "placeholder", "required"], ["type", "date", 1, "mj-input", 3, "ngModel", "required"], [1, "mj-input", 3, "type", "ngModel", "placeholder", "required"], [1, "mj-input", "mj-textarea", 3, "ngModelChange", "ngModel", "placeholder", "required"], [1, "mj-select", 3, "ngModelChange", "ngModel", "required"], [3, "ngValue"], ["type", "checkbox", 3, "ngModelChange", "ngModel"], ["type", "number", 1, "mj-input", 3, "ngModelChange", "ngModel", "placeholder", "required"], ["type", "date", 1, "mj-input", 3, "ngModelChange", "ngModel", "required"], [1, "mj-input", 3, "ngModelChange", "type", "ngModel", "placeholder", "required"], [1, "mj-multi-attendee-header"], ["type", "button", 1, "mj-btn-link", 3, "click"], [1, "mj-attendee-matrix"], [1, "mj-attendee-card"], [1, "mj-attendee-card-title"], [1, "mj-form-group", "full-width"], ["type", "text", 1, "mj-input", 3, "id", "ngModel", "required"], [1, "mj-select", 3, "ngModelChange", "id", "ngModel", "required"], ["type", "text", "placeholder", "Please specify", "required", "", 1, "mj-input", "mj-question-other", 3, "ngModel"], ["type", "text", "placeholder", "Please specify", "required", "", 1, "mj-input", "mj-question-other", 3, "ngModelChange", "ngModel"], ["type", "text", 1, "mj-input", 3, "ngModelChange", "id", "ngModel", "required"], [1, "mj-widget-payment-section"], [1, "mj-stripe-container"], ["id", "stripe-card-element", 1, "mj-stripe-mount-point"], [1, "mj-stripe-badge"], [1, "mj-stripe-lock-icon"], [1, "mj-checkout-total-row"], [1, "mj-total-label"], [1, "mj-total-amount"], [1, "mj-spinner"]], template: function MJCheckoutWidgetComponent_Template(rf, ctx) {
37277
37618
  if (rf & 1) {
37278
37619
  \u0275\u0275elementStart(0, "div", 0)(1, "header", 1)(2, "h2", 2);
37279
37620
  \u0275\u0275text(3);
@@ -37294,18 +37635,19 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37294
37635
  \u0275\u0275elementStart(16, "section", 14);
37295
37636
  \u0275\u0275conditionalCreate(17, MJCheckoutWidgetComponent_Conditional_17_Template, 5, 0)(18, MJCheckoutWidgetComponent_Conditional_18_Template, 8, 1);
37296
37637
  \u0275\u0275elementEnd();
37297
- \u0275\u0275conditionalCreate(19, MJCheckoutWidgetComponent_Conditional_19_Template, 15, 2);
37298
- \u0275\u0275elementStart(20, "div", 15)(21, "button", 16);
37299
- \u0275\u0275listener("click", function MJCheckoutWidgetComponent_Template_button_click_21_listener() {
37638
+ \u0275\u0275conditionalCreate(19, MJCheckoutWidgetComponent_Conditional_19_Template, 6, 0, "section", 14);
37639
+ \u0275\u0275conditionalCreate(20, MJCheckoutWidgetComponent_Conditional_20_Template, 15, 2);
37640
+ \u0275\u0275elementStart(21, "div", 15)(22, "button", 16);
37641
+ \u0275\u0275listener("click", function MJCheckoutWidgetComponent_Template_button_click_22_listener() {
37300
37642
  return ctx.handleSubmit();
37301
37643
  });
37302
- \u0275\u0275conditionalCreate(22, MJCheckoutWidgetComponent_Conditional_22_Template, 3, 0)(23, MJCheckoutWidgetComponent_Conditional_23_Template, 2, 0, "span")(24, MJCheckoutWidgetComponent_Conditional_24_Template, 2, 2, "span");
37644
+ \u0275\u0275conditionalCreate(23, MJCheckoutWidgetComponent_Conditional_23_Template, 3, 0)(24, MJCheckoutWidgetComponent_Conditional_24_Template, 2, 0, "span")(25, MJCheckoutWidgetComponent_Conditional_25_Template, 2, 2, "span");
37303
37645
  \u0275\u0275elementEnd();
37304
- \u0275\u0275elementStart(25, "button", 17);
37305
- \u0275\u0275listener("click", function MJCheckoutWidgetComponent_Template_button_click_25_listener() {
37646
+ \u0275\u0275elementStart(26, "button", 17);
37647
+ \u0275\u0275listener("click", function MJCheckoutWidgetComponent_Template_button_click_26_listener() {
37306
37648
  return ctx.cancelled.emit();
37307
37649
  });
37308
- \u0275\u0275text(26, " Cancel ");
37650
+ \u0275\u0275text(27, " Cancel ");
37309
37651
  \u0275\u0275elementEnd()()();
37310
37652
  }
37311
37653
  if (rf & 2) {
@@ -37333,15 +37675,17 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37333
37675
  \u0275\u0275advance(2);
37334
37676
  \u0275\u0275conditional(ctx.isSingleUnit() ? 17 : 18);
37335
37677
  \u0275\u0275advance(2);
37336
- \u0275\u0275conditional(!ctx.isFree() ? 19 : -1);
37678
+ \u0275\u0275conditional(ctx.questions().length > 0 ? 19 : -1);
37679
+ \u0275\u0275advance();
37680
+ \u0275\u0275conditional(!ctx.isFree() ? 20 : -1);
37337
37681
  \u0275\u0275advance(2);
37338
37682
  \u0275\u0275property("disabled", !ctx.isFormValid() || ctx.isProcessing);
37339
37683
  \u0275\u0275advance();
37340
- \u0275\u0275conditional(ctx.isProcessing ? 22 : ctx.isFree() ? 23 : 24);
37684
+ \u0275\u0275conditional(ctx.isProcessing ? 23 : ctx.isFree() ? 24 : 25);
37341
37685
  \u0275\u0275advance(3);
37342
37686
  \u0275\u0275property("disabled", ctx.isProcessing);
37343
37687
  }
37344
- }, dependencies: [CommonModule, FormsModule, NgSelectOption, \u0275NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, NgControlStatus, RequiredValidator, MinValidator, MaxValidator, NgModel], styles: ['[_nghost-%COMP%] {\n display: block;\n font-family: var(--mj-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);\n color: var(--mj-text-color, #1e293b);\n}\n\n.mj-checkout-widget-container[_ngcontent-%COMP%] {\n max-width: 560px;\n margin: 0 auto;\n background: var(--mj-bg-color, #ffffff);\n border: 1px solid #e2e8f0;\n border-radius: var(--mj-border-radius, 8px);\n padding: 24px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);\n}\n\n.mj-widget-header[_ngcontent-%COMP%] {\n margin-bottom: 20px;\n}\n\n.mj-widget-title[_ngcontent-%COMP%] {\n margin: 0 0 6px 0;\n font-size: 1.35rem;\n font-weight: 700;\n color: var(--mj-text-color, #0f172a);\n}\n\n.mj-widget-description[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 0.9rem;\n color: #64748b;\n line-height: 1.4;\n}\n\n.mj-widget-error-banner[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n margin-bottom: 18px;\n font-size: 0.875rem;\n}\n\n.mj-error-icon[_ngcontent-%COMP%] {\n font-size: 1rem;\n}\n\n.mj-widget-summary-card[_ngcontent-%COMP%] {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px 16px;\n margin-bottom: 20px;\n}\n\n.mj-summary-row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.mj-summary-price[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n}\n\n.mj-widget-form-section[_ngcontent-%COMP%] {\n margin-bottom: 20px;\n}\n\n.mj-summary-item-info[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.mj-product-name[_ngcontent-%COMP%] {\n font-weight: 600;\n font-size: 1rem;\n color: #1e293b;\n}\n\n.mj-badge-free[_ngcontent-%COMP%] {\n background: #dcfce7;\n color: #166534;\n font-size: 0.75rem;\n font-weight: 700;\n padding: 2px 6px;\n border-radius: 4px;\n}\n\n.mj-price-free[_ngcontent-%COMP%] {\n font-weight: 700;\n color: #166534;\n font-size: 1.1rem;\n}\n\n.mj-price-amount[_ngcontent-%COMP%] {\n font-weight: 700;\n color: #0f172a;\n font-size: 1.1rem;\n}\n\n.mj-quantity-selector-row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px dashed #cbd5e1;\n}\n\n.mj-qty-controls[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-qty-btn[_ngcontent-%COMP%] {\n width: 28px;\n height: 28px;\n background: #ffffff;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-qty-btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.mj-qty-input[_ngcontent-%COMP%] {\n width: 44px;\n height: 28px;\n text-align: center;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n font-weight: 600;\n}\n\n.mj-section-title[_ngcontent-%COMP%] {\n font-size: 1rem;\n font-weight: 600;\n margin: 0 0 12px 0;\n color: #334155;\n}\n\n.mj-form-grid[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 12px;\n margin-bottom: 18px;\n}\n\n.mj-form-group[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.mj-form-group.full-width[_ngcontent-%COMP%] {\n grid-column: 1 / -1;\n}\n\n.mj-label[_ngcontent-%COMP%] {\n font-size: 0.8rem;\n font-weight: 500;\n color: #475569;\n}\n\n.mj-required[_ngcontent-%COMP%] {\n color: #ef4444;\n}\n\n.mj-input[_ngcontent-%COMP%], .mj-select[_ngcontent-%COMP%] {\n padding: 8px 12px;\n font-size: 0.9rem;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n background: #ffffff;\n color: #1e293b;\n outline: none;\n transition: border-color 0.15s ease;\n width: 100%;\n box-sizing: border-box;\n}\n\n.mj-textarea[_ngcontent-%COMP%] {\n min-height: 70px;\n resize: vertical;\n font-family: inherit;\n}\n\n.mj-select[_ngcontent-%COMP%] {\n min-height: 38px;\n}\n\n.mj-checkbox-label[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n font-size: 0.9rem;\n color: #334155;\n margin-top: 4px;\n}\n\n.mj-input[_ngcontent-%COMP%]:focus, .mj-select[_ngcontent-%COMP%]:focus {\n border-color: var(--mj-primary-color, #2563eb);\n box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);\n}\n\n.mj-multi-attendee-header[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 12px;\n}\n\n.mj-btn-link[_ngcontent-%COMP%] {\n background: none;\n border: none;\n color: var(--mj-primary-color, #2563eb);\n font-size: 0.8rem;\n cursor: pointer;\n text-decoration: underline;\n padding: 0;\n}\n\n.mj-attendee-matrix[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 14px;\n margin-bottom: 20px;\n}\n\n.mj-attendee-card[_ngcontent-%COMP%] {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 12px 14px;\n}\n\n.mj-attendee-card-title[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n font-weight: 600;\n color: #475569;\n margin-bottom: 10px;\n}\n\n\n\n.mj-widget-payment-section[_ngcontent-%COMP%] {\n margin-top: 16px;\n padding-top: 16px;\n border-top: 1px solid #e2e8f0;\n}\n\n.mj-stripe-container[_ngcontent-%COMP%] {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px;\n margin-bottom: 16px;\n}\n\n.mj-stripe-mount-point[_ngcontent-%COMP%] {\n min-height: 40px;\n}\n\n.mj-stripe-badge[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 10px;\n font-size: 0.75rem;\n color: #64748b;\n}\n\n.mj-stripe-lock-icon[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n}\n\n.mj-checkout-total-row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 0;\n border-top: 1px solid #e2e8f0;\n margin-top: 10px;\n margin-bottom: 18px;\n}\n\n.mj-total-label[_ngcontent-%COMP%] {\n font-weight: 700;\n font-size: 1.05rem;\n color: #0f172a;\n}\n\n.mj-total-amount[_ngcontent-%COMP%] {\n font-weight: 800;\n font-size: 1.25rem;\n color: var(--mj-primary-color, #2563eb);\n}\n\n.mj-widget-actions[_ngcontent-%COMP%] {\n margin-top: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.mj-btn-submit[_ngcontent-%COMP%] {\n width: 100%;\n padding: 12px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-size: 1rem;\n font-weight: 600;\n border: none;\n border-radius: var(--mj-border-radius, 8px);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n transition: opacity 0.15s ease;\n}\n\n.mj-btn-submit[_ngcontent-%COMP%]:hover:not(:disabled) {\n opacity: 0.92;\n}\n\n.mj-btn-submit[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.mj-btn-cancel[_ngcontent-%COMP%] {\n width: 100%;\n padding: 8px 12px;\n background: transparent;\n color: #64748b;\n font-size: 0.875rem;\n font-weight: 500;\n border: none;\n cursor: pointer;\n text-align: center;\n}\n\n.mj-btn-cancel[_ngcontent-%COMP%]:hover:not(:disabled) {\n color: #334155;\n text-decoration: underline;\n}\n\n.mj-spinner[_ngcontent-%COMP%] {\n width: 16px;\n height: 16px;\n border: 2px solid #ffffff;\n border-top-color: transparent;\n border-radius: 50%;\n animation: _ngcontent-%COMP%_mj-spin 0.8s linear infinite;\n}\n\n@keyframes _ngcontent-%COMP%_mj-spin {\n to { transform: rotate(360deg); }\n}'], changeDetection: 0 });
37688
+ }, dependencies: [CommonModule, FormsModule, NgSelectOption, \u0275NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, NgControlStatus, RequiredValidator, MinValidator, MaxValidator, NgModel], styles: ['[_nghost-%COMP%] {\n display: block;\n font-family: var(--mj-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);\n color: var(--mj-text-color, #1e293b);\n}\n\n.mj-checkout-widget-container[_ngcontent-%COMP%] {\n max-width: 560px;\n margin: 0 auto;\n background: var(--mj-bg-color, #ffffff);\n border: 1px solid #e2e8f0;\n border-radius: var(--mj-border-radius, 8px);\n padding: 24px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);\n}\n\n.mj-widget-header[_ngcontent-%COMP%] {\n margin-bottom: 20px;\n}\n\n.mj-widget-title[_ngcontent-%COMP%] {\n margin: 0 0 6px 0;\n font-size: 1.35rem;\n font-weight: 700;\n color: var(--mj-text-color, #0f172a);\n}\n\n.mj-widget-description[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 0.9rem;\n color: #64748b;\n line-height: 1.4;\n}\n\n.mj-widget-error-banner[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n margin-bottom: 18px;\n font-size: 0.875rem;\n}\n\n.mj-error-icon[_ngcontent-%COMP%] {\n font-size: 1rem;\n}\n\n.mj-widget-summary-card[_ngcontent-%COMP%] {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px 16px;\n margin-bottom: 20px;\n}\n\n.mj-summary-row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.mj-summary-price[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n}\n\n.mj-widget-form-section[_ngcontent-%COMP%] {\n margin-bottom: 20px;\n}\n\n.mj-summary-item-info[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.mj-product-name[_ngcontent-%COMP%] {\n font-weight: 600;\n font-size: 1rem;\n color: #1e293b;\n}\n\n.mj-badge-free[_ngcontent-%COMP%] {\n background: #dcfce7;\n color: #166534;\n font-size: 0.75rem;\n font-weight: 700;\n padding: 2px 6px;\n border-radius: 4px;\n}\n\n.mj-price-free[_ngcontent-%COMP%] {\n font-weight: 700;\n color: #166534;\n font-size: 1.1rem;\n}\n\n.mj-price-amount[_ngcontent-%COMP%] {\n font-weight: 700;\n color: #0f172a;\n font-size: 1.1rem;\n}\n\n.mj-quantity-selector-row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px dashed #cbd5e1;\n}\n\n.mj-qty-controls[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-qty-btn[_ngcontent-%COMP%] {\n width: 28px;\n height: 28px;\n background: #ffffff;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-qty-btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.mj-qty-input[_ngcontent-%COMP%] {\n width: 44px;\n height: 28px;\n text-align: center;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n font-weight: 600;\n}\n\n.mj-section-title[_ngcontent-%COMP%] {\n font-size: 1rem;\n font-weight: 600;\n margin: 0 0 12px 0;\n color: #334155;\n}\n\n.mj-form-grid[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 12px;\n margin-bottom: 18px;\n}\n\n.mj-form-group[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.mj-form-group.full-width[_ngcontent-%COMP%] {\n grid-column: 1 / -1;\n}\n\n.mj-label[_ngcontent-%COMP%] {\n font-size: 0.8rem;\n font-weight: 500;\n color: #475569;\n}\n\n.mj-required[_ngcontent-%COMP%] {\n color: #ef4444;\n}\n\n.mj-input[_ngcontent-%COMP%], .mj-select[_ngcontent-%COMP%] {\n padding: 8px 12px;\n font-size: 0.9rem;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n background: #ffffff;\n color: #1e293b;\n outline: none;\n transition: border-color 0.15s ease;\n width: 100%;\n box-sizing: border-box;\n}\n\n.mj-textarea[_ngcontent-%COMP%] {\n min-height: 70px;\n resize: vertical;\n font-family: inherit;\n}\n\n.mj-select[_ngcontent-%COMP%] {\n min-height: 38px;\n}\n\n.mj-checkbox-label[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n font-size: 0.9rem;\n color: #334155;\n margin-top: 4px;\n}\n\n\n\n.mj-question-other[_ngcontent-%COMP%] {\n margin-top: 8px;\n}\n\n.mj-input[_ngcontent-%COMP%]:focus, .mj-select[_ngcontent-%COMP%]:focus {\n border-color: var(--mj-primary-color, #2563eb);\n box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);\n}\n\n.mj-multi-attendee-header[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 12px;\n}\n\n.mj-btn-link[_ngcontent-%COMP%] {\n background: none;\n border: none;\n color: var(--mj-primary-color, #2563eb);\n font-size: 0.8rem;\n cursor: pointer;\n text-decoration: underline;\n padding: 0;\n}\n\n.mj-attendee-matrix[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 14px;\n margin-bottom: 20px;\n}\n\n.mj-attendee-card[_ngcontent-%COMP%] {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 12px 14px;\n}\n\n.mj-attendee-card-title[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n font-weight: 600;\n color: #475569;\n margin-bottom: 10px;\n}\n\n\n\n.mj-widget-payment-section[_ngcontent-%COMP%] {\n margin-top: 16px;\n padding-top: 16px;\n border-top: 1px solid #e2e8f0;\n}\n\n.mj-stripe-container[_ngcontent-%COMP%] {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px;\n margin-bottom: 16px;\n}\n\n.mj-stripe-mount-point[_ngcontent-%COMP%] {\n min-height: 40px;\n}\n\n.mj-stripe-badge[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 10px;\n font-size: 0.75rem;\n color: #64748b;\n}\n\n.mj-stripe-lock-icon[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n}\n\n.mj-checkout-total-row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 0;\n border-top: 1px solid #e2e8f0;\n margin-top: 10px;\n margin-bottom: 18px;\n}\n\n.mj-total-label[_ngcontent-%COMP%] {\n font-weight: 700;\n font-size: 1.05rem;\n color: #0f172a;\n}\n\n.mj-total-amount[_ngcontent-%COMP%] {\n font-weight: 800;\n font-size: 1.25rem;\n color: var(--mj-primary-color, #2563eb);\n}\n\n.mj-widget-actions[_ngcontent-%COMP%] {\n margin-top: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.mj-btn-submit[_ngcontent-%COMP%] {\n width: 100%;\n padding: 12px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-size: 1rem;\n font-weight: 600;\n border: none;\n border-radius: var(--mj-border-radius, 8px);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n transition: opacity 0.15s ease;\n}\n\n.mj-btn-submit[_ngcontent-%COMP%]:hover:not(:disabled) {\n opacity: 0.92;\n}\n\n.mj-btn-submit[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.mj-btn-cancel[_ngcontent-%COMP%] {\n width: 100%;\n padding: 8px 12px;\n background: transparent;\n color: #64748b;\n font-size: 0.875rem;\n font-weight: 500;\n border: none;\n cursor: pointer;\n text-align: center;\n}\n\n.mj-btn-cancel[_ngcontent-%COMP%]:hover:not(:disabled) {\n color: #334155;\n text-decoration: underline;\n}\n\n.mj-spinner[_ngcontent-%COMP%] {\n width: 16px;\n height: 16px;\n border: 2px solid #ffffff;\n border-top-color: transparent;\n border-radius: 50%;\n animation: _ngcontent-%COMP%_mj-spin 0.8s linear infinite;\n}\n\n@keyframes _ngcontent-%COMP%_mj-spin {\n to { transform: rotate(360deg); }\n}'], changeDetection: 0 });
37345
37689
  };
37346
37690
  (() => {
37347
37691
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MJCheckoutWidgetComponent, [{
@@ -37564,6 +37908,58 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37564
37908
  }
37565
37909
  </section>
37566
37910
 
37911
+ <!-- Questions from the widget's Configuration; answers are recorded on the order -->
37912
+ @if (questions().length > 0) {
37913
+ <section class="mj-widget-form-section">
37914
+ <h3 class="mj-section-title">A few questions</h3>
37915
+ <div class="mj-form-grid">
37916
+ @for (question of questions(); track question.key) {
37917
+ <div class="mj-form-group full-width">
37918
+ <label class="mj-label" [attr.for]="widgetInstanceId + '-q-' + question.key">
37919
+ {{ question.label }}
37920
+ @if (question.required) {
37921
+ <span class="mj-required">*</span>
37922
+ }
37923
+ </label>
37924
+ @if (question.type === 'select') {
37925
+ <select
37926
+ class="mj-select"
37927
+ [id]="widgetInstanceId + '-q-' + question.key"
37928
+ [ngModel]="answerFor(question.key).Value ?? ''"
37929
+ (ngModelChange)="updateAnswer(question.key, { Value: $event })"
37930
+ [required]="question.required || false">
37931
+ <option [ngValue]="''">Select an answer</option>
37932
+ @for (opt of question.options; track optionValue(opt)) {
37933
+ <option [ngValue]="optionValue(opt)">{{ optionLabel(opt) }}</option>
37934
+ }
37935
+ </select>
37936
+ @if (isOtherChosen(question)) {
37937
+ <input
37938
+ type="text"
37939
+ class="mj-input mj-question-other"
37940
+ [attr.aria-label]="question.label + ' (please specify)'"
37941
+ placeholder="Please specify"
37942
+ [attr.maxlength]="answerMaxLength(question)"
37943
+ [ngModel]="answerFor(question.key).OtherText ?? ''"
37944
+ (ngModelChange)="updateAnswer(question.key, { OtherText: $event })"
37945
+ required />
37946
+ }
37947
+ } @else {
37948
+ <input
37949
+ type="text"
37950
+ class="mj-input"
37951
+ [id]="widgetInstanceId + '-q-' + question.key"
37952
+ [attr.maxlength]="answerMaxLength(question)"
37953
+ [ngModel]="answerFor(question.key).Value ?? ''"
37954
+ (ngModelChange)="updateAnswer(question.key, { Value: $event })"
37955
+ [required]="question.required || false" />
37956
+ }
37957
+ </div>
37958
+ }
37959
+ </div>
37960
+ </section>
37961
+ }
37962
+
37567
37963
  <!-- Stripe Embedded Payment Section -->
37568
37964
  @if (!isFree()) {
37569
37965
  <section class="mj-widget-payment-section">
@@ -37604,7 +38000,387 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37604
38000
  </button>
37605
38001
  </div>
37606
38002
  </div>
37607
- `, styles: [':host {\n display: block;\n font-family: var(--mj-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);\n color: var(--mj-text-color, #1e293b);\n}\n\n.mj-checkout-widget-container {\n max-width: 560px;\n margin: 0 auto;\n background: var(--mj-bg-color, #ffffff);\n border: 1px solid #e2e8f0;\n border-radius: var(--mj-border-radius, 8px);\n padding: 24px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);\n}\n\n.mj-widget-header {\n margin-bottom: 20px;\n}\n\n.mj-widget-title {\n margin: 0 0 6px 0;\n font-size: 1.35rem;\n font-weight: 700;\n color: var(--mj-text-color, #0f172a);\n}\n\n.mj-widget-description {\n margin: 0;\n font-size: 0.9rem;\n color: #64748b;\n line-height: 1.4;\n}\n\n.mj-widget-error-banner {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n margin-bottom: 18px;\n font-size: 0.875rem;\n}\n\n.mj-error-icon {\n font-size: 1rem;\n}\n\n.mj-widget-summary-card {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px 16px;\n margin-bottom: 20px;\n}\n\n.mj-summary-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.mj-summary-price {\n display: flex;\n align-items: center;\n}\n\n.mj-widget-form-section {\n margin-bottom: 20px;\n}\n\n.mj-summary-item-info {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.mj-product-name {\n font-weight: 600;\n font-size: 1rem;\n color: #1e293b;\n}\n\n.mj-badge-free {\n background: #dcfce7;\n color: #166534;\n font-size: 0.75rem;\n font-weight: 700;\n padding: 2px 6px;\n border-radius: 4px;\n}\n\n.mj-price-free {\n font-weight: 700;\n color: #166534;\n font-size: 1.1rem;\n}\n\n.mj-price-amount {\n font-weight: 700;\n color: #0f172a;\n font-size: 1.1rem;\n}\n\n.mj-quantity-selector-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px dashed #cbd5e1;\n}\n\n.mj-qty-controls {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-qty-btn {\n width: 28px;\n height: 28px;\n background: #ffffff;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-qty-btn:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.mj-qty-input {\n width: 44px;\n height: 28px;\n text-align: center;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n font-weight: 600;\n}\n\n.mj-section-title {\n font-size: 1rem;\n font-weight: 600;\n margin: 0 0 12px 0;\n color: #334155;\n}\n\n.mj-form-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 12px;\n margin-bottom: 18px;\n}\n\n.mj-form-group {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.mj-form-group.full-width {\n grid-column: 1 / -1;\n}\n\n.mj-label {\n font-size: 0.8rem;\n font-weight: 500;\n color: #475569;\n}\n\n.mj-required {\n color: #ef4444;\n}\n\n.mj-input, .mj-select {\n padding: 8px 12px;\n font-size: 0.9rem;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n background: #ffffff;\n color: #1e293b;\n outline: none;\n transition: border-color 0.15s ease;\n width: 100%;\n box-sizing: border-box;\n}\n\n.mj-textarea {\n min-height: 70px;\n resize: vertical;\n font-family: inherit;\n}\n\n.mj-select {\n min-height: 38px;\n}\n\n.mj-checkbox-label {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n font-size: 0.9rem;\n color: #334155;\n margin-top: 4px;\n}\n\n.mj-input:focus, .mj-select:focus {\n border-color: var(--mj-primary-color, #2563eb);\n box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);\n}\n\n.mj-multi-attendee-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 12px;\n}\n\n.mj-btn-link {\n background: none;\n border: none;\n color: var(--mj-primary-color, #2563eb);\n font-size: 0.8rem;\n cursor: pointer;\n text-decoration: underline;\n padding: 0;\n}\n\n.mj-attendee-matrix {\n display: flex;\n flex-direction: column;\n gap: 14px;\n margin-bottom: 20px;\n}\n\n.mj-attendee-card {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 12px 14px;\n}\n\n.mj-attendee-card-title {\n font-size: 0.85rem;\n font-weight: 600;\n color: #475569;\n margin-bottom: 10px;\n}\n\n/* Stripe Payment Container */\n.mj-widget-payment-section {\n margin-top: 16px;\n padding-top: 16px;\n border-top: 1px solid #e2e8f0;\n}\n\n.mj-stripe-container {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px;\n margin-bottom: 16px;\n}\n\n.mj-stripe-mount-point {\n min-height: 40px;\n}\n\n.mj-stripe-badge {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 10px;\n font-size: 0.75rem;\n color: #64748b;\n}\n\n.mj-stripe-lock-icon {\n font-size: 0.85rem;\n}\n\n.mj-checkout-total-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 0;\n border-top: 1px solid #e2e8f0;\n margin-top: 10px;\n margin-bottom: 18px;\n}\n\n.mj-total-label {\n font-weight: 700;\n font-size: 1.05rem;\n color: #0f172a;\n}\n\n.mj-total-amount {\n font-weight: 800;\n font-size: 1.25rem;\n color: var(--mj-primary-color, #2563eb);\n}\n\n.mj-widget-actions {\n margin-top: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.mj-btn-submit {\n width: 100%;\n padding: 12px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-size: 1rem;\n font-weight: 600;\n border: none;\n border-radius: var(--mj-border-radius, 8px);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n transition: opacity 0.15s ease;\n}\n\n.mj-btn-submit:hover:not(:disabled) {\n opacity: 0.92;\n}\n\n.mj-btn-submit:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.mj-btn-cancel {\n width: 100%;\n padding: 8px 12px;\n background: transparent;\n color: #64748b;\n font-size: 0.875rem;\n font-weight: 500;\n border: none;\n cursor: pointer;\n text-align: center;\n}\n\n.mj-btn-cancel:hover:not(:disabled) {\n color: #334155;\n text-decoration: underline;\n}\n\n.mj-spinner {\n width: 16px;\n height: 16px;\n border: 2px solid #ffffff;\n border-top-color: transparent;\n border-radius: 50%;\n animation: mj-spin 0.8s linear infinite;\n}\n\n@keyframes mj-spin {\n to { transform: rotate(360deg); }\n}\n'] }]
38003
+ `, styles: [`:host {
38004
+ display: block;
38005
+ font-family: var(--mj-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
38006
+ color: var(--mj-text-color, #1e293b);
38007
+ }
38008
+
38009
+ .mj-checkout-widget-container {
38010
+ max-width: 560px;
38011
+ margin: 0 auto;
38012
+ background: var(--mj-bg-color, #ffffff);
38013
+ border: 1px solid #e2e8f0;
38014
+ border-radius: var(--mj-border-radius, 8px);
38015
+ padding: 24px;
38016
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
38017
+ }
38018
+
38019
+ .mj-widget-header {
38020
+ margin-bottom: 20px;
38021
+ }
38022
+
38023
+ .mj-widget-title {
38024
+ margin: 0 0 6px 0;
38025
+ font-size: 1.35rem;
38026
+ font-weight: 700;
38027
+ color: var(--mj-text-color, #0f172a);
38028
+ }
38029
+
38030
+ .mj-widget-description {
38031
+ margin: 0;
38032
+ font-size: 0.9rem;
38033
+ color: #64748b;
38034
+ line-height: 1.4;
38035
+ }
38036
+
38037
+ .mj-widget-error-banner {
38038
+ display: flex;
38039
+ align-items: center;
38040
+ gap: 8px;
38041
+ background: #fef2f2;
38042
+ border: 1px solid #f87171;
38043
+ color: #991b1b;
38044
+ padding: 10px 14px;
38045
+ border-radius: 6px;
38046
+ margin-bottom: 18px;
38047
+ font-size: 0.875rem;
38048
+ }
38049
+
38050
+ .mj-error-icon {
38051
+ font-size: 1rem;
38052
+ }
38053
+
38054
+ .mj-widget-summary-card {
38055
+ background: #f8fafc;
38056
+ border: 1px solid #e2e8f0;
38057
+ border-radius: 6px;
38058
+ padding: 14px 16px;
38059
+ margin-bottom: 20px;
38060
+ }
38061
+
38062
+ .mj-summary-row {
38063
+ display: flex;
38064
+ justify-content: space-between;
38065
+ align-items: center;
38066
+ }
38067
+
38068
+ .mj-summary-price {
38069
+ display: flex;
38070
+ align-items: center;
38071
+ }
38072
+
38073
+ .mj-widget-form-section {
38074
+ margin-bottom: 20px;
38075
+ }
38076
+
38077
+ .mj-summary-item-info {
38078
+ display: flex;
38079
+ align-items: center;
38080
+ gap: 8px;
38081
+ }
38082
+
38083
+ .mj-product-name {
38084
+ font-weight: 600;
38085
+ font-size: 1rem;
38086
+ color: #1e293b;
38087
+ }
38088
+
38089
+ .mj-badge-free {
38090
+ background: #dcfce7;
38091
+ color: #166534;
38092
+ font-size: 0.75rem;
38093
+ font-weight: 700;
38094
+ padding: 2px 6px;
38095
+ border-radius: 4px;
38096
+ }
38097
+
38098
+ .mj-price-free {
38099
+ font-weight: 700;
38100
+ color: #166534;
38101
+ font-size: 1.1rem;
38102
+ }
38103
+
38104
+ .mj-price-amount {
38105
+ font-weight: 700;
38106
+ color: #0f172a;
38107
+ font-size: 1.1rem;
38108
+ }
38109
+
38110
+ .mj-quantity-selector-row {
38111
+ display: flex;
38112
+ justify-content: space-between;
38113
+ align-items: center;
38114
+ margin-top: 12px;
38115
+ padding-top: 12px;
38116
+ border-top: 1px dashed #cbd5e1;
38117
+ }
38118
+
38119
+ .mj-qty-controls {
38120
+ display: flex;
38121
+ align-items: center;
38122
+ gap: 4px;
38123
+ }
38124
+
38125
+ .mj-qty-btn {
38126
+ width: 28px;
38127
+ height: 28px;
38128
+ background: #ffffff;
38129
+ border: 1px solid #cbd5e1;
38130
+ border-radius: 4px;
38131
+ cursor: pointer;
38132
+ font-weight: 600;
38133
+ display: flex;
38134
+ align-items: center;
38135
+ justify-content: center;
38136
+ }
38137
+
38138
+ .mj-qty-btn:disabled {
38139
+ opacity: 0.4;
38140
+ cursor: not-allowed;
38141
+ }
38142
+
38143
+ .mj-qty-input {
38144
+ width: 44px;
38145
+ height: 28px;
38146
+ text-align: center;
38147
+ border: 1px solid #cbd5e1;
38148
+ border-radius: 4px;
38149
+ font-weight: 600;
38150
+ }
38151
+
38152
+ .mj-section-title {
38153
+ font-size: 1rem;
38154
+ font-weight: 600;
38155
+ margin: 0 0 12px 0;
38156
+ color: #334155;
38157
+ }
38158
+
38159
+ .mj-form-grid {
38160
+ display: grid;
38161
+ grid-template-columns: 1fr 1fr;
38162
+ gap: 12px;
38163
+ margin-bottom: 18px;
38164
+ }
38165
+
38166
+ .mj-form-group {
38167
+ display: flex;
38168
+ flex-direction: column;
38169
+ gap: 4px;
38170
+ }
38171
+
38172
+ .mj-form-group.full-width {
38173
+ grid-column: 1 / -1;
38174
+ }
38175
+
38176
+ .mj-label {
38177
+ font-size: 0.8rem;
38178
+ font-weight: 500;
38179
+ color: #475569;
38180
+ }
38181
+
38182
+ .mj-required {
38183
+ color: #ef4444;
38184
+ }
38185
+
38186
+ .mj-input, .mj-select {
38187
+ padding: 8px 12px;
38188
+ font-size: 0.9rem;
38189
+ border: 1px solid #cbd5e1;
38190
+ border-radius: 4px;
38191
+ background: #ffffff;
38192
+ color: #1e293b;
38193
+ outline: none;
38194
+ transition: border-color 0.15s ease;
38195
+ width: 100%;
38196
+ box-sizing: border-box;
38197
+ }
38198
+
38199
+ .mj-textarea {
38200
+ min-height: 70px;
38201
+ resize: vertical;
38202
+ font-family: inherit;
38203
+ }
38204
+
38205
+ .mj-select {
38206
+ min-height: 38px;
38207
+ }
38208
+
38209
+ .mj-checkbox-label {
38210
+ display: inline-flex;
38211
+ align-items: center;
38212
+ gap: 8px;
38213
+ cursor: pointer;
38214
+ font-size: 0.9rem;
38215
+ color: #334155;
38216
+ margin-top: 4px;
38217
+ }
38218
+
38219
+ /* The free-text answer that appears under a question's "Other" choice. */
38220
+ .mj-question-other {
38221
+ margin-top: 8px;
38222
+ }
38223
+
38224
+ .mj-input:focus, .mj-select:focus {
38225
+ border-color: var(--mj-primary-color, #2563eb);
38226
+ box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
38227
+ }
38228
+
38229
+ .mj-multi-attendee-header {
38230
+ display: flex;
38231
+ justify-content: space-between;
38232
+ align-items: center;
38233
+ margin-bottom: 12px;
38234
+ }
38235
+
38236
+ .mj-btn-link {
38237
+ background: none;
38238
+ border: none;
38239
+ color: var(--mj-primary-color, #2563eb);
38240
+ font-size: 0.8rem;
38241
+ cursor: pointer;
38242
+ text-decoration: underline;
38243
+ padding: 0;
38244
+ }
38245
+
38246
+ .mj-attendee-matrix {
38247
+ display: flex;
38248
+ flex-direction: column;
38249
+ gap: 14px;
38250
+ margin-bottom: 20px;
38251
+ }
38252
+
38253
+ .mj-attendee-card {
38254
+ background: #f8fafc;
38255
+ border: 1px solid #e2e8f0;
38256
+ border-radius: 6px;
38257
+ padding: 12px 14px;
38258
+ }
38259
+
38260
+ .mj-attendee-card-title {
38261
+ font-size: 0.85rem;
38262
+ font-weight: 600;
38263
+ color: #475569;
38264
+ margin-bottom: 10px;
38265
+ }
38266
+
38267
+ /* Stripe Payment Container */
38268
+ .mj-widget-payment-section {
38269
+ margin-top: 16px;
38270
+ padding-top: 16px;
38271
+ border-top: 1px solid #e2e8f0;
38272
+ }
38273
+
38274
+ .mj-stripe-container {
38275
+ background: #ffffff;
38276
+ border: 1px solid #e2e8f0;
38277
+ border-radius: 6px;
38278
+ padding: 14px;
38279
+ margin-bottom: 16px;
38280
+ }
38281
+
38282
+ .mj-stripe-mount-point {
38283
+ min-height: 40px;
38284
+ }
38285
+
38286
+ .mj-stripe-badge {
38287
+ display: flex;
38288
+ align-items: center;
38289
+ gap: 6px;
38290
+ margin-top: 10px;
38291
+ font-size: 0.75rem;
38292
+ color: #64748b;
38293
+ }
38294
+
38295
+ .mj-stripe-lock-icon {
38296
+ font-size: 0.85rem;
38297
+ }
38298
+
38299
+ .mj-checkout-total-row {
38300
+ display: flex;
38301
+ justify-content: space-between;
38302
+ align-items: center;
38303
+ padding: 12px 0;
38304
+ border-top: 1px solid #e2e8f0;
38305
+ margin-top: 10px;
38306
+ margin-bottom: 18px;
38307
+ }
38308
+
38309
+ .mj-total-label {
38310
+ font-weight: 700;
38311
+ font-size: 1.05rem;
38312
+ color: #0f172a;
38313
+ }
38314
+
38315
+ .mj-total-amount {
38316
+ font-weight: 800;
38317
+ font-size: 1.25rem;
38318
+ color: var(--mj-primary-color, #2563eb);
38319
+ }
38320
+
38321
+ .mj-widget-actions {
38322
+ margin-top: 12px;
38323
+ display: flex;
38324
+ flex-direction: column;
38325
+ gap: 8px;
38326
+ }
38327
+
38328
+ .mj-btn-submit {
38329
+ width: 100%;
38330
+ padding: 12px;
38331
+ background: var(--mj-primary-color, #2563eb);
38332
+ color: #ffffff;
38333
+ font-size: 1rem;
38334
+ font-weight: 600;
38335
+ border: none;
38336
+ border-radius: var(--mj-border-radius, 8px);
38337
+ cursor: pointer;
38338
+ display: flex;
38339
+ align-items: center;
38340
+ justify-content: center;
38341
+ gap: 8px;
38342
+ transition: opacity 0.15s ease;
38343
+ }
38344
+
38345
+ .mj-btn-submit:hover:not(:disabled) {
38346
+ opacity: 0.92;
38347
+ }
38348
+
38349
+ .mj-btn-submit:disabled {
38350
+ opacity: 0.5;
38351
+ cursor: not-allowed;
38352
+ }
38353
+
38354
+ .mj-btn-cancel {
38355
+ width: 100%;
38356
+ padding: 8px 12px;
38357
+ background: transparent;
38358
+ color: #64748b;
38359
+ font-size: 0.875rem;
38360
+ font-weight: 500;
38361
+ border: none;
38362
+ cursor: pointer;
38363
+ text-align: center;
38364
+ }
38365
+
38366
+ .mj-btn-cancel:hover:not(:disabled) {
38367
+ color: #334155;
38368
+ text-decoration: underline;
38369
+ }
38370
+
38371
+ .mj-spinner {
38372
+ width: 16px;
38373
+ height: 16px;
38374
+ border: 2px solid #ffffff;
38375
+ border-top-color: transparent;
38376
+ border-radius: 50%;
38377
+ animation: mj-spin 0.8s linear infinite;
38378
+ }
38379
+
38380
+ @keyframes mj-spin {
38381
+ to { transform: rotate(360deg); }
38382
+ }
38383
+ `] }]
37608
38384
  }], () => [{ type: ElementRef }, { type: Renderer2 }], { config: [{
37609
38385
  type: Input
37610
38386
  }], distributionSlug: [{
@@ -37619,6 +38395,8 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37619
38395
  type: Input
37620
38396
  }], stripePaymentMethodId: [{
37621
38397
  type: Input
38398
+ }], prefillEmail: [{
38399
+ type: Input
37622
38400
  }], submitted: [{
37623
38401
  type: Output
37624
38402
  }], cancelled: [{
@@ -37626,7 +38404,7 @@ var MJCheckoutWidgetComponent = class _MJCheckoutWidgetComponent {
37626
38404
  }] });
37627
38405
  })();
37628
38406
  (() => {
37629
- (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(MJCheckoutWidgetComponent, { className: "MJCheckoutWidgetComponent", filePath: "lib/checkout-widget/checkout-widget.component.ts", lineNumber: 116 });
38407
+ (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(MJCheckoutWidgetComponent, { className: "MJCheckoutWidgetComponent", filePath: "lib/checkout-widget/checkout-widget.component.ts", lineNumber: 130 });
37630
38408
  })();
37631
38409
 
37632
38410
  // dist/lib/checkout-widget/checkout-draft-line.js
@@ -37663,6 +38441,7 @@ function formatStripeError(error) {
37663
38441
  }
37664
38442
 
37665
38443
  // dist/lib/checkout-widget/checkout-public-host.component.js
38444
+ var _c0 = (a0) => [a0];
37666
38445
  function CheckoutPublicHostComponent_Conditional_1_Template(rf, ctx) {
37667
38446
  if (rf & 1) {
37668
38447
  \u0275\u0275elementStart(0, "div", 1);
@@ -37677,7 +38456,7 @@ function CheckoutPublicHostComponent_Conditional_1_Template(rf, ctx) {
37677
38456
  }
37678
38457
  function CheckoutPublicHostComponent_Conditional_2_Conditional_7_Template(rf, ctx) {
37679
38458
  if (rf & 1) {
37680
- \u0275\u0275elementStart(0, "p", 8);
38459
+ \u0275\u0275elementStart(0, "p", 7);
37681
38460
  \u0275\u0275text(1);
37682
38461
  \u0275\u0275elementEnd();
37683
38462
  }
@@ -37687,18 +38466,163 @@ function CheckoutPublicHostComponent_Conditional_2_Conditional_7_Template(rf, ct
37687
38466
  \u0275\u0275textInterpolate1("Order ", ctx_r0.orderNumber);
37688
38467
  }
37689
38468
  }
38469
+ function CheckoutPublicHostComponent_Conditional_2_Conditional_8_Template(rf, ctx) {
38470
+ if (rf & 1) {
38471
+ \u0275\u0275elementStart(0, "p", 8);
38472
+ \u0275\u0275text(1, "Setting up your account\u2026");
38473
+ \u0275\u0275elementEnd();
38474
+ }
38475
+ }
38476
+ function CheckoutPublicHostComponent_Conditional_2_Conditional_9_Conditional_3_Template(rf, ctx) {
38477
+ if (rf & 1) {
38478
+ \u0275\u0275elementStart(0, "p", 12);
38479
+ \u0275\u0275text(1);
38480
+ \u0275\u0275elementEnd();
38481
+ }
38482
+ if (rf & 2) {
38483
+ const ctx_r0 = \u0275\u0275nextContext(3);
38484
+ \u0275\u0275advance();
38485
+ \u0275\u0275textInterpolate(ctx_r0.verificationNote);
38486
+ }
38487
+ }
38488
+ function CheckoutPublicHostComponent_Conditional_2_Conditional_9_Conditional_10_Template(rf, ctx) {
38489
+ if (rf & 1) {
38490
+ \u0275\u0275elementStart(0, "p", 17);
38491
+ \u0275\u0275text(1);
38492
+ \u0275\u0275elementEnd();
38493
+ }
38494
+ if (rf & 2) {
38495
+ const ctx_r0 = \u0275\u0275nextContext(3);
38496
+ \u0275\u0275advance();
38497
+ \u0275\u0275textInterpolate(ctx_r0.passwordError);
38498
+ }
38499
+ }
38500
+ function CheckoutPublicHostComponent_Conditional_2_Conditional_9_Template(rf, ctx) {
38501
+ if (rf & 1) {
38502
+ const _r2 = \u0275\u0275getCurrentView();
38503
+ \u0275\u0275elementStart(0, "form", 10);
38504
+ \u0275\u0275listener("submit", function CheckoutPublicHostComponent_Conditional_2_Conditional_9_Template_form_submit_0_listener($event) {
38505
+ \u0275\u0275restoreView(_r2);
38506
+ const ctx_r0 = \u0275\u0275nextContext(2);
38507
+ $event.preventDefault();
38508
+ return \u0275\u0275resetView(ctx_r0.submitPassword());
38509
+ });
38510
+ \u0275\u0275elementStart(1, "h2", 11);
38511
+ \u0275\u0275text(2, "Set a password for your account");
38512
+ \u0275\u0275elementEnd();
38513
+ \u0275\u0275conditionalCreate(3, CheckoutPublicHostComponent_Conditional_2_Conditional_9_Conditional_3_Template, 2, 1, "p", 12);
38514
+ \u0275\u0275elementStart(4, "label", 13);
38515
+ \u0275\u0275text(5, "Password");
38516
+ \u0275\u0275elementEnd();
38517
+ \u0275\u0275elementStart(6, "input", 14);
38518
+ \u0275\u0275listener("input", function CheckoutPublicHostComponent_Conditional_2_Conditional_9_Template_input_input_6_listener($event) {
38519
+ \u0275\u0275restoreView(_r2);
38520
+ const ctx_r0 = \u0275\u0275nextContext(2);
38521
+ return \u0275\u0275resetView(ctx_r0.password = $event.target.value);
38522
+ });
38523
+ \u0275\u0275elementEnd();
38524
+ \u0275\u0275elementStart(7, "label", 15);
38525
+ \u0275\u0275text(8, "Confirm password");
38526
+ \u0275\u0275elementEnd();
38527
+ \u0275\u0275elementStart(9, "input", 16);
38528
+ \u0275\u0275listener("input", function CheckoutPublicHostComponent_Conditional_2_Conditional_9_Template_input_input_9_listener($event) {
38529
+ \u0275\u0275restoreView(_r2);
38530
+ const ctx_r0 = \u0275\u0275nextContext(2);
38531
+ return \u0275\u0275resetView(ctx_r0.passwordConfirmation = $event.target.value);
38532
+ });
38533
+ \u0275\u0275elementEnd();
38534
+ \u0275\u0275conditionalCreate(10, CheckoutPublicHostComponent_Conditional_2_Conditional_9_Conditional_10_Template, 2, 1, "p", 17);
38535
+ \u0275\u0275elementStart(11, "button", 18);
38536
+ \u0275\u0275text(12);
38537
+ \u0275\u0275elementEnd();
38538
+ \u0275\u0275elementStart(13, "button", 19);
38539
+ \u0275\u0275listener("click", function CheckoutPublicHostComponent_Conditional_2_Conditional_9_Template_button_click_13_listener() {
38540
+ \u0275\u0275restoreView(_r2);
38541
+ const ctx_r0 = \u0275\u0275nextContext(2);
38542
+ return \u0275\u0275resetView(ctx_r0.skipPassword());
38543
+ });
38544
+ \u0275\u0275text(14, " Not now ");
38545
+ \u0275\u0275elementEnd()();
38546
+ }
38547
+ if (rf & 2) {
38548
+ const ctx_r0 = \u0275\u0275nextContext(2);
38549
+ \u0275\u0275advance(3);
38550
+ \u0275\u0275conditional(ctx_r0.verificationNote ? 3 : -1);
38551
+ \u0275\u0275advance(3);
38552
+ \u0275\u0275property("value", ctx_r0.password);
38553
+ \u0275\u0275advance(3);
38554
+ \u0275\u0275property("value", ctx_r0.passwordConfirmation);
38555
+ \u0275\u0275advance();
38556
+ \u0275\u0275conditional(ctx_r0.passwordError ? 10 : -1);
38557
+ \u0275\u0275advance();
38558
+ \u0275\u0275property("disabled", ctx_r0.passwordBusy);
38559
+ \u0275\u0275advance();
38560
+ \u0275\u0275textInterpolate1(" ", ctx_r0.passwordBusy ? "Saving\u2026" : "Set password", " ");
38561
+ \u0275\u0275advance();
38562
+ \u0275\u0275property("disabled", ctx_r0.passwordBusy);
38563
+ }
38564
+ }
38565
+ function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_2_Conditional_3_Template(rf, ctx) {
38566
+ if (rf & 1) {
38567
+ const _r4 = \u0275\u0275getCurrentView();
38568
+ \u0275\u0275elementStart(0, "button", 23);
38569
+ \u0275\u0275listener("click", function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_2_Conditional_3_Template_button_click_0_listener() {
38570
+ \u0275\u0275restoreView(_r4);
38571
+ const ctx_r0 = \u0275\u0275nextContext(4);
38572
+ return \u0275\u0275resetView(ctx_r0.dismissAccount());
38573
+ });
38574
+ \u0275\u0275text(1, "Not now");
38575
+ \u0275\u0275elementEnd();
38576
+ }
38577
+ }
38578
+ function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_2_Template(rf, ctx) {
38579
+ if (rf & 1) {
38580
+ const _r3 = \u0275\u0275getCurrentView();
38581
+ \u0275\u0275elementStart(0, "div", 20)(1, "button", 21);
38582
+ \u0275\u0275listener("click", function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_2_Template_button_click_1_listener() {
38583
+ \u0275\u0275restoreView(_r3);
38584
+ const ctx_r0 = \u0275\u0275nextContext(3);
38585
+ return \u0275\u0275resetView(ctx_r0.retryAccount());
38586
+ });
38587
+ \u0275\u0275text(2, "Try again");
38588
+ \u0275\u0275elementEnd();
38589
+ \u0275\u0275conditionalCreate(3, CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_2_Conditional_3_Template, 2, 0, "button", 22);
38590
+ \u0275\u0275elementEnd();
38591
+ }
38592
+ if (rf & 2) {
38593
+ const ctx_r0 = \u0275\u0275nextContext(3);
38594
+ \u0275\u0275advance(3);
38595
+ \u0275\u0275conditional((ctx_r0.config == null ? null : ctx_r0.config.redirectUrl) ? 3 : -1);
38596
+ }
38597
+ }
38598
+ function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Template(rf, ctx) {
38599
+ if (rf & 1) {
38600
+ \u0275\u0275elementStart(0, "p", 8);
38601
+ \u0275\u0275text(1);
38602
+ \u0275\u0275elementEnd();
38603
+ \u0275\u0275conditionalCreate(2, CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_2_Template, 4, 1, "div", 20);
38604
+ }
38605
+ if (rf & 2) {
38606
+ const ctx_r0 = \u0275\u0275nextContext(2);
38607
+ \u0275\u0275advance();
38608
+ \u0275\u0275textInterpolate(ctx_r0.accountMessage);
38609
+ \u0275\u0275advance();
38610
+ \u0275\u0275conditional((ctx_r0.account == null ? null : ctx_r0.account.Outcome) === "Failed" ? 2 : -1);
38611
+ }
38612
+ }
37690
38613
  function CheckoutPublicHostComponent_Conditional_2_Template(rf, ctx) {
37691
38614
  if (rf & 1) {
37692
- \u0275\u0275elementStart(0, "div", 2)(1, "div", 5);
38615
+ \u0275\u0275elementStart(0, "div", 2)(1, "div", 4);
37693
38616
  \u0275\u0275text(2, "\u2713");
37694
38617
  \u0275\u0275elementEnd();
37695
- \u0275\u0275elementStart(3, "h1", 6);
38618
+ \u0275\u0275elementStart(3, "h1", 5);
37696
38619
  \u0275\u0275text(4, "You're all set");
37697
38620
  \u0275\u0275elementEnd();
37698
- \u0275\u0275elementStart(5, "p", 7);
38621
+ \u0275\u0275elementStart(5, "p", 6);
37699
38622
  \u0275\u0275text(6);
37700
38623
  \u0275\u0275elementEnd();
37701
- \u0275\u0275conditionalCreate(7, CheckoutPublicHostComponent_Conditional_2_Conditional_7_Template, 2, 1, "p", 8);
38624
+ \u0275\u0275conditionalCreate(7, CheckoutPublicHostComponent_Conditional_2_Conditional_7_Template, 2, 1, "p", 7);
38625
+ \u0275\u0275conditionalCreate(8, CheckoutPublicHostComponent_Conditional_2_Conditional_8_Template, 2, 0, "p", 8)(9, CheckoutPublicHostComponent_Conditional_2_Conditional_9_Template, 15, 7, "form", 9)(10, CheckoutPublicHostComponent_Conditional_2_Conditional_10_Template, 3, 2);
37702
38626
  \u0275\u0275elementEnd();
37703
38627
  }
37704
38628
  if (rf & 2) {
@@ -37707,6 +38631,8 @@ function CheckoutPublicHostComponent_Conditional_2_Template(rf, ctx) {
37707
38631
  \u0275\u0275textInterpolate(ctx_r0.successMessage);
37708
38632
  \u0275\u0275advance();
37709
38633
  \u0275\u0275conditional(ctx_r0.orderNumber ? 7 : -1);
38634
+ \u0275\u0275advance();
38635
+ \u0275\u0275conditional(ctx_r0.accountLoading ? 8 : (ctx_r0.account == null ? null : ctx_r0.account.CanSetPassword) ? 9 : ctx_r0.accountMessage ? 10 : -1);
37710
38636
  }
37711
38637
  }
37712
38638
  function CheckoutPublicHostComponent_Conditional_3_Template(rf, ctx) {
@@ -37716,24 +38642,33 @@ function CheckoutPublicHostComponent_Conditional_3_Template(rf, ctx) {
37716
38642
  \u0275\u0275elementEnd();
37717
38643
  }
37718
38644
  }
37719
- function CheckoutPublicHostComponent_Conditional_4_Template(rf, ctx) {
38645
+ function CheckoutPublicHostComponent_Conditional_4_For_1_Template(rf, ctx) {
37720
38646
  if (rf & 1) {
37721
- const _r2 = \u0275\u0275getCurrentView();
37722
- \u0275\u0275elementStart(0, "mj-checkout-widget", 9);
37723
- \u0275\u0275listener("submitted", function CheckoutPublicHostComponent_Conditional_4_Template_mj_checkout_widget_submitted_0_listener($event) {
37724
- \u0275\u0275restoreView(_r2);
37725
- const ctx_r0 = \u0275\u0275nextContext();
38647
+ const _r5 = \u0275\u0275getCurrentView();
38648
+ \u0275\u0275elementStart(0, "mj-checkout-widget", 25);
38649
+ \u0275\u0275listener("submitted", function CheckoutPublicHostComponent_Conditional_4_For_1_Template_mj_checkout_widget_submitted_0_listener($event) {
38650
+ \u0275\u0275restoreView(_r5);
38651
+ const ctx_r0 = \u0275\u0275nextContext(2);
37726
38652
  return \u0275\u0275resetView(ctx_r0.onSubmitted($event));
37727
- })("cancelled", function CheckoutPublicHostComponent_Conditional_4_Template_mj_checkout_widget_cancelled_0_listener() {
37728
- \u0275\u0275restoreView(_r2);
37729
- const ctx_r0 = \u0275\u0275nextContext();
38653
+ })("cancelled", function CheckoutPublicHostComponent_Conditional_4_For_1_Template_mj_checkout_widget_cancelled_0_listener() {
38654
+ \u0275\u0275restoreView(_r5);
38655
+ const ctx_r0 = \u0275\u0275nextContext(2);
37730
38656
  return \u0275\u0275resetView(ctx_r0.onCancelled());
37731
38657
  });
37732
38658
  \u0275\u0275elementEnd();
37733
38659
  }
38660
+ if (rf & 2) {
38661
+ const ctx_r0 = \u0275\u0275nextContext(2);
38662
+ \u0275\u0275property("config", ctx_r0.config)("distributionSlug", ctx_r0.slug)("sessionKey", ctx_r0.sessionKey)("isProcessing", ctx_r0.processing)("isPaymentReady", ctx_r0.isPaymentReady)("stripePaymentMethodId", ctx_r0.stripePaymentMethodId)("prefillEmail", ctx_r0.prefillEmail)("errorMessage", ctx_r0.errorMessage);
38663
+ }
38664
+ }
38665
+ function CheckoutPublicHostComponent_Conditional_4_Template(rf, ctx) {
38666
+ if (rf & 1) {
38667
+ \u0275\u0275repeaterCreate(0, CheckoutPublicHostComponent_Conditional_4_For_1_Template, 1, 8, "mj-checkout-widget", 24, \u0275\u0275repeaterTrackByIdentity);
38668
+ }
37734
38669
  if (rf & 2) {
37735
38670
  const ctx_r0 = \u0275\u0275nextContext();
37736
- \u0275\u0275property("config", ctx_r0.config)("distributionSlug", ctx_r0.slug)("sessionKey", ctx_r0.sessionKey)("isProcessing", ctx_r0.processing)("isPaymentReady", ctx_r0.isPaymentReady)("stripePaymentMethodId", ctx_r0.stripePaymentMethodId)("errorMessage", ctx_r0.errorMessage);
38671
+ \u0275\u0275repeater(\u0275\u0275pureFunction1(0, _c0, ctx_r0.formGeneration));
37737
38672
  }
37738
38673
  }
37739
38674
  var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
@@ -37751,10 +38686,35 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37751
38686
  loadError = null;
37752
38687
  successMessage = null;
37753
38688
  orderNumber = null;
38689
+ /** The post-payment account step, when the host registered one (#292). */
38690
+ account = null;
38691
+ password = "";
38692
+ passwordConfirmation = "";
38693
+ passwordError = null;
38694
+ passwordBusy = false;
38695
+ passwordSet = false;
38696
+ /** True while the account step is being asked for. */
38697
+ accountLoading = false;
38698
+ /** The buyer chose to leave a failed account step. */
38699
+ accountDismissed = false;
38700
+ get accountMessage() {
38701
+ return this.account ? AccountMessage(this.account, this.passwordSet) : null;
38702
+ }
38703
+ get verificationNote() {
38704
+ return VerificationNote(this.account);
38705
+ }
37754
38706
  stripe = null;
37755
38707
  card = null;
37756
38708
  cardMounted = false;
37757
38709
  destroyed = false;
38710
+ state = null;
38711
+ /** Bumped by Cancel: the template re-creates the widget, which clears everything the buyer entered. */
38712
+ formGeneration = 0;
38713
+ /** From the element's attributes, for a host that embeds the checkout in its own panel. */
38714
+ prefillEmail = null;
38715
+ attributionSource = null;
38716
+ attributionReference = null;
38717
+ onResetRequested = () => this.resetRequested();
37758
38718
  get isFree() {
37759
38719
  return (this.config?.unitPrice ?? 0) <= 0;
37760
38720
  }
@@ -37769,6 +38729,10 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37769
38729
  this.loadError = "Checkout requires a secure random source. Open this page over HTTPS.";
37770
38730
  return;
37771
38731
  }
38732
+ if (await this.resumeAccountStep()) {
38733
+ return;
38734
+ }
38735
+ this.setState("LOADING");
37772
38736
  try {
37773
38737
  const init = await this.post("/initialize", {
37774
38738
  slug: this.slug,
@@ -37791,9 +38755,12 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37791
38755
  return;
37792
38756
  }
37793
38757
  this.config = cfg;
38758
+ this.setState("CHECKOUT");
37794
38759
  } catch {
37795
38760
  this.loadError = "Checkout is temporarily unavailable. Please try again.";
37796
38761
  } finally {
38762
+ if (this.loadError)
38763
+ this.reportError(this.loadError);
37797
38764
  this.cdr.detectChanges();
37798
38765
  }
37799
38766
  }
@@ -37812,13 +38779,78 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37812
38779
  }
37813
38780
  ngOnDestroy() {
37814
38781
  this.destroyed = true;
38782
+ this.hostEl?.nativeElement?.removeEventListener?.(CHECKOUT_RESET_REQUEST_EVENT, this.onResetRequested);
37815
38783
  try {
37816
38784
  this.card?.unmount?.();
37817
38785
  } catch {
37818
38786
  }
37819
38787
  }
38788
+ /**
38789
+ * Cancel resets the checkout to a blank form and tells the host page, which may close the modal
38790
+ * the checkout sits in. The widget is re-created, so every field the buyer filled in is cleared,
38791
+ * and the card field is mounted again on the new form. The session stays open for the next try.
38792
+ */
37820
38793
  onCancelled() {
38794
+ if (this.processing) {
38795
+ return;
38796
+ }
38797
+ this.resetForm();
38798
+ this.setState("CHECKOUT");
38799
+ this.dispatch(CHECKOUT_CANCEL_EVENT, {});
38800
+ this.dispatch(CHECKOUT_CLOSE_EVENT, {});
38801
+ this.cdr.detectChanges();
38802
+ }
38803
+ /**
38804
+ * A reset the embedding host asked for, by dispatching `checkout-reset` on the element (a voice
38805
+ * or chat agent closing its panel, say). Refused while a payment is in flight — resetting then
38806
+ * would strand a charge the buyer cannot see. Unlike Cancel it sends no `checkout-cancel` or
38807
+ * `checkout-close`: the host started it. Also refused while the account step after a sale is
38808
+ * unsettled, since the buyer could not come back to it.
38809
+ *
38810
+ * A reset always starts a new session, before a sale as well as after one: the server matches
38811
+ * the buyer's person record once per session, so a kept session would carry the previous
38812
+ * conversation's buyer into the next. The e-mail and attribution are read again, so a host
38813
+ * starting a new conversation sets them on the element before it dispatches the reset.
38814
+ */
38815
+ resetRequested() {
38816
+ if (this.processing || this.accountUnsettled) {
38817
+ this.dispatch(CHECKOUT_RESET_REFUSED_EVENT, { state: this.state });
38818
+ return;
38819
+ }
38820
+ this.successMessage = null;
38821
+ this.orderNumber = null;
38822
+ this.account = null;
38823
+ this.accountDismissed = false;
38824
+ this.password = "";
38825
+ this.passwordConfirmation = "";
38826
+ this.passwordError = null;
38827
+ this.passwordSet = false;
38828
+ this.config = null;
38829
+ this.sessionId = "";
38830
+ this.forgetClientKey();
38831
+ this.forgetCompleting();
38832
+ this.resetForm();
38833
+ void this.ngOnInit();
38834
+ }
38835
+ /** The account step is still asking the buyer for something, and the buyer has not left it. */
38836
+ get accountUnsettled() {
38837
+ return this.accountLoading || this.passwordBusy || !this.accountDismissed && !IsAccountSettled(this.account);
38838
+ }
38839
+ /**
38840
+ * Back to a blank form: every field, the error banner and the card entry. The session stays open.
38841
+ * The caller reports the state, since a host reset reports `LOADING` next, not `CHECKOUT`.
38842
+ */
38843
+ resetForm() {
37821
38844
  this.errorMessage = null;
38845
+ this.stripePaymentMethodId = null;
38846
+ try {
38847
+ this.card?.destroy?.();
38848
+ } catch {
38849
+ }
38850
+ this.card = null;
38851
+ this.cardMounted = false;
38852
+ this.isPaymentReady = !this.config?.stripePublishableKey;
38853
+ this.formGeneration++;
37822
38854
  }
37823
38855
  async onSubmitted(event) {
37824
38856
  if (this.processing || !this.config?.productId) {
@@ -37826,13 +38858,16 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37826
38858
  }
37827
38859
  this.processing = true;
37828
38860
  this.errorMessage = null;
38861
+ this.setState("PROCESSING");
37829
38862
  try {
37830
38863
  const line = buildCheckoutDraftLine(this.config.productId, event);
37831
38864
  const draft = await this.post("/draft", {
37832
38865
  sessionId: this.sessionId,
37833
38866
  clientSessionKey: this.sessionKey,
37834
38867
  email: event.email,
37835
- lines: [line]
38868
+ lines: [line],
38869
+ answers: event.answers,
38870
+ ...this.attributionSource ? { attribution: { source: this.attributionSource, reference: this.attributionReference } } : {}
37836
38871
  });
37837
38872
  if (!draft?.Success) {
37838
38873
  throw new Error(this.str(draft?.ErrorMessage, "Could not price this checkout."));
@@ -37878,12 +38913,14 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37878
38913
  await this.finish();
37879
38914
  } catch (err) {
37880
38915
  this.errorMessage = err instanceof Error ? err.message : "Checkout failed.";
38916
+ this.reportError(this.errorMessage);
37881
38917
  } finally {
37882
38918
  this.processing = false;
37883
38919
  this.cdr.detectChanges();
37884
38920
  }
37885
38921
  }
37886
38922
  async finish() {
38923
+ this.rememberCompleting(this.sessionId);
37887
38924
  const done = await this.post("/complete", {
37888
38925
  sessionId: this.sessionId,
37889
38926
  clientSessionKey: this.sessionKey
@@ -37893,11 +38930,144 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37893
38930
  }
37894
38931
  this.orderNumber = done.OrderNumber ? String(done.OrderNumber) : null;
37895
38932
  this.successMessage = this.config?.successMessage || (this.orderNumber ? `Thank you. Order ${this.orderNumber} is confirmed.` : "Thank you. Your order is confirmed.");
37896
- if (this.config?.redirectUrl) {
37897
- window.location.href = this.config.redirectUrl;
38933
+ this.setState("SUCCESS");
38934
+ this.dispatch(CHECKOUT_COMPLETE_EVENT, BuildCheckoutCompleteDetail({
38935
+ sessionId: this.sessionId,
38936
+ productName: this.config?.productName ?? this.config?.title,
38937
+ productId: this.config?.productId,
38938
+ totalGross: done.TotalGross,
38939
+ currency: this.config?.currency,
38940
+ // The applied promotion code, once the checkout takes one.
38941
+ coupon: null
38942
+ }));
38943
+ if (done.AccountStep === true) {
38944
+ await this.loadAccount();
38945
+ } else {
38946
+ this.forgetCompleting();
38947
+ this.leaveIfDone();
38948
+ }
38949
+ this.cdr.detectChanges();
38950
+ }
38951
+ /** Asks for the account step of the completed checkout. The host is asked again only after a failure. */
38952
+ async loadAccount() {
38953
+ this.accountLoading = true;
38954
+ this.cdr.detectChanges();
38955
+ try {
38956
+ const res = await this.post("/account", {
38957
+ sessionId: this.sessionId,
38958
+ clientSessionKey: this.sessionKey
38959
+ });
38960
+ this.account = res.Success ? ReadCheckoutAccount(res.Account) : ACCOUNT_STEP_FAILED;
38961
+ } catch {
38962
+ this.account = ACCOUNT_STEP_FAILED;
38963
+ } finally {
38964
+ this.accountLoading = false;
37898
38965
  }
38966
+ if (IsAccountSettled(this.account))
38967
+ this.forgetCompleting();
38968
+ this.leaveIfDone();
37899
38969
  this.cdr.detectChanges();
37900
38970
  }
38971
+ /** Asks the host again after the account step failed. */
38972
+ async retryAccount() {
38973
+ if (this.accountLoading)
38974
+ return;
38975
+ await this.loadAccount();
38976
+ }
38977
+ /** Leaves a failed account step. A reload of this checkout in the same tab offers it again. */
38978
+ dismissAccount() {
38979
+ this.accountDismissed = true;
38980
+ this.leaveIfDone();
38981
+ }
38982
+ /**
38983
+ * A reload after payment: when this tab completed a checkout whose account step is not settled,
38984
+ * shows the confirmation and the account step instead of a new checkout.
38985
+ */
38986
+ async resumeAccountStep() {
38987
+ const sessionId = this.completingSession();
38988
+ if (!sessionId)
38989
+ return false;
38990
+ try {
38991
+ const res = await this.post("/account", { sessionId, clientSessionKey: this.sessionKey });
38992
+ const account = res.Success ? ReadCheckoutAccount(res.Account) : null;
38993
+ if (!account) {
38994
+ this.forgetCompleting();
38995
+ return false;
38996
+ }
38997
+ this.sessionId = sessionId;
38998
+ this.successMessage = "Thank you. Your order is confirmed.";
38999
+ this.account = account;
39000
+ if (IsAccountSettled(account))
39001
+ this.forgetCompleting();
39002
+ return true;
39003
+ } catch {
39004
+ return false;
39005
+ } finally {
39006
+ this.cdr.detectChanges();
39007
+ }
39008
+ }
39009
+ /** Sends the new account's password. The host's policy decides; its message is shown when it refuses. */
39010
+ async submitPassword() {
39011
+ const problem = CheckPasswordEntry(this.password, this.passwordConfirmation);
39012
+ if (problem) {
39013
+ this.passwordError = problem;
39014
+ return;
39015
+ }
39016
+ this.passwordBusy = true;
39017
+ this.passwordError = null;
39018
+ try {
39019
+ const res = await this.post("/account/password", {
39020
+ sessionId: this.sessionId,
39021
+ clientSessionKey: this.sessionKey,
39022
+ password: this.password
39023
+ });
39024
+ this.account = ReadCheckoutAccount(res.Account) ?? this.account;
39025
+ if (IsAccountSettled(this.account))
39026
+ this.forgetCompleting();
39027
+ if (res.Success) {
39028
+ this.passwordSet = true;
39029
+ this.password = "";
39030
+ this.passwordConfirmation = "";
39031
+ this.leaveIfDone();
39032
+ } else {
39033
+ this.passwordError = this.str(res.ErrorMessage, "That password could not be set. Please try another.");
39034
+ }
39035
+ } catch {
39036
+ this.passwordError = "That password could not be set right now. Please try again.";
39037
+ } finally {
39038
+ this.passwordBusy = false;
39039
+ this.cdr.detectChanges();
39040
+ }
39041
+ }
39042
+ /** Leaves the password for later: the buyer can reset it at sign-in. */
39043
+ skipPassword() {
39044
+ if (this.account)
39045
+ this.account = { ...this.account, CanSetPassword: false };
39046
+ this.forgetCompleting();
39047
+ this.leaveIfDone();
39048
+ }
39049
+ /** Follows the widget's redirect once nothing is left for the buyer to do here. */
39050
+ leaveIfDone() {
39051
+ if (this.config?.redirectUrl && !this.accountLoading && MayRedirect(this.account, this.accountDismissed)) {
39052
+ window.location.href = this.config.redirectUrl;
39053
+ }
39054
+ }
39055
+ /** Reports a state the host page can track; repeats of the same state are not re-sent. */
39056
+ setState(state) {
39057
+ if (this.state === state)
39058
+ return;
39059
+ this.state = state;
39060
+ this.dispatch(CHECKOUT_STATE_CHANGE_EVENT, { state });
39061
+ }
39062
+ reportError(message) {
39063
+ this.setState("ERROR");
39064
+ this.dispatch(CHECKOUT_ERROR_EVENT, { message });
39065
+ }
39066
+ /** Dispatches on the `<mj-orders-checkout>` element; bubbling and composed, so `document` hears it too. */
39067
+ dispatch(name, detail) {
39068
+ const el = this.hostEl?.nativeElement;
39069
+ el?.dispatchEvent(CheckoutElementEvent(name, detail));
39070
+ }
37901
39071
  async mountStripe(mount) {
37902
39072
  const pk = this.config?.stripePublishableKey;
37903
39073
  if (!pk) {
@@ -37915,6 +39085,7 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37915
39085
  } catch (err) {
37916
39086
  this.cardMounted = false;
37917
39087
  this.errorMessage = err instanceof Error ? err.message : "Could not load card entry.";
39088
+ this.reportError(this.errorMessage);
37918
39089
  }
37919
39090
  }
37920
39091
  loadStripe(pk) {
@@ -37953,6 +39124,27 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37953
39124
  if (apiRoot) {
37954
39125
  this.apiRoot = apiRoot.replace(/\/+$/, "");
37955
39126
  }
39127
+ this.readConversationAttributes();
39128
+ el.addEventListener?.(CHECKOUT_RESET_REQUEST_EVENT, this.onResetRequested);
39129
+ }
39130
+ /**
39131
+ * For a host that embeds the checkout in its own panel: an e-mail it already knows, and where the
39132
+ * checkout came from. The server keeps the attribution only if it reads as one.
39133
+ */
39134
+ readConversationAttributes() {
39135
+ const el = this.hostEl?.nativeElement;
39136
+ if (!el) {
39137
+ return;
39138
+ }
39139
+ this.prefillEmail = el.getAttribute("email") || el.getAttribute("data-email") || null;
39140
+ this.attributionSource = el.getAttribute("source") || el.getAttribute("data-source") || null;
39141
+ this.attributionReference = el.getAttribute("source-ref") || el.getAttribute("data-source-ref") || null;
39142
+ }
39143
+ forgetClientKey() {
39144
+ try {
39145
+ sessionStorage.removeItem(`mj-checkout-key:${this.slug}`);
39146
+ } catch {
39147
+ }
37956
39148
  }
37957
39149
  clientKey() {
37958
39150
  const storageKey = `mj-checkout-key:${this.slug}`;
@@ -37982,6 +39174,28 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37982
39174
  }
37983
39175
  return key;
37984
39176
  }
39177
+ get completingKey() {
39178
+ return `mj-checkout-completing:${this.slug}`;
39179
+ }
39180
+ rememberCompleting(sessionId) {
39181
+ try {
39182
+ sessionStorage.setItem(this.completingKey, sessionId);
39183
+ } catch {
39184
+ }
39185
+ }
39186
+ forgetCompleting() {
39187
+ try {
39188
+ sessionStorage.removeItem(this.completingKey);
39189
+ } catch {
39190
+ }
39191
+ }
39192
+ completingSession() {
39193
+ try {
39194
+ return sessionStorage.getItem(this.completingKey);
39195
+ } catch {
39196
+ return null;
39197
+ }
39198
+ }
37985
39199
  async post(path, body) {
37986
39200
  const res = await fetch(`${this.apiRoot}${path}`, {
37987
39201
  method: "POST",
@@ -37999,17 +39213,17 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
37999
39213
  static \u0275fac = function CheckoutPublicHostComponent_Factory(__ngFactoryType__) {
38000
39214
  return new (__ngFactoryType__ || _CheckoutPublicHostComponent)();
38001
39215
  };
38002
- static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _CheckoutPublicHostComponent, selectors: [["mj-orders-checkout"]], inputs: { slug: "slug", apiRoot: "apiRoot" }, decls: 5, vars: 1, consts: [[1, "mj-checkout-public"], ["role", "alert", 1, "mj-widget-error-banner"], ["role", "status", 1, "mj-checkout-success"], ["role", "status", 1, "mj-checkout-public__status"], [3, "config", "distributionSlug", "sessionKey", "isProcessing", "isPaymentReady", "stripePaymentMethodId", "errorMessage"], ["aria-hidden", "true", 1, "mj-checkout-success__icon"], [1, "mj-checkout-success__title"], [1, "mj-checkout-success__msg"], [1, "mj-checkout-success__order"], [3, "submitted", "cancelled", "config", "distributionSlug", "sessionKey", "isProcessing", "isPaymentReady", "stripePaymentMethodId", "errorMessage"]], template: function CheckoutPublicHostComponent_Template(rf, ctx) {
39216
+ static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _CheckoutPublicHostComponent, selectors: [["mj-orders-checkout"]], inputs: { slug: "slug", apiRoot: "apiRoot" }, decls: 5, vars: 1, consts: [[1, "mj-checkout-public"], ["role", "alert", 1, "mj-widget-error-banner"], ["role", "status", 1, "mj-checkout-success"], ["role", "status", 1, "mj-checkout-public__status"], ["aria-hidden", "true", 1, "mj-checkout-success__icon"], [1, "mj-checkout-success__title"], [1, "mj-checkout-success__msg"], [1, "mj-checkout-success__order"], ["role", "status", 1, "mj-checkout-account__msg"], [1, "mj-checkout-account"], [1, "mj-checkout-account", 3, "submit"], [1, "mj-checkout-account__title"], [1, "mj-checkout-account__note"], ["for", "mj-checkout-password", 1, "mj-checkout-account__label"], ["id", "mj-checkout-password", "type", "password", "autocomplete", "new-password", 1, "mj-checkout-account__input", 3, "input", "value"], ["for", "mj-checkout-password-confirm", 1, "mj-checkout-account__label"], ["id", "mj-checkout-password-confirm", "type", "password", "autocomplete", "new-password", 1, "mj-checkout-account__input", 3, "input", "value"], ["role", "alert", 1, "mj-checkout-account__error"], ["type", "submit", 1, "mj-checkout-account__submit", 3, "disabled"], ["type", "button", 1, "mj-checkout-account__skip", 3, "click", "disabled"], [1, "mj-checkout-account", "mj-checkout-account--actions"], ["type", "button", 1, "mj-checkout-account__submit", 3, "click"], ["type", "button", 1, "mj-checkout-account__skip"], ["type", "button", 1, "mj-checkout-account__skip", 3, "click"], [3, "config", "distributionSlug", "sessionKey", "isProcessing", "isPaymentReady", "stripePaymentMethodId", "prefillEmail", "errorMessage"], [3, "submitted", "cancelled", "config", "distributionSlug", "sessionKey", "isProcessing", "isPaymentReady", "stripePaymentMethodId", "prefillEmail", "errorMessage"]], template: function CheckoutPublicHostComponent_Template(rf, ctx) {
38003
39217
  if (rf & 1) {
38004
39218
  \u0275\u0275elementStart(0, "div", 0);
38005
- \u0275\u0275conditionalCreate(1, CheckoutPublicHostComponent_Conditional_1_Template, 2, 1, "div", 1)(2, CheckoutPublicHostComponent_Conditional_2_Template, 8, 2, "div", 2)(3, CheckoutPublicHostComponent_Conditional_3_Template, 2, 0, "p", 3)(4, CheckoutPublicHostComponent_Conditional_4_Template, 1, 7, "mj-checkout-widget", 4);
39219
+ \u0275\u0275conditionalCreate(1, CheckoutPublicHostComponent_Conditional_1_Template, 2, 1, "div", 1)(2, CheckoutPublicHostComponent_Conditional_2_Template, 11, 3, "div", 2)(3, CheckoutPublicHostComponent_Conditional_3_Template, 2, 0, "p", 3)(4, CheckoutPublicHostComponent_Conditional_4_Template, 2, 2);
38006
39220
  \u0275\u0275elementEnd();
38007
39221
  }
38008
39222
  if (rf & 2) {
38009
39223
  \u0275\u0275advance();
38010
39224
  \u0275\u0275conditional(ctx.loadError ? 1 : ctx.successMessage ? 2 : !ctx.config ? 3 : 4);
38011
39225
  }
38012
- }, dependencies: [CommonModule, MJCheckoutWidgetComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n}\n\n.mj-checkout-public[_ngcontent-%COMP%] {\n max-width: 580px;\n margin: 0 auto;\n}\n\n.mj-checkout-public__status[_ngcontent-%COMP%] {\n text-align: center;\n color: #64748b;\n font-size: 0.95rem;\n padding: 2rem 0;\n}\n\n.mj-widget-error-banner[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n font-size: 0.875rem;\n}\n\n.mj-checkout-success[_ngcontent-%COMP%] {\n text-align: center;\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 2rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n}\n\n.mj-checkout-success__icon[_ngcontent-%COMP%] {\n width: 3rem;\n height: 3rem;\n margin: 0 auto 1rem;\n border-radius: 50%;\n background: #dcfce7;\n color: #16a34a;\n font-size: 1.5rem;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-checkout-success__title[_ngcontent-%COMP%] {\n margin: 0 0 0.5rem;\n font-size: 1.5rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-success__msg[_ngcontent-%COMP%], \n.mj-checkout-success__order[_ngcontent-%COMP%] {\n margin: 0;\n color: #64748b;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-success__order[_ngcontent-%COMP%] {\n margin-top: 0.75rem;\n font-weight: 600;\n color: #334155;\n}"] });
39226
+ }, dependencies: [CommonModule, MJCheckoutWidgetComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n}\n\n.mj-checkout-public[_ngcontent-%COMP%] {\n max-width: 580px;\n margin: 0 auto;\n}\n\n.mj-checkout-public__status[_ngcontent-%COMP%] {\n text-align: center;\n color: #64748b;\n font-size: 0.95rem;\n padding: 2rem 0;\n}\n\n.mj-widget-error-banner[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n font-size: 0.875rem;\n}\n\n.mj-checkout-success[_ngcontent-%COMP%] {\n text-align: center;\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 2rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n}\n\n.mj-checkout-success__icon[_ngcontent-%COMP%] {\n width: 3rem;\n height: 3rem;\n margin: 0 auto 1rem;\n border-radius: 50%;\n background: #dcfce7;\n color: #16a34a;\n font-size: 1.5rem;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-checkout-success__title[_ngcontent-%COMP%] {\n margin: 0 0 0.5rem;\n font-size: 1.5rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-success__msg[_ngcontent-%COMP%], \n.mj-checkout-success__order[_ngcontent-%COMP%] {\n margin: 0;\n color: #64748b;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-success__order[_ngcontent-%COMP%] {\n margin-top: 0.75rem;\n font-weight: 600;\n color: #334155;\n}\n\n\n\n.mj-checkout-account[_ngcontent-%COMP%] {\n margin: 1.5rem auto 0;\n max-width: 320px;\n text-align: left;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.mj-checkout-account__title[_ngcontent-%COMP%] {\n margin: 0 0 0.5rem;\n font-size: 1.05rem;\n font-weight: 700;\n color: #0f172a;\n text-align: center;\n}\n\n.mj-checkout-account__label[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n font-weight: 600;\n color: #334155;\n}\n\n.mj-checkout-account__input[_ngcontent-%COMP%] {\n padding: 8px 10px;\n border: 1px solid #cbd5e1;\n border-radius: 6px;\n font-size: 0.95rem;\n font-family: inherit;\n}\n\n.mj-checkout-account__input[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: var(--mj-primary-color, #2563eb);\n box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);\n}\n\n.mj-checkout-account__error[_ngcontent-%COMP%] {\n margin: 4px 0 0;\n color: #991b1b;\n font-size: 0.85rem;\n}\n\n.mj-checkout-account__submit[_ngcontent-%COMP%] {\n margin-top: 10px;\n padding: 10px;\n border: 0;\n border-radius: 6px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-weight: 600;\n cursor: pointer;\n}\n\n.mj-checkout-account__skip[_ngcontent-%COMP%] {\n padding: 6px;\n border: 0;\n background: none;\n color: #64748b;\n font-size: 0.85rem;\n cursor: pointer;\n}\n\n.mj-checkout-account__submit[_ngcontent-%COMP%]:disabled, \n.mj-checkout-account__skip[_ngcontent-%COMP%]:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.mj-checkout-account__msg[_ngcontent-%COMP%] {\n margin: 1rem 0 0;\n color: #334155;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-account__note[_ngcontent-%COMP%] {\n margin: 0 0 0.5rem;\n color: #475569;\n font-size: 0.85rem;\n line-height: 1.45;\n text-align: center;\n}\n\n.mj-checkout-account--actions[_ngcontent-%COMP%] {\n margin-top: 0.75rem;\n}"] });
38013
39227
  };
38014
39228
  (() => {
38015
39229
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CheckoutPublicHostComponent, [{
@@ -38025,10 +39239,56 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
38025
39239
  @if (orderNumber) {
38026
39240
  <p class="mj-checkout-success__order">Order {{ orderNumber }}</p>
38027
39241
  }
39242
+ @if (accountLoading) {
39243
+ <p class="mj-checkout-account__msg" role="status">Setting up your account\u2026</p>
39244
+ } @else if (account?.CanSetPassword) {
39245
+ <form class="mj-checkout-account" (submit)="$event.preventDefault(); submitPassword()">
39246
+ <h2 class="mj-checkout-account__title">Set a password for your account</h2>
39247
+ @if (verificationNote) {
39248
+ <p class="mj-checkout-account__note">{{ verificationNote }}</p>
39249
+ }
39250
+ <label class="mj-checkout-account__label" for="mj-checkout-password">Password</label>
39251
+ <input
39252
+ id="mj-checkout-password"
39253
+ class="mj-checkout-account__input"
39254
+ type="password"
39255
+ autocomplete="new-password"
39256
+ [value]="password"
39257
+ (input)="password = $any($event.target).value" />
39258
+ <label class="mj-checkout-account__label" for="mj-checkout-password-confirm">Confirm password</label>
39259
+ <input
39260
+ id="mj-checkout-password-confirm"
39261
+ class="mj-checkout-account__input"
39262
+ type="password"
39263
+ autocomplete="new-password"
39264
+ [value]="passwordConfirmation"
39265
+ (input)="passwordConfirmation = $any($event.target).value" />
39266
+ @if (passwordError) {
39267
+ <p class="mj-checkout-account__error" role="alert">{{ passwordError }}</p>
39268
+ }
39269
+ <button class="mj-checkout-account__submit" type="submit" [disabled]="passwordBusy">
39270
+ {{ passwordBusy ? 'Saving\u2026' : 'Set password' }}
39271
+ </button>
39272
+ <button class="mj-checkout-account__skip" type="button" (click)="skipPassword()" [disabled]="passwordBusy">
39273
+ Not now
39274
+ </button>
39275
+ </form>
39276
+ } @else if (accountMessage) {
39277
+ <p class="mj-checkout-account__msg" role="status">{{ accountMessage }}</p>
39278
+ @if (account?.Outcome === 'Failed') {
39279
+ <div class="mj-checkout-account mj-checkout-account--actions">
39280
+ <button class="mj-checkout-account__submit" type="button" (click)="retryAccount()">Try again</button>
39281
+ @if (config?.redirectUrl) {
39282
+ <button class="mj-checkout-account__skip" type="button" (click)="dismissAccount()">Not now</button>
39283
+ }
39284
+ </div>
39285
+ }
39286
+ }
38028
39287
  </div>
38029
39288
  } @else if (!config) {
38030
39289
  <p class="mj-checkout-public__status" role="status">Loading checkout\u2026</p>
38031
39290
  } @else {
39291
+ @for (generation of [formGeneration]; track generation) {
38032
39292
  <mj-checkout-widget
38033
39293
  [config]="config"
38034
39294
  [distributionSlug]="slug"
@@ -38036,13 +39296,15 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
38036
39296
  [isProcessing]="processing"
38037
39297
  [isPaymentReady]="isPaymentReady"
38038
39298
  [stripePaymentMethodId]="stripePaymentMethodId"
39299
+ [prefillEmail]="prefillEmail"
38039
39300
  [errorMessage]="errorMessage"
38040
39301
  (submitted)="onSubmitted($event)"
38041
39302
  (cancelled)="onCancelled()">
38042
39303
  </mj-checkout-widget>
39304
+ }
38043
39305
  }
38044
39306
  </div>
38045
- `, styles: [":host {\n display: block;\n}\n\n.mj-checkout-public {\n max-width: 580px;\n margin: 0 auto;\n}\n\n.mj-checkout-public__status {\n text-align: center;\n color: #64748b;\n font-size: 0.95rem;\n padding: 2rem 0;\n}\n\n.mj-widget-error-banner {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n font-size: 0.875rem;\n}\n\n.mj-checkout-success {\n text-align: center;\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 2rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n}\n\n.mj-checkout-success__icon {\n width: 3rem;\n height: 3rem;\n margin: 0 auto 1rem;\n border-radius: 50%;\n background: #dcfce7;\n color: #16a34a;\n font-size: 1.5rem;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-checkout-success__title {\n margin: 0 0 0.5rem;\n font-size: 1.5rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-success__msg,\n.mj-checkout-success__order {\n margin: 0;\n color: #64748b;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-success__order {\n margin-top: 0.75rem;\n font-weight: 600;\n color: #334155;\n}\n"] }]
39307
+ `, styles: [":host {\n display: block;\n}\n\n.mj-checkout-public {\n max-width: 580px;\n margin: 0 auto;\n}\n\n.mj-checkout-public__status {\n text-align: center;\n color: #64748b;\n font-size: 0.95rem;\n padding: 2rem 0;\n}\n\n.mj-widget-error-banner {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n font-size: 0.875rem;\n}\n\n.mj-checkout-success {\n text-align: center;\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 2rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n}\n\n.mj-checkout-success__icon {\n width: 3rem;\n height: 3rem;\n margin: 0 auto 1rem;\n border-radius: 50%;\n background: #dcfce7;\n color: #16a34a;\n font-size: 1.5rem;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-checkout-success__title {\n margin: 0 0 0.5rem;\n font-size: 1.5rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-success__msg,\n.mj-checkout-success__order {\n margin: 0;\n color: #64748b;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-success__order {\n margin-top: 0.75rem;\n font-weight: 600;\n color: #334155;\n}\n\n/* Post-payment account step: set a password for the account the host created (#292). */\n.mj-checkout-account {\n margin: 1.5rem auto 0;\n max-width: 320px;\n text-align: left;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.mj-checkout-account__title {\n margin: 0 0 0.5rem;\n font-size: 1.05rem;\n font-weight: 700;\n color: #0f172a;\n text-align: center;\n}\n\n.mj-checkout-account__label {\n font-size: 0.85rem;\n font-weight: 600;\n color: #334155;\n}\n\n.mj-checkout-account__input {\n padding: 8px 10px;\n border: 1px solid #cbd5e1;\n border-radius: 6px;\n font-size: 0.95rem;\n font-family: inherit;\n}\n\n.mj-checkout-account__input:focus {\n outline: none;\n border-color: var(--mj-primary-color, #2563eb);\n box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);\n}\n\n.mj-checkout-account__error {\n margin: 4px 0 0;\n color: #991b1b;\n font-size: 0.85rem;\n}\n\n.mj-checkout-account__submit {\n margin-top: 10px;\n padding: 10px;\n border: 0;\n border-radius: 6px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-weight: 600;\n cursor: pointer;\n}\n\n.mj-checkout-account__skip {\n padding: 6px;\n border: 0;\n background: none;\n color: #64748b;\n font-size: 0.85rem;\n cursor: pointer;\n}\n\n.mj-checkout-account__submit:disabled,\n.mj-checkout-account__skip:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.mj-checkout-account__msg {\n margin: 1rem 0 0;\n color: #334155;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-account__note {\n margin: 0 0 0.5rem;\n color: #475569;\n font-size: 0.85rem;\n line-height: 1.45;\n text-align: center;\n}\n\n.mj-checkout-account--actions {\n margin-top: 0.75rem;\n}\n"] }]
38046
39308
  }], null, { slug: [{
38047
39309
  type: Input
38048
39310
  }], apiRoot: [{
@@ -38050,7 +39312,7 @@ var CheckoutPublicHostComponent = class _CheckoutPublicHostComponent {
38050
39312
  }] });
38051
39313
  })();
38052
39314
  (() => {
38053
- (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(CheckoutPublicHostComponent, { className: "CheckoutPublicHostComponent", filePath: "lib/checkout-widget/checkout-public-host.component.ts", lineNumber: 61 });
39315
+ (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(CheckoutPublicHostComponent, { className: "CheckoutPublicHostComponent", filePath: "lib/checkout-widget/checkout-public-host.component.ts", lineNumber: 84 });
38054
39316
  })();
38055
39317
 
38056
39318
  // scripts/checkout-element-entry.ts