@justifi/webcomponents 4.19.0 → 4.19.1-rc-3

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 (224) hide show
  1. package/dist/cjs/{Analytics-ff013cbc.js → Analytics-1ca4e47e.js} +2 -3
  2. package/dist/cjs/{business.service-f63650f5.js → business.service-6bb7ac82.js} +5 -6
  3. package/dist/cjs/{get-payout-csv-f3aee6d0.js → get-payout-csv-1391ff3e.js} +3 -4
  4. package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +7 -8
  5. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +4 -5
  6. package/dist/cjs/justifi-business-details.cjs.entry.js +3 -4
  7. package/dist/cjs/justifi-business-form.cjs.entry.js +4 -5
  8. package/dist/cjs/justifi-card-form.cjs.entry.js +4 -5
  9. package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
  10. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -5
  11. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -4
  12. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +11 -9
  13. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +1 -2
  14. package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -4
  15. package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -6
  16. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
  17. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -6
  18. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -4
  19. package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -4
  20. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -4
  21. package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -3
  22. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +4 -5
  23. package/dist/cjs/{package-cb0f8cb1.js → package-bc2632e4.js} +2 -4
  24. package/dist/cjs/{payment.service-0a64f9cd.js → payment.service-dfcfa19b.js} +2 -3
  25. package/dist/collection/api/services/analytics.service.js +1 -2
  26. package/dist/collection/api/services/business.service.js +5 -6
  27. package/dist/collection/api/services/checkout.service.js +2 -3
  28. package/dist/collection/api/services/insurance.service.js +2 -3
  29. package/dist/collection/api/services/payment.service.js +2 -3
  30. package/dist/collection/api/services/payout.service.js +3 -4
  31. package/dist/collection/api/services/provision.service.js +2 -4
  32. package/dist/collection/api/services/reports.service.js +1 -2
  33. package/dist/collection/components/bank-account-form/bank-account-form.js +3 -4
  34. package/dist/collection/components/business-forms/business-form/business-form.js +2 -3
  35. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -3
  36. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +2 -3
  37. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -3
  38. package/dist/collection/components/card-form/card-form.js +3 -4
  39. package/dist/collection/components/checkout/checkout-core.js +4 -4
  40. package/dist/collection/components/checkout/new-payment-method.js +6 -4
  41. package/dist/collection/components/checkout/payment-method-options.js +3 -4
  42. package/dist/collection/components/checkout/saved-payment-method.js +3 -4
  43. package/dist/collection/components/checkout/sezzle-payment-method.js +3 -4
  44. package/dist/collection/components/payment-form/payment-form.js +3 -4
  45. package/dist/collection/components/refund-form/refund-form.js +2 -3
  46. package/dist/docs.json +8 -8
  47. package/dist/esm/{Analytics-33b8fa8d.js → Analytics-c51439be.js} +2 -3
  48. package/dist/esm/{business.service-74bd1212.js → business.service-f45decfc.js} +5 -6
  49. package/dist/esm/{get-payout-csv-b494abfe.js → get-payout-csv-e784a2ab.js} +3 -4
  50. package/dist/esm/justifi-additional-questions-form-step_10.entry.js +7 -8
  51. package/dist/esm/justifi-bank-account-form.entry.js +4 -5
  52. package/dist/esm/justifi-business-details.entry.js +3 -4
  53. package/dist/esm/justifi-business-form.entry.js +4 -5
  54. package/dist/esm/justifi-card-form.entry.js +4 -5
  55. package/dist/esm/justifi-checkout-core.entry.js +3 -3
  56. package/dist/esm/justifi-checkout.entry.js +4 -5
  57. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -4
  58. package/dist/esm/justifi-new-payment-method_4.entry.js +11 -9
  59. package/dist/esm/justifi-owner-form_3.entry.js +1 -2
  60. package/dist/esm/justifi-payment-details.entry.js +3 -4
  61. package/dist/esm/justifi-payment-form.entry.js +5 -6
  62. package/dist/esm/justifi-payment-method-form.entry.js +1 -1
  63. package/dist/esm/justifi-payment-provisioning.entry.js +5 -6
  64. package/dist/esm/justifi-payments-list.entry.js +3 -4
  65. package/dist/esm/justifi-payout-details.entry.js +3 -4
  66. package/dist/esm/justifi-payouts-list.entry.js +3 -4
  67. package/dist/esm/justifi-refund-form.entry.js +2 -3
  68. package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -5
  69. package/dist/esm/{package-3e407c6d.js → package-09a354e0.js} +2 -4
  70. package/dist/esm/{payment.service-3ca4a492.js → payment.service-dad5153b.js} +2 -3
  71. package/dist/globals.d.ts +2 -0
  72. package/dist/module/Analytics.js +1 -2
  73. package/dist/module/business-bank-account-form-step.js +2 -3
  74. package/dist/module/business-document-upload-form-step.js +2 -3
  75. package/dist/module/business-terms-conditions-form-step.js +2 -3
  76. package/dist/module/business.service.js +5 -6
  77. package/dist/module/checkout-core.js +3 -3
  78. package/dist/module/get-payout-csv.js +3 -4
  79. package/dist/module/justifi-bank-account-form.js +2 -3
  80. package/dist/module/justifi-business-form.js +2 -3
  81. package/dist/module/justifi-card-form.js +2 -3
  82. package/dist/module/justifi-checkout.js +2 -3
  83. package/dist/module/justifi-gross-payment-chart.js +1 -2
  84. package/dist/module/justifi-payment-form.js +3 -4
  85. package/dist/module/justifi-payment-provisioning.js +2 -3
  86. package/dist/module/justifi-refund-form.js +2 -3
  87. package/dist/module/justifi-season-interruption-insurance.js +2 -3
  88. package/dist/module/new-payment-method.js +5 -3
  89. package/dist/module/package.js +2 -4
  90. package/dist/module/payment-method-options.js +2 -3
  91. package/dist/module/payment.service.js +2 -3
  92. package/dist/module/saved-payment-method.js +2 -3
  93. package/dist/module/sezzle-payment-method.js +2 -3
  94. package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
  95. package/dist/webcomponents/index.esm.js +1 -0
  96. package/dist/webcomponents/p-01a404ca.entry.js +44 -0
  97. package/dist/webcomponents/p-03d35880.entry.js +130 -0
  98. package/dist/webcomponents/p-06ff0429.entry.js +65 -0
  99. package/dist/webcomponents/p-08b0fb31.js +41 -1
  100. package/dist/webcomponents/p-14c91ffd.js +20 -1
  101. package/dist/webcomponents/p-1a17ea7d.entry.js +1684 -0
  102. package/dist/webcomponents/p-1ad5995e.js +3599 -1
  103. package/dist/webcomponents/p-1ff8810b.js +29 -1
  104. package/dist/webcomponents/p-21aeb013.entry.js +80 -0
  105. package/dist/webcomponents/p-2338affa.js +213 -1
  106. package/dist/webcomponents/p-258b1ee2.entry.js +149 -0
  107. package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
  108. package/dist/webcomponents/p-29c0b182.js +114 -1
  109. package/dist/webcomponents/p-2b6c9c4f.js +7 -1
  110. package/dist/webcomponents/p-2dabeb5a.js +79 -0
  111. package/dist/webcomponents/p-2eab3c90.js +3052 -1
  112. package/dist/webcomponents/p-33272d05.entry.js +94 -0
  113. package/dist/webcomponents/p-3642ad71.entry.js +145 -0
  114. package/dist/webcomponents/p-387450f6.js +77 -0
  115. package/dist/webcomponents/p-3e9ef4a8.js +28 -0
  116. package/dist/webcomponents/p-3fd13ca3.js +52 -1
  117. package/dist/webcomponents/p-41bc7c5c.entry.js +97 -0
  118. package/dist/webcomponents/p-4d8b45c6.entry.js +98 -0
  119. package/dist/webcomponents/p-525db3e8.js +22 -1
  120. package/dist/webcomponents/p-5482d030.entry.js +21 -0
  121. package/dist/webcomponents/p-56f6ce4c.js +10 -1
  122. package/dist/webcomponents/p-576826b1.entry.js +43 -0
  123. package/dist/webcomponents/p-5968ff8a.js +178 -1
  124. package/dist/webcomponents/p-5bd7b204.entry.js +75 -0
  125. package/dist/webcomponents/p-5cb3f0b2.entry.js +261 -0
  126. package/dist/webcomponents/p-5e70442b.entry.js +74 -0
  127. package/dist/webcomponents/p-5f835b89.entry.js +606 -0
  128. package/dist/webcomponents/p-6078a370.js +244 -1
  129. package/dist/webcomponents/p-68843186.entry.js +73 -0
  130. package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
  131. package/dist/webcomponents/p-7582b554.entry.js +18 -0
  132. package/dist/webcomponents/p-79646550.entry.js +61 -0
  133. package/dist/webcomponents/p-7c76e67c.entry.js +117 -0
  134. package/dist/webcomponents/p-7d85af5c.js +16 -1
  135. package/dist/webcomponents/p-800d31fe.entry.js +162 -0
  136. package/dist/webcomponents/p-8115b2f4.js +28 -1
  137. package/dist/webcomponents/p-83125497.js +4027 -1
  138. package/dist/webcomponents/p-85fc69e5.js +90 -1
  139. package/dist/webcomponents/p-890088fc.entry.js +298 -0
  140. package/dist/webcomponents/p-89887332.js +301 -1
  141. package/dist/webcomponents/p-8df7bde8.js +27 -1
  142. package/dist/webcomponents/p-8eb774df.entry.js +54 -0
  143. package/dist/webcomponents/p-9c9c7dac.js +24 -1
  144. package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
  145. package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
  146. package/dist/webcomponents/p-a5c5821e.entry.js +101 -0
  147. package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
  148. package/dist/webcomponents/p-a6d04afc.js +44 -0
  149. package/dist/webcomponents/p-ac086069.entry.js +58 -0
  150. package/dist/webcomponents/p-af244664.js +126 -1
  151. package/dist/webcomponents/p-b82c146f.entry.js +111 -0
  152. package/dist/webcomponents/p-b8a03a4b.entry.js +131 -0
  153. package/dist/webcomponents/p-ba4bae6f.js +12 -1
  154. package/dist/webcomponents/p-ba5fae28.js +90 -1
  155. package/dist/webcomponents/p-c636f563.entry.js +791 -0
  156. package/dist/webcomponents/p-c86c24d2.entry.js +94 -0
  157. package/dist/webcomponents/p-cb26f708.js +18 -0
  158. package/dist/webcomponents/p-ce733539.entry.js +99 -0
  159. package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
  160. package/dist/webcomponents/p-d5095f6c.entry.js +133 -0
  161. package/dist/webcomponents/p-d89bad72.js +39 -1
  162. package/dist/webcomponents/p-dce846bf.js +27 -1
  163. package/dist/webcomponents/p-df21aaad.js +120 -1
  164. package/dist/webcomponents/p-e1255160.js +3 -1
  165. package/dist/webcomponents/p-e333620e.js +34 -1
  166. package/dist/webcomponents/p-e356f280.entry.js +29 -0
  167. package/dist/webcomponents/p-e3fab0e2.js +43 -1
  168. package/dist/webcomponents/p-ec854a3e.entry.js +11053 -0
  169. package/dist/webcomponents/p-f02b75dc.entry.js +96 -0
  170. package/dist/webcomponents/p-fad19d75.js +1638 -2
  171. package/dist/webcomponents/webcomponents.css +362 -4
  172. package/dist/webcomponents/webcomponents.esm.js +20 -1
  173. package/package.json +2 -4
  174. package/dist/cjs/config-ff2dda66.js +0 -15
  175. package/dist/config.js +0 -11
  176. package/dist/esm/config-476c7241.js +0 -13
  177. package/dist/module/config.js +0 -13
  178. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +0 -11
  179. package/dist/webcomponents/p-07109641.entry.js +0 -1
  180. package/dist/webcomponents/p-0f7b9555.entry.js +0 -1
  181. package/dist/webcomponents/p-17e4246f.entry.js +0 -1
  182. package/dist/webcomponents/p-195f92e9.entry.js +0 -1
  183. package/dist/webcomponents/p-1a43e355.entry.js +0 -19
  184. package/dist/webcomponents/p-23014988.entry.js +0 -1
  185. package/dist/webcomponents/p-25dba252.entry.js +0 -1
  186. package/dist/webcomponents/p-27981600.entry.js +0 -1
  187. package/dist/webcomponents/p-301e0493.entry.js +0 -1
  188. package/dist/webcomponents/p-304dd644.entry.js +0 -1
  189. package/dist/webcomponents/p-30a493cd.entry.js +0 -1
  190. package/dist/webcomponents/p-462dc522.entry.js +0 -1
  191. package/dist/webcomponents/p-487b72a8.entry.js +0 -1
  192. package/dist/webcomponents/p-4abc17f0.entry.js +0 -1
  193. package/dist/webcomponents/p-4b4580dd.js +0 -1
  194. package/dist/webcomponents/p-52021fa1.entry.js +0 -1
  195. package/dist/webcomponents/p-53e64f15.entry.js +0 -1
  196. package/dist/webcomponents/p-60a370fc.entry.js +0 -1
  197. package/dist/webcomponents/p-623a4479.entry.js +0 -1
  198. package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
  199. package/dist/webcomponents/p-63acf322.js +0 -1
  200. package/dist/webcomponents/p-6f03b35a.entry.js +0 -1
  201. package/dist/webcomponents/p-75b4daef.js +0 -1
  202. package/dist/webcomponents/p-8603348a.js +0 -1
  203. package/dist/webcomponents/p-8c1e981b.entry.js +0 -1
  204. package/dist/webcomponents/p-8e541a32.entry.js +0 -1
  205. package/dist/webcomponents/p-9279aa49.entry.js +0 -1
  206. package/dist/webcomponents/p-96b42e7d.entry.js +0 -1
  207. package/dist/webcomponents/p-99022846.entry.js +0 -1
  208. package/dist/webcomponents/p-ae263544.js +0 -1
  209. package/dist/webcomponents/p-b16dfd5d.entry.js +0 -1
  210. package/dist/webcomponents/p-bbed6107.entry.js +0 -1
  211. package/dist/webcomponents/p-bc92235c.entry.js +0 -1
  212. package/dist/webcomponents/p-be39c802.entry.js +0 -1
  213. package/dist/webcomponents/p-c4b87db2.entry.js +0 -1
  214. package/dist/webcomponents/p-c9f8f7ec.entry.js +0 -1
  215. package/dist/webcomponents/p-cd7105dd.entry.js +0 -1
  216. package/dist/webcomponents/p-d101c5db.js +0 -1
  217. package/dist/webcomponents/p-d1fbeae5.entry.js +0 -1
  218. package/dist/webcomponents/p-d8355f91.entry.js +0 -1
  219. package/dist/webcomponents/p-e2c88817.entry.js +0 -1
  220. package/dist/webcomponents/p-e31f0f3e.entry.js +0 -1
  221. package/dist/webcomponents/p-e7067ef2.entry.js +0 -1
  222. package/dist/webcomponents/p-f0866375.entry.js +0 -1
  223. package/dist/webcomponents/p-fb58feb5.entry.js +0 -1
  224. package/dist/webcomponents/p-fe33151d.entry.js +0 -1
@@ -0,0 +1,111 @@
1
+ import { r as registerInstance, h, c as createEvent, H as Host, g as getElement } from './p-fad19d75.js';
2
+
3
+ const FormControlErrorText = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ this.errorText = undefined;
7
+ this.name = undefined;
8
+ }
9
+ render() {
10
+ if (!this.errorText) {
11
+ return null;
12
+ }
13
+ return (h("small", { class: 'form-text text-danger', id: `form-error-text-${this.name}` }, this.errorText));
14
+ }
15
+ };
16
+
17
+ const FormControlHelpText = class {
18
+ constructor(hostRef) {
19
+ registerInstance(this, hostRef);
20
+ this.helpText = undefined;
21
+ this.name = undefined;
22
+ }
23
+ render() {
24
+ if (!this.helpText) {
25
+ return null;
26
+ }
27
+ return (h("small", { class: 'form-text text-muted', id: `form-help-text-${this.name}` }, this.helpText));
28
+ }
29
+ };
30
+
31
+ const SelectInput = class {
32
+ constructor(hostRef) {
33
+ registerInstance(this, hostRef);
34
+ this.formControlInput = createEvent(this, "formControlInput", 7);
35
+ this.formControlBlur = createEvent(this, "formControlBlur", 7);
36
+ this.handleFormControlInput = (event) => {
37
+ const target = event.target;
38
+ const name = target.getAttribute('name');
39
+ this.inputHandler(name, target.value);
40
+ this.formControlInput.emit(target.value);
41
+ };
42
+ this.updateInput = (newValue) => {
43
+ this.selectElement.value = newValue;
44
+ };
45
+ this.label = undefined;
46
+ this.name = undefined;
47
+ this.helpText = undefined;
48
+ this.errorText = undefined;
49
+ this.defaultValue = undefined;
50
+ this.inputHandler = undefined;
51
+ this.options = undefined;
52
+ this.disabled = undefined;
53
+ }
54
+ handleDefaultValueChange(newValue) {
55
+ this.updateInput(newValue);
56
+ }
57
+ componentDidLoad() {
58
+ this.updateInput(this.defaultValue);
59
+ }
60
+ render() {
61
+ var _a;
62
+ return (h(Host, { key: '99449e3724103b12af7f2a4573831961074a484a', exportparts: "label,input,input-invalid" }, h("div", { key: 'd73e89d43da9968b687afece24794d9472fec6b5', class: "form-group d-flex flex-column" }, h("label", { key: '6964c55858fc3cf96a137e1061c7f66831105348', part: "label", class: "form-label", htmlFor: this.name }, this.label), h("select", { key: '5b1a09a607ad9638915f5e70f2164f6010020438', ref: el => (this.selectElement = el), id: this.name, name: this.name, onBlur: this.formControlBlur.emit, onInput: this.handleFormControlInput, part: `input ${this.errorText ? 'input-invalid' : ''}`, class: this.errorText ? 'form-select is-invalid' : 'form-select', disabled: this.disabled }, (_a = this.options) === null || _a === void 0 ? void 0 : _a.map(option => (h("option", { value: option.value }, option.label)))), h("form-control-help-text", { key: '62d862921d463c98e56888293c878624f7311548', helpText: this.helpText, name: this.name }), h("form-control-error-text", { key: '0b1c4d4752965fb058208c72c7f1c3872d1e0561', errorText: this.errorText, name: this.name }))));
63
+ }
64
+ static get watchers() { return {
65
+ "defaultValue": ["handleDefaultValueChange"]
66
+ }; }
67
+ };
68
+
69
+ const TextInput = class {
70
+ constructor(hostRef) {
71
+ registerInstance(this, hostRef);
72
+ this.formControlInput = createEvent(this, "formControlInput", 7);
73
+ this.formControlBlur = createEvent(this, "formControlBlur", 7);
74
+ this.handleFormControlInput = (event) => {
75
+ const target = event.target;
76
+ const name = target.getAttribute('name');
77
+ this.inputHandler(name, target.value);
78
+ this.formControlInput.emit({ name, value: target.value });
79
+ };
80
+ this.updateInput = (newValue) => {
81
+ const inputElement = this.el.querySelector('input');
82
+ if (inputElement) {
83
+ inputElement.value = newValue || '';
84
+ }
85
+ };
86
+ this.label = undefined;
87
+ this.name = undefined;
88
+ this.helpText = undefined;
89
+ this.errorText = undefined;
90
+ this.defaultValue = undefined;
91
+ this.maxLength = undefined;
92
+ this.inputHandler = undefined;
93
+ this.keyDownHandler = undefined;
94
+ this.disabled = undefined;
95
+ }
96
+ handleDefaultValueChange(newValue) {
97
+ this.updateInput(newValue);
98
+ }
99
+ componentDidLoad() {
100
+ this.updateInput(this.defaultValue);
101
+ }
102
+ render() {
103
+ return (h(Host, { key: '1194532f81831734543bad80860da14f8a5ad856', exportparts: "label,input,input-invalid" }, h("div", { key: '296538cf90b62f8041e21620aa06b4074f68b71a', class: "form-group d-flex flex-column" }, h("label", { key: '7c009ce96124e58f9657dba2565ef298225f10f7', part: "label", class: "form-label", htmlFor: this.name }, this.label), h("input", { key: '4b33cb700aecf4d0a359366ba2e0d248c602d904', id: this.name, name: this.name, onBlur: this.formControlBlur.emit, onInput: this.handleFormControlInput, onKeyDown: this.keyDownHandler, onPaste: this.keyDownHandler, maxLength: this.maxLength, part: `input ${this.errorText ? 'input-invalid ' : ''}${this.disabled ? ' input-disabled' : ''}`, class: this.errorText ? 'form-control is-invalid' : 'form-control', type: "text", disabled: this.disabled }), h("form-control-help-text", { key: '7a279d72bb262fcb044b5b0cc31703878ce9f444', helpText: this.helpText, name: this.name }), h("form-control-error-text", { key: '00bea288a99f626806697a98b6dca3f3298dc0b3', errorText: this.errorText, name: this.name }))));
104
+ }
105
+ get el() { return getElement(this); }
106
+ static get watchers() { return {
107
+ "defaultValue": ["handleDefaultValueChange"]
108
+ }; }
109
+ };
110
+
111
+ export { FormControlErrorText as form_control_error_text, FormControlHelpText as form_control_help_text, SelectInput as form_control_select, TextInput as form_control_text };
@@ -0,0 +1,131 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { A as Api } from './p-29c0b182.js';
3
+ import './p-56f6ce4c.js';
4
+ import './p-df21aaad.js';
5
+ import './p-e3fab0e2.js';
6
+ import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
7
+ import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
8
+ import { J as JustifiAnalytics } from './p-387450f6.js';
9
+ import './p-2dabeb5a.js';
10
+
11
+ class InsuranceService {
12
+ async fetchQuote(authToken, payload) {
13
+ const endpoint = 'insurance/quotes';
14
+ return Api({ authToken, apiOrigin: undefined }).post(endpoint, JSON.stringify(payload));
15
+ }
16
+ async toggleCoverage(authToken, quoteId, payload) {
17
+ const endpoint = `insurance/quotes/${quoteId}/toggle`;
18
+ return Api({ authToken, apiOrigin: undefined }).post(endpoint, JSON.stringify(payload));
19
+ }
20
+ }
21
+
22
+ const makeGetQuote = ({ authToken, service }) => async ({ payload, onSuccess, onError }) => {
23
+ var _a;
24
+ try {
25
+ const response = await service.fetchQuote(authToken, payload);
26
+ if (!response.error) {
27
+ const quote = response.data;
28
+ onSuccess({ quote });
29
+ }
30
+ else {
31
+ const responseError = getErrorMessage(response.error);
32
+ const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
33
+ return onError({
34
+ error: responseError,
35
+ code,
36
+ severity: ComponentErrorSeverity.ERROR,
37
+ });
38
+ }
39
+ }
40
+ catch (error) {
41
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
42
+ return onError({
43
+ error: error.message || error,
44
+ code,
45
+ severity: ComponentErrorSeverity.ERROR,
46
+ });
47
+ }
48
+ };
49
+ const makeToggleCoverage = ({ authToken, service }) => async ({ quoteId, payload, onSuccess, onError }) => {
50
+ var _a;
51
+ try {
52
+ const response = await service.toggleCoverage(authToken, quoteId, payload);
53
+ if (!response.error) {
54
+ const quote = response.data;
55
+ onSuccess({ quote });
56
+ }
57
+ else {
58
+ const responseError = getErrorMessage(response.error);
59
+ const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
60
+ return onError({
61
+ error: responseError,
62
+ code,
63
+ severity: ComponentErrorSeverity.ERROR,
64
+ });
65
+ }
66
+ }
67
+ catch (error) {
68
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
69
+ return onError({
70
+ error: error.message || error,
71
+ code,
72
+ severity: ComponentErrorSeverity.ERROR,
73
+ });
74
+ }
75
+ };
76
+
77
+ const SeasonInterruptionInsurance = class {
78
+ constructor(hostRef) {
79
+ registerInstance(this, hostRef);
80
+ this.errorEvent = createEvent(this, "error-event", 7);
81
+ this.authToken = undefined;
82
+ this.checkoutId = undefined;
83
+ this.primaryIdentityFirstName = undefined;
84
+ this.primaryIdentityLastName = undefined;
85
+ this.primaryIdentityState = undefined;
86
+ this.primaryIdentityPostalCode = undefined;
87
+ this.primaryIdentityCountry = undefined;
88
+ this.primaryIdentityEmailAddress = undefined;
89
+ this.policyAttributesInsurableAmount = undefined;
90
+ this.policyAttributesStartDate = undefined;
91
+ this.policyAttributesEndDate = undefined;
92
+ this.coveredIdentityFirstName = undefined;
93
+ this.coveredIdentityLastName = undefined;
94
+ this.getQuote = undefined;
95
+ this.toggleCoverage = undefined;
96
+ this.quote = undefined;
97
+ }
98
+ async validate() {
99
+ return this.seasonInterruptionCoreRef.validate();
100
+ }
101
+ componentWillLoad() {
102
+ this.analytics = new JustifiAnalytics(this);
103
+ this.initializeServiceMethods();
104
+ }
105
+ disconnectedCallback() {
106
+ this.analytics.cleanup();
107
+ }
108
+ initializeServiceMethods() {
109
+ if (!this.authToken) {
110
+ this.errorEvent.emit({
111
+ errorCode: ComponentErrorCodes.MISSING_PROPS,
112
+ message: 'Missing authToken',
113
+ severity: ComponentErrorSeverity.ERROR,
114
+ });
115
+ return;
116
+ }
117
+ this.getQuote = makeGetQuote({
118
+ authToken: this.authToken,
119
+ service: new InsuranceService(),
120
+ });
121
+ this.toggleCoverage = makeToggleCoverage({
122
+ authToken: this.authToken,
123
+ service: new InsuranceService(),
124
+ });
125
+ }
126
+ render() {
127
+ return (h("justifi-season-interruption-insurance-core", { key: '256d45d39c5d297abb7f955229b0e0e9fbc9504a', ref: (el) => (this.seasonInterruptionCoreRef = el), "checkout-id": this.checkoutId, getQuote: this.getQuote, toggleCoverage: this.toggleCoverage, "primary-identity-first-name": this.primaryIdentityFirstName, "primary-identity-last-name": this.primaryIdentityLastName, "primary-identity-state": this.primaryIdentityState, "primary-identity-postal-code": this.primaryIdentityPostalCode, "primary-identity-country": this.primaryIdentityCountry, "primary-identity-email-address": this.primaryIdentityEmailAddress, "policy-attributes-insurable-amount": this.policyAttributesInsurableAmount, "policy-attributes-start-date": this.policyAttributesStartDate, "policy-attributes-end-date": this.policyAttributesEndDate, "covered-identity-first-name": this.coveredIdentityFirstName, "covered-identity-last-name": this.coveredIdentityLastName }));
128
+ }
129
+ };
130
+
131
+ export { SeasonInterruptionInsurance as justifi_season_interruption_insurance };