adp-web-components 0.0.13 → 0.0.15

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 (125) hide show
  1. package/dist/cjs/{loader-baf2418b.js → Loading-20e4ef35.js} +9 -0
  2. package/dist/cjs/dead-stock-lookup.cjs.entry.js +3 -4
  3. package/dist/cjs/distributor-lookup.cjs.entry.js +3 -4
  4. package/dist/cjs/dynamic-claim_6.cjs.entry.js +1046 -0
  5. package/dist/cjs/dynamic-redeem.cjs.entry.js +5 -5
  6. package/dist/cjs/form-input.cjs.entry.js +2 -2
  7. package/dist/cjs/general-inquiry-form.cjs.entry.js +2 -2
  8. package/dist/cjs/{index-d4b5214c.js → index-97b8da6d.js} +289 -8
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/manufacturer-lookup.cjs.entry.js +3 -4
  11. package/dist/cjs/shift-components.cjs.js +2 -2
  12. package/dist/cjs/vehicle-lookup.cjs.entry.js +133 -0
  13. package/dist/collection/collection-manifest.json +6 -5
  14. package/dist/collection/components/dynamic-claim/dynamic-claim.css +1 -1
  15. package/dist/collection/components/dynamic-claim/dynamic-claim.js +2 -2
  16. package/dist/collection/components/dynamic-redeem/dynamic-redeem.css +1 -1
  17. package/dist/collection/components/dynamic-redeem/dynamic-redeem.js +3 -3
  18. package/dist/collection/components/form-input/form-input.js +1 -1
  19. package/dist/collection/components/general-inquiry-form/general-inquiry-form.js +1 -1
  20. package/dist/collection/components/paint-thickness/paint-thickness.css +1 -1
  21. package/dist/collection/components/paint-thickness/paint-thickness.js +3 -3
  22. package/dist/collection/components/part-lookup/dead-stock-lookup.js +1 -1
  23. package/dist/collection/components/part-lookup/distributor-lookup.js +1 -1
  24. package/dist/collection/components/part-lookup/manufacturer-lookup.js +1 -1
  25. package/dist/collection/components/service-history/service-history.css +1 -1
  26. package/dist/collection/components/service-history/service-history.js +1 -1
  27. package/dist/collection/components/vehicle-accessories/vehicle-accessories.css +1 -1
  28. package/dist/collection/components/vehicle-accessories/vehicle-accessories.js +3 -3
  29. package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -0
  30. package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +244 -0
  31. package/dist/collection/components/vehicle-specification/vehicle-specification.css +1 -1
  32. package/dist/collection/components/vehicle-specification/vehicle-specification.js +1 -1
  33. package/dist/collection/components/warranty-details/warranty-details.css +1 -1
  34. package/dist/collection/components/warranty-details/warranty-details.js +1 -1
  35. package/dist/collection/global/lib/validate-vin.js +62 -0
  36. package/dist/components/dead-stock-lookup.js +1 -1
  37. package/dist/components/distributor-lookup.js +1 -1
  38. package/dist/components/dynamic-claim.js +1 -1
  39. package/dist/components/dynamic-redeem.js +1 -1
  40. package/dist/components/form-input.js +1 -1
  41. package/dist/components/general-inquiry-form.js +1 -1
  42. package/dist/components/index.js +1 -1
  43. package/dist/components/manufacturer-lookup.js +1 -1
  44. package/dist/components/p-05871c28.js +5 -0
  45. package/dist/components/p-23551e81.js +5 -0
  46. package/dist/components/p-325b6857.js +5 -0
  47. package/dist/components/{p-50f73226.js → p-3bf0339d.js} +1 -1
  48. package/dist/components/p-514c4736.js +5 -0
  49. package/dist/components/{p-2b0cc0c6.js → p-8385e385.js} +1 -1
  50. package/dist/components/p-be0a5ab5.js +5 -0
  51. package/dist/components/p-c8eef708.js +5 -0
  52. package/dist/components/p-da533bd7.js +5 -0
  53. package/dist/components/p-e46b126e.js +5 -0
  54. package/dist/components/p-f1ffc23d.js +5 -0
  55. package/dist/components/paint-thickness.js +1 -1
  56. package/dist/components/service-history.js +1 -1
  57. package/dist/components/vehicle-accessories.js +1 -1
  58. package/dist/components/vehicle-lookup.d.ts +11 -0
  59. package/dist/components/vehicle-lookup.js +5 -0
  60. package/dist/components/vehicle-specification.js +1 -1
  61. package/dist/components/warranty-details.js +1 -1
  62. package/dist/esm/{loader-027b88af.js → Loading-d050617c.js} +9 -1
  63. package/dist/esm/dead-stock-lookup.entry.js +3 -4
  64. package/dist/esm/distributor-lookup.entry.js +3 -4
  65. package/dist/esm/dynamic-claim_6.entry.js +1037 -0
  66. package/dist/esm/dynamic-redeem.entry.js +5 -5
  67. package/dist/esm/form-input.entry.js +2 -2
  68. package/dist/esm/general-inquiry-form.entry.js +2 -2
  69. package/dist/esm/{index-ef54644b.js → index-ff1dab22.js} +289 -8
  70. package/dist/esm/loader.js +3 -3
  71. package/dist/esm/manufacturer-lookup.entry.js +3 -4
  72. package/dist/esm/shift-components.js +3 -3
  73. package/dist/esm/vehicle-lookup.entry.js +129 -0
  74. package/dist/shift-components/{p-894e7518.entry.js → p-15e82b1a.entry.js} +1 -1
  75. package/dist/shift-components/p-1a727cfd.entry.js +5 -0
  76. package/dist/shift-components/p-2bb4415e.entry.js +5 -0
  77. package/dist/shift-components/p-3f3b41b4.entry.js +5 -0
  78. package/dist/shift-components/{p-8e818568.entry.js → p-4c3f2850.entry.js} +1 -1
  79. package/dist/shift-components/p-4ca95c3d.entry.js +5 -0
  80. package/dist/shift-components/p-65939a2f.js +5 -0
  81. package/dist/shift-components/p-8b198a04.entry.js +5 -0
  82. package/dist/shift-components/p-d577db71.entry.js +5 -0
  83. package/dist/shift-components/p-f37b60d5.js +6 -0
  84. package/dist/shift-components/shift-components.esm.js +1 -1
  85. package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +23 -0
  86. package/dist/types/components.d.ts +37 -0
  87. package/dist/types/global/lib/validate-vin.d.ts +1 -0
  88. package/package.json +1 -1
  89. package/readme.md +2 -91
  90. package/dist/cjs/Loading-ee1a2ceb.js +0 -16
  91. package/dist/cjs/dynamic-claim.cjs.entry.js +0 -306
  92. package/dist/cjs/image-expansion-a9c9c6f7.js +0 -77
  93. package/dist/cjs/paint-thickness.cjs.entry.js +0 -118
  94. package/dist/cjs/service-history.cjs.entry.js +0 -103
  95. package/dist/cjs/vehicle-accessories.cjs.entry.js +0 -122
  96. package/dist/cjs/vehicle-specification.cjs.entry.js +0 -98
  97. package/dist/cjs/vehicleInformation-35c470fc.js +0 -52
  98. package/dist/cjs/warranty-details.cjs.entry.js +0 -257
  99. package/dist/components/p-4dc47f5f.js +0 -5
  100. package/dist/components/p-8375923d.js +0 -5
  101. package/dist/components/p-a454210b.js +0 -5
  102. package/dist/esm/Loading-61648252.js +0 -14
  103. package/dist/esm/dynamic-claim.entry.js +0 -302
  104. package/dist/esm/image-expansion-08c4bf0d.js +0 -73
  105. package/dist/esm/paint-thickness.entry.js +0 -114
  106. package/dist/esm/service-history.entry.js +0 -99
  107. package/dist/esm/vehicle-accessories.entry.js +0 -118
  108. package/dist/esm/vehicle-specification.entry.js +0 -94
  109. package/dist/esm/vehicleInformation-f7290628.js +0 -50
  110. package/dist/esm/warranty-details.entry.js +0 -253
  111. package/dist/shift-components/p-65e6ab8e.js +0 -5
  112. package/dist/shift-components/p-6b21ce2d.entry.js +0 -5
  113. package/dist/shift-components/p-7d85e912.entry.js +0 -5
  114. package/dist/shift-components/p-7f258017.entry.js +0 -5
  115. package/dist/shift-components/p-9653e992.entry.js +0 -5
  116. package/dist/shift-components/p-a21e2e2e.js +0 -5
  117. package/dist/shift-components/p-c4fad245.js +0 -5
  118. package/dist/shift-components/p-ca1e2e5b.entry.js +0 -5
  119. package/dist/shift-components/p-d1b9cd93.entry.js +0 -5
  120. package/dist/shift-components/p-d5ff7544.js +0 -5
  121. package/dist/shift-components/p-d6f40c8d.entry.js +0 -5
  122. package/dist/shift-components/p-e05acce1.entry.js +0 -5
  123. package/dist/shift-components/p-e97316d2.js +0 -6
  124. package/dist/shift-components/p-faa8070a.entry.js +0 -5
  125. package/dist/shift-components/p-feb3df85.entry.js +0 -5
@@ -1,118 +0,0 @@
1
- /*!
2
- * Built by ShiftSoftware
3
- * Copyright (c)
4
- */
5
- 'use strict';
6
-
7
- Object.defineProperty(exports, '__esModule', { value: true });
8
-
9
- const index = require('./index-d4b5214c.js');
10
- const Loading = require('./Loading-ee1a2ceb.js');
11
- const vehicleInformation = require('./vehicleInformation-35c470fc.js');
12
- const imageExpansion = require('./image-expansion-a9c9c6f7.js');
13
- const cn = require('./cn-f559f9e5.js');
14
- require('./loader-baf2418b.js');
15
-
16
- const paintThicknessCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.z-40{z-index:40}.float-right{float:right}.mx-auto{margin-left:auto;margin-right:auto}.mr-\\[16px\\]{margin-right:16px}.mt-\\[12px\\]{margin-top:12px}.mt-\\[16px\\]{margin-top:16px}.flex{display:flex}.table{display:table}.size-12{height:3rem;width:3rem}.size-full{height:100%;width:100%}.h-0{height:0}.h-1{height:.25rem}.h-\\[100dvh\\]{height:100dvh}.h-\\[150px\\]{height:150px}.h-\\[40px\\]{height:40px}.h-\\[50px\\]{height:50px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-12{width:3rem}.w-\\[100dvw\\]{width:100dvw}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.min-w-\\[100px\\]{min-width:100px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-rotate-45{--tw-rotate:-45deg}.-rotate-45,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-\\[16px\\]{gap:16px}.gap-\\[4px\\]{gap:4px}.gap-\\[8px\\]{gap:8px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.\\!border-none{border-style:none!important}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-black\\/40{background-color:rgba(0,0,0,.4)}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-\\[12px\\]{padding:12px}.p-\\[6px\\]{padding:6px}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[15px\\]{padding-left:15px;padding-right:15px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.px-\\[24px\\]{padding-left:24px;padding-right:24px}.px-\\[30px\\]{padding-left:30px;padding-right:30px}.py-\\[15px\\]{padding-bottom:15px;padding-top:15px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.font-semibold{font-weight:600}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.delay-200{transition-delay:.2s}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:opacity-100:hover{opacity:1}.\\[\\&_div\\]\\:hover\\:\\!opacity-100:hover div{opacity:1!important}.\\[\\&_img\\]\\:hover\\:shadow-lg:hover img{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
17
- const PaintThicknessStyle0 = paintThicknessCss;
18
-
19
- let mockData = {};
20
- const PaintThickness = class {
21
- constructor(hostRef) {
22
- index.registerInstance(this, hostRef);
23
- this.closeImageListener = (event) => {
24
- this.closeImage(event);
25
- };
26
- this.openImage = (target, imageSrc) => {
27
- imageExpansion.openImageViewer(this, target, imageSrc);
28
- };
29
- this.closeImage = (event) => {
30
- imageExpansion.closeImageViewer(this, event);
31
- };
32
- this.baseUrl = '';
33
- this.isDev = false;
34
- this.queryString = '';
35
- this.loadingStateChange = undefined;
36
- this.loadedResponse = undefined;
37
- this.state = 'idle';
38
- this.externalVin = null;
39
- this.errorMessage = null;
40
- this.expandedImage = null;
41
- this.vehicleInformation = undefined;
42
- }
43
- handleSettingData(response) {
44
- if (!response.paintThickness)
45
- response.paintThickness = { imageGroups: [], parts: [] };
46
- if (!response.paintThickness.parts || !Array.isArray(response.paintThickness.parts))
47
- response.paintThickness.parts = [];
48
- if (!response.paintThickness.imageGroups || !Array.isArray(response.paintThickness.imageGroups))
49
- response.paintThickness.imageGroups = [];
50
- this.vehicleInformation = response;
51
- }
52
- async setData(newData, headers = {}) {
53
- clearTimeout(this.networkTimeoutRef);
54
- if (this.abortController)
55
- this.abortController.abort();
56
- this.abortController = new AbortController();
57
- let scopedTimeoutRef;
58
- const isVinRequest = typeof newData === 'string';
59
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
60
- this.externalVin = vin;
61
- try {
62
- if (!vin || vin.trim().length === 0) {
63
- this.state = 'idle';
64
- return;
65
- }
66
- if (this.state === 'data' || this.state === 'error') {
67
- this.state = (this.state + '-loading');
68
- }
69
- else
70
- this.state = 'loading';
71
- await new Promise(r => {
72
- scopedTimeoutRef = setTimeout(r, 700);
73
- this.networkTimeoutRef = scopedTimeoutRef;
74
- });
75
- const vehicleResponse = isVinRequest ? await vehicleInformation.getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
76
- if (this.networkTimeoutRef === scopedTimeoutRef) {
77
- if (!vehicleResponse)
78
- throw new Error('Wrong response format');
79
- this.handleSettingData(vehicleResponse);
80
- }
81
- this.errorMessage = null;
82
- this.state = 'data';
83
- }
84
- catch (error) {
85
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
86
- return;
87
- this.state = 'error';
88
- this.vehicleInformation = null;
89
- this.errorMessage = error.message;
90
- }
91
- }
92
- async fetchData(requestedVin = this.externalVin, headers = {}) {
93
- await this.setData(requestedVin, headers);
94
- }
95
- async loadingListener() {
96
- if (this.loadingStateChange)
97
- this.loadingStateChange(this.state.includes('loading'));
98
- }
99
- async setMockData(newMockData) {
100
- mockData = newMockData;
101
- }
102
- render() {
103
- var _a, _b;
104
- const { imageGroups, parts } = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.paintThickness : { imageGroups: [], parts: [] };
105
- return (index.h(index.Host, { key: 'dd25115d7451c326da5411d30b8cebeac06ea3b4' }, index.h("div", { key: 'ebec5094a98846ffbe00abcbdc5bb5b987262548', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '67d4926b51399a2f990251d95a58558d07c64865' }, index.h(Loading.Loading, { key: 'd56bac7fe821253d2d9aea3a31e19a55002dc1ce', isLoading: this.state.includes('loading') }), index.h("div", { key: '27b2f517a1f974182c5704d9682213662f3dd2d3', class: cn.cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, index.h("div", { key: 'f9bdf1767f4e8d6f24f018a60649f54b75151de2', class: cn.cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin), ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: 'd2b739c8f39501a2335a312b6c9d0a0431104300', class: "py-[16px]" }, index.h("div", { key: '06e78434d8122f36a26faa5fed05a64d759c18c3', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: 'f17f4c019ed1357fb40f6f32c125918ab24069ce', class: "flex mt-[12px] w-full max-h-[70dvh] overflow-hidden mx-auto rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: 'b79eed13d13b7b91aff4aeb4b2280eb349592896', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Paint Thickeness"), index.h("div", { key: 'aab4ba79f226602f913652e27341df333f5be00d', class: "h-0 overflow-auto flex-1" }, !parts.length && index.h("div", { key: 'edf880bf05cc8c31000960c1ee9471d166444541', class: "h-[50px] px-[30px] flex items-center justify-center text-[18px]" }, "No parts are available."), !!parts.length && (index.h("table", { key: 'ddac23c3ba00bb44e58f2b5dfaa11034d4f13594', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: 'c39718f9cd059c765c51b90ba2f2f4e570b9778b', class: "top-0 font-bold sticky bg-white" }, index.h("tr", { key: 'ba28cd9cadfc036162a735d7353a089a581a8559' }, ['Part', 'Left', 'Right'].map(title => (index.h("th", { key: title, class: "px-[15px] min-w-[100px] py-[15px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), index.h("tbody", { key: '6049aecd19316b1d7e1c79606d7cf304b0b260ec' }, parts.map((part, idx) => (index.h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: part.part }, ['part', 'left', 'right'].map(key => (index.h("td", { key: part.part + key, class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
106
- '!border-none': idx === parts.length - 1,
107
- }) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: '73bfbe41ad8f91591c23b0dccd7be84b4505ede8' }, !imageGroups.length && index.h("div", { key: '33c2491e22faf7a5f11b6ec2ee62a1b758123b8e', class: "h-[40px] px-[30px] flex text-red-500 items-center justify-center text-[18px]" }, "No image groups are available."), !!imageGroups.length && (index.h("div", { key: '02103207298b679bdbe8d336c70d2cb8936087a4', class: "py-[16px] gap-[16px] justify-center flex flex-wrap px-[24px] w-full" }, imageGroups.map(imageGroup => (index.h("div", { class: "shrink-0 rounded-lg shadow-sm border overflow-hidden flex flex-col", key: imageGroup.name }, index.h("h1", { class: "text-center border-b bg-slate-200 font-semibold p-[6px]" }, imageGroup.name), index.h("div", { class: "flex p-[12px] gap-[8px]" }, imageGroup.images.map(image => (index.h("div", { class: "flex gap-[8px]", key: image }, index.h("button", { onClick: ({ target }) => this.openImage(target, image), class: "shrink-0 relative ring-0 outline-none w-fit mx-auto [&_img]:hover:shadow-lg [&_div]:hover:!opacity-100 cursor-pointer" }, index.h("div", { class: "absolute flex-col justify-center gap-[4px] size-full flex items-center pointer-events-none hover:opacity-100 rounded-lg opacity-0 bg-black/40 transition-all duration-300" }, index.h("img", { src: imageExpansion.eyeSvg }), index.h("span", { class: "text-white" }, "Expand")), index.h("img", { class: "w-auto h-[150px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: image }))))))))), index.h("div", { key: '7e239537ed9d3b07119fbf15fcb8cb238280c095', onClick: () => this.closeImage(), style: { backdropFilter: this.expandedImage ? 'blur(3px)' : 'blur(0px)' }, class: cn.cn('pointer-events-none w-[100dvw] h-[100dvh] fixed top-0 z-10 left-0 opacity-0 bg-black/40 transition-all duration-400', {
108
- 'pointer-events-auto opacity-100 delay-200': this.expandedImage,
109
- }) }, index.h("button", { key: 'a961871288f09b8776ca9530a6e5ae56133cb3bc', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, index.h("div", { key: '6db275131cf9b431540c2402552449a4ca2d4289', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), index.h("div", { key: '1b0c9149a6d22c436e89baf35fb146c08d13a40a', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), index.h("img", { key: '38939c47ad696305c5cc2b3ccb4c72112eea2cce', alt: "", id: "expanded-image", class: "fixed opacity-0 z-40 transition-all rounded-lg" }))))))))));
110
- }
111
- get el() { return index.getElement(this); }
112
- static get watchers() { return {
113
- "state": ["loadingListener"]
114
- }; }
115
- };
116
- PaintThickness.style = PaintThicknessStyle0;
117
-
118
- exports.paint_thickness = PaintThickness;
@@ -1,103 +0,0 @@
1
- /*!
2
- * Built by ShiftSoftware
3
- * Copyright (c)
4
- */
5
- 'use strict';
6
-
7
- Object.defineProperty(exports, '__esModule', { value: true });
8
-
9
- const index = require('./index-d4b5214c.js');
10
- const Loading = require('./Loading-ee1a2ceb.js');
11
- const cn = require('./cn-f559f9e5.js');
12
- const vehicleInformation = require('./vehicleInformation-35c470fc.js');
13
- require('./loader-baf2418b.js');
14
-
15
- const serviceHistoryCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.\\!border-none{border-style:none!important}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
16
- const ServiceHistoryStyle0 = serviceHistoryCss;
17
-
18
- let mockData = {};
19
- const ServiceHistory = class {
20
- constructor(hostRef) {
21
- index.registerInstance(this, hostRef);
22
- this.baseUrl = '';
23
- this.isDev = false;
24
- this.queryString = '';
25
- this.loadingStateChange = undefined;
26
- this.loadedResponse = undefined;
27
- this.state = 'idle';
28
- this.externalVin = null;
29
- this.errorMessage = null;
30
- this.vehicleInformation = undefined;
31
- }
32
- handleSettingData(response) {
33
- if (response.serviceHistory === null)
34
- response.serviceHistory = [];
35
- this.vehicleInformation = response;
36
- }
37
- async setData(newData, headers = {}) {
38
- clearTimeout(this.networkTimeoutRef);
39
- if (this.abortController)
40
- this.abortController.abort();
41
- this.abortController = new AbortController();
42
- let scopedTimeoutRef;
43
- const isVinRequest = typeof newData === 'string';
44
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
45
- this.externalVin = vin;
46
- try {
47
- if (!vin || vin.trim().length === 0) {
48
- this.state = 'idle';
49
- return;
50
- }
51
- if (this.state === 'data' || this.state === 'error') {
52
- this.state = (this.state + '-loading');
53
- }
54
- else
55
- this.state = 'loading';
56
- await new Promise(r => {
57
- scopedTimeoutRef = setTimeout(r, 700);
58
- this.networkTimeoutRef = scopedTimeoutRef;
59
- });
60
- const vehicleResponse = isVinRequest ? await vehicleInformation.getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
61
- if (this.networkTimeoutRef === scopedTimeoutRef) {
62
- if (!vehicleResponse)
63
- throw new Error('Wrong response format');
64
- this.handleSettingData(vehicleResponse);
65
- }
66
- this.errorMessage = null;
67
- this.state = 'data';
68
- }
69
- catch (error) {
70
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
71
- return;
72
- this.state = 'error';
73
- this.vehicleInformation = null;
74
- this.errorMessage = error.message;
75
- }
76
- }
77
- async fetchData(requestedVin = this.externalVin, headers = {}) {
78
- await this.setData(requestedVin, headers);
79
- }
80
- async loadingListener() {
81
- if (this.loadingStateChange)
82
- this.loadingStateChange(this.state.includes('loading'));
83
- }
84
- async setMockData(newMockData) {
85
- mockData = newMockData;
86
- }
87
- render() {
88
- var _a, _b, _c, _d;
89
- return (index.h(index.Host, { key: '41626d52c1a46c5aa17d924c740ff128c717db72' }, index.h("div", { key: '148b48b3511bbb0edcb06c95f432cec3794bb8be', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '83af30eb9e1bb760b7d0524b5868b98390ae67c0' }, index.h(Loading.Loading, { key: '6f4a0f5c66407fc24ba9ffc624d3d2e37abca2f6', isLoading: this.state.includes('loading') }), index.h("div", { key: 'f16ed2ccb8a9e3bcd8f71eaf05fb3c4a28eb0a16', class: cn.cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, index.h("div", { key: 'ffba94045d0641ffad445c78173ef139e133ae8d', class: cn.cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin), ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: '710d22f3233b428cafab34984cc562e46fa92d8b', class: "py-[16px]" }, index.h("div", { key: 'b036ab0231e60c66a24757b23ec5acceeca359f9', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: '64fd2439a7edc45b552a7e7ea2a6583b9376b57b', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: 'dec74cb4310d310094fa9958b0c3991f476d9bb8', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Service History"), index.h("div", { key: 'bc17bcd99593f7a86c00c6fbed2a9cc3c516eae7', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.serviceHistory.length) && index.h("div", { key: '8d5a0902e8a13909867f0f138bbd629ad97b8b3e', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.serviceHistory.length) && (index.h("table", { key: '9121de3dbcdd6ceb6e88380d15ba3a0885626af3', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: '492edb0969f9774ff1fa78af9fdb4bab3f240e23', class: "top-0 font-bold sticky bg-white" }, index.h("tr", { key: '91bb78d8f37c12c20f331ec55f76d362572bfcee' }, ['Branch', 'Dealer', 'Invoice No.', 'Date', 'Service Type', 'Odometer'].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), index.h("tbody", { key: '6019cc8f4ad18c13b3b082fe87da6a2bfab65773' }, (_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.serviceHistory.map((service, idx) => (index.h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: service.invoiceNumber }, ['branchName', 'companyName', 'invoiceNumber', 'serviceDate', 'serviceType', 'mileage'].map(serviceType => {
90
- var _a;
91
- return (index.h("td", { key: service.invoiceNumber + serviceType, class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
92
- '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
93
- }) }, service[serviceType] || '...'));
94
- })))))))))))))));
95
- }
96
- get el() { return index.getElement(this); }
97
- static get watchers() { return {
98
- "state": ["loadingListener"]
99
- }; }
100
- };
101
- ServiceHistory.style = ServiceHistoryStyle0;
102
-
103
- exports.service_history = ServiceHistory;
@@ -1,122 +0,0 @@
1
- /*!
2
- * Built by ShiftSoftware
3
- * Copyright (c)
4
- */
5
- 'use strict';
6
-
7
- Object.defineProperty(exports, '__esModule', { value: true });
8
-
9
- const index = require('./index-d4b5214c.js');
10
- const vehicleInformation = require('./vehicleInformation-35c470fc.js');
11
- const cn = require('./cn-f559f9e5.js');
12
- const Loading = require('./Loading-ee1a2ceb.js');
13
- const imageExpansion = require('./image-expansion-a9c9c6f7.js');
14
- require('./loader-baf2418b.js');
15
-
16
- const vehicleAccessoriesCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.top-0{top:0}.z-40{z-index:40}.z-50{z-index:50}.float-right{float:right}.mx-auto{margin-left:auto;margin-right:auto}.mr-\\[16px\\]{margin-right:16px}.mt-\\[12px\\]{margin-top:12px}.mt-\\[16px\\]{margin-top:16px}.flex{display:flex}.table{display:table}.size-12{height:3rem;width:3rem}.size-full{height:100%;width:100%}.h-0{height:0}.h-1{height:.25rem}.h-\\[100dvh\\]{height:100dvh}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.h-auto{height:auto}.max-h-\\[133px\\]{max-height:133px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-12{width:3rem}.w-\\[100dvw\\]{width:100dvw}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[133px\\]{max-width:133px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-rotate-45{--tw-rotate:-45deg}.-rotate-45,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-\\[4px\\]{gap:4px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.\\!border-none{border-style:none!important}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-black\\/40{background-color:rgba(0,0,0,.4)}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.delay-200{transition-delay:.2s}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:opacity-100:hover{opacity:1}.\\[\\&_div\\]\\:hover\\:\\!opacity-100:hover div{opacity:1!important}.\\[\\&_img\\]\\:hover\\:shadow-lg:hover img{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.size-\\[40px\\]{height:40px;width:40px}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
17
- const VehicleAccessoriesStyle0 = vehicleAccessoriesCss;
18
-
19
- let mockData = {};
20
- const VehicleAccessories = class {
21
- constructor(hostRef) {
22
- index.registerInstance(this, hostRef);
23
- this.closeImageListener = (event) => {
24
- this.closeImage(event);
25
- };
26
- this.openImage = (target, imageSrc) => {
27
- imageExpansion.openImageViewer(this, target, imageSrc);
28
- };
29
- this.closeImage = (event) => {
30
- imageExpansion.closeImageViewer(this, event);
31
- };
32
- this.baseUrl = '';
33
- this.isDev = false;
34
- this.queryString = '';
35
- this.loadingStateChange = undefined;
36
- this.loadedResponse = undefined;
37
- this.state = 'idle';
38
- this.externalVin = null;
39
- this.errorMessage = null;
40
- this.expandedImage = null;
41
- this.vehicleInformation = undefined;
42
- }
43
- handleSettingData(response) {
44
- if (!response.accessories || !Array.isArray(response.accessories))
45
- response.accessories = [];
46
- this.vehicleInformation = response;
47
- }
48
- async setData(newData, headers = {}) {
49
- clearTimeout(this.networkTimeoutRef);
50
- if (this.abortController)
51
- this.abortController.abort();
52
- this.abortController = new AbortController();
53
- let scopedTimeoutRef;
54
- const isVinRequest = typeof newData === 'string';
55
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
56
- this.externalVin = vin;
57
- try {
58
- if (!vin || vin.trim().length === 0) {
59
- this.state = 'idle';
60
- return;
61
- }
62
- if (this.state === 'data' || this.state === 'error') {
63
- this.state = (this.state + '-loading');
64
- }
65
- else
66
- this.state = 'loading';
67
- await new Promise(r => {
68
- scopedTimeoutRef = setTimeout(r, 700);
69
- this.networkTimeoutRef = scopedTimeoutRef;
70
- });
71
- const vehicleResponse = isVinRequest ? await vehicleInformation.getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
72
- if (this.networkTimeoutRef === scopedTimeoutRef) {
73
- if (!vehicleResponse)
74
- throw new Error('Wrong response format');
75
- this.handleSettingData(vehicleResponse);
76
- }
77
- this.errorMessage = null;
78
- this.state = 'data';
79
- }
80
- catch (error) {
81
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
82
- return;
83
- this.state = 'error';
84
- this.vehicleInformation = null;
85
- this.errorMessage = error.message;
86
- }
87
- }
88
- async fetchData(requestedVin = this.externalVin, headers = {}) {
89
- await this.setData(requestedVin, headers);
90
- }
91
- async loadingListener() {
92
- if (this.loadingStateChange)
93
- this.loadingStateChange(this.state.includes('loading'));
94
- }
95
- async setMockData(newMockData) {
96
- mockData = newMockData;
97
- }
98
- render() {
99
- var _a, _b;
100
- const accessories = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.accessories : [];
101
- return (index.h(index.Host, { key: '7e5394e3dad05815f3a514a342f7afbe11a8d4c1' }, index.h("div", { key: '1d3fea9972e6827680908bc1becb9be17a4305db', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '853e8ff5ad5adf557db5805fc6cc841d7ee224d0' }, index.h(Loading.Loading, { key: '46cdabae84cf49eb88b277bf55b45f233cf28021', isLoading: this.state.includes('loading') }), index.h("div", { key: '948f2861dcf3e7a8b94f84400a75f681f405122a', class: cn.cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, index.h("div", { key: '2b53f6a05b1beab10a9436435969bfc0bc383cae', class: cn.cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin), ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: '90d5c9e6f1efd3cef3994d2d7ccd6d278d424a76', class: "py-[16px]" }, index.h("div", { key: '4cd2e9823137e6a7b861fea69f13a6a0343929b2', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: '9481a97632f581c0b3ebdf0df9086730d10dfdc1', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '649fa9917501f66fa2380e3557c5e86ad26d7f89', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Vehicle Accessories"), index.h("div", { key: '262a67208efe49dbb113c7925cf6b6ae835b3f0c', class: "h-0 overflow-auto flex-1" }, !accessories.length && index.h("div", { key: 'ec443d025b8ca3e50f397ffb1c66e5b280e42f70', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!accessories.length && (index.h("table", { key: '48d6e63959a8732972b89ca514b72d5677eb4447', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: 'b9cdc265accdb543d14bacc09756e2a7ac44e6e8', class: "top-0 font-bold z-40 sticky bg-white" }, index.h("tr", { key: '2951863ff3d03fa9eab980acd348d2ae352cc1b4' }, ['Part Number', 'Description', 'Image'].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), index.h("tbody", { key: '7106dfb61229963e59d800f630a0e351be1d680f' }, accessories.map((accessory, idx) => {
102
- var _a;
103
- return (index.h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: accessory.partNumber }, ['partNumber', 'description'].map(key => {
104
- var _a;
105
- return (index.h("td", { key: accessory.partNumber + key, class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
106
- '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
107
- }) }, accessory[key] || '...'));
108
- }), index.h("td", { class: cn.cn('px-[10px] py-[10px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
109
- '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
110
- }) }, index.h("button", { onClick: ({ target }) => this.openImage(target, accessory.image), class: "shrink-0 relative ring-0 outline-none w-fit mx-auto [&_img]:hover:shadow-lg [&_div]:hover:!opacity-100 cursor-pointer" }, index.h("div", { class: "absolute flex-col justify-center gap-[4px] size-full flex items-center pointer-events-none hover:opacity-100 rounded-lg opacity-0 bg-black/40 transition-all duration-300" }, index.h("img", { src: imageExpansion.eyeSvg }), index.h("span", { class: "text-white" }, "Expand")), index.h("img", { class: "w-auto h-auto max-w-[133px] max-h-[133px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: accessory.image })))));
111
- })), index.h("div", { key: 'a16654412c64f0811caf281bc9a10b4325143f74', onClick: () => this.closeImage(), style: { backdropFilter: this.expandedImage ? 'blur(3px)' : 'blur(0px)' }, class: cn.cn('pointer-events-none w-[100dvw] h-[100dvh] fixed top-0 z-50 left-0 opacity-0 bg-black/40 transition-all duration-400', {
112
- 'pointer-events-auto opacity-100 delay-200': this.expandedImage,
113
- }) }, index.h("button", { key: '2a1f6a6de320d464b549be5c8d0955743eab0c1a', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, index.h("div", { key: '9806406418b9a2588b18a9659a183b494d2dc029', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), index.h("div", { key: 'e52ccc81db9fad6cde21438bae24ac06ed06d886', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), index.h("img", { key: '9db20d318e852a02ad255e5dc463d5ffd3135eb5', alt: "", id: "expanded-image", class: "fixed opacity-0 z-50 transition-all rounded-lg" })))))))))));
114
- }
115
- get el() { return index.getElement(this); }
116
- static get watchers() { return {
117
- "state": ["loadingListener"]
118
- }; }
119
- };
120
- VehicleAccessories.style = VehicleAccessoriesStyle0;
121
-
122
- exports.vehicle_accessories = VehicleAccessories;
@@ -1,98 +0,0 @@
1
- /*!
2
- * Built by ShiftSoftware
3
- * Copyright (c)
4
- */
5
- 'use strict';
6
-
7
- Object.defineProperty(exports, '__esModule', { value: true });
8
-
9
- const index = require('./index-d4b5214c.js');
10
- const Loading = require('./Loading-ee1a2ceb.js');
11
- const cn = require('./cn-f559f9e5.js');
12
- const vehicleInformation = require('./vehicleInformation-35c470fc.js');
13
- require('./loader-baf2418b.js');
14
-
15
- const vehicleSpecificationCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-4{padding-bottom:1rem;padding-top:1rem}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}.duration-100{transition-duration:.1s}";
16
- const VehicleSpecificationStyle0 = vehicleSpecificationCss;
17
-
18
- let mockData = {};
19
- const VehicleSpecification = class {
20
- constructor(hostRef) {
21
- index.registerInstance(this, hostRef);
22
- this.baseUrl = '';
23
- this.isDev = false;
24
- this.queryString = '';
25
- this.loadingStateChange = undefined;
26
- this.loadedResponse = undefined;
27
- this.state = 'idle';
28
- this.externalVin = null;
29
- this.errorMessage = null;
30
- this.vehicleInformation = undefined;
31
- }
32
- async setData(newData, headers = {}) {
33
- clearTimeout(this.networkTimeoutRef);
34
- if (this.abortController)
35
- this.abortController.abort();
36
- this.abortController = new AbortController();
37
- let scopedTimeoutRef;
38
- const isVinRequest = typeof newData === 'string';
39
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
40
- this.externalVin = vin;
41
- try {
42
- if (!vin || vin.trim().length === 0) {
43
- this.state = 'idle';
44
- return;
45
- }
46
- if (this.state === 'data' || this.state === 'error') {
47
- this.state = (this.state + '-loading');
48
- }
49
- else
50
- this.state = 'loading';
51
- await new Promise(r => {
52
- scopedTimeoutRef = setTimeout(r, 700);
53
- this.networkTimeoutRef = scopedTimeoutRef;
54
- });
55
- const vehicleResponse = isVinRequest ? await vehicleInformation.getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
56
- if (this.networkTimeoutRef === scopedTimeoutRef) {
57
- if (!vehicleResponse)
58
- throw new Error('Wrong response format');
59
- this.vehicleInformation = vehicleResponse;
60
- }
61
- this.errorMessage = null;
62
- this.state = 'data';
63
- }
64
- catch (error) {
65
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
66
- return;
67
- this.state = 'error';
68
- this.vehicleInformation = null;
69
- this.errorMessage = error.message;
70
- }
71
- }
72
- async fetchData(requestedVin = this.externalVin, headers = {}) {
73
- await this.setData(requestedVin, headers);
74
- }
75
- async loadingListener() {
76
- if (this.loadingStateChange)
77
- this.loadingStateChange(this.state.includes('loading'));
78
- }
79
- async setMockData(newMockData) {
80
- mockData = newMockData;
81
- }
82
- render() {
83
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
84
- return (index.h(index.Host, { key: 'b9a0f984a08acc14315b7b7b30742ad9f5bdb49e' }, index.h("div", { key: 'af83954e986a078b9e33bfd4fc8797fb79fb028b', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '448f30f13b9c20fb30ff369e55bf564bd0d8fe20' }, index.h(Loading.Loading, { key: '53523ee006eef27b765fd1b6375f39bf7f1e02c6', isLoading: this.state.includes('loading') }), index.h("div", { key: '78dd7934c80487fb68c67747512c5c96809280ac', class: cn.cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, index.h("div", { key: 'da5b237a42b1ff4b0c20fe40ad5c46224c265986', class: cn.cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin), ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: 'dc9cae0fec62f66c747de76185d2e1688162224e', class: "py-4" }, index.h("div", { key: '8f3b7129711bff7688170ac8228417b0bf3b4c5c', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: '9215e325e2b80534142c4833b717b569949721ec', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '87630966a701dc6989221ac7a133ca7e0856fcf1', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Vehicle Specifications"), index.h("div", { key: '06489c6c3ad553a5502cdf72cc43724d2b5c74bc', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vehicleSpecification) && index.h("div", { key: 'e6e2d53c4233cacc6571b1b9d2eaa6553bae7831', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.vehicleSpecification) && (index.h("table", { key: '30bf7dfaf6c8c5d9829e8a30d9644326c5a2c6d2', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: 'b64236329f77e1e236ad286bbe5068e55f5e40c9', class: "top-0 font-bold sticky bg-white" }, index.h("tr", { key: 'b79c310db87dc4b40a56a0efbe82ffd54da09a21' }, ['Model', 'Variant', 'Katashiki', 'Model Year', 'SFX'].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), index.h("tbody", { key: 'b8afb49709c1362e95dd4446978b54c2fc570fcb' }, index.h("tr", { key: 'b566724d705cd430f7fba1e1addab9a1189ebb5d' }, index.h("td", { key: '0577fa2f9221fdd8df0a557b92e77f3bad0885ac', class: "px-[10px] py-[20px] text-center whitespace-nowrap" }, ((_e = (_d = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.vehicleVariantInfo) === null || _e === void 0 ? void 0 : _e.modelCode) || '...', " ", index.h("br", { key: 'f751d6784c076ce25442d7a916bc468ecd007777', class: "my-2" }), ((_g = (_f = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _f === void 0 ? void 0 : _f.vehicleSpecification) === null || _g === void 0 ? void 0 : _g.modelDesc) || '...'), index.h("td", { key: '01e40cad1d8dc4cdfc933dcfade4b8e605219d3e', class: "px-[10px] py-[20px] text-center whitespace-nowrap" }, ((_j = (_h = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _h === void 0 ? void 0 : _h.identifiers) === null || _j === void 0 ? void 0 : _j.variant) || '...', " ", index.h("br", { key: 'f34677ab8bf2311f6ac2fd7426805cfe50ccafd7' }), ((_l = (_k = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _k === void 0 ? void 0 : _k.vehicleSpecification) === null || _l === void 0 ? void 0 : _l.variantDesc) || '...'), ['identifiers.katashiki', 'vehicleVariantInfo.modelYear', 'vehicleVariantInfo.sfx'].map(infoPath => {
85
- var _a;
86
- const [place, field] = infoPath.split('.');
87
- const cellValue = (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a[place][field].toString();
88
- return (index.h("td", { key: infoPath, class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, cellValue.trim() ? cellValue : '...'));
89
- })))))))))))));
90
- }
91
- get el() { return index.getElement(this); }
92
- static get watchers() { return {
93
- "state": ["loadingListener"]
94
- }; }
95
- };
96
- VehicleSpecification.style = VehicleSpecificationStyle0;
97
-
98
- exports.vehicle_specification = VehicleSpecification;
@@ -1,52 +0,0 @@
1
- /*!
2
- * Built by ShiftSoftware
3
- * Copyright (c)
4
- */
5
- 'use strict';
6
-
7
- const vehicleRequestHeaders = {
8
- cityId: 'City-Id',
9
- userId: 'User-Id',
10
- companyId: 'Company-Id',
11
- customerName: 'Customer-Name',
12
- customerPhone: 'Customer-Phone',
13
- customerEmail: 'Customer-Email',
14
- companyBranchId: 'Company-Branch-Id',
15
- cityIntegrationId: 'City-Integration-Id',
16
- brandIntegrationId: 'Brand-Integration-Id',
17
- companyIntegrationId: 'Company-Integration-Id',
18
- companyBranchIntegrationId: 'Company-Branch-Integration-Id'
19
- };
20
- const getVehicleInformation = async (component, generalProps, headers = {}) => {
21
- const { notAvailableMessage, mockData, vin, scopedTimeoutRef, middlewareCallback } = generalProps;
22
- const { isDev, baseUrl, queryString, abortController, networkTimeoutRef, loadedResponse } = component;
23
- const handleResult = (newVehicleInformation) => {
24
- if (networkTimeoutRef === scopedTimeoutRef) {
25
- if (!newVehicleInformation && vin)
26
- throw new Error(notAvailableMessage || 'Wrong response format');
27
- if (loadedResponse)
28
- loadedResponse(newVehicleInformation);
29
- if (middlewareCallback)
30
- middlewareCallback(newVehicleInformation);
31
- return newVehicleInformation;
32
- }
33
- };
34
- if (isDev) {
35
- const newData = mockData[vin];
36
- return handleResult(newData);
37
- }
38
- else {
39
- if (!baseUrl)
40
- throw new Error('Please provide base-url');
41
- const componentHeaders = Object.assign({}, headers);
42
- Object.entries(vehicleRequestHeaders).forEach(([componentHeaderKey, headerField]) => {
43
- if (component[componentHeaderKey])
44
- componentHeaders[headerField] = component[componentHeaderKey];
45
- });
46
- const response = await fetch(`${baseUrl}${vin}?${queryString}`, { signal: abortController.signal, headers: componentHeaders });
47
- const newData = (await response.json());
48
- return handleResult(newData);
49
- }
50
- };
51
-
52
- exports.getVehicleInformation = getVehicleInformation;