@flarehr/apollo-benefits 0.1.106 → 0.3.53396

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 (219) hide show
  1. package/README.md +19 -0
  2. package/dist/assets/@splitsoftware-7d799540.js +18 -0
  3. package/dist/assets/all_tab_color-548783b9.svg +21 -0
  4. package/dist/assets/all_tab_gray-a5051313.svg +6 -0
  5. package/dist/assets/check-57fe1dcb.svg +15 -0
  6. package/dist/assets/datadog-c7ede347.js +5 -0
  7. package/dist/assets/date-fns-c5d8fbc0.js +1 -0
  8. package/dist/assets/default_backdrop-fdd955b8.png +0 -0
  9. package/dist/assets/external_link-599a0aec.svg +3 -0
  10. package/dist/assets/external_link_white-55111b2e.svg +3 -0
  11. package/dist/assets/framer-motion-bb8d6b82.js +1 -0
  12. package/dist/assets/index-87923fdc.js +35 -0
  13. package/dist/assets/index-cfa25e28.css +1 -0
  14. package/dist/assets/index-ee9d2045.js +5 -0
  15. package/dist/assets/lodash-5d893f8c.js +1 -0
  16. package/dist/assets/logo-a34e9b4b.png +0 -0
  17. package/dist/assets/oidc-client-6f6e47c2.js +101 -0
  18. package/dist/assets/padlock-8c081120.svg +26 -0
  19. package/dist/assets/suitcase-6471ad05.svg +17 -0
  20. package/dist/assets/vendor-2d0139ca.js +788 -0
  21. package/dist/assets/warning-a7f1af23.svg +14 -0
  22. package/dist/assets/welcome_image_mobile-dbde6c80.png +0 -0
  23. package/dist/assets/welcome_image_v2-869c59e4.png +0 -0
  24. package/dist/assets/wellbeing_banner-6903d615.png +0 -0
  25. package/dist/assets/workplace_link_banner_mobile-6ebaa24b.png +0 -0
  26. package/dist/assets/workplace_link_banner_v2-c81ed849.png +0 -0
  27. package/dist/config.json +14 -0
  28. package/dist/favicon.ico +0 -0
  29. package/dist/icons/android-chrome-192x192.png +0 -0
  30. package/dist/icons/android-chrome-512x512.png +0 -0
  31. package/dist/icons/apple-touch-icon.png +0 -0
  32. package/dist/icons/favicon-16x16.png +0 -0
  33. package/dist/icons/favicon-32x32.png +0 -0
  34. package/dist/index.html +114 -0
  35. package/dist/manifest.json +21 -0
  36. package/dist/sw-esm.js +16 -0
  37. package/package.json +129 -60
  38. package/LICENSE +0 -21
  39. package/dist/lib/apollo-benefits/apollo-benefits.esm.js +0 -1
  40. package/dist/lib/apollo-benefits/assets/car-placeholder.svg +0 -5
  41. package/dist/lib/apollo-benefits/assets/check.svg +0 -13
  42. package/dist/lib/apollo-benefits/index.esm.js +0 -0
  43. package/dist/lib/apollo-benefits/p-06a1f65f.js +0 -1
  44. package/dist/lib/apollo-benefits/p-077d7f8d.entry.js +0 -1
  45. package/dist/lib/apollo-benefits/p-0a21a709.entry.js +0 -1
  46. package/dist/lib/apollo-benefits/p-14054f15.js +0 -1
  47. package/dist/lib/apollo-benefits/p-24a37d64.js +0 -1
  48. package/dist/lib/apollo-benefits/p-2b3f3b72.entry.js +0 -1
  49. package/dist/lib/apollo-benefits/p-3111d565.entry.js +0 -1
  50. package/dist/lib/apollo-benefits/p-327396fa.entry.js +0 -1
  51. package/dist/lib/apollo-benefits/p-3af26279.entry.js +0 -1
  52. package/dist/lib/apollo-benefits/p-3d4d2683.js +0 -1
  53. package/dist/lib/apollo-benefits/p-4474bcf8.entry.js +0 -1
  54. package/dist/lib/apollo-benefits/p-50fe790f.js +0 -1
  55. package/dist/lib/apollo-benefits/p-53bcbd1d.js +0 -1
  56. package/dist/lib/apollo-benefits/p-64a2b03a.entry.js +0 -1
  57. package/dist/lib/apollo-benefits/p-68c136da.js +0 -1
  58. package/dist/lib/apollo-benefits/p-6bd16f5b.js +0 -1
  59. package/dist/lib/apollo-benefits/p-71dbc8ff.entry.js +0 -1
  60. package/dist/lib/apollo-benefits/p-774d9bc5.entry.js +0 -1
  61. package/dist/lib/apollo-benefits/p-7a2ca86d.entry.js +0 -1
  62. package/dist/lib/apollo-benefits/p-7a572b50.js +0 -1
  63. package/dist/lib/apollo-benefits/p-7c2cd94a.entry.js +0 -1
  64. package/dist/lib/apollo-benefits/p-839493d7.entry.js +0 -1
  65. package/dist/lib/apollo-benefits/p-acf61bdc.js +0 -1
  66. package/dist/lib/apollo-benefits/p-b33fc683.js +0 -1
  67. package/dist/lib/apollo-benefits/p-beb8f728.entry.js +0 -1
  68. package/dist/lib/apollo-benefits/p-d7bea1d9.entry.js +0 -1
  69. package/dist/lib/apollo-benefits/p-ddb176cb.entry.js +0 -1
  70. package/dist/lib/apollo-benefits/p-e241f55b.entry.js +0 -1
  71. package/dist/lib/apollo-benefits/p-ef8ea713.entry.js +0 -1
  72. package/dist/lib/apollo-benefits/p-f603197d.js +0 -15
  73. package/dist/lib/cjs/active-router-0ecaf2b8.js +0 -75
  74. package/dist/lib/cjs/ap-ben-choose-vehicle-section_4.cjs.entry.js +0 -2684
  75. package/dist/lib/cjs/ap-ben-complete-section_4.cjs.entry.js +0 -108
  76. package/dist/lib/cjs/ap-ben-notifications-section.cjs.entry.js +0 -238
  77. package/dist/lib/cjs/apollo-benefits.cjs.js +0 -25
  78. package/dist/lib/cjs/app-globals-67583b8b.js +0 -12
  79. package/dist/lib/cjs/async-6a7926f0.js +0 -753
  80. package/dist/lib/cjs/cars-calculator-app.cjs.entry.js +0 -52
  81. package/dist/lib/cjs/cars-calculator.service-11b0cd88.js +0 -901
  82. package/dist/lib/cjs/context-consumer.cjs.entry.js +0 -29
  83. package/dist/lib/cjs/datorama-akita-31d23240.js +0 -2551
  84. package/dist/lib/cjs/delay-d31618c3.js +0 -206
  85. package/dist/lib/cjs/distinctUntilChanged-e8538790.js +0 -371
  86. package/dist/lib/cjs/dom-utils-b8befdd5.js +0 -63
  87. package/dist/lib/cjs/fl-button.cjs.entry.js +0 -30
  88. package/dist/lib/cjs/fl-dropdown-async_2.cjs.entry.js +0 -467
  89. package/dist/lib/cjs/fl-dropdown.cjs.entry.js +0 -232
  90. package/dist/lib/cjs/fl-loading-indicator.cjs.entry.js +0 -26
  91. package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -91
  92. package/dist/lib/cjs/index-f1fadf90.js +0 -1735
  93. package/dist/lib/cjs/index.cjs.js +0 -2
  94. package/dist/lib/cjs/loader.cjs.js +0 -27
  95. package/dist/lib/cjs/location-utils-36fe7e5e.js +0 -237
  96. package/dist/lib/cjs/match-path-be4ea5f6.js +0 -279
  97. package/dist/lib/cjs/session.query-d61ba7ec.js +0 -1731
  98. package/dist/lib/cjs/stencil-async-content.cjs.entry.js +0 -32
  99. package/dist/lib/cjs/stencil-route-link.cjs.entry.js +0 -78
  100. package/dist/lib/cjs/stencil-route-switch.cjs.entry.js +0 -104
  101. package/dist/lib/cjs/stencil-route-title.cjs.entry.js +0 -32
  102. package/dist/lib/cjs/stencil-route.cjs.entry.js +0 -97
  103. package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +0 -59
  104. package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +0 -32
  105. package/dist/lib/cjs/stencil-router.cjs.entry.js +0 -640
  106. package/dist/lib/collection/assets/image/complete.svg +0 -122
  107. package/dist/lib/collection/collection-manifest.json +0 -53
  108. package/dist/lib/collection/components/cars-calculator-app/api/api-client.js +0 -5
  109. package/dist/lib/collection/components/cars-calculator-app/api/cars-calculator.api.js +0 -45
  110. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.css +0 -22
  111. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.js +0 -93
  112. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.css +0 -0
  113. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.js +0 -144
  114. package/dist/lib/collection/components/cars-calculator-app/notifications-section/notifications-section.js +0 -25
  115. package/dist/lib/collection/components/cars-calculator-app/pages/assets/car-placeholder.svg +0 -5
  116. package/dist/lib/collection/components/cars-calculator-app/pages/assets/check.svg +0 -13
  117. package/dist/lib/collection/components/cars-calculator-app/pages/choose-vehicle-section.component.js +0 -193
  118. package/dist/lib/collection/components/cars-calculator-app/pages/complete-section.component.js +0 -38
  119. package/dist/lib/collection/components/cars-calculator-app/pages/cost-breakdown-section.component.js +0 -47
  120. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.css +0 -34
  121. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.js +0 -64
  122. package/dist/lib/collection/components/cars-calculator-app/pages/personal-info-section.component.js +0 -66
  123. package/dist/lib/collection/components/cars-calculator-app/pages/quote-result-section.component.js +0 -86
  124. package/dist/lib/collection/components/cars-calculator-app/pages/submit-quote-section.component.js +0 -75
  125. package/dist/lib/collection/components/cars-calculator-app/services/app-configuration.service.js +0 -13
  126. package/dist/lib/collection/components/cars-calculator-app/services/cars-calculator.service.js +0 -103
  127. package/dist/lib/collection/components/cars-calculator-app/services/notifications.service.js +0 -37
  128. package/dist/lib/collection/components/cars-calculator-app/services/notifications.store.js +0 -3
  129. package/dist/lib/collection/components/cars-calculator-app/services/session.query.js +0 -35
  130. package/dist/lib/collection/components/cars-calculator-app/services/session.store.js +0 -78
  131. package/dist/lib/collection/global/config.js +0 -2
  132. package/dist/lib/collection/global/main.dev.js +0 -5
  133. package/dist/lib/collection/global/main.js +0 -5
  134. package/dist/lib/collection/index.js +0 -2
  135. package/dist/lib/collection/utils/config.js +0 -2
  136. package/dist/lib/collection/utils/index.js +0 -15
  137. package/dist/lib/collection/utils/lazy.js +0 -29
  138. package/dist/lib/esm/active-router-7c2ca849.js +0 -73
  139. package/dist/lib/esm/ap-ben-choose-vehicle-section_4.entry.js +0 -2677
  140. package/dist/lib/esm/ap-ben-complete-section_4.entry.js +0 -101
  141. package/dist/lib/esm/ap-ben-notifications-section.entry.js +0 -234
  142. package/dist/lib/esm/apollo-benefits.js +0 -23
  143. package/dist/lib/esm/app-globals-65714cca.js +0 -10
  144. package/dist/lib/esm/async-68e9cad7.js +0 -738
  145. package/dist/lib/esm/cars-calculator-app.entry.js +0 -48
  146. package/dist/lib/esm/cars-calculator.service-2cde6288.js +0 -894
  147. package/dist/lib/esm/context-consumer.entry.js +0 -25
  148. package/dist/lib/esm/datorama-akita-c87196a0.js +0 -2545
  149. package/dist/lib/esm/delay-115d4292.js +0 -200
  150. package/dist/lib/esm/distinctUntilChanged-bf69e0f8.js +0 -363
  151. package/dist/lib/esm/dom-utils-109a7d75.js +0 -55
  152. package/dist/lib/esm/fl-button.entry.js +0 -26
  153. package/dist/lib/esm/fl-dropdown-async_2.entry.js +0 -462
  154. package/dist/lib/esm/fl-dropdown.entry.js +0 -228
  155. package/dist/lib/esm/fl-loading-indicator.entry.js +0 -22
  156. package/dist/lib/esm/fl-style-guide.entry.js +0 -87
  157. package/dist/lib/esm/index-19c4d245.js +0 -1703
  158. package/dist/lib/esm/index.js +0 -1
  159. package/dist/lib/esm/loader.js +0 -23
  160. package/dist/lib/esm/location-utils-312665d3.js +0 -226
  161. package/dist/lib/esm/match-path-4b5c7d98.js +0 -276
  162. package/dist/lib/esm/polyfills/core-js.js +0 -11
  163. package/dist/lib/esm/polyfills/css-shim.js +0 -1
  164. package/dist/lib/esm/polyfills/dom.js +0 -79
  165. package/dist/lib/esm/polyfills/es5-html-element.js +0 -1
  166. package/dist/lib/esm/polyfills/index.js +0 -34
  167. package/dist/lib/esm/polyfills/system.js +0 -6
  168. package/dist/lib/esm/session.query-0f1c9503.js +0 -1719
  169. package/dist/lib/esm/stencil-async-content.entry.js +0 -28
  170. package/dist/lib/esm/stencil-route-link.entry.js +0 -74
  171. package/dist/lib/esm/stencil-route-switch.entry.js +0 -100
  172. package/dist/lib/esm/stencil-route-title.entry.js +0 -28
  173. package/dist/lib/esm/stencil-route.entry.js +0 -93
  174. package/dist/lib/esm/stencil-router-prompt.entry.js +0 -55
  175. package/dist/lib/esm/stencil-router-redirect.entry.js +0 -28
  176. package/dist/lib/esm/stencil-router.entry.js +0 -636
  177. package/dist/lib/index.cjs.js +0 -1
  178. package/dist/lib/index.js +0 -1
  179. package/dist/lib/loader/cdn.js +0 -3
  180. package/dist/lib/loader/index.cjs.js +0 -3
  181. package/dist/lib/loader/index.d.ts +0 -13
  182. package/dist/lib/loader/index.es2017.js +0 -3
  183. package/dist/lib/loader/index.js +0 -4
  184. package/dist/lib/loader/package.json +0 -10
  185. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -45
  186. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
  187. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
  188. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
  189. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
  190. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
  191. package/dist/lib/node_modules/@stencil/router/dist/collection/components/route/route.css +0 -3
  192. package/dist/lib/types/components/cars-calculator-app/api/api-client.d.ts +0 -2
  193. package/dist/lib/types/components/cars-calculator-app/api/cars-calculator.api.d.ts +0 -96
  194. package/dist/lib/types/components/cars-calculator-app/cars-calculator-app.d.ts +0 -15
  195. package/dist/lib/types/components/cars-calculator-app/modal-section/modal-section.d.ts +0 -16
  196. package/dist/lib/types/components/cars-calculator-app/notifications-section/notifications-section.d.ts +0 -5
  197. package/dist/lib/types/components/cars-calculator-app/pages/choose-vehicle-section.component.d.ts +0 -23
  198. package/dist/lib/types/components/cars-calculator-app/pages/complete-section.component.d.ts +0 -5
  199. package/dist/lib/types/components/cars-calculator-app/pages/cost-breakdown-section.component.d.ts +0 -6
  200. package/dist/lib/types/components/cars-calculator-app/pages/model-variants-section.component.d.ts +0 -12
  201. package/dist/lib/types/components/cars-calculator-app/pages/personal-info-section.component.d.ts +0 -10
  202. package/dist/lib/types/components/cars-calculator-app/pages/quote-result-section.component.d.ts +0 -13
  203. package/dist/lib/types/components/cars-calculator-app/pages/submit-quote-section.component.d.ts +0 -10
  204. package/dist/lib/types/components/cars-calculator-app/services/app-configuration.service.d.ts +0 -7
  205. package/dist/lib/types/components/cars-calculator-app/services/cars-calculator.service.d.ts +0 -11
  206. package/dist/lib/types/components/cars-calculator-app/services/notifications.service.d.ts +0 -15
  207. package/dist/lib/types/components/cars-calculator-app/services/notifications.store.d.ts +0 -14
  208. package/dist/lib/types/components/cars-calculator-app/services/session.query.d.ts +0 -25
  209. package/dist/lib/types/components/cars-calculator-app/services/session.store.d.ts +0 -74
  210. package/dist/lib/types/components.d.ts +0 -170
  211. package/dist/lib/types/global/config.d.ts +0 -2
  212. package/dist/lib/types/global/main.d.ts +0 -1
  213. package/dist/lib/types/global/main.dev.d.ts +0 -1
  214. package/dist/lib/types/index.d.ts +0 -2
  215. package/dist/lib/types/stencil-public-runtime.d.ts +0 -1555
  216. package/dist/lib/types/utils/config.d.ts +0 -2
  217. package/dist/lib/types/utils/index.d.ts +0 -7
  218. package/dist/lib/types/utils/lazy.d.ts +0 -12
  219. package/readme.md +0 -1
@@ -1,193 +0,0 @@
1
- var __asyncValues = (this && this.__asyncValues) || function (o) {
2
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
3
- var m = o[Symbol.asyncIterator], i;
4
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
5
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
6
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
7
- };
8
- import { Component, h, Host, State } from '@stencil/core';
9
- import { pipe } from 'fp-ts/function';
10
- import * as O from 'fp-ts/Option';
11
- import { getOrDefault, getOrError } from '../../../utils';
12
- import carsCalculatorApi from '../api/cars-calculator.api';
13
- import sessionQuery from '../services/session.query';
14
- import sessionStore from '../services/session.store';
15
- export class ChooseVehicleSection {
16
- constructor() {
17
- this.toCapitalCase = (str) => str === null || str === void 0 ? void 0 : str.split(' ').map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase()).join(' ');
18
- sessionQuery.vehicle$.subscribe((state) => (this.vehicleInfo = state));
19
- sessionQuery.makeList$.subscribe((state) => (this.makeList = getOrDefault(state, [])));
20
- sessionQuery.modelList$.subscribe((state) => (this.modelList = getOrDefault(state, [])));
21
- sessionQuery.yearList$.subscribe((state) => (this.yearList = getOrDefault(state, [])));
22
- sessionQuery.bodyTypeList$.subscribe((state) => (this.bodyTypeList = getOrDefault(state, [])));
23
- }
24
- render() {
25
- return (h(Host, null,
26
- h("div", { class: "d-flex flex-column flex-wrap flex-md-row align-items-center justify-content-center h4" },
27
- h("div", { class: "d-flex align-items-center" }, "I'm looking to buy a"),
28
- h("div", { class: "d-flex mx-2 my-2 my-md-0" },
29
- h("div", { class: "btn-group", role: "group", "aria-label": "New or used vehicle" },
30
- h("button", { type: "button", class: {
31
- 'btn btn-outline-dark px-5': true,
32
- active: !this.isUsedCarSelected()
33
- }, onClick: (_event) => sessionStore.setVehicleState('isUsedCarRequested', false) }, "New"),
34
- h("button", { type: "button", class: {
35
- 'btn btn-outline-dark px-5': true,
36
- active: this.isUsedCarSelected()
37
- }, onClick: (_event) => sessionStore.setVehicleState('isUsedCarRequested', true) }, "Used"))),
38
- this.isUsedCarSelected() ? (h("div", { class: "d-flex flex-column flex-md-row align-items-center justify-content-center my-0 my-md-2 my-xl-0" },
39
- h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "vehicle, with a purchase price of"),
40
- h("input", { placeholder: "25000", type: "text", class: "form-control d-flex w-auto mt-2 mt-md-0", value: '$' + this.getVehicleInfo('approximatePrice'), onInput: (e) => {
41
- const el = e.target;
42
- el.value = el.value.replace(/\D/g, '');
43
- }, onFocus: (e) => {
44
- const el = e.target;
45
- el.value = el.value.replace('$', '');
46
- }, onBlur: (e) => {
47
- const el = e.target;
48
- el.value = '$' + el.value;
49
- }, onChange: (e) => sessionStore.setVehicleState('approximatePrice', parseFloat(e.target.value)) }))) : (h("div", { class: "d-flex align-items-center" }, "vehicle"))),
50
- h("div", { class: "d-flex flex-wrap flex-column flex-md-row align-items-center justify-content-center mt-5 h4" },
51
- h("div", { class: "d-flex align-items-center" }, "I'm interested in a"),
52
- h("div", { class: "d-flex mx-2 my-2 my-md-0" },
53
- h("fl-dropdown", { options: this.makeList, requiredValidationMessage: "Select an option", placeholder: "select make", value: this.getVehicleInfo('makeId'), onValueChanged: (e) => this.chooseMake(e.detail.label, e.detail.value) })),
54
- h("div", { class: "d-flex mx-2 my-2 my-md-0" },
55
- h("fl-dropdown", { options: this.modelList, requiredValidationMessage: "Select an option", placeholder: "select model", value: this.getVehicleInfo('modelId'), disabled: O.isNone(this.vehicleInfo.makeId), onValueChanged: (e) => this.chooseModel(e.detail.label, e.detail.value) })),
56
- h("div", { class: "d-flex align-items-center" }, "built in"),
57
- h("div", { class: "d-flex mx-2 my-2 my-xl-0" },
58
- h("fl-dropdown", { options: this.yearList, requiredValidationMessage: "Select an option", placeholder: "select year", value: this.getVehicleInfo('year'), disabled: O.isNone(this.vehicleInfo.modelId), onValueChanged: (e) => this.chooseYear(e.detail.value) }))),
59
- h("div", { class: "d-flex align-items-center justify-content-center justify-content-md-start mt-5" },
60
- h("div", { class: "btn-group", role: "group", "aria-label": "Body types" }, this.bodyTypeList.map((bodyType) => (h("button", { type: "button", class: {
61
- 'btn btn-sm btn-outline-dark px-5': true,
62
- active: this.isBodyTypeSelected(bodyType.value)
63
- }, onClick: (_event) => this.chooseBodyType(bodyType.label, bodyType.value) }, bodyType.label)))))));
64
- }
65
- async componentDidLoad() {
66
- var _a;
67
- if (((_a = this.makeList) === null || _a === void 0 ? void 0 : _a.length) > 0)
68
- return;
69
- const carsMakes = await carsCalculatorApi.getCarsMakes();
70
- sessionStore.updateList('makeList', carsMakes.map((make) => ({
71
- label: this.toCapitalCase(make.name),
72
- value: make.make_id
73
- })));
74
- }
75
- async chooseMake(make, makeId) {
76
- var _a;
77
- this.clearModelStates();
78
- this.clearYearStates();
79
- this.clearBodyTypeStates();
80
- this.clearVariantsList();
81
- if (((_a = this.modelList) === null || _a === void 0 ? void 0 : _a.length) === 0) {
82
- sessionStore.updateList('modelList', (await carsCalculatorApi.getCarsModels(makeId)).map((model) => ({
83
- label: this.toCapitalCase(model.model_code),
84
- value: model.model_id
85
- })));
86
- }
87
- sessionStore.setVehicleState('make', make);
88
- sessionStore.setVehicleState('makeId', makeId);
89
- }
90
- async chooseModel(model, modelId) {
91
- var _a;
92
- this.clearYearStates();
93
- this.clearBodyTypeStates();
94
- this.clearVariantsList();
95
- if (((_a = this.yearList) === null || _a === void 0 ? void 0 : _a.length) === 0) {
96
- sessionStore.updateList('yearList', (await carsCalculatorApi.getCarsModelYears(modelId))
97
- .sort()
98
- .reverse()
99
- .map((year) => ({
100
- label: year.toString(),
101
- value: year
102
- })));
103
- }
104
- sessionStore.setVehicleState('model', model);
105
- sessionStore.setVehicleState('modelId', modelId);
106
- }
107
- async chooseYear(year) {
108
- var _a;
109
- this.clearBodyTypeStates();
110
- this.clearVariantsList();
111
- const modelId = getOrError(this.vehicleInfo.modelId);
112
- if (((_a = this.bodyTypeList) === null || _a === void 0 ? void 0 : _a.length) === 0) {
113
- sessionStore.updateList('bodyTypeList', (await carsCalculatorApi.getCarsModelBodyTypes(modelId, year)).map((bodyType) => ({
114
- label: bodyType.body_type,
115
- value: bodyType.body_type_id
116
- })));
117
- }
118
- sessionStore.setVehicleState('year', year);
119
- await this.chooseBodyType(this.bodyTypeList[0].label, this.bodyTypeList[0].value);
120
- }
121
- async chooseBodyType(bodyType, bodyTypeId) {
122
- var e_1, _a;
123
- this.clearVariantsList();
124
- const modelId = getOrError(this.vehicleInfo.modelId);
125
- const year = getOrError(this.vehicleInfo.year);
126
- const variantPromises = (await carsCalculatorApi.getCarsModelVariant(modelId, year, bodyTypeId)).map(async (variant) => {
127
- var _a;
128
- const photoUri = await carsCalculatorApi.getCarsVariantPhotos(variant.variant_id);
129
- return {
130
- variantId: variant.variant_id,
131
- description: variant.short_description,
132
- buildYear: variant.build_year,
133
- modelMonth: variant.model_month,
134
- listPriceGross: variant.list_price_gross,
135
- photoUri: O.fromNullable((_a = photoUri === null || photoUri === void 0 ? void 0 : photoUri[0]) === null || _a === void 0 ? void 0 : _a.photo_uri)
136
- };
137
- });
138
- const variantList = [];
139
- try {
140
- for (var variantPromises_1 = __asyncValues(variantPromises), variantPromises_1_1; variantPromises_1_1 = await variantPromises_1.next(), !variantPromises_1_1.done;) {
141
- const variant = variantPromises_1_1.value;
142
- variantList.push(variant);
143
- }
144
- }
145
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
146
- finally {
147
- try {
148
- if (variantPromises_1_1 && !variantPromises_1_1.done && (_a = variantPromises_1.return)) await _a.call(variantPromises_1);
149
- }
150
- finally { if (e_1) throw e_1.error; }
151
- }
152
- sessionStore.updateList('modelVariantsList', variantList);
153
- sessionStore.setVehicleState('bodyType', bodyType);
154
- sessionStore.setVehicleState('bodyTypeId', bodyTypeId);
155
- }
156
- clearModelStates() {
157
- this.modelList = [];
158
- this.clearVehicleState('model');
159
- this.clearVehicleState('modelId');
160
- }
161
- clearYearStates() {
162
- this.yearList = [];
163
- this.clearVehicleState('year');
164
- }
165
- clearBodyTypeStates() {
166
- this.bodyTypeList = [];
167
- this.clearVehicleState('bodyType');
168
- this.clearVehicleState('bodyTypeId');
169
- }
170
- clearVariantsList() {
171
- sessionStore.updateList('modelVariantsList', []);
172
- }
173
- clearVehicleState(key) {
174
- sessionStore.setVehicleState(key, null);
175
- }
176
- getVehicleInfo(key) {
177
- return pipe(this.vehicleInfo[key], O.getOrElse(() => ''));
178
- }
179
- isBodyTypeSelected(bodyTypeId) {
180
- return pipe(this.vehicleInfo.bodyTypeId, O.fold(() => false, (selectedBodyTypeId) => selectedBodyTypeId === bodyTypeId));
181
- }
182
- isUsedCarSelected() {
183
- return pipe(this.vehicleInfo.isUsedCarRequested, O.getOrElse(() => false));
184
- }
185
- static get is() { return "ap-ben-choose-vehicle-section"; }
186
- static get states() { return {
187
- "makeList": {},
188
- "modelList": {},
189
- "yearList": {},
190
- "bodyTypeList": {},
191
- "vehicleInfo": {}
192
- }; }
193
- }
@@ -1,38 +0,0 @@
1
- import { Component, Event, h, Host } from '@stencil/core';
2
- import completeImage from '../../../assets/image/complete.svg';
3
- export class CompleteSection {
4
- render() {
5
- return (h(Host, null,
6
- h("div", { class: "container" },
7
- h("div", { class: "row" },
8
- h("div", { class: "col" },
9
- h("h3", null, "What happens next?"))),
10
- h("div", { class: "row" },
11
- h("div", { class: "col" },
12
- h("div", { class: "d-flex justify-content-center p-4" },
13
- h("img", { class: "img-fluid", src: completeImage, alt: "" })))),
14
- h("div", { class: "row" },
15
- h("div", { class: "col text-center" },
16
- h("p", null, "Thanks! We\u2019ll contact you within the next business day to discuss your quote in more detail."))),
17
- h("div", { class: "row" },
18
- h("div", { class: "col text-center" },
19
- h("fl-button", { class: "font-weight-bold", onClick: () => { var _a; return (_a = this.closed) === null || _a === void 0 ? void 0 : _a.emit(); } }, "Close"))))));
20
- }
21
- static get is() { return "ap-ben-complete-section"; }
22
- static get events() { return [{
23
- "method": "closed",
24
- "name": "closed",
25
- "bubbles": true,
26
- "cancelable": true,
27
- "composed": true,
28
- "docs": {
29
- "tags": [],
30
- "text": ""
31
- },
32
- "complexType": {
33
- "original": "void",
34
- "resolved": "void",
35
- "references": {}
36
- }
37
- }]; }
38
- }
@@ -1,47 +0,0 @@
1
- import { Component, h, Host, Prop } from '@stencil/core';
2
- import { getOrDefault } from '../../../utils';
3
- export class CostBreakdownSection {
4
- render() {
5
- return (h(Host, null,
6
- h("div", { class: "container text-left" },
7
- h("div", { class: "row" },
8
- h("div", { class: "col" },
9
- h("p", null, "Here\u2019s an estimate based on your kms:"))),
10
- this.generateLine('Finance', this.quote.financedAmount),
11
- this.generateLine('Fuel', this.quote.fuel),
12
- this.generateLine('Servicing and maintenance', this.quote.serviceAndMaintenance),
13
- this.generateLine('Registration and CTP', this.quote.registrationAndCtp),
14
- this.generateLine('Comprehensive insurance', this.quote.comprehensiveInsurance),
15
- this.generateLine('Management fee', this.quote.managementFee))));
16
- }
17
- generateLine(name, value) {
18
- return (h("div", { class: "row" },
19
- h("div", { class: "col" }, name),
20
- h("div", { class: "col text-right" },
21
- "$",
22
- getOrDefault(value, null))));
23
- }
24
- static get is() { return "ap-ben-cost-breakdown-section"; }
25
- static get properties() { return {
26
- "quote": {
27
- "type": "unknown",
28
- "mutable": false,
29
- "complexType": {
30
- "original": "QuoteResult",
31
- "resolved": "{ afterTaxEffectPerPayCycle: Option<number>; taxSaving: Option<number>; residualValue: Option<number>; financedAmount: Option<number>; fuel: Option<number>; serviceAndMaintenance: Option<number>; registrationAndCtp: Option<number>; comprehensiveInsurance: Option<number>; managementFee: Option<number>; quoteState: \"Not calculated\" | \"Calculation pending\" | \"Calculated\"; }",
32
- "references": {
33
- "QuoteResult": {
34
- "location": "import",
35
- "path": "../services/session.store"
36
- }
37
- }
38
- },
39
- "required": false,
40
- "optional": false,
41
- "docs": {
42
- "tags": [],
43
- "text": ""
44
- }
45
- }
46
- }; }
47
- }
@@ -1,34 +0,0 @@
1
- .abe-car-icon {
2
- max-width: 120px;
3
- height: 80px;
4
- object-fit: contain;
5
- }
6
-
7
- .abe-fade-in-bottom {
8
- -webkit-animation: fade-in-bottom 0.3s cubic-bezier(0.39, 0.575, 0.565, 1) both;
9
- animation: fade-in-bottom 0.3s cubic-bezier(0.39, 0.575, 0.565, 1) both;
10
- }
11
- @-webkit-keyframes fade-in-bottom {
12
- 0% {
13
- -webkit-transform: translateY(50px);
14
- transform: translateY(50px);
15
- opacity: 0;
16
- }
17
- 100% {
18
- -webkit-transform: translateY(0);
19
- transform: translateY(0);
20
- opacity: 1;
21
- }
22
- }
23
- @keyframes fade-in-bottom {
24
- 0% {
25
- -webkit-transform: translateY(50px);
26
- transform: translateY(50px);
27
- opacity: 0;
28
- }
29
- 100% {
30
- -webkit-transform: translateY(0);
31
- transform: translateY(0);
32
- opacity: 1;
33
- }
34
- }
@@ -1,64 +0,0 @@
1
- import { Component, getAssetPath, h, Host, State } from '@stencil/core';
2
- import { format } from 'date-fns';
3
- import * as O from 'fp-ts/Option';
4
- import { getOrDefault } from '../../../utils';
5
- import carsCalculatorService from '../services/cars-calculator.service';
6
- import sessionQuery from '../services/session.query';
7
- export class ModelVariantsSection {
8
- constructor() {
9
- this.selectedVariant = O.none;
10
- this.placeholderImage = getAssetPath('./assets/car-placeholder.svg');
11
- }
12
- componentWillLoad() {
13
- sessionQuery.selectedVariant$.subscribe((state) => {
14
- this.selectedVariant = state;
15
- });
16
- sessionQuery.modelVariantsList$.subscribe((state) => {
17
- this.variantsList = getOrDefault(state, []);
18
- });
19
- }
20
- render() {
21
- return (h(Host, { class: "d-flex flex-column justify-content-start abe-fade-in-bottom" }, O.isNone(this.selectedVariant)
22
- ? this.variantsList.map((variant) => this.variantCard(variant, false))
23
- : this.variantCard(this.selectedVariant.value, true)));
24
- }
25
- variantCard(variant, isSelected) {
26
- const imgSrc = getOrDefault(variant.photoUri, this.placeholderImage);
27
- return (h("div", { class: "card d-flex w-100 flex-row justify-content-between align-items-center mt-3" },
28
- h("img", { class: "abe-car-icon mx-4 d-none d-md-flex", src: imgSrc, alt: "", onError: (e) => this.handleImgError(e) }),
29
- h("div", { class: "d-flex flex-column align-items-start flex-grow-1 px-3 py-2 p-md-0" },
30
- h("h5", { class: "card-title text-capitalize mb-0" }, variant.description.toLowerCase()),
31
- h("p", { class: "card-text text-muted" },
32
- "Built from ",
33
- this.toMonthName(variant.modelMonth),
34
- " ",
35
- variant.buildYear)),
36
- isSelected ? (h("fl-button", { class: "ml-3 mr-4", variant: "secondary", onClick: () => this.resetVariant() },
37
- h("span", { class: "px-3" }, "Change"))) : (h("fl-button", { class: "ml-3 mr-4", onClick: () => this.chooseVariant(variant) },
38
- h("span", { class: "px-3" }, "Select")))));
39
- }
40
- toMonthName(monthNumber) {
41
- return format(new Date().setMonth(monthNumber), 'MMMM');
42
- }
43
- resetVariant() {
44
- carsCalculatorService.selectVariant(O.none);
45
- }
46
- chooseVariant(variant) {
47
- carsCalculatorService.selectVariant(O.some(variant));
48
- }
49
- handleImgError(event) {
50
- event.target.src = this.placeholderImage;
51
- }
52
- static get is() { return "ap-ben-model-variants-section"; }
53
- static get originalStyleUrls() { return {
54
- "$": ["model-variants-section.component.scss"]
55
- }; }
56
- static get styleUrls() { return {
57
- "$": ["model-variants-section.component.css"]
58
- }; }
59
- static get assetsDirs() { return ["assets"]; }
60
- static get states() { return {
61
- "variantsList": {},
62
- "selectedVariant": {}
63
- }; }
64
- }
@@ -1,66 +0,0 @@
1
- import { Component, h, Host, State } from '@stencil/core';
2
- import { pipe } from 'fp-ts/function';
3
- import * as O from 'fp-ts/Option';
4
- import { toSelectInputOptionsArray } from '../../../utils';
5
- import sessionQuery from '../services/session.query';
6
- import sessionStore from '../services/session.store';
7
- const generateTermsOptionsArray = (years) => [...Array(years).keys()]
8
- .map((n) => n + 1)
9
- .map((n) => ({
10
- label: `${n} Year${n > 1 ? 's' : ''}`,
11
- value: n
12
- }));
13
- export class PersonalInfoSection {
14
- constructor() {
15
- this.terms = generateTermsOptionsArray(5);
16
- this.states = ['ACT', 'NSW', 'NT', 'QLD', 'SA', 'TAS', 'VIC', 'WA'];
17
- this.paymentPeriods = ['Monthly', 'Fortnightly', 'Weekly'];
18
- sessionQuery.user$.subscribe((state) => (this.userInfo = state));
19
- }
20
- render() {
21
- return (h(Host, { class: "d-flex flex-column align-items-start justify-content-between" },
22
- h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-2 h4" },
23
- h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "My annual salary before tax is"),
24
- h("input", { placeholder: "50000", type: "text", class: "form-control d-flex w-auto mt-2 mt-lg-0", value: '$' + this.getUserInfo('annualSalary'), onInput: e => {
25
- const el = e.target;
26
- el.value = el.value.replace(/\D/g, '');
27
- }, onFocus: e => {
28
- const el = e.target;
29
- el.value = el.value.replace('$', '');
30
- }, onBlur: e => {
31
- const el = e.target;
32
- el.value = '$' + el.value;
33
- }, onChange: (e) => this.updateUserInfo('annualSalary', parseFloat(e.target.value.trim())) })),
34
- h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-4 h4" },
35
- h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "I get paid"),
36
- h("fl-dropdown", { class: "d-flex my-2 my-lg-0", options: toSelectInputOptionsArray(this.paymentPeriods), requiredValidationMessage: "Select an option", placeholder: "Select...", value: this.getUserInfo('paymentPeriod'), onValueChanged: (e) => this.updateUserInfo('paymentPeriod', e.detail.value) })),
37
- h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-4 h4" },
38
- h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "Every year I expect to drive"),
39
- h("input", { placeholder: "10000", type: "text", class: "form-control d-flex w-auto mt-2 mt-lg-0", value: this.getUserInfo('annualKms') + ' km', onInput: e => {
40
- const el = e.target;
41
- el.value = el.value.replace(/\D/g, '');
42
- }, onFocus: e => {
43
- const el = e.target;
44
- el.value = el.value.replace(' km', '');
45
- }, onBlur: e => {
46
- const el = e.target;
47
- el.value += ' km';
48
- }, onChange: (ev) => this.updateUserInfo('annualKms', parseInt(ev.target.value.trim())) })),
49
- h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-4 h4" },
50
- h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "I live in"),
51
- h("fl-dropdown", { class: "d-flex my-2 my-lg-0", options: toSelectInputOptionsArray(this.states), requiredValidationMessage: "Select an option", placeholder: "select state", value: this.getUserInfo('state'), onValueChanged: (e) => this.updateUserInfo('state', e.detail.value) })),
52
- h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-4 h4" },
53
- h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "I want my lease term to be"),
54
- h("fl-dropdown", { class: "d-flex my-2 my-lg-0", options: this.terms, requiredValidationMessage: "Select an option", placeholder: "Select...", value: this.getUserInfo('term'), onValueChanged: (e) => this.updateUserInfo('term', e.detail.value) }))));
55
- }
56
- updateUserInfo(key, value) {
57
- sessionStore.update({ user: Object.assign(Object.assign({}, this.userInfo), { [key]: O.some(value) }) });
58
- }
59
- getUserInfo(key) {
60
- return pipe(this.userInfo[key], O.getOrElseW(() => ''));
61
- }
62
- static get is() { return "ap-ben-personal-info-section"; }
63
- static get states() { return {
64
- "userInfo": {}
65
- }; }
66
- }
@@ -1,86 +0,0 @@
1
- import { Component, getAssetPath, h, Host, State } from '@stencil/core';
2
- import * as O from 'fp-ts/Option';
3
- import { getOrDefault } from '../../../utils';
4
- import sessionQuery from '../services/session.query';
5
- export class QuoteResultSection {
6
- constructor() {
7
- this.showRequestQuoteModal = false;
8
- this.showBreakdownModal = false;
9
- this.showCompletePage = false;
10
- this.getRenderedPaymentPeriod = () => {
11
- const selectedPaymentPeriod = O.getOrElse(() => 'Monthly')(sessionQuery.user.paymentPeriod);
12
- let renderedPaymentPeriod = 'month';
13
- switch (selectedPaymentPeriod) {
14
- case 'Monthly':
15
- renderedPaymentPeriod = 'month';
16
- break;
17
- case 'Fortnightly':
18
- renderedPaymentPeriod = 'fortnight';
19
- break;
20
- case 'Weekly':
21
- renderedPaymentPeriod = 'week';
22
- }
23
- return `Cost per ${renderedPaymentPeriod}`;
24
- };
25
- this.renderQuoteField = (quoteField) => (h("span", null,
26
- "$",
27
- this.quote.quoteState === 'Calculation pending' ? (h("fl-loading-indicator", { class: "ml-2" })) : (getOrDefault(quoteField, null))));
28
- this.leaseInclusion = (props) => (h("p", { class: "font-weight-light d-inline-flex align-items-center" },
29
- h("img", { class: "pr-1", src: getAssetPath('./assets/check.svg') }),
30
- props.inclusionName));
31
- }
32
- componentWillLoad() {
33
- this.subscription = sessionQuery.result$.subscribe((_state) => {
34
- this.quote = sessionQuery.result;
35
- });
36
- }
37
- disconnectedCallback() {
38
- this.subscription.unsubscribe();
39
- }
40
- render() {
41
- return (h(Host, { class: "card d-flex flex-column justify-content-between w-100 h-100" },
42
- h("div", { class: "d-flex flex-column flex-grow-1 justify-content-between p-4" },
43
- h("span", { class: "mb-3 text-left" },
44
- h("p", { class: "h1 text-muted font-weight-bold mb-0" }, this.renderQuoteField(this.quote.afterTaxEffectPerPayCycle)),
45
- h("p", { class: "mb-0" }, this.getRenderedPaymentPeriod())),
46
- h("span", { class: "mb-3 text-left" },
47
- h("p", { class: "h1 text-info font-weight-bold mb-0" }, this.renderQuoteField(this.quote.taxSaving)),
48
- h("p", { class: "mb-0" }, "Total tax savings")),
49
- h("span", { class: "mb-3 text-left" },
50
- h("p", { class: "h1 text-muted font-weight-bold mb-0" }, this.renderQuoteField(this.quote.residualValue)),
51
- h("p", { class: "mb-0" }, "Residual value")),
52
- h("fl-button", { class: "mt-2", isBlockElement: true, onClick: () => (this.showRequestQuoteModal = true) }, "Request a quote")),
53
- h("div", { class: "bg-light px-4 py-3" },
54
- h("p", { class: "font-weight-bold text-center" }, "Your lease includes"),
55
- h("div", { class: "d-flex flex-row align-items-center justify-content-between" },
56
- h("span", { class: "d-flex flex-column" },
57
- h(this.leaseInclusion, { inclusionName: "Finance" }),
58
- h(this.leaseInclusion, { inclusionName: "Servicing" })),
59
- h("span", { class: "d-flex flex-column" },
60
- h(this.leaseInclusion, { inclusionName: "Insurance" }),
61
- h(this.leaseInclusion, { inclusionName: "Registration" })),
62
- h("span", { class: "d-flex flex-column" },
63
- h(this.leaseInclusion, { inclusionName: "Fuel" }),
64
- h(this.leaseInclusion, { inclusionName: "Tyres" }))),
65
- h("fl-button", { class: "mt-2", isBlockElement: true, variant: "secondary", onClick: () => (this.showBreakdownModal = true) }, "View running cost breakdown")),
66
- h("ap-ben-modal-section", { show: this.showRequestQuoteModal, showHeader: true, onModalClosed: () => {
67
- this.showRequestQuoteModal = false;
68
- this.showCompletePage = false;
69
- } }, this.showCompletePage ? (h("ap-ben-complete-section", { onClosed: () => {
70
- this.showRequestQuoteModal = false;
71
- this.showCompletePage = false;
72
- } })) : (h("ap-ben-submit-quote-section", { onEnquirySubmitted: () => {
73
- this.showCompletePage = true;
74
- } }))),
75
- h("ap-ben-modal-section", { show: this.showBreakdownModal, modalTitle: "Running cost breakdown", onModalClosed: () => (this.showBreakdownModal = false), showHeader: true, showFooter: true },
76
- h("ap-ben-cost-breakdown-section", { quote: this.quote }))));
77
- }
78
- static get is() { return "ap-ben-quote-result-section"; }
79
- static get assetsDirs() { return ["assets"]; }
80
- static get states() { return {
81
- "quote": {},
82
- "showRequestQuoteModal": {},
83
- "showBreakdownModal": {},
84
- "showCompletePage": {}
85
- }; }
86
- }
@@ -1,75 +0,0 @@
1
- import { Component, Event, h, Host, State } from '@stencil/core';
2
- import * as O from 'fp-ts/Option';
3
- import backendApi from '../api/cars-calculator.api';
4
- import carsCalculatorService from '../services/cars-calculator.service';
5
- import sessionQuery from '../services/session.query';
6
- import sessionStore from '../services/session.store';
7
- export class SubmitQuoteSection {
8
- constructor() {
9
- sessionQuery.userDetails$.subscribe((state) => (this.userDetails = state));
10
- }
11
- render() {
12
- return (h(Host, null,
13
- h("div", { class: "container p-0 text-left" },
14
- h("div", { class: "row" },
15
- h("div", { class: "col" },
16
- h("h3", null, "Request a quote"))),
17
- h("div", { class: "row" },
18
- h("div", { class: "col" },
19
- h("p", null, "Enter your details below and we will get in touch."))),
20
- h("div", { class: "row mt-3" },
21
- this.inputField('userFirstName', 'First Name'),
22
- this.inputField('userLastName', 'Last Name')),
23
- h("div", { class: "row mt-3" }, this.inputField('emailAddress', 'Email')),
24
- h("div", { class: "row mt-3" },
25
- this.inputField('contactNumber', 'Mobile Number'),
26
- this.inputField('employerName', 'Employer Name')),
27
- h("div", { class: "row mt-4" },
28
- h("div", { class: "col" },
29
- h("fl-button", { class: "font-weight-bold float-right", onClick: () => this.handleSubmit() },
30
- h("span", { class: "px-4" }, "Submit")))),
31
- h("div", { class: "row mt-4" },
32
- h("div", { class: "col" },
33
- h("div", { class: "bg-light py-2 px-3" },
34
- h("p", { class: "small mb-0" },
35
- "By providing your contact details, you consent to Flare collecting and using your personal details as outlined in the",
36
- ' ',
37
- h("a", { target: "_blank", href: "https://www.flarehr.com/privacy-policy/" }, "privacy policy"),
38
- ".")))))));
39
- }
40
- inputField(stateKey, placeholder) {
41
- return (h("div", { class: "col" },
42
- h("input", { placeholder: placeholder, type: "text", class: "form-control", minlength: "2", onChange: (e) => {
43
- this.updateUserDetail(stateKey, e.target.value.trim());
44
- } })));
45
- }
46
- updateUserDetail(key, value) {
47
- sessionStore.update({ userDetails: Object.assign(Object.assign({}, this.userDetails), { [key]: O.some(value) }) });
48
- }
49
- async handleSubmit() {
50
- var _a;
51
- const enquiryRequest = carsCalculatorService.generateCarsEnquiryRequest();
52
- await backendApi.postQuoteInfoAsync(enquiryRequest);
53
- (_a = this.enquirySubmitted) === null || _a === void 0 ? void 0 : _a.emit();
54
- }
55
- static get is() { return "ap-ben-submit-quote-section"; }
56
- static get states() { return {
57
- "userDetails": {}
58
- }; }
59
- static get events() { return [{
60
- "method": "enquirySubmitted",
61
- "name": "enquirySubmitted",
62
- "bubbles": true,
63
- "cancelable": true,
64
- "composed": true,
65
- "docs": {
66
- "tags": [],
67
- "text": ""
68
- },
69
- "complexType": {
70
- "original": "void",
71
- "resolved": "void",
72
- "references": {}
73
- }
74
- }]; }
75
- }
@@ -1,13 +0,0 @@
1
- import * as O from 'fp-ts/lib/Option';
2
- export class AppConfigurationService {
3
- set apiBaseUrl(url) {
4
- AppConfigurationService._apiBaseUrl = O.fromNullable(url);
5
- }
6
- get apiBaseUrl() {
7
- if (O.isNone(AppConfigurationService._apiBaseUrl)) {
8
- throw Error('API base URL is not set');
9
- }
10
- return AppConfigurationService._apiBaseUrl.value;
11
- }
12
- }
13
- export default new AppConfigurationService();