@flarehr/apollo-benefits 0.1.109 → 0.3.53405

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 (216) 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-ff247651.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-0b3afb09.js +5 -0
  13. package/dist/assets/index-5e9e5aa9.js +35 -0
  14. package/dist/assets/index-cfa25e28.css +1 -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-14054f15.js +0 -1
  46. package/dist/lib/apollo-benefits/p-24a37d64.js +0 -1
  47. package/dist/lib/apollo-benefits/p-2b3f3b72.entry.js +0 -1
  48. package/dist/lib/apollo-benefits/p-3111d565.entry.js +0 -1
  49. package/dist/lib/apollo-benefits/p-327396fa.entry.js +0 -1
  50. package/dist/lib/apollo-benefits/p-3d4d2683.js +0 -1
  51. package/dist/lib/apollo-benefits/p-4474bcf8.entry.js +0 -1
  52. package/dist/lib/apollo-benefits/p-4bff99bd.entry.js +0 -1
  53. package/dist/lib/apollo-benefits/p-50fe790f.js +0 -1
  54. package/dist/lib/apollo-benefits/p-53bcbd1d.js +0 -1
  55. package/dist/lib/apollo-benefits/p-68c136da.js +0 -1
  56. package/dist/lib/apollo-benefits/p-6bd16f5b.js +0 -1
  57. package/dist/lib/apollo-benefits/p-71dbc8ff.entry.js +0 -1
  58. package/dist/lib/apollo-benefits/p-774d9bc5.entry.js +0 -1
  59. package/dist/lib/apollo-benefits/p-7a2ca86d.entry.js +0 -1
  60. package/dist/lib/apollo-benefits/p-7a572b50.js +0 -1
  61. package/dist/lib/apollo-benefits/p-7c2cd94a.entry.js +0 -1
  62. package/dist/lib/apollo-benefits/p-839493d7.entry.js +0 -1
  63. package/dist/lib/apollo-benefits/p-a24d169b.entry.js +0 -1
  64. package/dist/lib/apollo-benefits/p-b33fc683.js +0 -1
  65. package/dist/lib/apollo-benefits/p-beb8f728.entry.js +0 -1
  66. package/dist/lib/apollo-benefits/p-e241f55b.entry.js +0 -1
  67. package/dist/lib/apollo-benefits/p-e28cee25.js +0 -1
  68. package/dist/lib/apollo-benefits/p-e3cf51f1.entry.js +0 -1
  69. package/dist/lib/apollo-benefits/p-ef8ea713.entry.js +0 -1
  70. package/dist/lib/apollo-benefits/p-f0a7c9fa.entry.js +0 -1
  71. package/dist/lib/apollo-benefits/p-f603197d.js +0 -15
  72. package/dist/lib/cjs/active-router-0ecaf2b8.js +0 -75
  73. package/dist/lib/cjs/ap-ben-choose-vehicle-section_4.cjs.entry.js +0 -2708
  74. package/dist/lib/cjs/ap-ben-complete-section_4.cjs.entry.js +0 -108
  75. package/dist/lib/cjs/ap-ben-notifications-section.cjs.entry.js +0 -238
  76. package/dist/lib/cjs/apollo-benefits.cjs.js +0 -25
  77. package/dist/lib/cjs/app-globals-67583b8b.js +0 -12
  78. package/dist/lib/cjs/async-6a7926f0.js +0 -753
  79. package/dist/lib/cjs/cars-calculator-app.cjs.entry.js +0 -55
  80. package/dist/lib/cjs/cars-calculator.service-c0e51584.js +0 -904
  81. package/dist/lib/cjs/context-consumer.cjs.entry.js +0 -29
  82. package/dist/lib/cjs/datorama-akita-31d23240.js +0 -2551
  83. package/dist/lib/cjs/delay-d31618c3.js +0 -206
  84. package/dist/lib/cjs/distinctUntilChanged-e8538790.js +0 -371
  85. package/dist/lib/cjs/dom-utils-b8befdd5.js +0 -63
  86. package/dist/lib/cjs/fl-button_2.cjs.entry.js +0 -50
  87. package/dist/lib/cjs/fl-dropdown-async_2.cjs.entry.js +0 -467
  88. package/dist/lib/cjs/fl-dropdown.cjs.entry.js +0 -232
  89. package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -91
  90. package/dist/lib/cjs/index-f1fadf90.js +0 -1735
  91. package/dist/lib/cjs/index.cjs.js +0 -2
  92. package/dist/lib/cjs/loader.cjs.js +0 -27
  93. package/dist/lib/cjs/location-utils-36fe7e5e.js +0 -237
  94. package/dist/lib/cjs/match-path-be4ea5f6.js +0 -279
  95. package/dist/lib/cjs/session.query-d61ba7ec.js +0 -1731
  96. package/dist/lib/cjs/stencil-async-content.cjs.entry.js +0 -32
  97. package/dist/lib/cjs/stencil-route-link.cjs.entry.js +0 -78
  98. package/dist/lib/cjs/stencil-route-switch.cjs.entry.js +0 -104
  99. package/dist/lib/cjs/stencil-route-title.cjs.entry.js +0 -32
  100. package/dist/lib/cjs/stencil-route.cjs.entry.js +0 -97
  101. package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +0 -59
  102. package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +0 -32
  103. package/dist/lib/cjs/stencil-router.cjs.entry.js +0 -640
  104. package/dist/lib/collection/assets/image/complete.svg +0 -122
  105. package/dist/lib/collection/collection-manifest.json +0 -53
  106. package/dist/lib/collection/components/cars-calculator-app/api/api-client.js +0 -5
  107. package/dist/lib/collection/components/cars-calculator-app/api/cars-calculator.api.js +0 -45
  108. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.css +0 -22
  109. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.js +0 -97
  110. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.css +0 -0
  111. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.js +0 -144
  112. package/dist/lib/collection/components/cars-calculator-app/notifications-section/notifications-section.js +0 -25
  113. package/dist/lib/collection/components/cars-calculator-app/pages/assets/car-placeholder.svg +0 -5
  114. package/dist/lib/collection/components/cars-calculator-app/pages/assets/check.svg +0 -13
  115. package/dist/lib/collection/components/cars-calculator-app/pages/choose-vehicle-section.component.js +0 -196
  116. package/dist/lib/collection/components/cars-calculator-app/pages/complete-section.component.js +0 -38
  117. package/dist/lib/collection/components/cars-calculator-app/pages/cost-breakdown-section.component.js +0 -45
  118. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.css +0 -34
  119. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.js +0 -85
  120. package/dist/lib/collection/components/cars-calculator-app/pages/personal-info-section.component.js +0 -66
  121. package/dist/lib/collection/components/cars-calculator-app/pages/quote-result-section.component.js +0 -86
  122. package/dist/lib/collection/components/cars-calculator-app/pages/submit-quote-section.component.js +0 -75
  123. package/dist/lib/collection/components/cars-calculator-app/services/app-configuration.service.js +0 -13
  124. package/dist/lib/collection/components/cars-calculator-app/services/cars-calculator.service.js +0 -106
  125. package/dist/lib/collection/components/cars-calculator-app/services/notifications.service.js +0 -37
  126. package/dist/lib/collection/components/cars-calculator-app/services/notifications.store.js +0 -3
  127. package/dist/lib/collection/components/cars-calculator-app/services/session.query.js +0 -35
  128. package/dist/lib/collection/components/cars-calculator-app/services/session.store.js +0 -78
  129. package/dist/lib/collection/global/config.js +0 -2
  130. package/dist/lib/collection/global/main.dev.js +0 -5
  131. package/dist/lib/collection/global/main.js +0 -5
  132. package/dist/lib/collection/index.js +0 -2
  133. package/dist/lib/collection/utils/config.js +0 -2
  134. package/dist/lib/collection/utils/index.js +0 -15
  135. package/dist/lib/collection/utils/lazy.js +0 -29
  136. package/dist/lib/esm/active-router-7c2ca849.js +0 -73
  137. package/dist/lib/esm/ap-ben-choose-vehicle-section_4.entry.js +0 -2701
  138. package/dist/lib/esm/ap-ben-complete-section_4.entry.js +0 -101
  139. package/dist/lib/esm/ap-ben-notifications-section.entry.js +0 -234
  140. package/dist/lib/esm/apollo-benefits.js +0 -23
  141. package/dist/lib/esm/app-globals-65714cca.js +0 -10
  142. package/dist/lib/esm/async-68e9cad7.js +0 -738
  143. package/dist/lib/esm/cars-calculator-app.entry.js +0 -51
  144. package/dist/lib/esm/cars-calculator.service-27826530.js +0 -897
  145. package/dist/lib/esm/context-consumer.entry.js +0 -25
  146. package/dist/lib/esm/datorama-akita-c87196a0.js +0 -2545
  147. package/dist/lib/esm/delay-115d4292.js +0 -200
  148. package/dist/lib/esm/distinctUntilChanged-bf69e0f8.js +0 -363
  149. package/dist/lib/esm/dom-utils-109a7d75.js +0 -55
  150. package/dist/lib/esm/fl-button_2.entry.js +0 -45
  151. package/dist/lib/esm/fl-dropdown-async_2.entry.js +0 -462
  152. package/dist/lib/esm/fl-dropdown.entry.js +0 -228
  153. package/dist/lib/esm/fl-style-guide.entry.js +0 -87
  154. package/dist/lib/esm/index-19c4d245.js +0 -1703
  155. package/dist/lib/esm/index.js +0 -1
  156. package/dist/lib/esm/loader.js +0 -23
  157. package/dist/lib/esm/location-utils-312665d3.js +0 -226
  158. package/dist/lib/esm/match-path-4b5c7d98.js +0 -276
  159. package/dist/lib/esm/polyfills/core-js.js +0 -11
  160. package/dist/lib/esm/polyfills/css-shim.js +0 -1
  161. package/dist/lib/esm/polyfills/dom.js +0 -79
  162. package/dist/lib/esm/polyfills/es5-html-element.js +0 -1
  163. package/dist/lib/esm/polyfills/index.js +0 -34
  164. package/dist/lib/esm/polyfills/system.js +0 -6
  165. package/dist/lib/esm/session.query-0f1c9503.js +0 -1719
  166. package/dist/lib/esm/stencil-async-content.entry.js +0 -28
  167. package/dist/lib/esm/stencil-route-link.entry.js +0 -74
  168. package/dist/lib/esm/stencil-route-switch.entry.js +0 -100
  169. package/dist/lib/esm/stencil-route-title.entry.js +0 -28
  170. package/dist/lib/esm/stencil-route.entry.js +0 -93
  171. package/dist/lib/esm/stencil-router-prompt.entry.js +0 -55
  172. package/dist/lib/esm/stencil-router-redirect.entry.js +0 -28
  173. package/dist/lib/esm/stencil-router.entry.js +0 -636
  174. package/dist/lib/index.cjs.js +0 -1
  175. package/dist/lib/index.js +0 -1
  176. package/dist/lib/loader/cdn.js +0 -3
  177. package/dist/lib/loader/index.cjs.js +0 -3
  178. package/dist/lib/loader/index.d.ts +0 -13
  179. package/dist/lib/loader/index.es2017.js +0 -3
  180. package/dist/lib/loader/index.js +0 -4
  181. package/dist/lib/loader/package.json +0 -10
  182. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -45
  183. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
  184. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
  185. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
  186. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
  187. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
  188. package/dist/lib/node_modules/@stencil/router/dist/collection/components/route/route.css +0 -3
  189. package/dist/lib/types/components/cars-calculator-app/api/api-client.d.ts +0 -2
  190. package/dist/lib/types/components/cars-calculator-app/api/cars-calculator.api.d.ts +0 -99
  191. package/dist/lib/types/components/cars-calculator-app/cars-calculator-app.d.ts +0 -17
  192. package/dist/lib/types/components/cars-calculator-app/modal-section/modal-section.d.ts +0 -16
  193. package/dist/lib/types/components/cars-calculator-app/notifications-section/notifications-section.d.ts +0 -5
  194. package/dist/lib/types/components/cars-calculator-app/pages/choose-vehicle-section.component.d.ts +0 -23
  195. package/dist/lib/types/components/cars-calculator-app/pages/complete-section.component.d.ts +0 -5
  196. package/dist/lib/types/components/cars-calculator-app/pages/cost-breakdown-section.component.d.ts +0 -6
  197. package/dist/lib/types/components/cars-calculator-app/pages/model-variants-section.component.d.ts +0 -12
  198. package/dist/lib/types/components/cars-calculator-app/pages/personal-info-section.component.d.ts +0 -10
  199. package/dist/lib/types/components/cars-calculator-app/pages/quote-result-section.component.d.ts +0 -13
  200. package/dist/lib/types/components/cars-calculator-app/pages/submit-quote-section.component.d.ts +0 -10
  201. package/dist/lib/types/components/cars-calculator-app/services/app-configuration.service.d.ts +0 -7
  202. package/dist/lib/types/components/cars-calculator-app/services/cars-calculator.service.d.ts +0 -11
  203. package/dist/lib/types/components/cars-calculator-app/services/notifications.service.d.ts +0 -15
  204. package/dist/lib/types/components/cars-calculator-app/services/notifications.store.d.ts +0 -14
  205. package/dist/lib/types/components/cars-calculator-app/services/session.query.d.ts +0 -25
  206. package/dist/lib/types/components/cars-calculator-app/services/session.store.d.ts +0 -77
  207. package/dist/lib/types/components.d.ts +0 -170
  208. package/dist/lib/types/global/config.d.ts +0 -2
  209. package/dist/lib/types/global/main.d.ts +0 -1
  210. package/dist/lib/types/global/main.dev.d.ts +0 -1
  211. package/dist/lib/types/index.d.ts +0 -2
  212. package/dist/lib/types/stencil-public-runtime.d.ts +0 -1555
  213. package/dist/lib/types/utils/config.d.ts +0 -2
  214. package/dist/lib/types/utils/index.d.ts +0 -7
  215. package/dist/lib/types/utils/lazy.d.ts +0 -12
  216. package/readme.md +0 -1
@@ -1,196 +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 flex-wrap", 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
- sessionStore.setVehicleState('bodyType', bodyType);
125
- sessionStore.setVehicleState('bodyTypeId', bodyTypeId);
126
- const modelId = getOrError(this.vehicleInfo.modelId);
127
- const year = getOrError(this.vehicleInfo.year);
128
- const variantPromises = (await carsCalculatorApi.getCarsModelVariant(modelId, year, bodyTypeId)).map(async (variant) => {
129
- var _a;
130
- const photoUri = await carsCalculatorApi.getCarsVariantPhotos(variant.variant_id);
131
- return {
132
- variantId: variant.variant_id,
133
- description: variant.short_description,
134
- buildYear: variant.build_year,
135
- modelMonth: variant.model_month,
136
- listPriceGross: variant.list_price_gross,
137
- engineLitres: variant.engine_litres,
138
- transmission: variant.transmission,
139
- fuelTypeId: variant.fuel_type_translation_id,
140
- photoUri: O.fromNullable((_a = photoUri === null || photoUri === void 0 ? void 0 : photoUri[0]) === null || _a === void 0 ? void 0 : _a.photo_uri)
141
- };
142
- });
143
- const variantList = [];
144
- try {
145
- for (var variantPromises_1 = __asyncValues(variantPromises), variantPromises_1_1; variantPromises_1_1 = await variantPromises_1.next(), !variantPromises_1_1.done;) {
146
- const variant = variantPromises_1_1.value;
147
- variantList.push(variant);
148
- }
149
- }
150
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
151
- finally {
152
- try {
153
- if (variantPromises_1_1 && !variantPromises_1_1.done && (_a = variantPromises_1.return)) await _a.call(variantPromises_1);
154
- }
155
- finally { if (e_1) throw e_1.error; }
156
- }
157
- sessionStore.updateList('modelVariantsList', variantList);
158
- }
159
- clearModelStates() {
160
- this.modelList = [];
161
- this.clearVehicleState('model');
162
- this.clearVehicleState('modelId');
163
- }
164
- clearYearStates() {
165
- this.yearList = [];
166
- this.clearVehicleState('year');
167
- }
168
- clearBodyTypeStates() {
169
- this.bodyTypeList = [];
170
- this.clearVehicleState('bodyType');
171
- this.clearVehicleState('bodyTypeId');
172
- }
173
- clearVariantsList() {
174
- sessionStore.updateList('modelVariantsList', []);
175
- }
176
- clearVehicleState(key) {
177
- sessionStore.setVehicleState(key, null);
178
- }
179
- getVehicleInfo(key) {
180
- return pipe(this.vehicleInfo[key], O.getOrElse(() => ''));
181
- }
182
- isBodyTypeSelected(bodyTypeId) {
183
- return pipe(this.vehicleInfo.bodyTypeId, O.fold(() => false, (selectedBodyTypeId) => selectedBodyTypeId === bodyTypeId));
184
- }
185
- isUsedCarSelected() {
186
- return pipe(this.vehicleInfo.isUsedCarRequested, O.getOrElse(() => false));
187
- }
188
- static get is() { return "ap-ben-choose-vehicle-section"; }
189
- static get states() { return {
190
- "makeList": {},
191
- "modelList": {},
192
- "yearList": {},
193
- "bodyTypeList": {},
194
- "vehicleInfo": {}
195
- }; }
196
- }
@@ -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,45 +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, { class: "d-flex flex-column justify-content-between text-left mb-3" },
6
- h("span", { class: "pb-2" }, "Here\u2019s an estimate based on your kms:"),
7
- h("span", { class: "text-muted text-right" }, "(per pay)"),
8
- this.generateLine('Finance', this.quote.financedAmount),
9
- this.generateLine('Fuel', this.quote.fuel),
10
- this.generateLine('Servicing and maintenance', this.quote.serviceAndMaintenance),
11
- this.generateLine('Registration and CTP', this.quote.registrationAndCtp),
12
- this.generateLine('Comprehensive insurance', this.quote.comprehensiveInsurance),
13
- this.generateLine('Management fee', this.quote.managementFee)));
14
- }
15
- generateLine(name, value) {
16
- return (h("div", { class: "d-flex flex-row" },
17
- h("span", { class: "d-flex-inline flex-grow-1 text-left" }, name),
18
- h("span", { class: "d-flex-inline text-right" },
19
- "$",
20
- getOrDefault(value, null))));
21
- }
22
- static get is() { return "ap-ben-cost-breakdown-section"; }
23
- static get properties() { return {
24
- "quote": {
25
- "type": "unknown",
26
- "mutable": false,
27
- "complexType": {
28
- "original": "QuoteResult",
29
- "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\"; }",
30
- "references": {
31
- "QuoteResult": {
32
- "location": "import",
33
- "path": "../services/session.store"
34
- }
35
- }
36
- },
37
- "required": false,
38
- "optional": false,
39
- "docs": {
40
- "tags": [],
41
- "text": ""
42
- }
43
- }
44
- }; }
45
- }
@@ -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,85 +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.variantsList = [];
10
- this.selectedVariant = O.none;
11
- this.placeholderImage = getAssetPath('./assets/car-placeholder.svg');
12
- }
13
- componentWillLoad() {
14
- sessionQuery.selectedVariant$.subscribe((state) => {
15
- this.selectedVariant = state;
16
- });
17
- sessionQuery.modelVariantsList$.subscribe((state) => {
18
- this.variantsList = getOrDefault(state, []);
19
- });
20
- }
21
- render() {
22
- return (h(Host, { class: "d-flex flex-column justify-content-start align-items-center abe-fade-in-bottom" }, O.isNone(this.selectedVariant) ? (this.variantsList.length > 0 ? (this.variantsList.map((variant) => this.variantCard(variant, false))) : (h("fl-loading-indicator", { class: "mt-5" }))) : (this.variantCard(this.selectedVariant.value, true))));
23
- }
24
- variantCard(variant, isSelected) {
25
- const imgSrc = getOrDefault(variant.photoUri, this.placeholderImage);
26
- const toVariantFuelType = (fuelTypeId) => {
27
- switch (fuelTypeId) {
28
- case 100029:
29
- case 100032:
30
- return 'Diesel';
31
- case 100035:
32
- return 'Electric';
33
- case 100030:
34
- case 100031:
35
- return 'LPG';
36
- case 100033:
37
- case 100034:
38
- return 'Petrol';
39
- default:
40
- return '';
41
- }
42
- };
43
- const toEngineDescription = (variant) => {
44
- return `${variant.engineLitres.toFixed(1)}L ${toVariantFuelType(variant.fuelTypeId)}`.trimEnd();
45
- };
46
- const toVariantDescription = (variant) => `${variant.description.toLowerCase().trimEnd()}, ${toEngineDescription(variant)}, ${variant.transmission.toLowerCase()}`;
47
- return (h("div", { class: "card d-flex w-100 flex-row justify-content-between align-items-center mt-3" },
48
- h("img", { class: "abe-car-icon mx-4 d-none d-md-flex", src: imgSrc, alt: "", onError: (e) => this.handleImgError(e) }),
49
- h("div", { class: "d-flex flex-column align-items-start flex-grow-1 px-3 py-2 p-md-0" },
50
- h("h5", { class: "card-title text-capitalize mb-0" }, toVariantDescription(variant)),
51
- h("p", { class: "card-text text-muted" },
52
- "Built from ",
53
- this.toMonthName(variant.modelMonth),
54
- " ",
55
- variant.buildYear)),
56
- isSelected ? (h("fl-button", { class: "ml-3 mr-4", variant: "secondary", onClick: () => this.resetVariant() },
57
- h("span", { class: "px-3" }, "Change"))) : (h("fl-button", { class: "ml-3 mr-4", onClick: () => this.chooseVariant(variant) },
58
- h("span", { class: "px-3" }, "Select")))));
59
- }
60
- toMonthName(monthNumber) {
61
- return format(new Date().setMonth(monthNumber), 'MMMM');
62
- }
63
- resetVariant() {
64
- carsCalculatorService.selectVariant(O.none);
65
- }
66
- chooseVariant(variant) {
67
- carsCalculatorService.selectVariant(O.some(variant));
68
- window.scroll(0, 0);
69
- }
70
- handleImgError(event) {
71
- event.target.src = this.placeholderImage;
72
- }
73
- static get is() { return "ap-ben-model-variants-section"; }
74
- static get originalStyleUrls() { return {
75
- "$": ["model-variants-section.component.scss"]
76
- }; }
77
- static get styleUrls() { return {
78
- "$": ["model-variants-section.component.css"]
79
- }; }
80
- static get assetsDirs() { return ["assets"]; }
81
- static get states() { return {
82
- "variantsList": {},
83
- "selectedVariant": {}
84
- }; }
85
- }
@@ -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();