adp-web-components 0.0.90 → 0.0.92

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 (340) hide show
  1. package/dist/cjs/contact-us-form.cjs.entry.js +4 -4
  2. package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +282 -325
  3. package/dist/cjs/empty-table-icon-PdTX6gpI.js +16 -0
  4. package/dist/cjs/flexible-container.cjs.entry.js +43 -46
  5. package/dist/cjs/form-dialog_8.cjs.entry.js +12 -12
  6. package/dist/cjs/{get-local-language-XsAJEAsO.js → get-local-language-Ch7javM0.js} +38 -38
  7. package/dist/cjs/information-table.cjs.entry.js +6 -3
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
  10. package/dist/cjs/material-card-Cd0L1Get.js +43 -0
  11. package/dist/cjs/part-lookup.cjs.entry.js +32 -11
  12. package/dist/cjs/print-icon-C4ASnhAO.js +106 -0
  13. package/dist/cjs/service-booking-form.cjs.entry.js +4 -4
  14. package/dist/cjs/shift-components.cjs.js +1 -1
  15. package/dist/cjs/shift-tab-content.cjs.entry.js +42 -0
  16. package/dist/cjs/shift-tabs_2.cjs.entry.js +277 -234
  17. package/dist/cjs/{vehicle-info-layout-BSAeLW7e.js → type-BG4jir8r.js} +45 -9
  18. package/dist/cjs/{type-BAD2dFzP.js → type-BpPQE0Ww.js} +1 -1
  19. package/dist/cjs/{type-DT5vXP0E.js → type-DB__lcA9.js} +1 -1
  20. package/dist/cjs/vehicle-accessories_6.cjs.entry.js +1115 -0
  21. package/dist/cjs/vehicle-info-layout-Dp2Po_uc.js +16 -0
  22. package/dist/cjs/vehicle-lookup.cjs.entry.js +19 -16
  23. package/dist/cjs/vin-extractor.cjs.entry.js +3 -3
  24. package/dist/collection/components/components/flexible-container.css +1 -1
  25. package/dist/collection/components/components/flexible-container.js +34 -36
  26. package/dist/collection/components/components/information-table.css +1 -1
  27. package/dist/collection/components/components/information-table.js +45 -2
  28. package/dist/collection/components/components/loading-spinner.css +1 -1
  29. package/dist/collection/components/components/material-card.js +2 -2
  30. package/dist/collection/components/components/shift-tab-content.css +1 -1
  31. package/dist/collection/components/components/shift-tab-content.js +1 -1
  32. package/dist/collection/components/components/shift-tabs.css +1 -1
  33. package/dist/collection/components/form-elements/form-dialog.js +6 -6
  34. package/dist/collection/components/form-elements/form-input.js +4 -4
  35. package/dist/collection/components/form-elements/form-select.js +6 -6
  36. package/dist/collection/components/form-elements/form-structure-error.js +4 -4
  37. package/dist/collection/components/form-elements/form-structure.js +3 -3
  38. package/dist/collection/components/form-elements/form-submit.js +5 -5
  39. package/dist/collection/components/form-elements/form-text-area.js +4 -4
  40. package/dist/collection/components/forms/contact-us/element-mapper.js +1 -1
  41. package/dist/collection/components/forms/contact-us-form.js +4 -4
  42. package/dist/collection/components/forms/service-booking/element-mapper.js +1 -1
  43. package/dist/collection/components/forms/service-booking-form.js +4 -4
  44. package/dist/collection/components/part-lookup/components/dead-stock-item.js +15 -0
  45. package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
  46. package/dist/collection/components/part-lookup/dead-stock-lookup.js +153 -175
  47. package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
  48. package/dist/collection/components/part-lookup/distributor-lookup.js +192 -224
  49. package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
  50. package/dist/collection/components/part-lookup/manufacturer-lookup.js +165 -224
  51. package/dist/collection/components/part-lookup/part-lookup.css +1 -1
  52. package/dist/collection/components/part-lookup/part-lookup.js +127 -57
  53. package/dist/collection/components/vehicle-lookup/components/CardsContainer.js +1 -1
  54. package/dist/collection/components/vehicle-lookup/components/StatusCard.js +2 -2
  55. package/dist/collection/components/vehicle-lookup/components/claimable-item-popover.js +73 -0
  56. package/dist/collection/components/vehicle-lookup/components/claimable-item.js +27 -0
  57. package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
  58. package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +108 -187
  59. package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
  60. package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +369 -507
  61. package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
  62. package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.js +271 -345
  63. package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
  64. package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +59 -56
  65. package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
  66. package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.js +106 -192
  67. package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -3
  68. package/dist/collection/components/vehicle-lookup/vehicle-service-history.js +106 -176
  69. package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -3
  70. package/dist/collection/components/vehicle-lookup/vehicle-specification.js +104 -168
  71. package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -3
  72. package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.js +198 -274
  73. package/dist/collection/components/vin-extractor/vin-extractor.js +13 -4
  74. package/dist/collection/{global/lib/image-expansion.js → features/image-viewer/image-viewer-logic.js} +15 -11
  75. package/dist/collection/features/image-viewer/image-viewer.js +9 -0
  76. package/dist/collection/features/image-viewer/index.js +7 -0
  77. package/dist/collection/features/image-viewer/interface.js +1 -0
  78. package/dist/collection/{global/lib → features/multi-lingual}/get-local-language.js +1 -5
  79. package/dist/collection/features/multi-lingual/index.js +7 -0
  80. package/dist/collection/features/multi-lingual/interface.js +1 -0
  81. package/dist/collection/{global/types/locale.js → features/multi-lingual/types.js} +6 -0
  82. package/dist/collection/features/part-lookup-components/index.js +7 -0
  83. package/dist/collection/features/part-lookup-components/interface.js +1 -0
  84. package/dist/collection/features/part-lookup-components/part-lookup-api-integration.js +84 -0
  85. package/dist/collection/features/part-lookup-components/types.js +1 -0
  86. package/dist/collection/features/vehicle-info-layout/index.js +6 -0
  87. package/dist/collection/features/vehicle-info-layout/interface.js +1 -0
  88. package/dist/collection/{components/components → features/vehicle-info-layout}/vehicle-info-layout.js +1 -1
  89. package/dist/collection/features/vehicle-lookup-component/index.js +7 -0
  90. package/dist/collection/features/vehicle-lookup-component/interface.js +1 -0
  91. package/dist/collection/features/vehicle-lookup-component/types.js +17 -0
  92. package/dist/collection/features/vehicle-lookup-component/vehicle-lookup-api-integration.js +87 -0
  93. package/dist/collection/global/assets/activation-icon.js +6 -0
  94. package/dist/collection/global/assets/add-icon.js +6 -0
  95. package/dist/collection/global/assets/alert-icon.js +6 -0
  96. package/dist/collection/global/assets/arrow-up-icon.js +6 -0
  97. package/dist/collection/global/assets/attach-icon.js +6 -0
  98. package/dist/collection/global/assets/check-icon.js +6 -0
  99. package/dist/collection/global/assets/empty-table-icon.js +6 -0
  100. package/dist/collection/global/assets/form-submit-svg.js +6 -0
  101. package/dist/collection/global/assets/print-icon.js +6 -0
  102. package/dist/collection/global/assets/question-mark.js +6 -0
  103. package/dist/collection/global/assets/triangle-icon.js +6 -0
  104. package/dist/collection/global/lib/parents-with-tag.js +22 -0
  105. package/dist/collection/global/types/generated/vehicle-lookup/vehicle-item-warning.js +1 -0
  106. package/dist/collection/locales/vehicleLookup/claimableItems/type.js +4 -6
  107. package/dist/collection/templates/part-lookup/mock-data.js +85 -2
  108. package/dist/collection/templates/vehicle-lookup/mock-data.js +39 -0
  109. package/dist/components/contact-us-form.js +1 -1
  110. package/dist/components/dead-stock-lookup.js +1 -1
  111. package/dist/components/distributor-lookup.js +1 -1
  112. package/dist/components/flexible-container.js +1 -1
  113. package/dist/components/form-dialog.js +1 -1
  114. package/dist/components/form-input.js +1 -1
  115. package/dist/components/form-select.js +1 -1
  116. package/dist/components/form-structure-error.js +1 -1
  117. package/dist/components/form-structure.js +1 -1
  118. package/dist/components/form-submit.js +1 -1
  119. package/dist/components/form-text-area.js +1 -1
  120. package/dist/components/information-table.js +1 -1
  121. package/dist/components/loading-spinner.js +1 -1
  122. package/dist/components/manufacturer-lookup.js +1 -1
  123. package/dist/components/p-4O0gfpsm.js +5 -0
  124. package/dist/components/p-8hUwcL5D.js +5 -0
  125. package/dist/components/p-9BQXTBdQ.js +5 -0
  126. package/dist/components/p-B1fdQNyr.js +5 -0
  127. package/dist/components/p-B2EAhWbD.js +5 -0
  128. package/dist/components/p-B9RSECb0.js +5 -0
  129. package/dist/components/p-BDCoLRVe.js +5 -0
  130. package/dist/components/p-BG8YXzND.js +5 -0
  131. package/dist/components/p-BNhO80aE.js +5 -0
  132. package/dist/components/p-Be1vlY8X.js +5 -0
  133. package/dist/components/p-BhjL0HMA.js +5 -0
  134. package/dist/components/p-C4zpDhOi.js +5 -0
  135. package/dist/components/p-CHE0gMDU.js +5 -0
  136. package/dist/components/p-CMweaUDZ.js +5 -0
  137. package/dist/components/p-COU68JDH.js +5 -0
  138. package/dist/components/p-Ce4X3l8Z.js +5 -0
  139. package/dist/components/p-CeUz_77J.js +5 -0
  140. package/dist/components/{p-D7yku_Qi.js → p-CgRbul8P.js} +1 -1
  141. package/dist/components/{p-JtBlsz4j.js → p-CiosiH6q.js} +1 -1
  142. package/dist/components/p-CnCnKZ25.js +5 -0
  143. package/dist/components/{p-C-4kx8qU.js → p-CqvK2B_Z.js} +1 -1
  144. package/dist/components/{p-B6QhQCZi.js → p-D6AC01Wg.js} +1 -1
  145. package/dist/components/p-DOoqf10k.js +5 -0
  146. package/dist/components/{p-BaJpYztb.js → p-DRdEUWsa.js} +1 -1
  147. package/dist/components/p-DSNyMvnc.js +5 -0
  148. package/dist/components/{p-CjWDXQ_q.js → p-DhxirzfQ.js} +1 -1
  149. package/dist/components/p-DiG3vhi6.js +5 -0
  150. package/dist/{shift-components/p-CIU9c3pi.js → components/p-DnMCq3Mw.js} +1 -1
  151. package/dist/components/p-Dt-24vpn.js +5 -0
  152. package/dist/components/p-DxBcoZIg.js +5 -0
  153. package/dist/components/{p-D63WC2_Y.js → p-pYVYeitk.js} +1 -1
  154. package/dist/components/p-piZ41_ho.js +5 -0
  155. package/dist/components/part-lookup.js +1 -1
  156. package/dist/components/service-booking-form.js +1 -1
  157. package/dist/components/shift-accordion.js +1 -1
  158. package/dist/components/shift-slider.js +1 -1
  159. package/dist/components/shift-tab-content.js +1 -1
  160. package/dist/components/shift-tabs.js +1 -1
  161. package/dist/components/vehicle-accessories.js +1 -1
  162. package/dist/components/vehicle-claimable-items.js +1 -1
  163. package/dist/components/vehicle-item-claim-form.js +1 -1
  164. package/dist/components/vehicle-lookup.js +1 -1
  165. package/dist/components/vehicle-paint-thickness.js +1 -1
  166. package/dist/components/vehicle-service-history.js +1 -1
  167. package/dist/components/vehicle-specification.js +1 -1
  168. package/dist/components/vehicle-warranty-details.js +1 -1
  169. package/dist/components/vin-extractor.js +1 -1
  170. package/dist/esm/contact-us-form.entry.js +4 -4
  171. package/dist/esm/dead-stock-lookup_3.entry.js +283 -326
  172. package/dist/esm/empty-table-icon-DvQk12N9.js +14 -0
  173. package/dist/esm/flexible-container.entry.js +43 -46
  174. package/dist/esm/form-dialog_8.entry.js +12 -12
  175. package/dist/esm/{get-local-language-BPo-xYwK.js → get-local-language-KsoLM3LI.js} +38 -38
  176. package/dist/esm/information-table.entry.js +6 -3
  177. package/dist/esm/loader.js +1 -1
  178. package/dist/esm/loading-spinner.entry.js +1 -1
  179. package/dist/esm/material-card-DiAl-884.js +40 -0
  180. package/dist/esm/part-lookup.entry.js +32 -11
  181. package/dist/esm/print-icon-Dn5kQmLo.js +99 -0
  182. package/dist/esm/service-booking-form.entry.js +4 -4
  183. package/dist/esm/shift-components.js +1 -1
  184. package/dist/esm/shift-tab-content.entry.js +40 -0
  185. package/dist/esm/shift-tabs_2.entry.js +277 -234
  186. package/dist/esm/type-BAXhU7Vq.js +79 -0
  187. package/dist/esm/{type-DHujxJVp.js → type-CAfIkrCW.js} +1 -1
  188. package/dist/esm/{type-D9Rd8Kcd.js → type-CoXoa4w8.js} +1 -1
  189. package/dist/esm/vehicle-accessories_6.entry.js +1108 -0
  190. package/dist/esm/vehicle-info-layout-CNGGKAia.js +14 -0
  191. package/dist/esm/vehicle-lookup.entry.js +14 -11
  192. package/dist/esm/vin-extractor.entry.js +3 -3
  193. package/dist/locales/vehicleLookup/claimableItems/ar.json +5 -6
  194. package/dist/locales/vehicleLookup/claimableItems/en.json +5 -6
  195. package/dist/locales/vehicleLookup/claimableItems/ku.json +5 -6
  196. package/dist/locales/vehicleLookup/claimableItems/ru.json +5 -6
  197. package/dist/locales/vehicleLookup/claimableItems/type.ts +4 -6
  198. package/dist/shift-components/p-03f093e0.entry.js +5 -0
  199. package/dist/shift-components/p-277c8a5b.entry.js +5 -0
  200. package/dist/shift-components/p-42218765.entry.js +5 -0
  201. package/dist/shift-components/p-55c5a5ea.entry.js +5 -0
  202. package/dist/shift-components/p-5906834e.entry.js +5 -0
  203. package/dist/shift-components/p-5bd460db.entry.js +5 -0
  204. package/dist/shift-components/p-701e3fb0.entry.js +5 -0
  205. package/dist/shift-components/p-98cb9ff7.entry.js +5 -0
  206. package/dist/{components/p-CK4E5G0i.js → shift-components/p-BBKhY55u.js} +1 -1
  207. package/dist/shift-components/{p-DHb8KxaG.js → p-BGyVhGdx.js} +1 -1
  208. package/dist/shift-components/p-BSpTbUWi.js +5 -0
  209. package/dist/shift-components/p-BnTnweSV.js +5 -0
  210. package/dist/shift-components/{p-CuQ84qxe.js → p-D7OEt6rC.js} +1 -1
  211. package/dist/shift-components/p-DzSZ47FV.js +5 -0
  212. package/dist/shift-components/p-Wtw8qj6x.js +5 -0
  213. package/dist/shift-components/p-a137e4bb.entry.js +5 -0
  214. package/dist/shift-components/{p-f282c740.entry.js → p-c4c88519.entry.js} +1 -1
  215. package/dist/shift-components/{p-b6497f63.entry.js → p-dee5dd04.entry.js} +1 -1
  216. package/dist/shift-components/p-e428aabb.entry.js +5 -0
  217. package/dist/shift-components/p-ff79b92b.entry.js +5 -0
  218. package/dist/shift-components/p-fyqwD4fB.js +5 -0
  219. package/dist/shift-components/shift-components.esm.js +1 -1
  220. package/dist/types/components/components/flexible-container.d.ts +2 -5
  221. package/dist/types/components/components/information-table.d.ts +2 -0
  222. package/dist/types/components/components/material-card.d.ts +1 -1
  223. package/dist/types/components/form-elements/form-dialog.d.ts +1 -2
  224. package/dist/types/components/form-elements/form-input.d.ts +1 -2
  225. package/dist/types/components/form-elements/form-select.d.ts +1 -2
  226. package/dist/types/components/form-elements/form-structure-error.d.ts +1 -2
  227. package/dist/types/components/form-elements/form-structure.d.ts +2 -3
  228. package/dist/types/components/form-elements/form-submit.d.ts +1 -1
  229. package/dist/types/components/form-elements/form-text-area.d.ts +1 -1
  230. package/dist/types/components/forms/contact-us-form.d.ts +1 -1
  231. package/dist/types/components/forms/service-booking-form.d.ts +1 -1
  232. package/dist/types/components/part-lookup/components/dead-stock-item.d.ts +14 -0
  233. package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +25 -23
  234. package/dist/types/components/part-lookup/distributor-lookup.d.ts +23 -24
  235. package/dist/types/components/part-lookup/manufacturer-lookup.d.ts +23 -25
  236. package/dist/types/components/part-lookup/part-lookup.d.ts +17 -12
  237. package/dist/types/components/vehicle-lookup/components/claimable-item-popover.d.ts +17 -0
  238. package/dist/types/components/vehicle-lookup/components/claimable-item.d.ts +12 -0
  239. package/dist/types/components/vehicle-lookup/vehicle-accessories.d.ts +23 -28
  240. package/dist/types/components/vehicle-lookup/vehicle-claimable-items.d.ts +53 -55
  241. package/dist/types/components/vehicle-lookup/vehicle-item-claim-form.d.ts +39 -55
  242. package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +8 -9
  243. package/dist/types/components/vehicle-lookup/vehicle-paint-thickness.d.ts +23 -29
  244. package/dist/types/components/vehicle-lookup/vehicle-service-history.d.ts +20 -23
  245. package/dist/types/components/vehicle-lookup/vehicle-specification.d.ts +20 -22
  246. package/dist/types/components/vehicle-lookup/vehicle-warranty-details.d.ts +27 -31
  247. package/dist/types/components/vin-extractor/vin-extractor.d.ts +2 -2
  248. package/dist/types/components.d.ts +143 -169
  249. package/dist/types/features/image-viewer/image-viewer-logic.d.ts +3 -0
  250. package/dist/types/features/image-viewer/image-viewer.d.ts +10 -0
  251. package/dist/types/features/image-viewer/index.d.ts +3 -0
  252. package/dist/types/features/image-viewer/interface.d.ts +5 -0
  253. package/dist/types/features/multi-lingual/get-local-language.d.ts +4 -0
  254. package/dist/types/features/multi-lingual/index.d.ts +3 -0
  255. package/dist/types/features/multi-lingual/interface.d.ts +8 -0
  256. package/dist/types/{global/lib/get-local-language.d.ts → features/multi-lingual/types.d.ts} +17 -6
  257. package/dist/types/features/part-lookup-components/index.d.ts +3 -0
  258. package/dist/types/features/part-lookup-components/interface.d.ts +25 -0
  259. package/dist/types/features/part-lookup-components/part-lookup-api-integration.d.ts +14 -0
  260. package/dist/types/features/part-lookup-components/types.d.ts +3 -0
  261. package/dist/types/features/vehicle-info-layout/index.d.ts +2 -0
  262. package/dist/types/features/vehicle-info-layout/interface.d.ts +3 -0
  263. package/dist/types/{components/components → features/vehicle-info-layout}/vehicle-info-layout.d.ts +3 -3
  264. package/dist/types/features/vehicle-lookup-component/index.d.ts +3 -0
  265. package/dist/types/features/vehicle-lookup-component/interface.d.ts +24 -0
  266. package/dist/types/features/vehicle-lookup-component/types.d.ts +17 -0
  267. package/dist/types/features/vehicle-lookup-component/vehicle-lookup-api-integration.d.ts +15 -0
  268. package/dist/types/global/assets/activation-icon.d.ts +6 -0
  269. package/dist/types/global/assets/add-icon.d.ts +6 -0
  270. package/dist/types/global/assets/alert-icon.d.ts +6 -0
  271. package/dist/types/global/assets/arrow-up-icon.d.ts +6 -0
  272. package/dist/types/global/assets/attach-icon.d.ts +6 -0
  273. package/dist/types/global/assets/check-icon.d.ts +6 -0
  274. package/dist/types/global/assets/empty-table-icon.d.ts +6 -0
  275. package/dist/types/global/assets/form-submit-svg.d.ts +6 -0
  276. package/dist/types/global/assets/print-icon.d.ts +6 -0
  277. package/dist/types/global/assets/question-mark.d.ts +6 -0
  278. package/dist/types/global/assets/triangle-icon.d.ts +6 -0
  279. package/dist/types/global/lib/parents-with-tag.d.ts +1 -0
  280. package/dist/types/global/lib/recaptcha.d.ts +1 -1
  281. package/dist/types/global/types/components.d.ts +0 -1
  282. package/dist/types/global/types/forms.d.ts +1 -1
  283. package/dist/types/global/types/generated/vehicle-lookup/vehicle-item-warning.d.ts +7 -0
  284. package/dist/types/global/types/generated/vehicle-lookup/vehicle-service-item-dto.d.ts +3 -0
  285. package/dist/types/locales/vehicleLookup/accessories/type.d.ts +2 -2
  286. package/dist/types/locales/vehicleLookup/claimableItems/type.d.ts +18 -26
  287. package/dist/types/locales/vehicleLookup/warranty/type.d.ts +2 -2
  288. package/dist/types/locales/vehicleLookup/wrapper-type.d.ts +14 -18
  289. package/package.json +1 -2
  290. package/dist/cjs/shift-tab-content_7.cjs.entry.js +0 -1487
  291. package/dist/cjs/type-CCsnwaKp.js +0 -56
  292. package/dist/collection/global/api/partInformation.js +0 -32
  293. package/dist/collection/global/api/vehicleInformation.js +0 -48
  294. package/dist/components/p-1vy-Ba6r.js +0 -5
  295. package/dist/components/p-B5YdqGVm.js +0 -5
  296. package/dist/components/p-BDkK65_1.js +0 -5
  297. package/dist/components/p-BT4rhLRL.js +0 -5
  298. package/dist/components/p-C1F_f1WE.js +0 -5
  299. package/dist/components/p-CACnUI7c.js +0 -5
  300. package/dist/components/p-CDOvd2iD.js +0 -5
  301. package/dist/components/p-CGzOJT7g.js +0 -5
  302. package/dist/components/p-CINfIgzX.js +0 -5
  303. package/dist/components/p-CJpwqpuQ.js +0 -5
  304. package/dist/components/p-CUqXnLyM.js +0 -5
  305. package/dist/components/p-Cl9ct-bZ.js +0 -5
  306. package/dist/components/p-CqGVdvFp.js +0 -5
  307. package/dist/components/p-D2bxjSGr.js +0 -5
  308. package/dist/components/p-DXHx6lre.js +0 -5
  309. package/dist/components/p-DXj5zsQK.js +0 -5
  310. package/dist/components/p-DsCtgcZn.js +0 -5
  311. package/dist/components/p-DxjQlmaz.js +0 -5
  312. package/dist/components/p-nxlqujKv.js +0 -5
  313. package/dist/components/p-vvHN2Olh.js +0 -5
  314. package/dist/components/p-yQ70lKV2.js +0 -5
  315. package/dist/esm/shift-tab-content_7.entry.js +0 -1479
  316. package/dist/esm/type-CfLRnI1J.js +0 -53
  317. package/dist/esm/vehicle-info-layout-D1bvY1nt.js +0 -43
  318. package/dist/shift-components/p-389f444c.entry.js +0 -5
  319. package/dist/shift-components/p-5dd208de.entry.js +0 -5
  320. package/dist/shift-components/p-5f91eb5f.entry.js +0 -5
  321. package/dist/shift-components/p-76dd44e9.entry.js +0 -5
  322. package/dist/shift-components/p-9a51dae0.entry.js +0 -5
  323. package/dist/shift-components/p-BAMA88Mr.js +0 -5
  324. package/dist/shift-components/p-Br0JD1CD.js +0 -5
  325. package/dist/shift-components/p-af44ca99.entry.js +0 -5
  326. package/dist/shift-components/p-d0e6cd78.entry.js +0 -5
  327. package/dist/shift-components/p-f1225504.entry.js +0 -5
  328. package/dist/shift-components/p-faabbd23.entry.js +0 -5
  329. package/dist/shift-components/p-ff0fec09.entry.js +0 -5
  330. package/dist/types/global/api/partInformation.d.ts +0 -19
  331. package/dist/types/global/api/vehicleInformation.d.ts +0 -33
  332. package/dist/types/global/lib/image-expansion.d.ts +0 -9
  333. package/dist/types/global/types/locale.d.ts +0 -11
  334. /package/dist/collection/{components/vehicle-lookup → global}/assets/activationRequired.svg +0 -0
  335. /package/dist/collection/{components/vehicle-lookup → global}/assets/cancelled.svg +0 -0
  336. /package/dist/collection/{components/vehicle-lookup → global}/assets/check.svg +0 -0
  337. /package/dist/collection/{components/vehicle-lookup → global}/assets/expired.svg +0 -0
  338. /package/dist/collection/{components/vehicle-lookup → global}/assets/pending.svg +0 -0
  339. /package/dist/collection/{components/vehicle-lookup → global}/assets/processed.svg +0 -0
  340. /package/dist/collection/{components/vehicle-lookup → global}/assets/x-mark.svg +0 -0
@@ -17,267 +17,287 @@ var __rest = (this && this.__rest) || function (s, e) {
17
17
  import { Host, h } from "@stencil/core";
18
18
  import cn from "../../global/lib/cn";
19
19
  import { scrollIntoContainerView } from "../../global/lib/scroll-into-container-view";
20
- import { getLocaleLanguage, getSharedLocal, sharedLocalesSchema } from "../../global/lib/get-local-language";
21
- import expiredIcon from "./assets/expired.svg";
22
- import pendingIcon from "./assets/pending.svg";
23
- import cancelledIcon from "./assets/cancelled.svg";
24
- import processedIcon from "./assets/processed.svg";
25
- import activationRequiredIcon from "./assets/activationRequired.svg";
26
- import { getVehicleInformation } from "../../global/api/vehicleInformation";
20
+ import { VehicleInfoLayout } from "../../features/vehicle-info-layout/index";
21
+ import { setVehicleLookupData, setVehicleLookupErrorState } from "../../features/vehicle-lookup-component/index";
22
+ import { getLocaleLanguage, getSharedLocal, sharedLocalesSchema } from "../../features/multi-lingual/index";
23
+ import { ClaimableItem } from "./components/claimable-item";
24
+ import { ClaimableItemPopover } from "./components/claimable-item-popover";
27
25
  import dynamicClaimSchema from "../../locales/vehicleLookup/claimableItems/type";
28
- import { VehicleInfoLayout } from "../components/vehicle-info-layout";
29
- let mockData = {};
30
- const icons = {
31
- expired: expiredIcon,
32
- pending: pendingIcon,
33
- processed: processedIcon,
34
- cancelled: cancelledIcon,
35
- activationRequired: activationRequiredIcon,
36
- };
26
+ import { PrintIcon } from "../../global/assets/print-icon";
27
+ import { ActivationIcon } from "../../global/assets/activation-icon";
28
+ import { EmptyTableIcon } from "../../global/assets/empty-table-icon";
37
29
  export class VehicleClaimableItems {
38
30
  constructor() {
31
+ // ====== Start Localization
32
+ this.language = 'en';
33
+ this.locale = Object.assign({ sharedLocales: sharedLocalesSchema.getDefault() }, dynamicClaimSchema.getDefault());
34
+ // ====== End Localization
35
+ // ====== Start Vehicle info layout prop
36
+ this.coreOnly = false;
39
37
  this.headers = {};
40
- this.isDev = false;
41
38
  this.queryString = '';
42
- this.coreOnly = false;
43
- this.language = 'en';
39
+ this.uploadMultipleDocumentsAtTheForm = true;
40
+ this.isError = false;
41
+ this.isLoading = false;
44
42
  this.maximumDocumentFileSizeInMb = 30;
45
43
  this.claimEndPoint = 'api/vehicle/swift-claim';
46
- this.sharedLocales = sharedLocalesSchema.getDefault();
47
- this.locale = dynamicClaimSchema.getDefault();
48
44
  this.activeTab = '';
49
- this.isError = false;
50
- this.showPopup = false;
51
- this.isLoading = false;
52
- this.externalVin = null;
53
45
  this.showPrintBox = false;
54
- this.errorMessage = null;
55
46
  this.tabAnimationLoading = false;
56
- this.activePopupIndex = null;
57
- this.tabs = [];
58
47
  this.lastSuccessfulClaimResponse = null;
59
- this.pendingItemHighlighted = false;
60
- this.onMouseLeave = () => {
61
- clearTimeout(this.timeoutRef);
62
- this.showPopup = false;
63
- this.timeoutRef = setTimeout(() => {
64
- this.activePopupIndex = null;
65
- }, 400);
66
- };
67
- this.onMouseEnter = (dynamicClaimItemHeader, idx) => {
68
- clearTimeout(this.timeoutRef);
69
- this.activePopupIndex = idx;
70
- this.timeoutRef = setTimeout(() => {
71
- const positionRef = dynamicClaimItemHeader.querySelector('.popup-ref');
72
- this.popupPositionRef = positionRef;
73
- this.calculatePopupPos(this.el.shadowRoot);
74
- this.showPopup = true;
75
- }, 50);
76
- };
48
+ this.showClaimableItemPopover = false;
49
+ this.tabs = [];
50
+ this.popoverTargetLocation = { left: 0, bottom: 0, top: 0 };
77
51
  this.getServiceItems = () => {
78
52
  var _a, _b, _c, _d, _e;
79
- if (!((_b = (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) === null || _b === void 0 ? void 0 : _b.length))
53
+ if (!((_b = (_a = this.vehicleLookup) === null || _a === void 0 ? void 0 : _a.serviceItems) === null || _b === void 0 ? void 0 : _b.length))
80
54
  return [];
81
55
  if (!((_c = this.tabs) === null || _c === void 0 ? void 0 : _c.length))
82
- return (_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.serviceItems;
83
- return (_e = this.vehicleInformation) === null || _e === void 0 ? void 0 : _e.serviceItems.filter(serviceItem => { var _a; return ((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.group) === null || _a === void 0 ? void 0 : _a.name) === this.activeTab; });
56
+ return (_d = this.vehicleLookup) === null || _d === void 0 ? void 0 : _d.serviceItems;
57
+ return (_e = this.vehicleLookup) === null || _e === void 0 ? void 0 : _e.serviceItems.filter(serviceItem => { var _a; return ((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.group) === null || _a === void 0 ? void 0 : _a.name) === this.activeTab; });
58
+ };
59
+ this.parseGroupData = (vehicleLookup) => {
60
+ var _a;
61
+ if ((_a = vehicleLookup === null || vehicleLookup === void 0 ? void 0 : vehicleLookup.serviceItems) === null || _a === void 0 ? void 0 : _a.length) {
62
+ let orderedGroups = [];
63
+ const unOrderedGroups = [];
64
+ vehicleLookup.serviceItems.forEach(({ group }) => {
65
+ if (!(group === null || group === void 0 ? void 0 : group.name))
66
+ return;
67
+ if ([...orderedGroups, ...unOrderedGroups].find(g => (g === null || g === void 0 ? void 0 : g.name) === (group === null || group === void 0 ? void 0 : group.name)))
68
+ return;
69
+ if (group === null || group === void 0 ? void 0 : group.isDefault)
70
+ this.activeTab = group === null || group === void 0 ? void 0 : group.name;
71
+ if (typeof (group === null || group === void 0 ? void 0 : group.tabOrder) === 'number')
72
+ orderedGroups.push(group);
73
+ else
74
+ unOrderedGroups.push(group);
75
+ });
76
+ if (!!unOrderedGroups.length || !!orderedGroups.length) {
77
+ orderedGroups = orderedGroups.sort((a, b) => a.tabOrder - b.tabOrder);
78
+ this.tabs = [...orderedGroups, ...unOrderedGroups];
79
+ if (!this.activeTab)
80
+ this.activeTab = this.tabs[0].name;
81
+ }
82
+ else {
83
+ this.tabs = [];
84
+ this.activeTab = '';
85
+ }
86
+ }
87
+ else {
88
+ this.tabs = [];
89
+ this.activeTab = '';
90
+ }
91
+ return vehicleLookup;
92
+ };
93
+ this.updateProgressBar = async (payload) => {
94
+ var _a, _b;
95
+ // payload indicates its not a fresh list rather it is an update to current one
96
+ if (!payload) {
97
+ // hard reset of the bar
98
+ this.progressBar.style.transitionDuration = '0s';
99
+ this.progressBar.style.opacity = '0';
100
+ this.progressBar.style.width = '0%';
101
+ // apply changes
102
+ await new Promise(r => setTimeout(r, 10));
103
+ }
104
+ this.progressBar.style.transitionDuration = '1s';
105
+ this.progressBar.style.opacity = '1';
106
+ if (!this.vehicleLookup)
107
+ return;
108
+ if (!!((_a = this.tabs) === null || _a === void 0 ? void 0 : _a.length) && this.tabs.find(tab => tab.name === this.activeTab) && !((_b = this.tabs.find(tab => tab.name === this.activeTab)) === null || _b === void 0 ? void 0 : _b.isSequential))
109
+ return;
110
+ const serviceItems = this.getServiceItems();
111
+ const firstPendingItemIndex = serviceItems.findIndex(x => x.status === 'pending');
112
+ if (firstPendingItemIndex !== -1) {
113
+ const pendingItemRef = this.el.shadowRoot.querySelectorAll('.claimable-item')[firstPendingItemIndex];
114
+ const progressLaneRef = this.el.shadowRoot.querySelector('.progress-lane');
115
+ const { left: pendingItemLeftOffset } = pendingItemRef.getBoundingClientRect();
116
+ const { width: progressLaneWidth, left: progressLeftOffset } = progressLaneRef.getBoundingClientRect();
117
+ const offsetToLeftRatio = ((pendingItemLeftOffset - progressLeftOffset) / progressLaneWidth) * 100;
118
+ this.progressBar.style.width = `${offsetToLeftRatio.toFixed(2)}%`;
119
+ if (firstPendingItemIndex === serviceItems.length - 1)
120
+ this.claimableItemsBox.scrollTo({
121
+ left: this.claimableItemsBox.scrollWidth,
122
+ behavior: 'smooth',
123
+ });
124
+ else
125
+ scrollIntoContainerView(pendingItemRef, this.claimableItemsBox);
126
+ }
127
+ else if (!(serviceItems.length === 0 || serviceItems.filter(x => x.status === 'activationRequired').length === serviceItems.length)) {
128
+ this.progressBar.style.width = '100%';
129
+ this.claimableItemsBox.scrollTo({
130
+ left: this.claimableItemsBox.scrollWidth,
131
+ behavior: 'smooth',
132
+ });
133
+ }
84
134
  };
85
135
  this.onActiveTabChange = ({ label }) => {
86
136
  this.tabAnimationLoading = true;
87
137
  clearTimeout(this.tabAnimationTimeoutRef);
88
138
  this.tabAnimationTimeoutRef = setTimeout(() => {
89
139
  this.activeTab = label;
90
- this.claimableContentWrapper.scrollLeft = 0;
140
+ // wait for jsx update
91
141
  setTimeout(() => {
92
142
  this.tabAnimationLoading = false;
93
143
  this.updateProgressBar();
94
- }, 100);
95
- }, 500);
144
+ }, 50);
145
+ }, 750);
146
+ };
147
+ this.activateClaimItem = () => {
148
+ if (this.activate)
149
+ this.activate(this.vehicleLookup);
150
+ };
151
+ this.printLastClaimResponse = () => {
152
+ if (this.print) {
153
+ this.print(this.lastSuccessfulClaimResponse);
154
+ }
155
+ else {
156
+ if (this.lastSuccessfulClaimResponse.PrintURL) {
157
+ window.open(this.lastSuccessfulClaimResponse.PrintURL, '_blank').focus();
158
+ }
159
+ }
160
+ };
161
+ this.updatePopoverLocation = () => {
162
+ if (!this.claimableItemPopoverRef)
163
+ return;
164
+ const { left, bottom, width, top } = this.claimableItemPopoverRef.getBoundingClientRect();
165
+ this.popoverTargetLocation = { left: left + width / 2, bottom, top };
166
+ };
167
+ this.setClaimableItemPopover = (showPopover, claimableItem, claimableItemPopoverRef) => {
168
+ if (showPopover) {
169
+ this.claimableItemPopoverRef = claimableItemPopoverRef;
170
+ this.updatePopoverLocation();
171
+ this.selectedClaimItem = claimableItem;
172
+ this.showClaimableItemPopover = true;
173
+ }
174
+ else {
175
+ this.showClaimableItemPopover = false;
176
+ }
177
+ };
178
+ this.handleClaim = async (_a) => {
179
+ var { documents } = _a, payload = __rest(_a, ["documents"]);
180
+ try {
181
+ const formData = new FormData();
182
+ formData.append('payload', JSON.stringify(Object.assign(Object.assign({}, payload), { vin: this.vehicleLookup.vin, serviceItem: this.claimForm.item, saleInformation: this.vehicleLookup.saleInformation })));
183
+ if (documents && documents.length > 0) {
184
+ documents.forEach(doc => {
185
+ formData.append('document', doc);
186
+ });
187
+ }
188
+ await new Promise((resolve, reject) => {
189
+ const xhr = new XMLHttpRequest();
190
+ xhr.open('POST', this.claimEndPoint);
191
+ Object.entries(this.headers || {}).forEach(([key, value]) => {
192
+ xhr.setRequestHeader(key, value);
193
+ });
194
+ xhr.upload.onprogress = e => {
195
+ if (e.lengthComputable)
196
+ this.claimForm.setFileUploadProgression(Math.round((e.loaded / e.total) * 100));
197
+ };
198
+ xhr.onload = () => {
199
+ if (xhr.status === 200) {
200
+ try {
201
+ const responseData = JSON.parse(xhr.responseText);
202
+ this.completeClaim(responseData);
203
+ resolve();
204
+ }
205
+ catch (parseError) {
206
+ console.error('Response is not valid JSON', {
207
+ rawResponse: xhr.responseText,
208
+ error: parseError,
209
+ });
210
+ reject(new Error('Upload succeeded but response is not valid JSON'));
211
+ }
212
+ resolve();
213
+ }
214
+ else {
215
+ try {
216
+ const responseData = JSON.parse(xhr.responseText);
217
+ alert(responseData.Message);
218
+ }
219
+ catch (_a) {
220
+ reject(new Error(`Upload failed with status ${xhr.status}`));
221
+ }
222
+ }
223
+ };
224
+ xhr.onerror = e => {
225
+ console.log(e);
226
+ reject(new Error('Network error'));
227
+ };
228
+ xhr.send(formData);
229
+ });
230
+ }
231
+ catch (error) {
232
+ console.error(error);
233
+ alert(this.locale.sharedLocales.errors.requestFailedPleaseTryAgainLater);
234
+ }
235
+ };
236
+ this.handleDevClaim = async ({ documents }) => {
237
+ if (documents && documents.length > 0) {
238
+ this.claimForm.setFileUploadProgression(0);
239
+ let uploadChunks = 20;
240
+ for (let index = 0; index < uploadChunks; index++) {
241
+ const uploadPercentage = Math.round(((index + 1) / uploadChunks) * 100);
242
+ await new Promise(r => setTimeout(r, 200));
243
+ this.claimForm.setFileUploadProgression(uploadPercentage);
244
+ }
245
+ }
246
+ await new Promise(r => setTimeout(r, 1000));
247
+ this.completeClaim({ Success: true, ID: '11223344', PrintURL: 'http://localhost/test/print/1122' });
96
248
  };
97
249
  }
98
250
  async componentWillLoad() {
99
251
  await this.changeLanguage(this.language);
100
252
  }
101
253
  async changeLanguage(newLanguage) {
102
- const localeResponses = await Promise.all([getLocaleLanguage(newLanguage, 'vehicleLookup.claimableItems', dynamicClaimSchema), getSharedLocal(newLanguage)]);
103
- this.locale = localeResponses[0];
104
- this.sharedLocales = localeResponses[1];
105
- }
106
- async componentDidLoad() {
107
- this.claimableContentWrapper = this.el.shadowRoot.querySelector('.claimable-content-wrapper');
108
- this.claimForm = this.el.shadowRoot.getElementById('vehicle-item-claim-form');
109
- this.progressBar = this.el.shadowRoot.querySelector('.progress-bar');
254
+ const [sharedLocales, locale] = await Promise.all([getSharedLocal(newLanguage), getLocaleLanguage(newLanguage, 'vehicleLookup.claimableItems', dynamicClaimSchema)]);
255
+ this.locale = Object.assign({ sharedLocales }, locale);
110
256
  }
111
257
  async setMockData(newMockData) {
112
- mockData = newMockData;
258
+ this.mockData = newMockData;
113
259
  }
114
- async setData(newData, headers = {}) {
115
- var _a;
116
- clearTimeout(this.networkTimeoutRef);
117
- if (this.abortController)
118
- this.abortController.abort();
119
- this.abortController = new AbortController();
120
- let scopedTimeoutRef;
121
- const isVinRequest = typeof newData === 'string';
122
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
123
- this.externalVin = vin;
124
- try {
125
- if (!vin || vin.trim().length === 0) {
126
- this.isError = false;
127
- this.vehicleInformation = null;
128
- return;
129
- }
130
- this.isLoading = true;
260
+ async fetchData(newData, headers = {}) {
261
+ const beforeAssignment = async (vehicleLookup) => {
131
262
  this.showPrintBox = false;
132
- await new Promise(r => {
133
- scopedTimeoutRef = setTimeout(r, 1000);
134
- this.networkTimeoutRef = scopedTimeoutRef;
135
- });
136
- this.claimableContentWrapper.scrollLeft = 0;
137
- const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
138
- if (this.networkTimeoutRef === scopedTimeoutRef) {
139
- if (!vehicleResponse)
140
- throw new Error('wrongResponseFormat');
141
- if (!Array.isArray(vehicleResponse.serviceItems))
142
- throw new Error('noServiceAvailable');
143
- this.vehicleInformation = vehicleResponse;
144
- if ((_a = vehicleResponse === null || vehicleResponse === void 0 ? void 0 : vehicleResponse.serviceItems) === null || _a === void 0 ? void 0 : _a.length) {
145
- let orderedGroups = [];
146
- const unOrderedGroups = [];
147
- vehicleResponse.serviceItems.forEach(({ group }) => {
148
- if (!(group === null || group === void 0 ? void 0 : group.name))
149
- return;
150
- if ([...orderedGroups, ...unOrderedGroups].find(g => (g === null || g === void 0 ? void 0 : g.name) === (group === null || group === void 0 ? void 0 : group.name)))
151
- return;
152
- if (group === null || group === void 0 ? void 0 : group.isDefault)
153
- this.activeTab = group === null || group === void 0 ? void 0 : group.name;
154
- if (typeof (group === null || group === void 0 ? void 0 : group.tabOrder) === 'number')
155
- orderedGroups.push(group);
156
- else
157
- unOrderedGroups.push(group);
158
- });
159
- if (!!unOrderedGroups.length || !!orderedGroups.length) {
160
- orderedGroups = orderedGroups.sort((a, b) => a.tabOrder - b.tabOrder);
161
- this.tabs = [...orderedGroups, ...unOrderedGroups];
162
- if (!this.activeTab)
163
- this.activeTab = this.tabs[0].name;
164
- }
165
- else {
166
- this.tabs = [];
167
- this.activeTab = '';
168
- }
169
- }
170
- else {
171
- this.tabs = [];
172
- this.activeTab = '';
173
- }
174
- }
175
- this.errorMessage = null;
176
- this.isLoading = false;
177
- this.isError = false;
178
- }
179
- catch (error) {
180
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
181
- return;
182
- if (this.errorCallback)
183
- this.errorCallback(error.message);
184
- console.error(error);
185
- this.setErrorMessage(error.message);
186
- }
263
+ await this.parseGroupData(vehicleLookup);
264
+ return vehicleLookup;
265
+ };
266
+ await setVehicleLookupData(this, newData, headers, { beforeAssignment });
187
267
  }
188
268
  async setErrorMessage(message) {
189
- this.isError = true;
190
- this.isLoading = false;
191
- this.vehicleInformation = null;
192
- this.errorMessage = message;
193
- }
194
- async fetchData(requestedVin = this.externalVin, headers = {}) {
195
- await this.setData(requestedVin, headers);
269
+ setVehicleLookupErrorState(this, message);
196
270
  }
197
271
  onLoadingChange(newValue) {
198
272
  if (this.loadingStateChange)
199
273
  this.loadingStateChange(newValue);
200
- this.setLoadingUi(newValue);
201
274
  }
202
- async setLoadingUi(isLoading) {
203
- if (!isLoading) {
204
- this.progressBar.style.width = '0';
205
- this.progressBar.style.opacity = '0';
206
- await new Promise(r => setTimeout(r, 200));
207
- this.updateProgressBar();
208
- }
275
+ async componentDidLoad() {
276
+ this.progressBar = this.el.shadowRoot.querySelector('.progress-bar');
277
+ this.claimForm = this.el.shadowRoot.querySelector('.vehicle-item-claim-form');
278
+ this.claimableItemsBox = this.el.shadowRoot.querySelector('.claimable-items-box');
279
+ window.addEventListener('resize', this.updateProgressBar);
280
+ if (this.claimableItemsBox)
281
+ this.claimableItemsBox.addEventListener('scroll', this.updatePopoverLocation);
282
+ window.addEventListener('scroll', this.updatePopoverLocation);
283
+ window.addEventListener('resize', this.updatePopoverLocation);
209
284
  }
210
- updateProgressBar() {
211
- var _a, _b;
212
- const serviceItems = this.getServiceItems();
213
- if (!!((_a = this.tabs) === null || _a === void 0 ? void 0 : _a.length) && this.tabs.find(tab => tab.name === this.activeTab) && !((_b = this.tabs.find(tab => tab.name === this.activeTab)) === null || _b === void 0 ? void 0 : _b.isSequential)) {
214
- this.progressBar.style.width = '0%';
215
- this.progressBar.style.opacity = '0';
216
- return;
217
- }
218
- if (serviceItems.filter(x => x.status === 'pending').length === 0) {
219
- if (serviceItems.length === 0 || serviceItems.filter(x => x.status === 'activationRequired').length === serviceItems.length) {
220
- this.progressBar.style.width = '0%';
221
- this.progressBar.style.opacity = '0';
222
- }
223
- else {
224
- this.progressBar.style.width = '100%';
225
- this.progressBar.style.opacity = '1';
226
- const claimableItems = this.claimableContentWrapper.getElementsByClassName('claimable-item');
227
- scrollIntoContainerView(claimableItems[claimableItems.length - 1], this.claimableContentWrapper);
228
- }
229
- }
230
- else {
231
- const firstPendingItem = serviceItems.find(x => x.status === 'pending');
232
- const firstPendingItemIndex = serviceItems.indexOf(firstPendingItem) + 1;
233
- const firstPendingItemRef = this.claimableContentWrapper.getElementsByClassName('claimable-item')[firstPendingItemIndex - 1];
234
- this.progressBar.style.width = (firstPendingItemIndex / serviceItems.length - 1 / (serviceItems.length * 2)) * 100 + '%';
235
- this.progressBar.style.opacity = this.progressBar.style.width === '0%' ? '0' : '1';
236
- scrollIntoContainerView(firstPendingItemRef, this.claimableContentWrapper);
237
- }
285
+ async disconnectedCallback() {
286
+ window.removeEventListener('resize', this.updateProgressBar);
287
+ if (this.claimableItemsBox)
288
+ this.claimableItemsBox.removeEventListener('scroll', this.updatePopoverLocation);
289
+ window.removeEventListener('scroll', this.updatePopoverLocation);
290
+ window.removeEventListener('resize', this.updatePopoverLocation);
238
291
  }
239
- resetProgressBar() {
292
+ async onVehicleChange() {
293
+ // wait for jsx update
240
294
  setTimeout(() => {
241
295
  this.updateProgressBar();
242
- }, 100);
243
- }
244
- windowScrollListener(newValue) {
245
- if (newValue) {
246
- this.scrollListenerRef = () => this.calculatePopupPos(this.el.shadowRoot);
247
- window.addEventListener('scroll', this.scrollListenerRef);
248
- this.claimableContentWrapper.addEventListener('scroll', this.scrollListenerRef);
249
- }
250
- else {
251
- window.removeEventListener('scroll', this.scrollListenerRef);
252
- this.claimableContentWrapper.removeEventListener('scroll', this.scrollListenerRef);
253
- }
254
- }
255
- calculatePopupPos(root) {
256
- const popupPositionRef = root.querySelector('.popup-ref');
257
- let { x, y } = popupPositionRef.getBoundingClientRect();
258
- const popupContainer = popupPositionRef.querySelector('.popup-container');
259
- const { width } = popupContainer.getBoundingClientRect();
260
- const popupInfo = popupContainer.querySelector('.popup-info');
261
- const windowWidth = window.innerWidth; // Get the viewport's width
262
- popupContainer.style.top = `${y}px`;
263
- popupContainer.style.left = `${x - width / 2}px`;
264
- const offsetFromLeft = x - width / 2; // Distance from left side of the viewport
265
- const offsetFromRight = windowWidth - (x + width / 2); // Distance from right side of the viewport
266
- let movingNeeded = 0;
267
- let horizontalMargin = 16;
268
- if (offsetFromRight < horizontalMargin)
269
- movingNeeded = offsetFromRight - horizontalMargin;
270
- else if (offsetFromLeft < horizontalMargin)
271
- movingNeeded = Math.abs(offsetFromLeft - horizontalMargin);
272
- popupInfo.style.transform = `translateX(${movingNeeded}px)`;
273
- }
274
- removeLoadAnimationClass(event) {
275
- const component = event.target;
276
- component.classList.remove('load-animation');
296
+ }, 50);
277
297
  }
278
298
  async completeClaim(response) {
279
299
  const serviceItems = this.getServiceItems();
280
- const item = this.cachedClaimItem;
300
+ const item = this.selectedClaimItem;
281
301
  const serviceDataClone = JSON.parse(JSON.stringify(serviceItems));
282
302
  const index = serviceItems.indexOf(item);
283
303
  const pendingItemsBefore = serviceDataClone.slice(0, index).filter(x => x.status === 'pending');
@@ -286,175 +306,42 @@ export class VehicleClaimableItems {
286
306
  pendingItemsBefore.forEach(function (otherItem) {
287
307
  otherItem.status = 'cancelled';
288
308
  });
289
- this.pendingItemHighlighted = false;
290
- const vehicleDataClone = JSON.parse(JSON.stringify(this.vehicleInformation));
309
+ const vehicleDataClone = JSON.parse(JSON.stringify(this.vehicleLookup));
291
310
  vehicleDataClone.serviceItems = serviceDataClone;
292
- this.vehicleInformation = JSON.parse(JSON.stringify(vehicleDataClone));
311
+ this.vehicleLookup = JSON.parse(JSON.stringify(vehicleDataClone));
293
312
  this.showPrintBox = true;
294
313
  this.lastSuccessfulClaimResponse = response;
295
314
  }
296
315
  async claim(item) {
316
+ var _a;
297
317
  const serviceItems = this.getServiceItems();
298
318
  const vinDataClone = JSON.parse(JSON.stringify(serviceItems));
299
319
  const index = serviceItems.indexOf(item);
320
+ this.selectedClaimItem = item;
300
321
  //Find other items before this item that have status 'pending'
301
322
  let pendingItemsBefore = vinDataClone.slice(0, index).filter(x => x.status === 'pending');
302
- this.cachedClaimItem = item;
303
- if (item.maximumMileage === null) {
323
+ if ((item === null || item === void 0 ? void 0 : item.maximumMileage) === null)
304
324
  pendingItemsBefore = [];
305
- }
306
- this.onMouseLeave();
307
- this.openRedeem(item, pendingItemsBefore);
308
- }
309
- async handleClaiming() {
310
- if (this.isDev) {
311
- this.claimForm.handleClaiming = async ({ document }) => {
312
- if (document) {
313
- this.claimForm.uploadProgress = 0;
314
- let uploadChunks = 20;
315
- for (let index = 0; index < uploadChunks; index++) {
316
- const uploadPercentage = Math.round(((index + 1) / uploadChunks) * 100);
317
- await new Promise(r => setTimeout(r, 200));
318
- this.claimForm.setFileUploadProgression(uploadPercentage);
319
- }
320
- }
321
- this.claimForm.quite();
322
- this.completeClaim({ Success: true, ID: '11223344', PrintURL: 'http://localhost/test/print/1122' });
323
- this.claimForm.handleClaiming = null;
324
- };
325
- }
326
- else {
327
- this.claimForm.handleClaiming = async (_a) => {
328
- var { document } = _a, payload = __rest(_a, ["document"]);
329
- try {
330
- const formData = new FormData();
331
- formData.append('payload', JSON.stringify(Object.assign(Object.assign({}, payload), { vin: this.vehicleInformation.vin, saleInformation: this.vehicleInformation.saleInformation, serviceItem: this.claimForm.item, cancelledServiceItems: this.claimForm.canceledItems })));
332
- if (document)
333
- formData.append('document', document);
334
- await new Promise((resolve, reject) => {
335
- const xhr = new XMLHttpRequest();
336
- xhr.open('POST', this.claimEndPoint);
337
- Object.entries(this.headers || {}).forEach(([key, value]) => {
338
- xhr.setRequestHeader(key, value);
339
- });
340
- xhr.upload.onprogress = e => {
341
- if (e.lengthComputable)
342
- this.claimForm.setFileUploadProgression(Math.round((e.loaded / e.total) * 100));
343
- };
344
- xhr.onload = () => {
345
- this.claimForm.quite();
346
- this.claimForm.handleClaiming = null;
347
- if (xhr.status === 200) {
348
- try {
349
- const responseData = JSON.parse(xhr.responseText);
350
- this.completeClaim(responseData);
351
- resolve();
352
- }
353
- catch (parseError) {
354
- console.error('Response is not valid JSON', {
355
- rawResponse: xhr.responseText,
356
- error: parseError,
357
- });
358
- reject(new Error('Upload succeeded but response is not valid JSON'));
359
- }
360
- resolve();
361
- }
362
- else {
363
- try {
364
- const responseData = JSON.parse(xhr.responseText);
365
- alert(responseData.Message);
366
- }
367
- catch (_a) {
368
- reject(new Error(`Upload failed with status ${xhr.status}`));
369
- }
370
- }
371
- };
372
- xhr.onerror = e => {
373
- console.log(e);
374
- this.claimForm.quite();
375
- this.claimForm.handleClaiming = null;
376
- reject(new Error('Network error'));
377
- };
378
- xhr.send(formData);
379
- });
380
- }
381
- catch (error) {
382
- console.error(error);
383
- alert(this.sharedLocales.errors.requestFailedPleaseTryAgainLater);
384
- this.claimForm.quite();
385
- this.claimForm.handleClaiming = null;
386
- }
387
- };
388
- }
389
- }
390
- openRedeem(item, oldItems) {
391
- var _a, _b, _c, _d, _e;
392
- const vehicleInformation = this.vehicleInformation;
393
- this.claimForm.vin = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.vin;
394
325
  this.claimForm.item = item;
395
- this.claimForm.canceledItems = oldItems;
396
- if (((_a = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _a === void 0 ? void 0 : _a.broker) !== null && ((_c = (_b = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _b === void 0 ? void 0 : _b.broker) === null || _c === void 0 ? void 0 : _c.invoiceDate) === null)
397
- this.claimForm.unInvoicedByBrokerName = (_e = (_d = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _d === void 0 ? void 0 : _d.broker) === null || _e === void 0 ? void 0 : _e.brokerName;
398
- else
399
- this.claimForm.unInvoicedByBrokerName = null;
400
- this.handleClaiming();
401
- }
402
- createPopup(item) {
403
- const texts = this.locale;
404
- return (h("div", { dir: this.sharedLocales.direction, class: "popup-ref w-0 h-0 bottom-0 flex absolute justify-center" }, h("div", { class: "popup-container fixed z-[100]" }, h("div", { class: cn('opacity-0 w-full z-[101] flex transition-all duration-[0.4s] relative invisible justify-center translate-y-[-9px]', {
405
- '!opacity-100 !visible': this.showPopup,
406
- }) }, h("div", { class: "absolute w-0 h-0 border-[10px] border-t-0 !border-b-[#dddddd] border-transparent" }), h("div", { class: "mt-[1px] absolute w-0 h-0 border-[10px] border-t-0 !border-b-[#f9f9f9] border-transparent" })), h("div", { class: cn('popup-info bg-[#f9f9f9] border border-[#ddd] w-auto p-[20px] rounded-[5px] transition-all duration-[0.4s] text-[#282828] opacity-0 invisible', {
407
- '!opacity-100 !visible': this.showPopup,
408
- }) }, h("table", { class: cn('w-full border-collapse', '[&_th]:border-b [&_th]:border-[#ddd] [&_th]:p-[10px] [&_th]:pe-[50px] [&_th]:text-start [&_th]:whitespace-nowrap', '[&_td]:border-b [&_td]:border-[#ddd] [&_td]:p-[10px] [&_td]:pe-[50px] [&_td]:text-start [&_td]:whitespace-nowrap') }, h("tbody", null, h("tr", null, h("th", null, texts.serviceType), h("td", null, item.type.charAt(0).toUpperCase() + item.type.slice(1))), h("tr", null, h("th", null, texts.activationDate), h("td", null, item.activatedAt)), h("tr", null, h("th", null, texts.expireDate), h("td", null, item.expiresAt)), h("tr", null, h("th", null, texts.claimAt), h("td", null, item.claimDate)), h("tr", null, h("th", null, texts.claimingCompany), h("td", null, item.companyName)), h("tr", null, h("th", null, texts.invoiceNumber), h("td", null, item.invoiceNumber)), h("tr", null, h("th", null, texts.jobNumber), h("td", null, item.jobNumber)), h("tr", null, h("th", null, texts.packageCode), h("td", null, item.packageCode)))), item.claimable && (h("button", { onClick: () => this.claim(item), class: "claim-button m-auto mt-[15px] w-[80%] justify-center" }, h("svg", { class: "size-[30px] duration-200", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { "stroke-width": "0" }), h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), h("g", null, h("circle", { cx: "12", cy: "12", r: "8", "fill-opacity": "0.24" }), h("path", { d: "M8.5 11L11.3939 13.8939C11.4525 13.9525 11.5475 13.9525 11.6061 13.8939L19.5 6", "stroke-width": "1.2" }))), h("span", null, texts.claim)))))));
326
+ this.claimForm.vin = (_a = this.vehicleLookup) === null || _a === void 0 ? void 0 : _a.vin;
327
+ this.claimForm.handleClaiming = this.isDev ? this.handleDevClaim.bind(this) : this.handleClaim.bind(this);
328
+ this.claimForm.open();
409
329
  }
330
+ // ====== End Component Logic
410
331
  render() {
411
332
  var _a;
412
333
  const serviceItems = this.getServiceItems();
413
- const texts = this.locale;
414
- const hasInactiveItems = serviceItems.filter(x => x.status === 'activationRequired').length > 0;
334
+ const isNoServicesAvailable = !this.isLoading && this.vehicleLookup && !serviceItems.length;
415
335
  const hideTabs = this.isLoading || this.isError || !this.tabs.length || !serviceItems.length;
416
336
  const tabs = this.tabs.map(group => group.name);
417
- return (h(Host, { key: '650300d8b2495485e104a8450e6849111f45a843' }, h("vehicle-item-claim-form", { key: '205514a455cab1507e9798c66924d10b6b10e09c', locale: texts.claimForm, language: this.language, id: "vehicle-item-claim-form", maximumDocumentFileSizeInMb: this.maximumDocumentFileSizeInMb }), h(VehicleInfoLayout, { key: '24bcc50ed3fd697fe0e1bd536b04300572905519', isError: this.isError, coreOnly: this.coreOnly, isLoading: this.isLoading, vin: (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin, direction: this.sharedLocales.direction, errorMessage: this.sharedLocales.errors[this.errorMessage] || this.sharedLocales.errors.wildCard }, h("div", { key: 'a133d8beadb9dfc21efc4ea3f3eca8f9c97643e5', class: "absolute z-10 w-full pt-[16px]" }, h("div", { key: '3e27fb454add0e0a7a103bddecafaa98fdf39fea', class: cn('duration-300', { 'translate-y-[-50%] opacity-0': hideTabs }) }, h("shift-tabs", { key: 'a71888699a3189bef9f8391b811c0ab2bbbe82d3', activeTabLabel: this.activeTab, changeActiveTab: this.onActiveTabChange, tabs: tabs }))), h("div", { key: 'f879a081b412cf82ff15592034aa8a190edd5964', class: "relative" }, h("div", { key: 'ce6e960144465d725acf883b14a723835bec1292', class: "flex px-[30px] absolute w-full h-[320px] items-center" }, h("div", { key: 'bf3a6cd026eae91abcd895ae4550098f14648273', class: "h-[10px] translate-y-[-5px] relative bg-[#f2f2f2] border border-[#ddd] rounded-[10px] w-[calc(100%-62px)] items-center justify-around" }, h("div", { key: '0bd1d257ab6a49da3dfb15fda773e0ee7a7b951e', class: "w-full h-full rounded-[4px] overflow-x-hidden absolute left-0 top-0" }, h("div", { key: '73b1ab665d109c6f4e77c975ced5c7f8ff587495', class: "absolute opacity-0 bg-[#1a1a1a] w-[150%] h-full" }), h("div", { key: 'cdce5de783b1c1eec2b50d3775f07997af209bff', class: "absolute h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] lane-inc" }), h("div", { key: 'c34ecca02274697dd705f522e06d194747e94c76', class: "absolute h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] lane-dec" })))), h("div", { key: '4230dfc62c4398edb5277c884e2641260ff736d4', dir: "ltr", class: cn('flex overflow-x-scroll px-[30px] relative h-[320px] items-center transition-all duration-300 claimable-content-wrapper', {
418
- 'hide-scroll': this.tabAnimationLoading,
419
- }) }, h("div", { key: 'caa65ad50775e49b88d082409ece04b9a2e20b6a', class: cn('h-[10px] bg-[#f2f2f2] border flex-1 border-[#ddd] rounded-[10px] flex items-center justify-around relative', {
420
- 'bg-transparent border-transparent': this.isLoading || this.tabAnimationLoading || !serviceItems.length,
421
- }) }, serviceItems.map((item, idx) => {
422
- let statusClass = '';
423
- if (item.status === 'pending') {
424
- if (serviceItems.findIndex(i => i.status === 'pending') === idx)
425
- statusClass = item.status;
426
- }
427
- else
428
- statusClass = item.status;
429
- return (h("div", { key: item.name, class: cn('claimable-item flex flex-col items-center gap-[5px] font-[14px] min-w-[250px]', statusClass), onMouseLeave: this.onMouseLeave }, h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: cn('claimable-item-header load-animation hover:[&>img]:rotate-[360deg] hover:[&>img]:scale-[125%] relative duration-[0.4s] py-[10px] leading-[1em] h-[3em] flex flex-col items-center cursor-pointer', {
430
- '!opacity-0 !translate-y-[-5px] !scale-[70%]': this.isLoading || this.tabAnimationLoading,
431
- }), onMouseEnter: event => this.onMouseEnter(event.target, idx) }, h("img", { class: "duration-[0.4s]", src: icons[item.status], alt: "status icon" }), h("span", { dir: this.sharedLocales.direction, class: "font-bold" }, texts[item.status]), this.activePopupIndex === idx && this.createPopup(item)), h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: cn('claimable-item-circle load-animation w-[18px] translate-y-[2px] h-[18px] rounded-[50%] bg-[#a1a1a1] border-[5px] border-double border-[#ececec] transition-all duration-[0.4s] z-[1]', {
432
- '!opacity-0 !scale-[150%]': this.isLoading || this.tabAnimationLoading,
433
- }) }), h("p", { onAnimationEnd: this.removeLoadAnimationClass, class: cn('claimable-item-footer load-animation transition-all duration-[0.4s] px-[20px] text-center leading-[1.5em] h-[4.5em] overflow-hidden text-ellipsis m-0', {
434
- '!opacity-0 !translate-y-[10px] !scale-[70%]': this.isLoading || this.tabAnimationLoading,
435
- }) }, item.name)));
436
- }), h("div", { key: 'bde59a64354da72d443fe00d4f5e655e17f4010b', class: cn('progress-bar h-[10px] opacity-0 bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] border border-[#ddd] rounded-[10px] w-0 absolute left-0 transition-all duration-500 z-0', {
437
- '!w-0 !opacity-0': this.isLoading || this.tabAnimationLoading,
438
- }) })), h("div", { key: '0d26706af93683381eeb154d660e30888a55ef57', class: cn('absolute w-[90%] left-1/2 ml-[-45%] bottom-[40px] z-[1]', { '!z-[-1]': !(this.vehicleInformation && hasInactiveItems) }) }, h("div", { key: '65f407d2ead8a828ba8cbd85f745286ed7c182a4', class: cn('card warning-card span-entire-1st-row activation-panel', {
439
- loading: this.isLoading || this.tabAnimationLoading,
440
- visible: hasInactiveItems,
441
- }), onAnimationEnd: this.removeLoadAnimationClass }, h("p", { key: '3bc24cddfff666c5e5d6151128e5556246f4191c', class: "no-padding flex gap-2" }, h("span", { key: '97ec53465789ac41c60ba78476865c526516f28d', class: "font-semibold" }, texts.warrantyAndServicesNotActivated)), h("button", { key: '3559fbedb98d0d66a018448b47a0c5ae22181e13', onClick: () => {
442
- if (this.activate) {
443
- this.activate(this.vehicleInformation);
444
- }
445
- }, class: "claim-button" }, h("svg", { key: 'afaad252b24ef036246d7ea4e5dfa0e586072286', class: "size-[30px] duration-200", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { key: '29417f41b50310c2a3196aa09f9ec8356f444b2b', "stroke-width": "0" }), h("g", { key: '337ff662f389278eb4252e67d7297b8104b58ad9', "stroke-linecap": "round", "stroke-linejoin": "round" }), h("g", { key: '69055decd90dbf005e604c49e1b8758766b4e59d' }, h("circle", { key: '0e241fa0f14d0363201609a701bf1fe5d09c611f', cx: "12", cy: "12", r: "8", "fill-opacity": "0.24" }), h("path", { key: 'cdc48fe47ee90b76cb94f6db6fbd2b66170c4fdd', d: "M8.5 11L11.3939 13.8939C11.4525 13.9525 11.5475 13.9525 11.6061 13.8939L19.5 6", "stroke-width": "1.2" }))), h("span", { key: '5cfe67e43afa0342e680e9f195dd37c95f0d2dbb' }, texts.activateNow)))), h("div", { key: '2ecd71e4bd4f8e096473b74e330de8f50272f6c5', class: cn('absolute w-[90%] left-1/2 ml-[-45%] bottom-[40px] z-[1]', { '!z-[-1]': !this.showPrintBox }) }, h("div", { key: 'bda52bd244b2af92b3c6c0501e8f85eded6c56c5', class: cn('card warning-card span-entire-1st-row activation-panel', {
446
- loading: this.isLoading,
447
- visible: this.showPrintBox,
448
- }), onAnimationEnd: this.removeLoadAnimationClass }, h("p", { key: '77be3dfd74e1271f4a6c8799feed44d611733604', class: "no-padding flex gap-2" }, h("span", { key: '7cb43c7a81f928396fe932385955bdbe9543a487', class: "font-semibold" }, texts.successFulClaimMessage)), h("button", { key: 'ea9a839303813a7177b66023cc1f961954f4f91b', onClick: () => {
449
- if (this.print) {
450
- this.print(this.lastSuccessfulClaimResponse);
451
- }
452
- else {
453
- if (this.lastSuccessfulClaimResponse.PrintURL) {
454
- window.open(this.lastSuccessfulClaimResponse.PrintURL, '_blank').focus();
455
- }
456
- }
457
- }, class: "claim-button dynamic-claim-button" }, h("svg", { key: 'fec1b6e0cf6615788bcf9ef246a3e9259ae694f9', width: "30px", height: "30px", viewBox: "-5 -5 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'f2348cb0d49cb586e28111952f6b0620948b7d25', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M17 7H7V6h10v1zm0 12H7v-6h10v6zm2-12V3H5v4H1v8.996C1 17.103 1.897 18 3.004 18H5v3h14v-3h1.996A2.004 2.004 0 0 0 23 15.996V7h-4z", fill: "rgb(252, 248, 227)" })), h("span", { key: 'cf58fe2d58d553130b8281d28c3057b5a89097e3' }, texts.print)))))))));
337
+ const hasInactiveItems = serviceItems.filter(x => x.status === 'activationRequired').length > 0;
338
+ return (h(Host, { key: '420836fe97f84d0c85c03c30442d2893fca3f8ba' }, h("vehicle-item-claim-form", { key: 'a8d947cf4ab32179c86bfb4683920069fc799a68', class: "vehicle-item-claim-form", maximumDocumentFileSizeInMb: this.maximumDocumentFileSizeInMb, uploadMultipleDocuments: this.uploadMultipleDocumentsAtTheForm, locale: Object.assign({ sharedLocales: this.locale.sharedLocales }, this.locale.claimForm) }), h(ClaimableItemPopover, { key: '191bc792eddd6ab4852d12857a7ca664752b9bcf', locale: this.locale, claim: this.claim.bind(this), item: this.selectedClaimItem, showPopover: this.showClaimableItemPopover, targetLocation: this.popoverTargetLocation }), h(VehicleInfoLayout, { key: 'd22f93480af931843c3eca6af382f41947b1de84', isError: this.isError, coreOnly: this.coreOnly, header: (_a = this.vehicleLookup) === null || _a === void 0 ? void 0 : _a.vin, direction: this.locale.sharedLocales.direction, isLoading: this.isLoading || this.tabAnimationLoading, errorMessage: this.locale.sharedLocales.errors[this.errorMessage] || this.locale.sharedLocales.errors.wildCard }, h("div", { key: 'd37a20ac1c8b391b88fe0d4bc4735cbbcb48331e', dir: "ltr", class: cn('relative flex items-center h-[320px] transition-all duration-300', { loading: this.isLoading || this.tabAnimationLoading }) }, h("div", { key: 'b5cd132511def343a95e136826e5e60d7b1887a8', dir: this.locale.sharedLocales.direction, class: "absolute top-0 z-10 w-full pt-[16px]" }, h("div", { key: 'b37bfd31d0a0971782da446054020331c3ee0800', class: cn('duration-300', { 'translate-y-[-50%] opacity-0': hideTabs }) }, h("shift-tabs", { key: '5657c8726e556c4e263f8beaf97bc0e03dbb5792', activeTabLabel: this.activeTab, changeActiveTab: this.onActiveTabChange, tabs: tabs }))), h("div", { key: 'b3a916499dd50965e2e1bbb3941bbe3aca446dd3', class: cn('absolute w-[calc(100%-60px)] left-[30px] progress-container-style opacity-0', { 'opacity-100': this.isLoading || this.tabAnimationLoading }) }, h("div", { key: '642cb0e00a9639c80ed2260b1e934e2ee2f6dec9', class: "w-full h-full rounded-[4px] overflow-x-hidden absolute left-0 top-0" }, h("div", { key: 'b5e07aaafe87a5b4e99badb35013140665cfa6bd', class: "absolute opacity-0 bg-[#1a1a1a] w-[150%] h-full" }), h("div", { key: 'b40bb1d459c19585913afccf5b2a929f75abf6fd', class: "absolute h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] lane-inc" }), h("div", { key: '8833ad2dae76e0b4a9df6c14b0040af5ca66ed8d', class: "absolute h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] lane-dec" }))), h("div", { key: 'fbd0c6c826753ad7bc7d63d5349598aa75bbdf39', dir: this.locale.sharedLocales.direction, class: cn('absolute w-[90%] z-10 pointer-events-none border opacity-0 translate-y-[-5px] scale-[70%] text-[#8a6d3b] bg-[#fcf8e3] border-[#faebcc] p-[25px] text-[16px] rounded-[6px] flex items-center justify-between left-1/2 -translate-x-1/2 h-10 bottom-[40px] transition duration-500', {
339
+ 'opacity-100 pointer-events-auto translate-y-0 scale-100': !this.isLoading && this.vehicleLookup && !this.tabAnimationLoading && (hasInactiveItems || this.showPrintBox),
340
+ }) }, h("span", { key: '2af47dd3e74425ebf33e8c4541513a383aa91094', class: "font-semibold" }, this.showPrintBox ? this.locale.successFulClaimMessage : this.locale.warrantyAndServicesNotActivated), h("button", { key: '4636341286d8e242ca7a8f6c7f79ecf344481af2', class: "claim-button", onClick: this.showPrintBox ? this.printLastClaimResponse : this.activateClaimItem }, this.showPrintBox ? h(PrintIcon, { class: "size-[30px] duration-200" }) : h(ActivationIcon, { class: "size-[30px] duration-200" }), h("span", { key: '0ed0f78745db4b036079bd3b6b29989d58e0f2ca' }, this.showPrintBox ? this.locale.print : this.locale.activateNow))), h("div", { key: 'e83d05efabd56909beb7e3e090ddd72ac778b75d', class: "claimable-items-box px-[30px] min-w-full relative overflow-x-scroll h-full overflow-y-hidden" }, h("div", { key: '75df6fd87dfbdf36e8a96344f15954d59f40b8ed', class: "flex relative w-fit min-w-full items-center h-full [&_*]:shrink-0 gap-[250px] justify-between" }, h("div", { key: '4c5116ce0f5111887c4351631e904051d6d64724', class: cn('progress-container-style progress-lane absolute overflow-hidden w-[calc(100%-0px)] translate-y-0 opacity-100', {
341
+ 'opacity-0': this.isLoading || this.tabAnimationLoading || isNoServicesAvailable || !this.vehicleLookup,
342
+ }) }, h("div", { key: '383a47e72978b4fa81210eb59b4bfd95166c3a7f', part: "progress-bar", class: "progress-bar transition-all w-1/2 h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)]" })), h("div", { key: '1b788c61a3910e659cc19e122d5b708cb1cb2b25', class: "ml-[-125px]" }), serviceItems.map((item, idx) => (h(ClaimableItem, { item: item, locale: this.locale, setClaimableItemPopover: this.setClaimableItemPopover, addStatusClass: item.status !== 'pending' || serviceItems.findIndex(i => i.status === 'pending') === idx }))), h("div", { key: '4d7130b602882354ab73bdac1dd03c51704fd9aa', class: "ml-[-125px]" })), h("div", { key: 'e1d3a01cc8caa27d297ca8ad5bbd8bd7f646c146', dir: this.locale.sharedLocales.direction, class: cn('absolute top-0 left-0 pointer-events-none size-full box-content flex flex-col justify-center opacity-0 transition duration-500 items-center text-slate-700', {
343
+ 'opacity-100 scale-100': isNoServicesAvailable,
344
+ }) }, h(EmptyTableIcon, { key: '57054dfaa04a58b1a2accb0174f5d45265660293', class: "size-[90px]" }), h("div", { key: '1a5d4dc74a5e1aa755f31d68ed3505d8f7e9f2ac', class: "text-[22px]" }, this.locale.sharedLocales.errors.noServiceAvailable)))))));
458
345
  }
459
346
  static get is() { return "vehicle-claimable-items"; }
460
347
  static get encapsulation() { return "shadow"; }
@@ -470,14 +357,20 @@ export class VehicleClaimableItems {
470
357
  }
471
358
  static get properties() {
472
359
  return {
473
- "baseUrl": {
360
+ "language": {
474
361
  "type": "string",
475
- "attribute": "base-url",
362
+ "attribute": "language",
476
363
  "mutable": false,
477
364
  "complexType": {
478
- "original": "string",
479
- "resolved": "string",
480
- "references": {}
365
+ "original": "LanguageKeys",
366
+ "resolved": "\"ar\" | \"en\" | \"ku\" | \"ru\"",
367
+ "references": {
368
+ "LanguageKeys": {
369
+ "location": "import",
370
+ "path": "~features/multi-lingual",
371
+ "id": "src/features/multi-lingual/index.ts::LanguageKeys"
372
+ }
373
+ }
481
374
  },
482
375
  "required": false,
483
376
  "optional": false,
@@ -487,15 +380,16 @@ export class VehicleClaimableItems {
487
380
  },
488
381
  "getter": false,
489
382
  "setter": false,
490
- "reflect": false
383
+ "reflect": false,
384
+ "defaultValue": "'en'"
491
385
  },
492
- "headers": {
493
- "type": "any",
494
- "attribute": "headers",
386
+ "coreOnly": {
387
+ "type": "boolean",
388
+ "attribute": "core-only",
495
389
  "mutable": false,
496
390
  "complexType": {
497
- "original": "any",
498
- "resolved": "any",
391
+ "original": "boolean",
392
+ "resolved": "boolean",
499
393
  "references": {}
500
394
  },
501
395
  "required": false,
@@ -507,7 +401,7 @@ export class VehicleClaimableItems {
507
401
  "getter": false,
508
402
  "setter": false,
509
403
  "reflect": false,
510
- "defaultValue": "{}"
404
+ "defaultValue": "false"
511
405
  },
512
406
  "isDev": {
513
407
  "type": "boolean",
@@ -526,12 +420,11 @@ export class VehicleClaimableItems {
526
420
  },
527
421
  "getter": false,
528
422
  "setter": false,
529
- "reflect": false,
530
- "defaultValue": "false"
423
+ "reflect": false
531
424
  },
532
- "queryString": {
425
+ "baseUrl": {
533
426
  "type": "string",
534
- "attribute": "query-string",
427
+ "attribute": "base-url",
535
428
  "mutable": false,
536
429
  "complexType": {
537
430
  "original": "string",
@@ -546,16 +439,15 @@ export class VehicleClaimableItems {
546
439
  },
547
440
  "getter": false,
548
441
  "setter": false,
549
- "reflect": false,
550
- "defaultValue": "''"
442
+ "reflect": false
551
443
  },
552
- "coreOnly": {
553
- "type": "boolean",
554
- "attribute": "core-only",
444
+ "headers": {
445
+ "type": "unknown",
446
+ "attribute": "headers",
555
447
  "mutable": false,
556
448
  "complexType": {
557
- "original": "boolean",
558
- "resolved": "boolean",
449
+ "original": "object",
450
+ "resolved": "object",
559
451
  "references": {}
560
452
  },
561
453
  "required": false,
@@ -566,60 +458,15 @@ export class VehicleClaimableItems {
566
458
  },
567
459
  "getter": false,
568
460
  "setter": false,
569
- "reflect": false,
570
- "defaultValue": "false"
461
+ "defaultValue": "{}"
571
462
  },
572
- "language": {
463
+ "queryString": {
573
464
  "type": "string",
574
- "attribute": "language",
575
- "mutable": false,
576
- "complexType": {
577
- "original": "LanguageKeys",
578
- "resolved": "\"ar\" | \"en\" | \"ku\" | \"ru\"",
579
- "references": {
580
- "LanguageKeys": {
581
- "location": "import",
582
- "path": "~types/locale",
583
- "id": "src/global/types/locale.ts::LanguageKeys"
584
- }
585
- }
586
- },
587
- "required": false,
588
- "optional": false,
589
- "docs": {
590
- "tags": [],
591
- "text": ""
592
- },
593
- "getter": false,
594
- "setter": false,
595
- "reflect": false,
596
- "defaultValue": "'en'"
597
- },
598
- "print": {
599
- "type": "unknown",
600
- "attribute": "print",
601
- "mutable": false,
602
- "complexType": {
603
- "original": "(claimResponse: any) => void",
604
- "resolved": "(claimResponse: any) => void",
605
- "references": {}
606
- },
607
- "required": false,
608
- "optional": true,
609
- "docs": {
610
- "tags": [],
611
- "text": ""
612
- },
613
- "getter": false,
614
- "setter": false
615
- },
616
- "maximumDocumentFileSizeInMb": {
617
- "type": "number",
618
- "attribute": "maximum-document-file-size-in-mb",
465
+ "attribute": "query-string",
619
466
  "mutable": false,
620
467
  "complexType": {
621
- "original": "number",
622
- "resolved": "number",
468
+ "original": "string",
469
+ "resolved": "string",
623
470
  "references": {}
624
471
  },
625
472
  "required": false,
@@ -631,15 +478,15 @@ export class VehicleClaimableItems {
631
478
  "getter": false,
632
479
  "setter": false,
633
480
  "reflect": false,
634
- "defaultValue": "30"
481
+ "defaultValue": "''"
635
482
  },
636
- "claimEndPoint": {
637
- "type": "string",
638
- "attribute": "claim-end-point",
483
+ "uploadMultipleDocumentsAtTheForm": {
484
+ "type": "boolean",
485
+ "attribute": "upload-multiple-documents-at-the-form",
639
486
  "mutable": false,
640
487
  "complexType": {
641
- "original": "string",
642
- "resolved": "string",
488
+ "original": "boolean",
489
+ "resolved": "boolean",
643
490
  "references": {}
644
491
  },
645
492
  "required": false,
@@ -651,7 +498,7 @@ export class VehicleClaimableItems {
651
498
  "getter": false,
652
499
  "setter": false,
653
500
  "reflect": false,
654
- "defaultValue": "'api/vehicle/swift-claim'"
501
+ "defaultValue": "true"
655
502
  },
656
503
  "errorCallback": {
657
504
  "type": "unknown",
@@ -663,13 +510,13 @@ export class VehicleClaimableItems {
663
510
  "references": {
664
511
  "ErrorKeys": {
665
512
  "location": "import",
666
- "path": "~lib/get-local-language",
667
- "id": "src/global/lib/get-local-language.ts::ErrorKeys"
513
+ "path": "~features/multi-lingual",
514
+ "id": "src/features/multi-lingual/index.ts::ErrorKeys"
668
515
  }
669
516
  }
670
517
  },
671
518
  "required": false,
672
- "optional": false,
519
+ "optional": true,
673
520
  "docs": {
674
521
  "tags": [],
675
522
  "text": ""
@@ -719,6 +566,64 @@ export class VehicleClaimableItems {
719
566
  "getter": false,
720
567
  "setter": false
721
568
  },
569
+ "print": {
570
+ "type": "unknown",
571
+ "attribute": "print",
572
+ "mutable": false,
573
+ "complexType": {
574
+ "original": "(claimResponse: any) => void",
575
+ "resolved": "(claimResponse: any) => void",
576
+ "references": {}
577
+ },
578
+ "required": false,
579
+ "optional": true,
580
+ "docs": {
581
+ "tags": [],
582
+ "text": ""
583
+ },
584
+ "getter": false,
585
+ "setter": false
586
+ },
587
+ "maximumDocumentFileSizeInMb": {
588
+ "type": "number",
589
+ "attribute": "maximum-document-file-size-in-mb",
590
+ "mutable": false,
591
+ "complexType": {
592
+ "original": "number",
593
+ "resolved": "number",
594
+ "references": {}
595
+ },
596
+ "required": false,
597
+ "optional": false,
598
+ "docs": {
599
+ "tags": [],
600
+ "text": ""
601
+ },
602
+ "getter": false,
603
+ "setter": false,
604
+ "reflect": false,
605
+ "defaultValue": "30"
606
+ },
607
+ "claimEndPoint": {
608
+ "type": "string",
609
+ "attribute": "claim-end-point",
610
+ "mutable": false,
611
+ "complexType": {
612
+ "original": "string",
613
+ "resolved": "string",
614
+ "references": {}
615
+ },
616
+ "required": false,
617
+ "optional": false,
618
+ "docs": {
619
+ "tags": [],
620
+ "text": ""
621
+ },
622
+ "getter": false,
623
+ "setter": false,
624
+ "reflect": false,
625
+ "defaultValue": "'api/vehicle/swift-claim'"
626
+ },
722
627
  "activate": {
723
628
  "type": "unknown",
724
629
  "attribute": "activate",
@@ -747,27 +652,26 @@ export class VehicleClaimableItems {
747
652
  }
748
653
  static get states() {
749
654
  return {
750
- "sharedLocales": {},
751
655
  "locale": {},
752
- "activeTab": {},
753
656
  "isError": {},
754
- "showPopup": {},
657
+ "errorMessage": {},
755
658
  "isLoading": {},
756
- "externalVin": {},
659
+ "vehicleLookup": {},
660
+ "activeTab": {},
757
661
  "showPrintBox": {},
758
- "errorMessage": {},
759
662
  "tabAnimationLoading": {},
760
- "activePopupIndex": {},
761
- "tabs": {},
762
663
  "lastSuccessfulClaimResponse": {},
763
- "vehicleInformation": {}
664
+ "showClaimableItemPopover": {},
665
+ "selectedClaimItem": {},
666
+ "tabs": {},
667
+ "popoverTargetLocation": {}
764
668
  };
765
669
  }
766
670
  static get methods() {
767
671
  return {
768
672
  "setMockData": {
769
673
  "complexType": {
770
- "signature": "(newMockData: MockJson<VehicleLookupDTO>) => Promise<void>",
674
+ "signature": "(newMockData: VehicleLookupMock) => Promise<void>",
771
675
  "parameters": [{
772
676
  "name": "newMockData",
773
677
  "type": "{ [key: string]: VehicleLookupDTO; }",
@@ -778,15 +682,10 @@ export class VehicleClaimableItems {
778
682
  "location": "global",
779
683
  "id": "global::Promise"
780
684
  },
781
- "MockJson": {
685
+ "VehicleLookupMock": {
782
686
  "location": "import",
783
- "path": "~types/components",
784
- "id": "src/global/types/components.ts::MockJson"
785
- },
786
- "VehicleLookupDTO": {
787
- "location": "import",
788
- "path": "~types/generated/vehicle-lookup/vehicle-lookup-dto",
789
- "id": "src/global/types/generated/vehicle-lookup/vehicle-lookup-dto.ts::VehicleLookupDTO"
687
+ "path": "~features/vehicle-lookup-component/types",
688
+ "id": "src/features/vehicle-lookup-component/types.ts::VehicleLookupMock"
790
689
  }
791
690
  },
792
691
  "return": "Promise<void>"
@@ -796,7 +695,7 @@ export class VehicleClaimableItems {
796
695
  "tags": []
797
696
  }
798
697
  },
799
- "setData": {
698
+ "fetchData": {
800
699
  "complexType": {
801
700
  "signature": "(newData: VehicleLookupDTO | string, headers?: any) => Promise<void>",
802
701
  "parameters": [{
@@ -817,15 +716,6 @@ export class VehicleClaimableItems {
817
716
  "location": "import",
818
717
  "path": "~types/generated/vehicle-lookup/vehicle-lookup-dto",
819
718
  "id": "src/global/types/generated/vehicle-lookup/vehicle-lookup-dto.ts::VehicleLookupDTO"
820
- },
821
- "ReturnType": {
822
- "location": "global",
823
- "id": "global::ReturnType"
824
- },
825
- "VehicleServiceItemDTO": {
826
- "location": "import",
827
- "path": "~types/generated/vehicle-lookup/vehicle-service-item-dto",
828
- "id": "src/global/types/generated/vehicle-lookup/vehicle-service-item-dto.ts::VehicleServiceItemDTO"
829
719
  }
830
720
  },
831
721
  "return": "Promise<void>"
@@ -850,33 +740,8 @@ export class VehicleClaimableItems {
850
740
  },
851
741
  "ErrorKeys": {
852
742
  "location": "import",
853
- "path": "~lib/get-local-language",
854
- "id": "src/global/lib/get-local-language.ts::ErrorKeys"
855
- }
856
- },
857
- "return": "Promise<void>"
858
- },
859
- "docs": {
860
- "text": "",
861
- "tags": []
862
- }
863
- },
864
- "fetchData": {
865
- "complexType": {
866
- "signature": "(requestedVin?: string, headers?: any) => Promise<void>",
867
- "parameters": [{
868
- "name": "requestedVin",
869
- "type": "string",
870
- "docs": ""
871
- }, {
872
- "name": "headers",
873
- "type": "any",
874
- "docs": ""
875
- }],
876
- "references": {
877
- "Promise": {
878
- "location": "global",
879
- "id": "global::Promise"
743
+ "path": "~features/multi-lingual",
744
+ "id": "src/features/multi-lingual/index.ts::ErrorKeys"
880
745
  }
881
746
  },
882
747
  "return": "Promise<void>"
@@ -917,7 +782,7 @@ export class VehicleClaimableItems {
917
782
  "signature": "(item: VehicleServiceItemDTO) => Promise<void>",
918
783
  "parameters": [{
919
784
  "name": "item",
920
- "type": "{ group: VehicleServiceItemGroup; showDocumentUploader: boolean; documentUploaderIsRequired: boolean; name: string; description: string; title: string; image: string; type: string; typeEnum: \"Free\" | \"Paid\"; activatedAt: string; expiresAt?: string; status: string; statusEnum: \"Processed\" | \"Expired\" | \"Pending\" | \"Cancelled\" | \"ActivationRequired\"; campaignID?: number; campaignUniqueReference: string; packageCode: string; cost?: number; claimDate?: string; modelCostID?: number; serviceItemID: number; paidServiceInvoiceLineID?: number; companyID: string; companyName: string; invoiceNumber: string; jobNumber: string; maximumMileage?: number; claimable: boolean; claimingMethodEnum: \"ClaimByScanningQRCode\" | \"ClaimByEnteringInvoiceAndJobNumber\"; vehicleInspectionID: string; signature: string; signatureExpiry: string; }",
785
+ "type": "{ group: VehicleServiceItemGroup; showDocumentUploader: boolean; warnings?: VehicleItemWarning[]; printUrl?: string; documentUploaderIsRequired: boolean; name: string; description: string; title: string; image: string; type: string; typeEnum: \"Free\" | \"Paid\"; activatedAt: string; expiresAt?: string; status: string; statusEnum: \"Processed\" | \"Expired\" | \"Pending\" | \"Cancelled\" | \"ActivationRequired\"; campaignID?: number; campaignUniqueReference: string; packageCode: string; cost?: number; claimDate?: string; modelCostID?: number; serviceItemID: number; paidServiceInvoiceLineID?: number; companyID: string; companyName: string; invoiceNumber: string; jobNumber: string; maximumMileage?: number; claimable: boolean; claimingMethodEnum: \"ClaimByScanningQRCode\" | \"ClaimByEnteringInvoiceAndJobNumber\"; vehicleInspectionID: string; signature: string; signatureExpiry: string; }",
921
786
  "docs": ""
922
787
  }],
923
788
  "references": {
@@ -949,11 +814,8 @@ export class VehicleClaimableItems {
949
814
  "propName": "isLoading",
950
815
  "methodName": "onLoadingChange"
951
816
  }, {
952
- "propName": "vehicleInformation",
953
- "methodName": "resetProgressBar"
954
- }, {
955
- "propName": "popupClasses",
956
- "methodName": "windowScrollListener"
817
+ "propName": "vehicleLookup",
818
+ "methodName": "onVehicleChange"
957
819
  }];
958
820
  }
959
821
  }