adp-web-components 0.0.11 → 0.0.12
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.
- package/dist/cjs/dead-stock-lookup.cjs.entry.js +6 -6
- package/dist/cjs/distributor-lookup.cjs.entry.js +6 -6
- package/dist/cjs/dynamic-claim.cjs.entry.js +7 -7
- package/dist/cjs/manufacturer-lookup.cjs.entry.js +6 -6
- package/dist/cjs/paint-thickness.cjs.entry.js +8 -8
- package/dist/cjs/{partInformation-2a6a018b.js → partInformation-07651204.js} +2 -2
- package/dist/cjs/service-history.cjs.entry.js +6 -6
- package/dist/cjs/vehicle-accessories.cjs.entry.js +8 -8
- package/dist/cjs/vehicle-specification.cjs.entry.js +6 -6
- package/dist/cjs/{vehicleInformation-4c1dcaf2.js → vehicleInformation-35c470fc.js} +5 -5
- package/dist/cjs/warranty-details.cjs.entry.js +6 -6
- package/dist/collection/components/dynamic-claim/dynamic-claim.js +16 -8
- package/dist/collection/components/paint-thickness/paint-thickness.js +17 -9
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +16 -8
- package/dist/collection/components/part-lookup/distributor-lookup.js +16 -8
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +16 -8
- package/dist/collection/components/service-history/service-history.js +15 -7
- package/dist/collection/components/vehicle-accessories/vehicle-accessories.js +17 -9
- package/dist/collection/components/vehicle-specification/vehicle-specification.js +15 -7
- package/dist/collection/components/warranty-details/warranty-details.js +15 -7
- package/dist/collection/global/api/partInformation.js +2 -2
- package/dist/collection/global/api/vehicleInformation.js +5 -5
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/dynamic-claim.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/p-4f08bcb8.js +5 -0
- package/dist/components/p-c4fad245.js +5 -0
- package/dist/components/paint-thickness.js +1 -1
- package/dist/components/service-history.js +1 -1
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/warranty-details.js +1 -1
- package/dist/esm/dead-stock-lookup.entry.js +6 -6
- package/dist/esm/distributor-lookup.entry.js +6 -6
- package/dist/esm/dynamic-claim.entry.js +7 -7
- package/dist/esm/manufacturer-lookup.entry.js +6 -6
- package/dist/esm/paint-thickness.entry.js +8 -8
- package/dist/esm/{partInformation-73ece994.js → partInformation-096a8f55.js} +2 -2
- package/dist/esm/service-history.entry.js +6 -6
- package/dist/esm/vehicle-accessories.entry.js +8 -8
- package/dist/esm/vehicle-specification.entry.js +6 -6
- package/dist/esm/{vehicleInformation-f1081f83.js → vehicleInformation-f7290628.js} +5 -5
- package/dist/esm/warranty-details.entry.js +6 -6
- package/dist/shift-components/p-2e3e8e97.entry.js +5 -0
- package/dist/shift-components/p-3bfafc40.entry.js +5 -0
- package/dist/shift-components/p-4f08bcb8.js +5 -0
- package/dist/shift-components/p-75ea0e53.entry.js +5 -0
- package/dist/shift-components/p-91eff216.entry.js +5 -0
- package/dist/shift-components/p-c274f4ba.entry.js +5 -0
- package/dist/shift-components/p-c4fad245.js +5 -0
- package/dist/shift-components/p-ca1e2e5b.entry.js +5 -0
- package/dist/shift-components/p-ec9302fb.entry.js +5 -0
- package/dist/shift-components/p-f21722ce.entry.js +5 -0
- package/dist/shift-components/p-f95c7501.entry.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/dynamic-claim/dynamic-claim.d.ts +2 -2
- package/dist/types/components/paint-thickness/paint-thickness.d.ts +2 -2
- package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +2 -2
- package/dist/types/components/part-lookup/distributor-lookup.d.ts +2 -2
- package/dist/types/components/part-lookup/manufacturer-lookup.d.ts +2 -2
- package/dist/types/components/service-history/service-history.d.ts +2 -2
- package/dist/types/components/vehicle-accessories/vehicle-accessories.d.ts +2 -2
- package/dist/types/components/vehicle-specification/vehicle-specification.d.ts +2 -2
- package/dist/types/components/warranty-details/warranty-details.d.ts +2 -2
- package/dist/types/components.d.ts +18 -18
- package/dist/types/global/api/partInformation.d.ts +1 -1
- package/dist/types/global/api/vehicleInformation.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/p-5df9bc5f.js +0 -5
- package/dist/components/p-d265c109.js +0 -5
- package/dist/shift-components/p-15f86441.entry.js +0 -5
- package/dist/shift-components/p-1ae3a61f.entry.js +0 -5
- package/dist/shift-components/p-5df9bc5f.js +0 -5
- package/dist/shift-components/p-8c261972.entry.js +0 -5
- package/dist/shift-components/p-9bd4471c.entry.js +0 -5
- package/dist/shift-components/p-9f790b14.entry.js +0 -5
- package/dist/shift-components/p-c113792c.entry.js +0 -5
- package/dist/shift-components/p-d265c109.js +0 -5
- package/dist/shift-components/p-dc9845ed.entry.js +0 -5
- package/dist/shift-components/p-e32b0798.entry.js +0 -5
- package/dist/shift-components/p-f759c597.entry.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built by ShiftSoftware
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
|
-
import{p as t,H as e,h as i,c as a}from"./p-4dc47f5f.js";import{h as o,l as n}from"./p-8375923d.js";import{c as s}from"./p-98d9e7ab.js";import{g as r}from"./p-5df9bc5f.js";function d({isLoading:t}){return o("div",{class:s("loading-spinner absolute",{hide:!t})},o("img",{class:"spin",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIKICAgIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1sb2FkZXIiPgogICAgPHBhdGggZD0iTTEyIDJ2NCIgLz4KICAgIDxwYXRoIGQ9Im0xNi4yIDcuOCAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTE4IDEyaDQiIC8+CiAgICA8cGF0aCBkPSJtMTYuMiAxNi4yIDIuOSAyLjkiIC8+CiAgICA8cGF0aCBkPSJNMTIgMTh2NCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgMTkuMSAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTIgMTJoNCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgNC45IDIuOSAyLjkiIC8+Cjwvc3ZnPg=="}))}const c="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiMwYjM1MjEiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0zNjkgMjA5TDI0MSAzMzdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwbC02NC02NGMtOS40LTkuNC05LjQtMjQuNiAwLTMzLjlzMjQuNi05LjQgMzMuOSAwbDQ3IDQ3TDMzNSAxNzVjOS40LTkuNCAyNC42LTkuNCAzMy45IDBzOS40IDI0LjYgMCAzMy45eiIgLz4KPC9zdmc+",l="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiM1ODE1MWMiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0xNzUgMTc1YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwbDQ3IDQ3IDQ3LTQ3YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwczkuNCAyNC42IDAgMzMuOWwtNDcgNDcgNDcgNDdjOS40IDkuNCA5LjQgMjQuNiAwIDMzLjlzLTI0LjYgOS40LTMzLjkgMGwtNDctNDctNDcgNDdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwcy05LjQtMjQuNiAwLTMzLjlsNDctNDctNDctNDdjLTkuNC05LjQtOS40LTI0LjYgMC0zMy45eiIgLz4KPC9zdmc+";function h({desc:t,className:e,from:i,to:a,state:n="idle",icon:r=!0}){return o("div",{class:s("card",e,n+"-card")},r&&"reject"===n&&o("img",{src:l}),r&&"warning"===n&&o("img",{src:l}),r&&"success"===n&&o("img",{src:c}),i&&o("p",{class:"no-padding"},o("span",{class:"font-semibold pr-1"},"From:")," ",t),a&&o("p",{class:"no-padding"},o("span",{class:"font-semibold pr-1"},"To:")," ",t),!i&&!a&&o("p",{class:"idle"===n?"no-padding":""},t))}function p({warranty:t,isAuthorized:e,unInvoicedByBrokerName:i}){return o("div",{class:"warranty-tags mx-auto pt-3"},o(h,{state:e?"success":"reject",desc:e?"Authorized":"Unauthorized"}),o(h,{state:t.hasActiveWarranty?"success":"reject",desc:t.hasActiveWarranty?"Has Active Warranty":"Doesn't Have Active Warranty"}),i&&o(h,{className:"span-entire-2nd-row",state:"warning",icon:!0,desc:"Warranty is not Active because this Vehicle is not Invoiced by the following Trusted Business Partner: "+i}),t.warrantyStartDate&&o(h,{state:(null==t?void 0:t.hasActiveWarranty)?"success":"reject",icon:!1,from:!0,desc:t.warrantyStartDate}),t.warrantyEndDate&&o(h,{state:(null==t?void 0:t.hasActiveWarranty)?"success":"reject",icon:!1,to:!0,desc:t.warrantyEndDate}))}function g({ssc:t}){return o("div",{class:"wrapper-table"},o("div",{class:"header"},"SSC Campings"),o("div",{class:"ssc-table-container"},o("table",{class:"ssc-table"},o("thead",null,o("tr",null,o("th",null,"Code"),o("th",null,"Description"),o("th",null,"Repair Status"),o("th",null,"OP-Codes"),o("th",null,"Part Number"))),o("tbody",null,t.map((t=>o("tr",{class:"transition",key:t.sscCode},o("td",null,t.sscCode),o("td",null,t.description),o("td",null,o("div",{class:"table-cell-container"},o("img",{class:"table-status-icon",src:t.repaired?c:l})," ",null==t?void 0:t.repairDate)),o("td",null,t.opCode),o("td",null,o("div",{class:"table-cell-container table-cell-parts-container"},t.parts.length?t.parts.map((t=>o("div",{key:t.partNumber,class:t.isAvailable?"success":"reject"},t.partNumber))):"...")))))))))}let u={};const b=t(class extends e{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.baseUrl="",this.unauthorizedSscLookupBaseUrl="",this.isDev=!1,this.showSsc=!1,this.queryString="",this.unauthorizedSscLookupQueryString="",this.recaptchaKey="",this.showWarranty=!1,this.cityId=null,this.cityIntegrationId=null,this.companyId=null,this.companyIntegrationId=null,this.companyBranchId=null,this.companyBranchIntegrationId=null,this.userId=null,this.brandIntegrationId=null,this.customerName=null,this.customerPhone=null,this.customerEmail=null,this.loadingStateChange=void 0,this.loadedResponse=void 0,this.state="idle",this.externalVin=null,this.errorMessage=null,this.showRecaptcha=!1,this.unInvoicedByBrokerName=null,this.vehicleInformation=void 0,this.checkingUnauthorizedSSC=!1,this.recaptchaRes=null}handleSettingData(t){var e,i,a;null===t.warranty&&(t.warranty={warrantyEndDate:"",warrantyStartDate:"",hasActiveWarranty:!1,hasExtendedWarranty:!1,extendedWarrantyEndDate:"",extendedWarrantyStartDate:""}),null===t.ssc&&(t.ssc=[]),this.unInvoicedByBrokerName=null,null!==(null===(e=null==t?void 0:t.saleInformation)||void 0===e?void 0:e.broker)&&null===(null===(a=null===(i=null==t?void 0:t.saleInformation)||void 0===i?void 0:i.broker)||void 0===a?void 0:a.invoiceDate)&&(this.unInvoicedByBrokerName=t.saleInformation.broker.brokerName),this.vehicleInformation=t}async handleInitializingRecaptcha(t,e){var i;!1===(null===(i=this.vehicleInformation)||void 0===i?void 0:i.isAuthorized)&&this.showSsc&&""!==this.recaptchaKey?(grecaptcha.reset(),await new Promise((t=>setTimeout(t,400))),this.recaptchaIntervalRef=setInterval((async()=>{var i;const a=grecaptcha.getResponse();if(a)if(clearInterval(this.recaptchaIntervalRef),this.isDev){this.checkingUnauthorizedSSC=!0,this.showRecaptcha=!1,await new Promise((t=>setTimeout(t,3e3))),this.checkingUnauthorizedSSC=!1;const t=!(Math.random()<.5);this.recaptchaRes={hasSSC:t,message:t?"This Vehicle has a Pending SSC":"No Pending SSC"}}else{this.checkingUnauthorizedSSC=!0,this.showRecaptcha=!1;const o=await fetch(`${this.unauthorizedSscLookupBaseUrl}${t}/${null===(i=this.vehicleInformation)||void 0===i?void 0:i.sscLogId}?${this.unauthorizedSscLookupQueryString}`,{signal:this.abortController.signal,headers:{"Ssc-Recaptcha-Token":a}}),n=await o.json();if(!n||this.networkTimeoutRef!==e)throw Error("Wrong response format");{this.checkingUnauthorizedSSC=!1;const t=1===n.sscLookupStatus;this.recaptchaRes={hasSSC:t,message:t?"This Vehicle has a Pending SSC":"No Pending SSC"}}}}),500),this.showRecaptcha=!0):this.showRecaptcha=!1}async setData(t){let e;this.recaptchaRes=null,clearTimeout(this.networkTimeoutRef),clearInterval(this.recaptchaIntervalRef),this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const i="string"==typeof t,a=i?t:null==t?void 0:t.vin;this.externalVin=a;try{if(!a||0===a.trim().length)return void(this.state="idle");this.state="data"===this.state||"error"===this.state?this.state+"-loading":"loading",await new Promise((t=>{e=setTimeout(t,600),this.networkTimeoutRef=e}));const o=i?await r(this,{scopedTimeoutRef:e,vin:a,mockData:u}):t;if(this.networkTimeoutRef===e){if(!o)throw Error("Wrong response format");this.handleSettingData(o),this.handleInitializingRecaptcha(a,e)}this.errorMessage=null,this.state="data"}catch(t){if(t&&"AbortError"===(null==t?void 0:t.name))return;this.state="error",this.vehicleInformation=null,this.errorMessage=t.message}}async fetchData(t=this.externalVin){await this.setData(t)}async componentDidLoad(){if(""!==this.recaptchaKey){const t=document.createElement("script");t.src="https://www.google.com/recaptcha/api.js",t.async=!0,t.defer=!0,t.onload=()=>console.log("reCAPTCHA script loaded"),document.head.appendChild(t)}}async setMockData(t){u=t}onShowSscChange(){}onShowWarrantyChange(){}async loadingListener(){this.loadingStateChange&&this.loadingStateChange(this.state.includes("loading"))}render(){var t,e,o,r,c;return i(a,{key:"9f7b4391eb2ac41ecb6b620adb733d06cad61e01"},i("div",{key:"a120fa5f7b7ec6b586ae1553ddd5f1270b4bafdf",class:"min-h-[100px] warranty"},i("div",{key:"a3e41d8aad2f04cd6f0fc7cc0ce952ec80eb67e9"},i(d,{key:"548ba51ad8f41ebba0d4591f22294c4a0ceeddca",isLoading:this.state.includes("loading")}),i("div",{key:"fa06505b9ad363d070e98c384ca08be6fab23e3a",class:"transition duration-700",style:{transform:this.state.includes("loading")||"idle"===this.state?"scale(0)":"scale(1)",opacity:this.state.includes("loading")?"0":"1"}},(this.showSsc||this.showWarranty)&&i("div",{key:"dd5cae430e26d6b99de558414bc54ae61037b6ee",style:{color:this.errorMessage?"red":"black"},class:"warranty-vin"},null===(t=this.vehicleInformation)||void 0===t?void 0:t.vin),["error","error-loading"].includes(this.state)&&i("div",{key:"2aa3678b9daedb664cb83908bab1a3ae79d26ca4",class:"py-4"},i(h,{key:"9fb71c4271b607184140207e737f9db6955446a1",desc:this.errorMessage,className:"mx-auto reject-card max-w-500"})," "),this.showWarranty&&["data","data-loading"].includes(this.state)&&i(p,{key:"d14715477bfd2a7a07ed203794cdd90bf3dc7f77",isAuthorized:null===(e=this.vehicleInformation)||void 0===e?void 0:e.isAuthorized,unInvoicedByBrokerName:this.unInvoicedByBrokerName,warranty:null===(o=this.vehicleInformation)||void 0===o?void 0:o.warranty}),i("div",{key:"7d24f6ed652cfd6e23ff88471a8c134810909522",style:Object.assign({},this.showRecaptcha?{height:"auto",padding:"16px 16px 0px 16px"}:{height:"0px"}),class:"recaptcha-container"},i("slot",{key:"09944b5683a9c564bba4a7bf7b02bf45578b1a01"})),["data","data-loading"].includes(this.state)&&this.recaptchaRes&&i("div",{key:"3503fc5ab15f118a4614f0aa4a0cbc98dffd341b",class:s("recaptcha-response",this.recaptchaRes.hasSSC?"reject-card ":"success-card")},this.recaptchaRes.message),this.checkingUnauthorizedSSC&&i("div",{key:"2d307b6517e8734a86b366d24550870d141559f5",class:"loading-spinner",style:{marginTop:"20px",flexDirection:"column"}},i("div",{key:"3ce58c58e769399b08909d24b49dfb16020beaa4"},i("strong",{key:"7a09f45c291d5561410116ffb6cfb4de417c51ce"},"Checking TMC")),i("img",{key:"6ff6d07a3834f1f02d1a54d2d45cfff712d8ec53",class:"spin",src:n})),this.showSsc&&["data","data-loading"].includes(this.state)&&null!==(null===(r=this.vehicleInformation)||void 0===r?void 0:r.ssc)&&!!(null===(c=this.vehicleInformation)||void 0===c?void 0:c.ssc.length)&&i(g,{key:"f67095d616937712e31ed0421811f1cf3c7982ed",ssc:this.vehicleInformation.ssc})))))}get el(){return this}static get watchers(){return{showSsc:["onShowSscChange"],showWarranty:["onShowWarrantyChange"],state:["loadingListener"]}}static get style(){return'*,: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}.collapse{visibility:collapse}.absolute{left:0;position:absolute;top:0}.relative{position:relative}.sticky{position:sticky}.mx-auto{margin-left:auto;margin-right:auto}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-0{height:0;height:0!important}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.transform{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-wrap{flex-wrap:wrap}.border{border-width:1px}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-1{padding-right:4px}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.font-semibold{font-weight:600}.transition{transition:all;transition-duration:.3s;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-1000{transition-duration:1s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.success-card{background:#d0e7de;background-color:#d0e7de;border-color:#a2d0bb!important;border-color:#a2d0bb;color:#0b3521}.reject-card{background:#f7d7d8;background-color:#f7d7d8;border-color:#f2aeb5!important;border-color:#f2aeb5;color:#58151c}:host{all:initial!important;display:block}*{font-family:Arial}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fade-in{animation:fadeIn .3s ease-in forwards;opacity:0}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-out{animation:fadeIn .3s ease-in forwards;opacity:1}.spin{animation:spin 2s linear infinite}.loading-spinner{align-items:center;display:flex;height:100%;justify-content:center;pointer-events:none;transition:all;transition-duration:.1s;width:100%}.loading-spinner img{height:40px;width:40px}.warranty{overflow:hidden;position:relative;transition:all;transition-duration:.3s}.hide{opacity:0}.card{border:1px solid;border-radius:6px;flex-shrink:0;gap:8px;padding:8px 12px}.card,.card p{align-items:center;display:flex}.card p{flex:1 1 0%;font-size:16px;height:25px;margin:0;padding-left:50px}.card p.no-padding{padding-left:4px}.card img{height:25px;width:25px}.recaptcha-response{border:1px solid;border-radius:8px;font-size:20px;margin:16px auto 0;padding:8px 16px;width:-moz-fit-content;width:fit-content}.warning-card{background:#fcf8e3;border-color:#faebcc!important;color:#8a6d3b}.span-entire-2nd-row{grid-column:1/3;grid-row:2/3}.warranty-tags{display:grid;gap:12px;grid-template-columns:1fr 1fr;max-width:1000px}.pt-3,.py-3{padding-top:12px}.pb-3,.py-3{padding-bottom:12px}.pt-4,.py-4{padding-top:16px}.pb-4,.py-4{padding-bottom:16px}.max-w-500{max-width:500px}.mt-4,.my-4{margin-bottom:16px;margin-top:16px}.warranty *{box-sizing:border-box}.wrapper-table{border:1px solid #d6d8dc;border-radius:4px;display:flex;flex-direction:column;margin-top:12px;max-height:70vh;overflow:hidden}.ssc-table-container{flex:1 1 0%;height:0;overflow:auto}.wrapper-table .header{align-items:center;background:#e1e3e5;color:#383c43;display:flex;flex-shrink:0;font-size:18px;height:40px;justify-content:center;width:100%}.ssc-table{border-collapse:collapse;overflow:auto;position:relative;width:100%}.ssc-table thead{background-color:#fff;font-weight:700;position:sticky;top:0}.ssc-table td,.ssc-table th{border-bottom:1px solid #d6d8dc;padding:10px 20px;text-align:center;transition:all;transition-duration:.3s;white-space:nowrap}.ssc-table tr:hover{background:#f4f4f4}.ssc-table tr:last-child td{border:none}.table-cell-container{align-items:center;display:flex;gap:8px;justify-content:center;width:100%}.table-cell-parts-container{flex-wrap:wrap}.table-cell-parts-container div{border-radius:4px;font-size:14px;padding:4px 8px}.table-cell-parts-container div.success{background:#d0e7de}.table-cell-parts-container div.reject{background:#f7d7d8}.table-status-icon{height:20px;width:20px}.warranty-vin{font-size:20px;padding-top:4px;text-align:center}.recaptcha-container{display:flex;justify-content:center;overflow:hidden}.static{position:static}.min-h-\\[100px\\]{min-height:100px}.py-4{padding-bottom:1rem;padding-top:1rem}.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)}'}},[1,"warranty-details",{baseUrl:[1,"base-url"],unauthorizedSscLookupBaseUrl:[1,"unauthorized-ssc-lookup-base-url"],isDev:[4,"is-dev"],showSsc:[4,"show-ssc"],queryString:[1,"query-string"],unauthorizedSscLookupQueryString:[1,"unauthorized-ssc-lookup-query-string"],recaptchaKey:[1,"recaptcha-key"],showWarranty:[4,"show-warranty"],cityId:[1,"city-id"],cityIntegrationId:[1,"city-integration-id"],companyId:[1,"company-id"],companyIntegrationId:[1,"company-integration-id"],companyBranchId:[1,"company-branch-id"],companyBranchIntegrationId:[1,"company-branch-integration-id"],userId:[1,"user-id"],brandIntegrationId:[1,"brand-integration-id"],customerName:[1,"customer-name"],customerPhone:[1,"customer-phone"],customerEmail:[1,"customer-email"],loadingStateChange:[16],loadedResponse:[16],state:[32],externalVin:[32],errorMessage:[32],showRecaptcha:[32],unInvoicedByBrokerName:[32],vehicleInformation:[32],checkingUnauthorizedSSC:[32],recaptchaRes:[32],setData:[64],fetchData:[64],setMockData:[64]},void 0,{showSsc:["onShowSscChange"],showWarranty:["onShowWarrantyChange"],state:["loadingListener"]}]);function f(){"undefined"!=typeof customElements&&["warranty-details"].forEach((t=>{"warranty-details"===t&&(customElements.get(t)||customElements.define(t,b))}))}f();const w=b,m=f;export{w as WarrantyDetails,m as defineCustomElement}
|
|
5
|
+
import{p as t,H as e,h as i,c as a}from"./p-4dc47f5f.js";import{h as o,l as n}from"./p-8375923d.js";import{c as s}from"./p-98d9e7ab.js";import{g as r}from"./p-c4fad245.js";function d({isLoading:t}){return o("div",{class:s("loading-spinner absolute",{hide:!t})},o("img",{class:"spin",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIKICAgIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1sb2FkZXIiPgogICAgPHBhdGggZD0iTTEyIDJ2NCIgLz4KICAgIDxwYXRoIGQ9Im0xNi4yIDcuOCAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTE4IDEyaDQiIC8+CiAgICA8cGF0aCBkPSJtMTYuMiAxNi4yIDIuOSAyLjkiIC8+CiAgICA8cGF0aCBkPSJNMTIgMTh2NCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgMTkuMSAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTIgMTJoNCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgNC45IDIuOSAyLjkiIC8+Cjwvc3ZnPg=="}))}const c="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiMwYjM1MjEiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0zNjkgMjA5TDI0MSAzMzdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwbC02NC02NGMtOS40LTkuNC05LjQtMjQuNiAwLTMzLjlzMjQuNi05LjQgMzMuOSAwbDQ3IDQ3TDMzNSAxNzVjOS40LTkuNCAyNC42LTkuNCAzMy45IDBzOS40IDI0LjYgMCAzMy45eiIgLz4KPC9zdmc+",l="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiM1ODE1MWMiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0xNzUgMTc1YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwbDQ3IDQ3IDQ3LTQ3YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwczkuNCAyNC42IDAgMzMuOWwtNDcgNDcgNDcgNDdjOS40IDkuNCA5LjQgMjQuNiAwIDMzLjlzLTI0LjYgOS40LTMzLjkgMGwtNDctNDctNDcgNDdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwcy05LjQtMjQuNiAwLTMzLjlsNDctNDctNDctNDdjLTkuNC05LjQtOS40LTI0LjYgMC0zMy45eiIgLz4KPC9zdmc+";function h({desc:t,className:e,from:i,to:a,state:n="idle",icon:r=!0}){return o("div",{class:s("card",e,n+"-card")},r&&"reject"===n&&o("img",{src:l}),r&&"warning"===n&&o("img",{src:l}),r&&"success"===n&&o("img",{src:c}),i&&o("p",{class:"no-padding"},o("span",{class:"font-semibold pr-1"},"From:")," ",t),a&&o("p",{class:"no-padding"},o("span",{class:"font-semibold pr-1"},"To:")," ",t),!i&&!a&&o("p",{class:"idle"===n?"no-padding":""},t))}function p({warranty:t,isAuthorized:e,unInvoicedByBrokerName:i}){return o("div",{class:"warranty-tags mx-auto pt-3"},o(h,{state:e?"success":"reject",desc:e?"Authorized":"Unauthorized"}),o(h,{state:t.hasActiveWarranty?"success":"reject",desc:t.hasActiveWarranty?"Has Active Warranty":"Doesn't Have Active Warranty"}),i&&o(h,{className:"span-entire-2nd-row",state:"warning",icon:!0,desc:"Warranty is not Active because this Vehicle is not Invoiced by the following Trusted Business Partner: "+i}),t.warrantyStartDate&&o(h,{state:(null==t?void 0:t.hasActiveWarranty)?"success":"reject",icon:!1,from:!0,desc:t.warrantyStartDate}),t.warrantyEndDate&&o(h,{state:(null==t?void 0:t.hasActiveWarranty)?"success":"reject",icon:!1,to:!0,desc:t.warrantyEndDate}))}function g({ssc:t}){return o("div",{class:"wrapper-table"},o("div",{class:"header"},"SSC Campings"),o("div",{class:"ssc-table-container"},o("table",{class:"ssc-table"},o("thead",null,o("tr",null,o("th",null,"Code"),o("th",null,"Description"),o("th",null,"Repair Status"),o("th",null,"OP-Codes"),o("th",null,"Part Number"))),o("tbody",null,t.map((t=>o("tr",{class:"transition",key:t.sscCode},o("td",null,t.sscCode),o("td",null,t.description),o("td",null,o("div",{class:"table-cell-container"},o("img",{class:"table-status-icon",src:t.repaired?c:l})," ",null==t?void 0:t.repairDate)),o("td",null,t.opCode),o("td",null,o("div",{class:"table-cell-container table-cell-parts-container"},t.parts.length?t.parts.map((t=>o("div",{key:t.partNumber,class:t.isAvailable?"success":"reject"},t.partNumber))):"...")))))))))}let u={};const b=t(class extends e{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.baseUrl="",this.unauthorizedSscLookupBaseUrl="",this.isDev=!1,this.showSsc=!1,this.queryString="",this.unauthorizedSscLookupQueryString="",this.recaptchaKey="",this.showWarranty=!1,this.cityId=null,this.cityIntegrationId=null,this.companyId=null,this.companyIntegrationId=null,this.companyBranchId=null,this.companyBranchIntegrationId=null,this.userId=null,this.brandIntegrationId=null,this.customerName=null,this.customerPhone=null,this.customerEmail=null,this.loadingStateChange=void 0,this.loadedResponse=void 0,this.state="idle",this.externalVin=null,this.errorMessage=null,this.showRecaptcha=!1,this.unInvoicedByBrokerName=null,this.vehicleInformation=void 0,this.checkingUnauthorizedSSC=!1,this.recaptchaRes=null}handleSettingData(t){var e,i,a;null===t.warranty&&(t.warranty={warrantyEndDate:"",warrantyStartDate:"",hasActiveWarranty:!1,hasExtendedWarranty:!1,extendedWarrantyEndDate:"",extendedWarrantyStartDate:""}),null===t.ssc&&(t.ssc=[]),this.unInvoicedByBrokerName=null,null!==(null===(e=null==t?void 0:t.saleInformation)||void 0===e?void 0:e.broker)&&null===(null===(a=null===(i=null==t?void 0:t.saleInformation)||void 0===i?void 0:i.broker)||void 0===a?void 0:a.invoiceDate)&&(this.unInvoicedByBrokerName=t.saleInformation.broker.brokerName),this.vehicleInformation=t}async handleInitializingRecaptcha(t,e){var i;!1===(null===(i=this.vehicleInformation)||void 0===i?void 0:i.isAuthorized)&&this.showSsc&&""!==this.recaptchaKey?(grecaptcha.reset(),await new Promise((t=>setTimeout(t,400))),this.recaptchaIntervalRef=setInterval((async()=>{var i;const a=grecaptcha.getResponse();if(a)if(clearInterval(this.recaptchaIntervalRef),this.isDev){this.checkingUnauthorizedSSC=!0,this.showRecaptcha=!1,await new Promise((t=>setTimeout(t,3e3))),this.checkingUnauthorizedSSC=!1;const t=!(Math.random()<.5);this.recaptchaRes={hasSSC:t,message:t?"This Vehicle has a Pending SSC":"No Pending SSC"}}else{this.checkingUnauthorizedSSC=!0,this.showRecaptcha=!1;const o=await fetch(`${this.unauthorizedSscLookupBaseUrl}${t}/${null===(i=this.vehicleInformation)||void 0===i?void 0:i.sscLogId}?${this.unauthorizedSscLookupQueryString}`,{signal:this.abortController.signal,headers:{"Ssc-Recaptcha-Token":a}}),n=await o.json();if(!n||this.networkTimeoutRef!==e)throw Error("Wrong response format");{this.checkingUnauthorizedSSC=!1;const t=1===n.sscLookupStatus;this.recaptchaRes={hasSSC:t,message:t?"This Vehicle has a Pending SSC":"No Pending SSC"}}}}),500),this.showRecaptcha=!0):this.showRecaptcha=!1}async setData(t,e={}){let i;this.recaptchaRes=null,clearTimeout(this.networkTimeoutRef),clearInterval(this.recaptchaIntervalRef),this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const a="string"==typeof t,o=a?t:null==t?void 0:t.vin;this.externalVin=o;try{if(!o||0===o.trim().length)return void(this.state="idle");this.state="data"===this.state||"error"===this.state?this.state+"-loading":"loading",await new Promise((t=>{i=setTimeout(t,600),this.networkTimeoutRef=i}));const n=a?await r(this,{scopedTimeoutRef:i,vin:o,mockData:u},e):t;if(this.networkTimeoutRef===i){if(!n)throw Error("Wrong response format");this.handleSettingData(n),this.handleInitializingRecaptcha(o,i)}this.errorMessage=null,this.state="data"}catch(t){if(t&&"AbortError"===(null==t?void 0:t.name))return;this.state="error",this.vehicleInformation=null,this.errorMessage=t.message}}async fetchData(t=this.externalVin,e={}){await this.setData(t,e)}async componentDidLoad(){if(""!==this.recaptchaKey){const t=document.createElement("script");t.src="https://www.google.com/recaptcha/api.js",t.async=!0,t.defer=!0,t.onload=()=>console.log("reCAPTCHA script loaded"),document.head.appendChild(t)}}async setMockData(t){u=t}onShowSscChange(){}onShowWarrantyChange(){}async loadingListener(){this.loadingStateChange&&this.loadingStateChange(this.state.includes("loading"))}render(){var t,e,o,r,c;return i(a,{key:"788b8a8ffbca4b31a40ab95655fabcb41f0d83df"},i("div",{key:"ed92ce80c844eb884cd872f58894136c47fb7c4c",class:"min-h-[100px] warranty"},i("div",{key:"016013ecfba73d87df136580fffe5e2e07aaf958"},i(d,{key:"3b8de918e7a315e843b8bc42942fc14b57216c94",isLoading:this.state.includes("loading")}),i("div",{key:"4c5f2ad067fcfd199ae1c69765509e6bbb1944f4",class:"transition duration-700",style:{transform:this.state.includes("loading")||"idle"===this.state?"scale(0)":"scale(1)",opacity:this.state.includes("loading")?"0":"1"}},(this.showSsc||this.showWarranty)&&i("div",{key:"5174d6380ed09d1e003cbd58d544b9838eaf8b16",style:{color:this.errorMessage?"red":"black"},class:"warranty-vin"},null===(t=this.vehicleInformation)||void 0===t?void 0:t.vin),["error","error-loading"].includes(this.state)&&i("div",{key:"9ca23b51fa38b8ae7900c0283d84a27f485e9e87",class:"py-4"},i(h,{key:"304a1c83cb397b42d297abbbda51c925246105ec",desc:this.errorMessage,className:"mx-auto reject-card max-w-500"})," "),this.showWarranty&&["data","data-loading"].includes(this.state)&&i(p,{key:"542c2cdfb222054604ef7b9ab3614c69339027ed",isAuthorized:null===(e=this.vehicleInformation)||void 0===e?void 0:e.isAuthorized,unInvoicedByBrokerName:this.unInvoicedByBrokerName,warranty:null===(o=this.vehicleInformation)||void 0===o?void 0:o.warranty}),i("div",{key:"56c5529bbf8b264b5bc1568b4b9aa3cf687e6915",style:Object.assign({},this.showRecaptcha?{height:"auto",padding:"16px 16px 0px 16px"}:{height:"0px"}),class:"recaptcha-container"},i("slot",{key:"0211fb8f130efc788e73524c4cd6f79702458aaf"})),["data","data-loading"].includes(this.state)&&this.recaptchaRes&&i("div",{key:"cc1e03101e506ffb831e0ad6adacaf86b8c542fe",class:s("recaptcha-response",this.recaptchaRes.hasSSC?"reject-card ":"success-card")},this.recaptchaRes.message),this.checkingUnauthorizedSSC&&i("div",{key:"557261d532b671e5813c0259e623647a802851a0",class:"loading-spinner",style:{marginTop:"20px",flexDirection:"column"}},i("div",{key:"1e8a78a692a8b9171cdd201d34aca99a253d0781"},i("strong",{key:"967e34d989ebacb6f4b469fa11c73ae165426fa4"},"Checking TMC")),i("img",{key:"112de8a206bb8877b6cd71ba437755bfc56720be",class:"spin",src:n})),this.showSsc&&["data","data-loading"].includes(this.state)&&null!==(null===(r=this.vehicleInformation)||void 0===r?void 0:r.ssc)&&!!(null===(c=this.vehicleInformation)||void 0===c?void 0:c.ssc.length)&&i(g,{key:"903b7a27b9093657aa7a2f11a8677ea825fb1d90",ssc:this.vehicleInformation.ssc})))))}get el(){return this}static get watchers(){return{showSsc:["onShowSscChange"],showWarranty:["onShowWarrantyChange"],state:["loadingListener"]}}static get style(){return'*,: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}.collapse{visibility:collapse}.absolute{left:0;position:absolute;top:0}.relative{position:relative}.sticky{position:sticky}.mx-auto{margin-left:auto;margin-right:auto}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-0{height:0;height:0!important}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.transform{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-wrap{flex-wrap:wrap}.border{border-width:1px}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-1{padding-right:4px}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.font-semibold{font-weight:600}.transition{transition:all;transition-duration:.3s;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-1000{transition-duration:1s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.success-card{background:#d0e7de;background-color:#d0e7de;border-color:#a2d0bb!important;border-color:#a2d0bb;color:#0b3521}.reject-card{background:#f7d7d8;background-color:#f7d7d8;border-color:#f2aeb5!important;border-color:#f2aeb5;color:#58151c}:host{all:initial!important;display:block}*{font-family:Arial}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fade-in{animation:fadeIn .3s ease-in forwards;opacity:0}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-out{animation:fadeIn .3s ease-in forwards;opacity:1}.spin{animation:spin 2s linear infinite}.loading-spinner{align-items:center;display:flex;height:100%;justify-content:center;pointer-events:none;transition:all;transition-duration:.1s;width:100%}.loading-spinner img{height:40px;width:40px}.warranty{overflow:hidden;position:relative;transition:all;transition-duration:.3s}.hide{opacity:0}.card{border:1px solid;border-radius:6px;flex-shrink:0;gap:8px;padding:8px 12px}.card,.card p{align-items:center;display:flex}.card p{flex:1 1 0%;font-size:16px;height:25px;margin:0;padding-left:50px}.card p.no-padding{padding-left:4px}.card img{height:25px;width:25px}.recaptcha-response{border:1px solid;border-radius:8px;font-size:20px;margin:16px auto 0;padding:8px 16px;width:-moz-fit-content;width:fit-content}.warning-card{background:#fcf8e3;border-color:#faebcc!important;color:#8a6d3b}.span-entire-2nd-row{grid-column:1/3;grid-row:2/3}.warranty-tags{display:grid;gap:12px;grid-template-columns:1fr 1fr;max-width:1000px}.pt-3,.py-3{padding-top:12px}.pb-3,.py-3{padding-bottom:12px}.pt-4,.py-4{padding-top:16px}.pb-4,.py-4{padding-bottom:16px}.max-w-500{max-width:500px}.mt-4,.my-4{margin-bottom:16px;margin-top:16px}.warranty *{box-sizing:border-box}.wrapper-table{border:1px solid #d6d8dc;border-radius:4px;display:flex;flex-direction:column;margin-top:12px;max-height:70vh;overflow:hidden}.ssc-table-container{flex:1 1 0%;height:0;overflow:auto}.wrapper-table .header{align-items:center;background:#e1e3e5;color:#383c43;display:flex;flex-shrink:0;font-size:18px;height:40px;justify-content:center;width:100%}.ssc-table{border-collapse:collapse;overflow:auto;position:relative;width:100%}.ssc-table thead{background-color:#fff;font-weight:700;position:sticky;top:0}.ssc-table td,.ssc-table th{border-bottom:1px solid #d6d8dc;padding:10px 20px;text-align:center;transition:all;transition-duration:.3s;white-space:nowrap}.ssc-table tr:hover{background:#f4f4f4}.ssc-table tr:last-child td{border:none}.table-cell-container{align-items:center;display:flex;gap:8px;justify-content:center;width:100%}.table-cell-parts-container{flex-wrap:wrap}.table-cell-parts-container div{border-radius:4px;font-size:14px;padding:4px 8px}.table-cell-parts-container div.success{background:#d0e7de}.table-cell-parts-container div.reject{background:#f7d7d8}.table-status-icon{height:20px;width:20px}.warranty-vin{font-size:20px;padding-top:4px;text-align:center}.recaptcha-container{display:flex;justify-content:center;overflow:hidden}.static{position:static}.min-h-\\[100px\\]{min-height:100px}.py-4{padding-bottom:1rem;padding-top:1rem}.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)}'}},[1,"warranty-details",{baseUrl:[1,"base-url"],unauthorizedSscLookupBaseUrl:[1,"unauthorized-ssc-lookup-base-url"],isDev:[4,"is-dev"],showSsc:[4,"show-ssc"],queryString:[1,"query-string"],unauthorizedSscLookupQueryString:[1,"unauthorized-ssc-lookup-query-string"],recaptchaKey:[1,"recaptcha-key"],showWarranty:[4,"show-warranty"],cityId:[1,"city-id"],cityIntegrationId:[1,"city-integration-id"],companyId:[1,"company-id"],companyIntegrationId:[1,"company-integration-id"],companyBranchId:[1,"company-branch-id"],companyBranchIntegrationId:[1,"company-branch-integration-id"],userId:[1,"user-id"],brandIntegrationId:[1,"brand-integration-id"],customerName:[1,"customer-name"],customerPhone:[1,"customer-phone"],customerEmail:[1,"customer-email"],loadingStateChange:[16],loadedResponse:[16],state:[32],externalVin:[32],errorMessage:[32],showRecaptcha:[32],unInvoicedByBrokerName:[32],vehicleInformation:[32],checkingUnauthorizedSSC:[32],recaptchaRes:[32],setData:[64],fetchData:[64],setMockData:[64]},void 0,{showSsc:["onShowSscChange"],showWarranty:["onShowWarrantyChange"],state:["loadingListener"]}]);function f(){"undefined"!=typeof customElements&&["warranty-details"].forEach((t=>{"warranty-details"===t&&(customElements.get(t)||customElements.define(t,b))}))}f();const w=b,m=f;export{w as WarrantyDetails,m as defineCustomElement}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
|
|
6
|
-
import { g as getPartInformation } from './partInformation-
|
|
6
|
+
import { g as getPartInformation } from './partInformation-096a8f55.js';
|
|
7
7
|
import { L as Loading } from './Loading-61648252.js';
|
|
8
8
|
import { c as cn } from './cn-cc419b94.js';
|
|
9
9
|
import './loader-027b88af.js';
|
|
@@ -32,7 +32,7 @@ const DeadStockLookup = class {
|
|
|
32
32
|
toggleAccordion(index) {
|
|
33
33
|
this.activeIndex = this.activeIndex === index ? null : index;
|
|
34
34
|
}
|
|
35
|
-
async setData(newData) {
|
|
35
|
+
async setData(newData, headers = {}) {
|
|
36
36
|
clearTimeout(this.networkTimeoutRef);
|
|
37
37
|
if (this.abortController)
|
|
38
38
|
this.abortController.abort();
|
|
@@ -56,7 +56,7 @@ const DeadStockLookup = class {
|
|
|
56
56
|
scopedTimeoutRef = setTimeout(r, 700);
|
|
57
57
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
58
58
|
});
|
|
59
|
-
const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }) : newData;
|
|
59
|
+
const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }, headers) : newData;
|
|
60
60
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
61
61
|
if (!partResponse)
|
|
62
62
|
throw new Error('Wrong response format');
|
|
@@ -73,8 +73,8 @@ const DeadStockLookup = class {
|
|
|
73
73
|
this.errorMessage = error.message;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
async fetchData(
|
|
77
|
-
await this.setData(
|
|
76
|
+
async fetchData(partNumber = this.externalPartNumber, headers = {}) {
|
|
77
|
+
await this.setData(partNumber, headers);
|
|
78
78
|
}
|
|
79
79
|
async loadingListener() {
|
|
80
80
|
//this.calculateHeight(newState);
|
|
@@ -86,7 +86,7 @@ const DeadStockLookup = class {
|
|
|
86
86
|
}
|
|
87
87
|
render() {
|
|
88
88
|
var _a, _b;
|
|
89
|
-
return (h(Host, { key: '
|
|
89
|
+
return (h(Host, { key: '3a3c612f26d4a50303a00056983a967b2215ed27' }, h("div", { key: 'fbbef3d5226e849ad7fc864c62b581f4c9dff507', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'b5059f256646d672ddd0d1c09a4de3c8b5e66dc0' }, h(Loading, { key: '311ba459650a88d1c87f45963b81748885055cf6', isLoading: this.state.includes('loading') }), h("div", { key: '5a9de2b501e5d6e33da6b9581be2a5c34327a2e5', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (h("div", { key: 'c49cac2c5a97860ce92ef7ca3ca8bd71866d9168', class: "py-[16px]" }, h("div", { key: '3f00000ec1798ee3afc0a9c135e56470220a8b40', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '9d31d42ac64f1fae58e8e6e802f62fe3bb29bf5c' }, h("div", { key: 'bac3865cb1e2570e2b20193ff0ffb474fad0a57c', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '0d4537c5db76475425e6862837ce49f60c0cbc76', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Deadstock"), (_b = (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.deadStock) === null || _b === void 0 ? void 0 :
|
|
90
90
|
_b.map((deadStock, i) => (h("div", { style: { padding: '10px 20px' } }, h("div", { class: "accordion-item border-b border-slate-200", style: { boxShadow: 'rgb(225 225 225) 0px 0px 4px 1px', borderRadius: '5px', padding: '0 10px', marginBottom: '10px' }, key: deadStock.companyIntegrationID }, h("button", { class: "accordion-header w-full flex justify-between items-center py-5 text-slate-800", onClick: () => this.toggleAccordion(i) }, h("strong", null, deadStock.companyName), h("span", { class: `icon text-slate-800 transition-transform duration-300 ${this.activeIndex === i ? 'rotate-180' : ''}` }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "w-4 h-4" }, h("path", { "fill-rule": "evenodd", d: "M11.78 9.78a.75.75 0 0 1-1.06 0L8 7.06 5.28 9.78a.75.75 0 0 1-1.06-1.06l3.25-3.25a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1 0 1.06Z", "clip-rule": "evenodd" })))), h("div", { class: `accordion-content overflow-hidden transition-all duration-300 ease-in-out ${this.activeIndex === i ? 'max-h-screen' : 'max-h-0'}` }, h("table", { class: "w-full overflow-auto relative border-collapse" }, h("thead", null, h("tr", null, h("th", { class: "px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Branch"), h("th", { class: "px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Available Qty"))), h("tbody", null, deadStock === null || deadStock === void 0 ? void 0 : deadStock.branchDeadStock.map(branchDeadStock => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: branchDeadStock.companyBranchIntegrationID }, h("td", { class: cn('px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]') }, branchDeadStock.companyBranchName), h("td", { class: cn('px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]') }, h("strong", null, branchDeadStock.quantity))))))))))))))))))));
|
|
91
91
|
}
|
|
92
92
|
get el() { return getElement(this); }
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
|
|
6
6
|
import { L as Loading } from './Loading-61648252.js';
|
|
7
7
|
import { c as cn } from './cn-cc419b94.js';
|
|
8
|
-
import { g as getPartInformation } from './partInformation-
|
|
8
|
+
import { g as getPartInformation } from './partInformation-096a8f55.js';
|
|
9
9
|
import './loader-027b88af.js';
|
|
10
10
|
|
|
11
11
|
const distributorLookupCss = "*,: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}.success{color:green}.warning{color:orange}.reject{color:red}.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-\\[40px\\]{height:40px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.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-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.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))}.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)}.filter{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)}.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}";
|
|
@@ -28,7 +28,7 @@ const DistributorLookup = class {
|
|
|
28
28
|
handleSettingData(response) {
|
|
29
29
|
this.partInformation = response;
|
|
30
30
|
}
|
|
31
|
-
async setData(newData) {
|
|
31
|
+
async setData(newData, headers = {}) {
|
|
32
32
|
clearTimeout(this.networkTimeoutRef);
|
|
33
33
|
if (this.abortController)
|
|
34
34
|
this.abortController.abort();
|
|
@@ -52,7 +52,7 @@ const DistributorLookup = class {
|
|
|
52
52
|
scopedTimeoutRef = setTimeout(r, 700);
|
|
53
53
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
54
54
|
});
|
|
55
|
-
const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }) : newData;
|
|
55
|
+
const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }, headers) : newData;
|
|
56
56
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
57
57
|
if (!partResponse)
|
|
58
58
|
throw new Error('Wrong response format');
|
|
@@ -69,8 +69,8 @@ const DistributorLookup = class {
|
|
|
69
69
|
this.errorMessage = error.message;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
async fetchData(
|
|
73
|
-
await this.setData(
|
|
72
|
+
async fetchData(partNumber = this.externalPartNumber, headers = {}) {
|
|
73
|
+
await this.setData(partNumber, headers);
|
|
74
74
|
}
|
|
75
75
|
//calculateHeight(componentState: string) {
|
|
76
76
|
// if (componentState.includes('loading') && this.componentHeight === '0px') {
|
|
@@ -93,7 +93,7 @@ const DistributorLookup = class {
|
|
|
93
93
|
}
|
|
94
94
|
render() {
|
|
95
95
|
var _a;
|
|
96
|
-
return (h(Host, { key: '
|
|
96
|
+
return (h(Host, { key: 'a9685f218c3388c8871a1fe5ad3e5f7a6db16525' }, h("div", { key: '06d3ebe5cea1877eca04e2bd531ced6886efce21', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '25ce4d8a810565277b13fa9897c624df7db7c306' }, h(Loading, { key: '69ab848c559a4f84cb5f92249704d4f6e608ef7c', isLoading: this.state.includes('loading') }), h("div", { key: 'f7407c9bc18b4a9e9fed9df8ff7c933ffa72bb74', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (h("div", { key: 'f0b4b92ded5f1f3dedea006efa39f80a2d8b21a2', class: "py-[16px]" }, h("div", { key: '40a070ad198be5ef292518891494ee24c3bd1f30', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '1b1ef313fb728a736fbff5dadb4a0ea8b00538c0' }, h("div", { key: '62edebf935eadf1024dfae210c94b9101e6a1469', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'ead7db5ff9a5c3044873869f9dd5e929e1ae3e64', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Info"), h("div", { key: '5d09e0bb243d5d3e2b1c79c1207fd6f8eb3206e9', style: { padding: '10px 30px', display: 'flex', flexDirection: 'column', gap: '15px' } }, h("div", { key: '1ebfebcbed472f1ede92dec490bf26091b5cdb7e', style: { display: 'flex', gap: '50px' } }, h("div", { key: 'fe41112534c499faab4fb24a0e074774eb269a84', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: '9a6b0ced60f697bee9a588037e2f13422c6abb0b', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Description"), h("div", { key: '8838fc064ac4194fb0ee8ca8bb4de52bd17acfb0', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].partDescription)), h("div", { key: 'd3c6827596e5eefe390ce1b41296cf66ca28feeb', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: 'df1cdfdaf6d79f400be5391745e1d062a0ec89f5', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Product Group"), h("div", { key: 'e6986b7e77dd09185b7675f8501534d60ebec64a', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].group)), h("div", { key: '2e948e425f174e11b4ef52c732940641d01b20c2', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: 'c6e4380800858509bb2f428f49e0b9fe4617cad5', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Price"), h("div", { key: '43eeceb7be881b1f88eb3d1d8de8ba41aa2d5930', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].price))), h("div", { key: 'aab231f411233286eba1fefcf77da5ab40de2dfe', style: { display: 'flex', gap: '50px' } }, h("div", { key: 'ad59c8bacdac79cdf1cd8520756d059b91b336c5', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: 'd8409b080baf442816dd2d24f00f3a85f3502366', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Superseded To"), h("div", { key: '76e0c5431c52f90677c3c513c5d72160bdf03e19', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].supersededTo)), h("div", { key: 'e7651b63dccd4e7e9a122ce9ea6810c1b415692e', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: 'a9c43a444c872205837dd54fb9ec863714b4c3d6', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Superseded From"), h("div", { key: 'e089ddeeea660e693a8fee0b4a718a1ae91fe064', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].supersededFrom)), h("div", { key: 'd409f7c7b329fdae0edc077d633cce92f58d141c', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } })))), this.partInformation.stockParts.filter(y => { return y.quantityLookUpResult === 'LookupIsSkipped' || y.quantityLookUpResult === 'QuantityNotWithinLookupThreshold'; }).length === 0 && (h("div", { key: 'd4b0fc1bdb5224c14def453ebbbedbdb7e645bb4', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '886e7a946cb4c73f672220d18dc69232bceafaa3', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Distributor Stock"), h("div", { key: '8792f50034f94d60e541e88008a08c3b5d57270f', style: { padding: '10px 30px', display: 'flex', flexDirection: 'column', gap: '15px' } }, h("table", { key: '837e3552fe2e3281b7571242db01eb583ed436fa', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '35ed95194fc2182428710ccc48e19e58fbfba3f7', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '302dfdd19840cf9aa22529f780d2873aa1e398ab' }, ['Location', 'Availability'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: 'c8b09ff4b1d2696d9c86fb828caeac54996f1bba' }, (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.stockParts.map((stock) => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: stock.locationID }, h("td", { class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]') }, stock.locationName), h("td", { class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]') }, h("div", { class: stock.quantityLookUpResult === 'Available' ? 'success' : stock.quantityLookUpResult === 'PartiallyAvailable' ? 'warning' : 'reject' }, h("strong", null, stock.quantityLookUpResult === 'Available' ? 'Available' : stock.quantityLookUpResult === 'PartiallyAvailable' ? 'Partially Available' : 'Not Available'))))))))))))))))));
|
|
97
97
|
}
|
|
98
98
|
get el() { return getElement(this); }
|
|
99
99
|
static get watchers() { return {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
|
|
6
6
|
import { c as cn } from './cn-cc419b94.js';
|
|
7
|
-
import { g as getVehicleInformation } from './vehicleInformation-
|
|
7
|
+
import { g as getVehicleInformation } from './vehicleInformation-f7290628.js';
|
|
8
8
|
|
|
9
9
|
const expiredSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9ImJsYWNrIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiAxNkw4IDgiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiA4TDggMTYiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgPC9nPgo8L3N2Zz4=';
|
|
10
10
|
|
|
@@ -66,7 +66,7 @@ const DynamicClaim = class {
|
|
|
66
66
|
async setMockData(newMockData) {
|
|
67
67
|
mockData = newMockData;
|
|
68
68
|
}
|
|
69
|
-
async setData(newData) {
|
|
69
|
+
async setData(newData, headers = {}) {
|
|
70
70
|
clearTimeout(this.networkTimeoutRef);
|
|
71
71
|
if (this.abortController)
|
|
72
72
|
this.abortController.abort();
|
|
@@ -86,7 +86,7 @@ const DynamicClaim = class {
|
|
|
86
86
|
scopedTimeoutRef = setTimeout(r, 1000);
|
|
87
87
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
88
88
|
});
|
|
89
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
|
|
89
|
+
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
90
90
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
91
91
|
if (!vehicleResponse)
|
|
92
92
|
throw new Error('Wrong response format');
|
|
@@ -105,8 +105,8 @@ const DynamicClaim = class {
|
|
|
105
105
|
this.errorMessage = error.message;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
async fetchData(requestedVin = this.externalVin) {
|
|
109
|
-
await this.setData(requestedVin);
|
|
108
|
+
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
109
|
+
await this.setData(requestedVin, headers);
|
|
110
110
|
}
|
|
111
111
|
onLoadingChange(newValue) {
|
|
112
112
|
if (this.loadingStateChange)
|
|
@@ -279,7 +279,7 @@ const DynamicClaim = class {
|
|
|
279
279
|
render() {
|
|
280
280
|
var _a, _b;
|
|
281
281
|
const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
|
|
282
|
-
return (h(Host, { key: '
|
|
282
|
+
return (h(Host, { key: '15b709f7252b85f308c880576dd4f8ff6a7dc666' }, h("dynamic-redeem", { key: '71a57f4626d0f394c2293db5bfccaf477c5c3f1e', id: "dynamic-redeem" }), h("div", { key: '3e247cedd1e720c89a30af72f8c9758f7a5642fb', class: cn('dynamic-claim-wrapper', { loading: this.isLoading, idle: this.isIdle }) }, h("div", { key: 'd6aea716001e09c9ff3180889afc5daca008b130', class: "dynamic-claim-header" }, h("strong", { key: 'f9469ece92c4e189eed94a119d233787d78aa8b1', onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-header-vin load-animation" }, this.errorMessage && h("span", { key: 'b132706208c827613e967186ba98a1314d9aaf08', style: { color: 'red' } }, this.errorMessage), !this.errorMessage && ((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin))), h("div", { key: '849960f27d5188e3ab088c5de8d0bebc25723829', class: "dynamic-claim-body" }, h("div", { key: 'bdbd37aa75a00973008634299d1768dcbe95843f', class: "loading-lane" }, h("div", { key: '6a17f141b034edbcd38b86979431c3ff26614d00', class: "dynamic-claim-loading-slider" }, h("div", { key: '34597a589f5dab07e60959ba09d39876901f2ee1', class: "dynamic-claim-loading-slider-line" }), h("div", { key: '4a2483d4997fff60631cd01302d272665e2d2736', class: "dynamic-claim-loading-slider-subline dynamic-claim-inc" }), h("div", { key: 'c05466961bfcfd2580f670c57178492f31729f52', class: "dynamic-claim-loading-slider-subline dynamic-claim-dec" }))), h("div", { key: 'ac968ede27ec14df080f8c17758e071cfa272d2d', class: "dynamic-claim-progress-lane" }, serviceItems.map((item, idx) => {
|
|
283
283
|
let statusClass = '';
|
|
284
284
|
if (item.status === 'pending') {
|
|
285
285
|
if (serviceItems.findIndex(i => i.status === 'pending') === idx)
|
|
@@ -288,7 +288,7 @@ const DynamicClaim = class {
|
|
|
288
288
|
else
|
|
289
289
|
statusClass = item.status;
|
|
290
290
|
return (h("div", { key: item.name, class: cn('dynamic-claim-item', statusClass), onMouseLeave: this.onMouseLeave }, h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-header load-animation", onMouseEnter: event => this.onMouseEnter(event.target, idx) }, h("img", { src: icons[item.status], alt: "status icon" }), h("span", null, item.status.charAt(0).toUpperCase() + item.status.slice(1)), this.activePopupIndex === idx && this.createPopup(item)), h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-circle load-animation" }), h("p", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-footer load-animation" }, item.name)));
|
|
291
|
-
}), h("div", { key: '
|
|
291
|
+
}), h("div", { key: '720ee8e73001f6c4304f9e0af8212e37fc69e74a', class: "dynamic-claim-progress-bar" }))))));
|
|
292
292
|
}
|
|
293
293
|
get el() { return getElement(this); }
|
|
294
294
|
static get watchers() { return {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
|
|
6
6
|
import { L as Loading } from './Loading-61648252.js';
|
|
7
7
|
import { c as cn } from './cn-cc419b94.js';
|
|
8
|
-
import { g as getPartInformation } from './partInformation-
|
|
8
|
+
import { g as getPartInformation } from './partInformation-096a8f55.js';
|
|
9
9
|
import './loader-027b88af.js';
|
|
10
10
|
|
|
11
11
|
const manufacturerLookupCss = "*,: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}.success{color:green}.warning{color:orange}.reject{color:red}.static{position:static}.relative{position:relative}.mx-auto{margin-left:auto;margin-right:auto}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.h-\\[40px\\]{height:40px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.shrink-0{flex-shrink:0}.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-hidden{overflow:hidden}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-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))}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/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}";
|
|
@@ -29,7 +29,7 @@ const ManufacturerLookup = class {
|
|
|
29
29
|
handleSettingData(response) {
|
|
30
30
|
this.partInformation = response;
|
|
31
31
|
}
|
|
32
|
-
async setData(newData) {
|
|
32
|
+
async setData(newData, headers = {}) {
|
|
33
33
|
clearTimeout(this.networkTimeoutRef);
|
|
34
34
|
if (this.abortController)
|
|
35
35
|
this.abortController.abort();
|
|
@@ -53,7 +53,7 @@ const ManufacturerLookup = class {
|
|
|
53
53
|
scopedTimeoutRef = setTimeout(r, 700);
|
|
54
54
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
55
55
|
});
|
|
56
|
-
const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }) : newData;
|
|
56
|
+
const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }, headers) : newData;
|
|
57
57
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
58
58
|
if (!partResponse)
|
|
59
59
|
throw new Error('Wrong response format');
|
|
@@ -70,8 +70,8 @@ const ManufacturerLookup = class {
|
|
|
70
70
|
this.errorMessage = error.message;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
async fetchData(
|
|
74
|
-
await this.setData(
|
|
73
|
+
async fetchData(partNumber = this.externalPartNumber, headers = {}) {
|
|
74
|
+
await this.setData(partNumber, headers);
|
|
75
75
|
}
|
|
76
76
|
//calculateHeight(componentState: string) {
|
|
77
77
|
// if (componentState.includes('loading') && this.componentHeight === '0px') {
|
|
@@ -93,7 +93,7 @@ const ManufacturerLookup = class {
|
|
|
93
93
|
mockData = newMockData;
|
|
94
94
|
}
|
|
95
95
|
render() {
|
|
96
|
-
return (h(Host, { key: '
|
|
96
|
+
return (h(Host, { key: 'cfd90dcfbe3be613c1badcf79c09923f79a2eea6' }, h("div", { key: '1c6930673bcf7b50e9937ddc8f42e54c2b473ca2', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'ed2db39446481defe0ac1f162a4c5346dee315fa' }, h(Loading, { key: '5972c7d753a7555bba05c82deea9f887629ab720', isLoading: this.state.includes('loading') }), h("div", { key: 'd5de561df856b0fb26e6ca0145160c96a9790847', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (h("div", { key: '9422a2aa8e63cb09d68eaf57ad4c9981ec2a1085', class: "py-[16px]" }, h("div", { key: '59a4815a98f4a01518f2b4750a6c4c627f9bf0ae', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '3f980055e6a3ae355360997d7a014eaf7afca5d4' }, h("div", { key: 'e0e30bffb51cd26076420f2719dc0a498404efcd', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'ddeb24dd0779a8861c229b0f722debe000cc034c', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, this.headerTitle), h("div", { key: 'c1de3e307ed2d6cf2eb33cc477b4e17c6651c0ab', style: { padding: '10px 30px', display: 'flex', flexDirection: 'column', gap: '15px' } }, h("div", { key: 'a3e83b3ac55b1759819e8065b5eaede1a7001b44', style: { display: 'flex', gap: '50px' } }, h("div", { key: 'a4b1da95397584c6081673df484e7851647aa4fa', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: 'c61412662fd8c418825d1e7cdbcabb08c2c207ec', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Description"), h("div", { key: 'dcd926214097661e86c8dad9a323f7d68ef30b0b', style: { padding: '10px 0px' } }, this.partInformation.tmcPart.partDescription)), h("div", { key: '0f5bdf2566698de09e1eeaacad4c7dcff4146022', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: 'fb4e8ef5bd79548dc31e79792d32b55b090513f1', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Product Group"), h("div", { key: 'b2e31ce6014013cda2abb9c2f4ef823c493da4c2', style: { padding: '10px 0px' } }, this.partInformation.tmcPart.group)), h("div", { key: '75215d7f9a18f7fea6528d11e118fc1dbb50e3b8', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } })))))))))));
|
|
97
97
|
}
|
|
98
98
|
get el() { return getElement(this); }
|
|
99
99
|
static get watchers() { return {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
|
|
6
6
|
import { L as Loading } from './Loading-61648252.js';
|
|
7
|
-
import { g as getVehicleInformation } from './vehicleInformation-
|
|
7
|
+
import { g as getVehicleInformation } from './vehicleInformation-f7290628.js';
|
|
8
8
|
import { o as openImageViewer, c as closeImageViewer, e as eyeSvg } from './image-expansion-08c4bf0d.js';
|
|
9
9
|
import { c as cn } from './cn-cc419b94.js';
|
|
10
10
|
import './loader-027b88af.js';
|
|
@@ -45,7 +45,7 @@ const PaintThickness = class {
|
|
|
45
45
|
response.paintThickness.imageGroups = [];
|
|
46
46
|
this.vehicleInformation = response;
|
|
47
47
|
}
|
|
48
|
-
async setData(newData) {
|
|
48
|
+
async setData(newData, headers = {}) {
|
|
49
49
|
clearTimeout(this.networkTimeoutRef);
|
|
50
50
|
if (this.abortController)
|
|
51
51
|
this.abortController.abort();
|
|
@@ -69,7 +69,7 @@ const PaintThickness = class {
|
|
|
69
69
|
scopedTimeoutRef = setTimeout(r, 700);
|
|
70
70
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
71
71
|
});
|
|
72
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
|
|
72
|
+
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
73
73
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
74
74
|
if (!vehicleResponse)
|
|
75
75
|
throw new Error('Wrong response format');
|
|
@@ -86,8 +86,8 @@ const PaintThickness = class {
|
|
|
86
86
|
this.errorMessage = error.message;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
async fetchData(requestedVin = this.externalVin) {
|
|
90
|
-
await this.setData(requestedVin);
|
|
89
|
+
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
90
|
+
await this.setData(requestedVin, headers);
|
|
91
91
|
}
|
|
92
92
|
//calculateHeight(componentState: string) {
|
|
93
93
|
// if (componentState.includes('loading') && this.componentHeight === '0px') {
|
|
@@ -111,11 +111,11 @@ const PaintThickness = class {
|
|
|
111
111
|
render() {
|
|
112
112
|
var _a, _b;
|
|
113
113
|
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: [] };
|
|
114
|
-
return (h(Host, { key: '
|
|
114
|
+
return (h(Host, { key: '27ef74f7d3b896fee2b8ec9ea45cabd06771e55f' }, h("div", { key: 'a9d29e02c453d06d1ab3989150ec4a68b4823692', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '1a08070d1a9a1899de09dd07f38c8361a6cda178' }, h(Loading, { key: '10897e5c10e7f992f76469d16df7ded2c31c19c3', isLoading: this.state.includes('loading') }), h("div", { key: '5bec28c51b9b07cc8eb2aa137be0b147d8325367', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '475dcd3dbee8d3fa23aedfbe7b5bec441c0f1b27', class: 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) && (h("div", { key: 'b2bf022b4305f0363bbfbbd2e46a4c72736a9b07', class: "py-[16px]" }, h("div", { key: '69ff9a1dbf40e4ab1741ba4feb26ae90eea35e39', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: 'f63916046b17e946708a81b4697d2dafcee6857c', class: "flex mt-[12px] w-full max-h-[70dvh] overflow-hidden mx-auto rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '058d7e1ec5c93f183baf62a9e84eac5e28c3fb81', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Paint Thickeness"), h("div", { key: '36c9a6ff73d058272be62336a6f36845cdd8d86a', class: "h-0 overflow-auto flex-1" }, !parts.length && h("div", { key: '28236c4b032136da2d69ecf9bbfd428d326ea948', class: "h-[50px] px-[30px] flex items-center justify-center text-[18px]" }, "No parts are available."), !!parts.length && (h("table", { key: 'bd6966dd901c94b5b07396a471a9589077e267a6', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'fa810cf4a8e359dcfa5e558aa54760a066339b73', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: 'c4d34f474f30c08c32b1dedadefd050b8da13a3f' }, ['Part', 'Left', 'Right'].map(title => (h("th", { key: title, class: "px-[15px] min-w-[100px] py-[15px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: '65c5905e2e8a84cf3bc9a23db6d6561df877aedf' }, parts.map((part, idx) => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: part.part }, ['part', 'left', 'right'].map(key => (h("td", { key: part.part + key, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
115
115
|
'!border-none': idx === parts.length - 1,
|
|
116
|
-
}) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '
|
|
116
|
+
}) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '4297103d40bfc9642958065df2d5bd9a2f558634' }, !imageGroups.length && h("div", { key: '1573a3b1715217cb5af0097f0a8d8eea6b560ce7', class: "h-[40px] px-[30px] flex text-red-500 items-center justify-center text-[18px]" }, "No image groups are available."), !!imageGroups.length && (h("div", { key: '11f0a30c184766471e1e9dd0bfac5f96a612f279', class: "py-[16px] gap-[16px] justify-center flex flex-wrap px-[24px] w-full" }, imageGroups.map(imageGroup => (h("div", { class: "shrink-0 rounded-lg shadow-sm border overflow-hidden flex flex-col", key: imageGroup.name }, h("h1", { class: "text-center border-b bg-slate-200 font-semibold p-[6px]" }, imageGroup.name), h("div", { class: "flex p-[12px] gap-[8px]" }, imageGroup.images.map(image => (h("div", { class: "flex gap-[8px]", key: image }, 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" }, 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" }, h("img", { src: eyeSvg }), h("span", { class: "text-white" }, "Expand")), h("img", { class: "w-auto h-[150px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: image }))))))))), h("div", { key: '6920779802a4da3d9399619e6ee9c788db3b204c', onClick: () => this.closeImage(), style: { backdropFilter: this.expandedImage ? 'blur(3px)' : 'blur(0px)' }, class: cn('pointer-events-none w-[100dvw] h-[100dvh] fixed top-0 z-10 left-0 opacity-0 bg-black/40 transition-all duration-400', {
|
|
117
117
|
'pointer-events-auto opacity-100 delay-200': this.expandedImage,
|
|
118
|
-
}) }, h("button", { key: '
|
|
118
|
+
}) }, h("button", { key: 'e6e11c7cf4ff71de129d92977f2971eb6f9b9268', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: 'cad4548287110796c756160c79a43ea0eb3f22d3', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: 'c117d12d51b4058a392e80802630896aeca7192f', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: 'a900ecc78d2b3ab5aaaf42f23469fe3fa4b07db2', alt: "", id: "expanded-image", class: "fixed opacity-0 z-40 transition-all rounded-lg" }))))))))));
|
|
119
119
|
}
|
|
120
120
|
get el() { return getElement(this); }
|
|
121
121
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built by ShiftSoftware
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
|
-
const getPartInformation = async (component, generalProps) => {
|
|
5
|
+
const getPartInformation = async (component, generalProps, headers = {}) => {
|
|
6
6
|
const { notAvailableMessage, mockData, partNumber, scopedTimeoutRef, middlewareCallback } = generalProps;
|
|
7
7
|
const { isDev, baseUrl, queryString, abortController, networkTimeoutRef, loadedResponse } = component;
|
|
8
8
|
const handleResult = (newPartInformation) => {
|
|
@@ -23,7 +23,7 @@ const getPartInformation = async (component, generalProps) => {
|
|
|
23
23
|
else {
|
|
24
24
|
if (!baseUrl)
|
|
25
25
|
throw new Error('Please provide base-url');
|
|
26
|
-
const response = await fetch(`${baseUrl}${partNumber}?${queryString}`, { signal: abortController.signal });
|
|
26
|
+
const response = await fetch(`${baseUrl}${partNumber}?${queryString}`, { signal: abortController.signal, headers: headers });
|
|
27
27
|
const newData = (await response.json());
|
|
28
28
|
return handleResult(newData);
|
|
29
29
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
|
|
6
6
|
import { L as Loading } from './Loading-61648252.js';
|
|
7
7
|
import { c as cn } from './cn-cc419b94.js';
|
|
8
|
-
import { g as getVehicleInformation } from './vehicleInformation-
|
|
8
|
+
import { g as getVehicleInformation } from './vehicleInformation-f7290628.js';
|
|
9
9
|
import './loader-027b88af.js';
|
|
10
10
|
|
|
11
11
|
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}";
|
|
@@ -30,7 +30,7 @@ const ServiceHistory = class {
|
|
|
30
30
|
response.serviceHistory = [];
|
|
31
31
|
this.vehicleInformation = response;
|
|
32
32
|
}
|
|
33
|
-
async setData(newData) {
|
|
33
|
+
async setData(newData, headers = {}) {
|
|
34
34
|
clearTimeout(this.networkTimeoutRef);
|
|
35
35
|
if (this.abortController)
|
|
36
36
|
this.abortController.abort();
|
|
@@ -54,7 +54,7 @@ const ServiceHistory = class {
|
|
|
54
54
|
scopedTimeoutRef = setTimeout(r, 700);
|
|
55
55
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
56
56
|
});
|
|
57
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
|
|
57
|
+
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
58
58
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
59
59
|
if (!vehicleResponse)
|
|
60
60
|
throw new Error('Wrong response format');
|
|
@@ -71,8 +71,8 @@ const ServiceHistory = class {
|
|
|
71
71
|
this.errorMessage = error.message;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
async fetchData(requestedVin = this.externalVin) {
|
|
75
|
-
await this.setData(requestedVin);
|
|
74
|
+
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
75
|
+
await this.setData(requestedVin, headers);
|
|
76
76
|
}
|
|
77
77
|
//calculateHeight(componentState: string) {
|
|
78
78
|
// if (componentState.includes('loading') && this.componentHeight === '0px') {
|
|
@@ -95,7 +95,7 @@ const ServiceHistory = class {
|
|
|
95
95
|
}
|
|
96
96
|
render() {
|
|
97
97
|
var _a, _b, _c, _d;
|
|
98
|
-
return (h(Host, { key: '
|
|
98
|
+
return (h(Host, { key: '8e5ae0eaa05bf7f1365f5a16e31b4f546daa267b' }, h("div", { key: 'd097bff639f07f92245df5c7898ceb6375443826', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'd03547e52874be8356089f968292c7b330b4edef' }, h(Loading, { key: '6d13faffb586131276ab0dbbfe21afec97b0ec77', isLoading: this.state.includes('loading') }), h("div", { key: '68e8bcbf3590e50f8ed54389ebe3fe716e3da901', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '03cdb8690215c104f4e0253b29bbaf92f3dbb0d6', class: 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) && (h("div", { key: '32ccb311b5118329bbe9d04a29453e0a6360f88f', class: "py-[16px]" }, h("div", { key: '70595222071784b2708a7cc5e1a0ae3392498725', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '02426e89ded841b22db0af5ddc30c8cff1ba2426', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '3060be4709758da0bc75d9a8cce3a4bff4530c98', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Service History"), h("div", { key: '377288b6e742f2fd9f06b2ca0920293437dd3968', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.serviceHistory.length) && h("div", { key: '5ed26853f4bf544b18fed55dc21a3c3a222ac5a3', 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) && (h("table", { key: 'a7995bb565c22d8594a5219d836396a3df1e53c6', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '530da33ea34b28a82d23b509db1ba2fb7003b187', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '710aff75e258d6e408111b5e8442042440f7c29b' }, ['Branch', 'Dealer', 'Invoice No.', 'Date', 'Service Type', 'Odometer'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: '68e5fda2e43df1c20550bada35bb17bc4393aa60' }, (_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.serviceHistory.map((service, idx) => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: service.invoiceNumber }, ['branchName', 'companyName', 'invoiceNumber', 'serviceDate', 'serviceType', 'mileage'].map(serviceType => {
|
|
99
99
|
var _a;
|
|
100
100
|
return (h("td", { key: service.invoiceNumber + serviceType, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
101
101
|
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|