adp-web-components 0.1.63 → 0.1.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +4 -4
  2. package/dist/cjs/flexible-container.cjs.entry.js +1 -1
  3. package/dist/cjs/form-checkbox.cjs.entry.js +2 -2
  4. package/dist/cjs/form-date-picker.cjs.entry.js +1 -1
  5. package/dist/cjs/form-dialog_8.cjs.entry.js +81 -11
  6. package/dist/cjs/form-input-C3gQ_Noj.js +30 -0
  7. package/dist/cjs/form-input_4.cjs.entry.js +5 -5
  8. package/dist/cjs/form-switch.cjs.entry.js +2 -2
  9. package/dist/cjs/form-time-picker.cjs.entry.js +1 -1
  10. package/dist/cjs/general-inquiry-form.cjs.entry.js +4 -4
  11. package/dist/cjs/{get-language-from-url-CfLHbGsq.js → get-language-from-url-DSzX4HQt.js} +28 -2
  12. package/dist/cjs/{get-local-language-CG40OoLK.js → get-local-language-8KMktNqV.js} +1 -1
  13. package/dist/cjs/information-table.cjs.entry.js +1 -1
  14. package/dist/cjs/{loader-icon-CoLnzFJQ.js → loader-icon-Cf3Xs3Kv.js} +2 -2
  15. package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
  16. package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +3 -3
  17. package/dist/cjs/part-lookup.cjs.entry.js +2 -2
  18. package/dist/cjs/service-booking-form.cjs.entry.js +4 -4
  19. package/dist/cjs/shift-tab-content.cjs.entry.js +1 -1
  20. package/dist/cjs/shift-tabs_2.cjs.entry.js +2 -2
  21. package/dist/cjs/ssc-lookup-form.cjs.entry.js +4 -4
  22. package/dist/cjs/{state-object-C1OC85SG.js → state-object-BhdQ1vEN.js} +1 -1
  23. package/dist/cjs/test-drive-form.cjs.entry.js +4 -4
  24. package/dist/cjs/vehicle-accessories_7.cjs.entry.js +8 -8
  25. package/dist/cjs/vehicle-lookup.cjs.entry.js +2 -2
  26. package/dist/cjs/vehicle-quotation-form.cjs.entry.js +3 -3
  27. package/dist/collection/components/components/flexible-container.css +1 -1
  28. package/dist/collection/components/components/information-table.css +1 -1
  29. package/dist/collection/components/components/loading-spinner.css +1 -1
  30. package/dist/collection/components/components/shift-tab-content.css +1 -1
  31. package/dist/collection/components/components/shift-tabs.css +1 -1
  32. package/dist/collection/components/form-elements/form-checkbox.js +1 -1
  33. package/dist/collection/components/form-elements/form-input.js +1 -1
  34. package/dist/collection/components/form-elements/form-inputs.css +1 -1
  35. package/dist/collection/components/form-elements/form-phone-number.js +1 -1
  36. package/dist/collection/components/form-elements/form-picker-input.js +74 -4
  37. package/dist/collection/components/form-elements/form-select.js +1 -1
  38. package/dist/collection/components/form-elements/form-submit.js +1 -1
  39. package/dist/collection/components/form-elements/form-switch.js +1 -1
  40. package/dist/collection/components/form-elements/form-text-area.js +1 -1
  41. package/dist/collection/components/form-elements/form-vin-input.js +1 -1
  42. package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
  43. package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
  44. package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
  45. package/dist/collection/components/part-lookup/manufacturer-part-lookup.css +1 -1
  46. package/dist/collection/components/part-lookup/part-lookup.css +1 -1
  47. package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
  48. package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
  49. package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
  50. package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
  51. package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
  52. package/dist/collection/components/vehicle-lookup/vehicle-sale-information.css +1 -1
  53. package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -1
  54. package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
  55. package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -1
  56. package/dist/collection/features/form-hook/form-hook.js +28 -2
  57. package/dist/collection/features/form-hook/inputs/form-input.js +11 -5
  58. package/dist/components/dead-stock-lookup.js +1 -1
  59. package/dist/components/distributor-lookup.js +1 -1
  60. package/dist/components/flexible-container.js +1 -1
  61. package/dist/components/form-checkbox.js +1 -1
  62. package/dist/components/form-date-picker.js +1 -1
  63. package/dist/components/form-dialog.js +1 -1
  64. package/dist/components/form-input.js +1 -1
  65. package/dist/components/form-phone-number.js +1 -1
  66. package/dist/components/form-picker-input.js +1 -1
  67. package/dist/components/form-select.js +1 -1
  68. package/dist/components/form-shadow-input.js +1 -1
  69. package/dist/components/form-structure-error.js +1 -1
  70. package/dist/components/form-structure.js +1 -1
  71. package/dist/components/form-submit.js +1 -1
  72. package/dist/components/form-switch.js +1 -1
  73. package/dist/components/form-text-area.js +1 -1
  74. package/dist/components/form-time-picker.js +1 -1
  75. package/dist/components/form-vin-input.js +1 -1
  76. package/dist/components/general-inquiry-form.js +1 -1
  77. package/dist/components/information-table.js +1 -1
  78. package/dist/components/loading-spinner.js +1 -1
  79. package/dist/components/manufacturer-lookup.js +1 -1
  80. package/dist/components/manufacturer-part-lookup.js +1 -1
  81. package/dist/components/p-B7jki48I.js +5 -0
  82. package/dist/components/{p-DBPcMct2.js → p-BP80WvAz.js} +1 -1
  83. package/dist/components/{p-36-IaSKm.js → p-BQtb1fok.js} +1 -1
  84. package/dist/components/{p-Cjj1G4D2.js → p-BuKy7Rx0.js} +1 -1
  85. package/dist/components/{p-A7iMsEel.js → p-BuP_DwlH.js} +1 -1
  86. package/dist/components/{p-5agmhwm7.js → p-Bxru3K95.js} +1 -1
  87. package/dist/components/{p-DnkuFboF.js → p-C1siXH7Y.js} +1 -1
  88. package/dist/components/{p-DRb1hBHP.js → p-C2aeZGeT.js} +1 -1
  89. package/dist/components/p-CAxrIdkp.js +5 -0
  90. package/dist/components/p-CDTvzwTY.js +5 -0
  91. package/dist/components/{p-D0XGI6mk.js → p-CG-zovra.js} +1 -1
  92. package/dist/components/{p-C6hyNnHw.js → p-CKI3aAYE.js} +1 -1
  93. package/dist/components/p-CO1nZnKO.js +5 -0
  94. package/dist/components/p-CU0-hVft.js +5 -0
  95. package/dist/components/{p-BPrc_-Uw.js → p-CUBMSqcx.js} +1 -1
  96. package/dist/components/{p-DpfBI1eP.js → p-CasPml7B.js} +1 -1
  97. package/dist/components/{p-clgmN8l6.js → p-CcLFnUSS.js} +1 -1
  98. package/dist/components/{p-D4rNtEH9.js → p-Cekl00HW.js} +1 -1
  99. package/dist/components/p-CkzCdQDi.js +5 -0
  100. package/dist/components/{p-DppYpL5T.js → p-D3RWScgO.js} +1 -1
  101. package/dist/components/{p-DsFbXACB.js → p-DACKk-aI.js} +1 -1
  102. package/dist/components/p-DAOqnjKo.js +5 -0
  103. package/dist/components/p-DC9JViaQ.js +5 -0
  104. package/dist/components/{p-BkRUZTAo.js → p-DPN4YeOb.js} +1 -1
  105. package/dist/components/{p-CrUnNyzK.js → p-DWp-GWu1.js} +1 -1
  106. package/dist/components/{p-D3aoGLFX.js → p-DZWy-asx.js} +1 -1
  107. package/dist/components/{p-Cz2GJXgI.js → p-DeNo_PJi.js} +1 -1
  108. package/dist/components/{p-Bgg84Jga.js → p-Dk1orRQl.js} +1 -1
  109. package/dist/components/p-Dlrjtovg.js +5 -0
  110. package/dist/components/{p-aJdysKHK.js → p-EKpRGPLQ.js} +1 -1
  111. package/dist/components/{p-DTYO6O3a.js → p-NSqEj65Q.js} +1 -1
  112. package/dist/components/p-Oy02T-n-.js +5 -0
  113. package/dist/components/{p-BXt8N0qj.js → p-elqvs8Bp.js} +1 -1
  114. package/dist/components/p-jTYPnZnQ.js +5 -0
  115. package/dist/components/part-lookup.js +1 -1
  116. package/dist/components/service-booking-form.js +1 -1
  117. package/dist/components/shift-accordion.js +1 -1
  118. package/dist/components/shift-slider.js +1 -1
  119. package/dist/components/shift-tab-content.js +1 -1
  120. package/dist/components/shift-tabs.js +1 -1
  121. package/dist/components/ssc-lookup-form.js +1 -1
  122. package/dist/components/test-drive-form.js +1 -1
  123. package/dist/components/vehicle-accessories.js +1 -1
  124. package/dist/components/vehicle-claimable-items.js +1 -1
  125. package/dist/components/vehicle-item-claim-form.js +1 -1
  126. package/dist/components/vehicle-lookup.js +1 -1
  127. package/dist/components/vehicle-paint-thickness.js +1 -1
  128. package/dist/components/vehicle-quotation-form.js +1 -1
  129. package/dist/components/vehicle-sale-information.js +1 -1
  130. package/dist/components/vehicle-service-history.js +1 -1
  131. package/dist/components/vehicle-specification.js +1 -1
  132. package/dist/components/vehicle-warranty-details.js +1 -1
  133. package/dist/esm/dead-stock-lookup_3.entry.js +4 -4
  134. package/dist/esm/flexible-container.entry.js +1 -1
  135. package/dist/esm/form-checkbox.entry.js +2 -2
  136. package/dist/esm/form-date-picker.entry.js +1 -1
  137. package/dist/esm/form-dialog_8.entry.js +81 -11
  138. package/dist/esm/form-input-C5O2h7ti.js +28 -0
  139. package/dist/esm/form-input_4.entry.js +5 -5
  140. package/dist/esm/form-switch.entry.js +2 -2
  141. package/dist/esm/form-time-picker.entry.js +1 -1
  142. package/dist/esm/general-inquiry-form.entry.js +4 -4
  143. package/dist/esm/{get-language-from-url-DS2wH9wf.js → get-language-from-url-WEiw5juk.js} +28 -2
  144. package/dist/esm/{get-local-language-VdAZpG-2.js → get-local-language-B8070P5r.js} +1 -1
  145. package/dist/esm/information-table.entry.js +1 -1
  146. package/dist/esm/{loader-icon-QHxzLM80.js → loader-icon-Bdlakq4b.js} +2 -2
  147. package/dist/esm/loading-spinner.entry.js +1 -1
  148. package/dist/esm/manufacturer-part-lookup.entry.js +3 -3
  149. package/dist/esm/part-lookup.entry.js +2 -2
  150. package/dist/esm/service-booking-form.entry.js +4 -4
  151. package/dist/esm/shift-tab-content.entry.js +1 -1
  152. package/dist/esm/shift-tabs_2.entry.js +2 -2
  153. package/dist/esm/ssc-lookup-form.entry.js +4 -4
  154. package/dist/esm/{state-object-B5sDOkr3.js → state-object-CmzxAD3a.js} +1 -1
  155. package/dist/esm/test-drive-form.entry.js +4 -4
  156. package/dist/esm/vehicle-accessories_7.entry.js +8 -8
  157. package/dist/esm/vehicle-lookup.entry.js +2 -2
  158. package/dist/esm/vehicle-quotation-form.entry.js +3 -3
  159. package/dist/shift-components/{p-bac28415.entry.js → p-0cd22be9.entry.js} +1 -1
  160. package/dist/shift-components/{p-caed63eb.entry.js → p-1103449e.entry.js} +1 -1
  161. package/dist/shift-components/{p-1eb4562c.entry.js → p-15af4b62.entry.js} +1 -1
  162. package/dist/shift-components/{p-82d7784e.entry.js → p-220ce6f0.entry.js} +1 -1
  163. package/dist/shift-components/p-2af694b2.entry.js +5 -0
  164. package/dist/shift-components/{p-3c07dae0.entry.js → p-314e6be5.entry.js} +1 -1
  165. package/dist/shift-components/p-42e06b24.entry.js +5 -0
  166. package/dist/shift-components/{p-aab59b34.entry.js → p-4aaeb37f.entry.js} +1 -1
  167. package/dist/shift-components/{p-6035ad7f.entry.js → p-5caec752.entry.js} +1 -1
  168. package/dist/shift-components/{p-5d6ca023.entry.js → p-601b2a59.entry.js} +1 -1
  169. package/dist/shift-components/p-6685c185.entry.js +5 -0
  170. package/dist/shift-components/{p-69a9617b.entry.js → p-7cbe4db3.entry.js} +1 -1
  171. package/dist/shift-components/p-8512615f.entry.js +5 -0
  172. package/dist/shift-components/{p-4ca85ba8.entry.js → p-89bb047b.entry.js} +1 -1
  173. package/dist/shift-components/{p-59296309.entry.js → p-99ba86c6.entry.js} +1 -1
  174. package/dist/shift-components/p-Bp-HDfJB.js +5 -0
  175. package/dist/shift-components/{p-BqVN5MXa.js → p-DO0hHkF_.js} +1 -1
  176. package/dist/shift-components/{p-D43Y2KJZ.js → p-DOQtgS4h.js} +1 -1
  177. package/dist/shift-components/{p-CYuX6By7.js → p-DPETJEMv.js} +1 -1
  178. package/dist/shift-components/{p-7a9dc564.entry.js → p-a4c7d4c9.entry.js} +1 -1
  179. package/dist/shift-components/p-a56e2de9.entry.js +5 -0
  180. package/dist/shift-components/{p-bc928bcf.entry.js → p-ba318357.entry.js} +1 -1
  181. package/dist/shift-components/p-d4c5e30d.entry.js +5 -0
  182. package/dist/shift-components/{p-82cc9e0d.entry.js → p-d51df697.entry.js} +1 -1
  183. package/dist/shift-components/{p-35e4059b.entry.js → p-f21ceea0.entry.js} +1 -1
  184. package/dist/shift-components/p-no7IC1jn.js +5 -0
  185. package/dist/shift-components/shift-components.esm.js +1 -1
  186. package/dist/types/components/form-elements/form-picker-input.d.ts +5 -0
  187. package/dist/types/features/form-hook/form-hook.d.ts +3 -5
  188. package/dist/types/features/form-hook/inputs/form-input.d.ts +3 -0
  189. package/dist/types/features/form-hook/interface.d.ts +3 -0
  190. package/package.json +1 -1
  191. package/dist/cjs/form-input-D5dWFwoN.js +0 -24
  192. package/dist/components/p-78hsxToT.js +0 -5
  193. package/dist/components/p-B1K4fRUA.js +0 -5
  194. package/dist/components/p-C7H6IjZ0.js +0 -5
  195. package/dist/components/p-D205nHLN.js +0 -5
  196. package/dist/components/p-DZ29hUTN.js +0 -5
  197. package/dist/components/p-Di7kQptP.js +0 -5
  198. package/dist/components/p-DzJYZ-yg.js +0 -5
  199. package/dist/components/p-K0JAT1Gz.js +0 -5
  200. package/dist/components/p-e7OMZxZr.js +0 -5
  201. package/dist/components/p-rAxWdX54.js +0 -5
  202. package/dist/components/p-v09Fe7HV.js +0 -5
  203. package/dist/esm/form-input-qOEP7NyE.js +0 -22
  204. package/dist/shift-components/p-2b8d01e8.entry.js +0 -5
  205. package/dist/shift-components/p-3ab64036.entry.js +0 -5
  206. package/dist/shift-components/p-5e1772f7.entry.js +0 -5
  207. package/dist/shift-components/p-6ab35401.entry.js +0 -5
  208. package/dist/shift-components/p-BtuVI_PX.js +0 -5
  209. package/dist/shift-components/p-DgUKb8cO.js +0 -5
  210. package/dist/shift-components/p-aa5fbfe8.entry.js +0 -5
  211. package/dist/shift-components/p-e3cd1038.entry.js +0 -5
@@ -2,4 +2,4 @@
2
2
  * Built by ShiftSoftware
3
3
  * Copyright (c)
4
4
  */
5
- import{h as e}from"./p-Bf4Ol6Qt.js";import"./p-CWP4hZcw.js";import{d as l}from"./p-BILW0yP6.js";import{L as a,g as r}from"./p-D43Y2KJZ.js";import{c as i}from"./p-BK16Cn81.js";import{d as t}from"./p-XyQhTm0V.js";import{g as o}from"./p-D0IHkGuC.js";const n={};let c="";const s=({form:l})=>{var r,t,o,s;l.addWatcher("vehicle");let d=l.getValue("vehicle"),u=!!d;const v=null===(r=l.context.vehicleList)||void 0===r?void 0:r.find((e=>e.value===d));let p;v?(p=null===(t=null==v?void 0:v.meta)||void 0===t?void 0:t.image,d=v.value):l.context.vehicleList&&l.context.vehicleList[0]&&(p=null===(s=null===(o=l.context.vehicleList[0])||void 0===o?void 0:o.meta)||void 0===s?void 0:s.image,d=l.context.vehicleList[0].value);let h=!1;return n[d]?c=n[d]:l&&p&&d&&(((e,l,a)=>{fetch(l).then((e=>e.blob())).then((l=>{const r=new FileReader;r.onloadend=()=>{n[a]=r.result,e.rerender({rerenderForm:!0})},r.readAsDataURL(l)})).catch((e=>{console.log(e)}))})(l,p,d),h=!0),e("flexible-container",{isOpened:u},e("div",{style:{"min-height":"60px"},part:"vehicle-image-wrapper",class:i("vehicle-image-wrapper",{loading:h})},e("div",{part:i("vehicle-image-loading-wrapper",{"vehicle-image-active-loading-wrapper":h}),class:i("loading-wrapper vehicle-image-loading-wrapper",{"vehicle-image-active-loading-wrapper":h})},e(a,{part:"vehicle-image-loader-icon",class:"img vehicle-image-loader-icon"})),e("img",{alt:"vehicle image",part:"vehicle-image",src:c,style:{"border-radius":"6px",transition:"opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);",opacity:h?"0":"1"}})))},d=l=>e("svg",Object.assign({fill:"none"},l,{"stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"}),e("path",{d:"M8 2v4"}),e("path",{d:"M16 2v4"}),e("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e("path",{d:"M3 10h18"}),e("path",{d:"M8 14h.01"}),e("path",{d:"M12 14h.01"}),e("path",{d:"M16 14h.01"}),e("path",{d:"M8 18h.01"}),e("path",{d:"M12 18h.01"}),e("path",{d:"M16 18h.01"})),u=(a,i={})=>Object.assign({submit:({props:l})=>e("form-submit",Object.assign({},l)),name:({props:l})=>e("form-input",Object.assign({},l)),lastName:({props:l})=>e("form-input",Object.assign({},l)),email:({props:l})=>e("form-input",Object.assign({type:"email"},l)),message:({props:l})=>e("form-text-area",Object.assign({},l)),vin:({props:l})=>e("form-vin-input",Object.assign({},l)),vehicleImage:({form:l})=>e(s,{form:l}),phone:({props:l,isLoading:i})=>(a.phoneValidator||(a.phoneValidator=r((null==l?void 0:l.countryCode)||"")),e("form-phone-number",Object.assign({defaultValue:a.phoneValidator.default},l,{isLoading:i,validator:a.phoneValidator}))),vehicle:({language:l,props:a})=>e("form-select",Object.assign({},a,{searchable:!0,fetcher:async({signal:e,context:r})=>{var i,t;let n=null===(i=new URLSearchParams(window.location.search).get(null==a?void 0:a.vehicleIdQueryParam)||"")||void 0===i?void 0:i.toLowerCase();const c=a.vehicleApi,s=await fetch(c,{signal:e,headers:{"Accept-Language":l}});let d,u=-1;return(null==a?void 0:a.dynamic)?(d=((e,l)=>{const a=[];return o(e,l.items).forEach((e=>{const r=o(e,l["item-value"]),i=o(e,l["item-label"]),t={value:(null==l?void 0:l.useNamedValue)?i:r,label:i};t.meta=Object.assign({},e),a.push(t)})),a})(await s.json(),a),d.forEach(((e,l)=>{var r,i;a.defaultValue||!n||(null===(r=null==e?void 0:e.label)||void 0===r?void 0:r.toLowerCase())!==n&&(null===(i=`${e.value}`)||void 0===i?void 0:i.toLowerCase())!==n||(u=l)}))):(null==a?void 0:a.vehiclesApiStrapiFormat)?(d=(await s.json()).data,d=d.map(((e,l)=>{var r,i,t;return a.defaultValue||!n||(null===(r=null==e?void 0:e.GradeName)||void 0===r?void 0:r.toLowerCase())!==n&&(null===(i=`${e.id}`)||void 0===i?void 0:i.toLowerCase())!==n||(u=l),{label:e.attributes.GradeName,value:(null==a?void 0:a.useNamedValue)?`${null===(t=null==e?void 0:e.attributes)||void 0===t?void 0:t.GradeName}`:`${e.id}`,meta:Object.assign(Object.assign({},e),{image:e.attributes.Cover.data.attributes.url})}}))):(d=await s.json(),d=d.map(((e,l)=>{var r,i;return a.defaultValue||!n||(null===(r=null==e?void 0:e.Title)||void 0===r?void 0:r.toLowerCase())!==n&&(null===(i=`${e.ID}`)||void 0===i?void 0:i.toLowerCase())!==n||(u=l),{label:e.Title,value:(null==a?void 0:a.useNamedValue)?`${e.Title}`:`${e.ID}`,meta:Object.assign(Object.assign({},e),{image:e.Image})}}))),r.defaultValue=(null==a?void 0:a.defaultValue)?null==a?void 0:a.defaultValue:u>-1?null===(t=d[u])||void 0===t?void 0:t.value:"",d},language:l})),companyBranchId:({language:l,props:a})=>e("form-select",Object.assign({},a,{clearable:!0,searchable:!0,fetcher:async({signal:e})=>{const r=null==a?void 0:a.branchApi,i=await fetch(r,{signal:e,headers:{"Accept-Language":l}});return(await i.json()).map((e=>({label:e.Name,value:`${e.ID}`,meta:Object.assign({},e)})))},language:l})),cityId:({language:l,props:a})=>e("form-select",Object.assign({},a,{clearable:!0,searchable:!0,fetcher:async({signal:e})=>{const r=null==a?void 0:a.cityApi,i=await fetch(r,{signal:e,headers:{"Accept-Language":l}});return(await i.json()).map((e=>({label:e.Name,value:`${e.ID}`,meta:Object.assign({},e)})))},language:l})),date:({props:l})=>e("form-picker-input",Object.assign({type:"date"},l,{icon:e(d,null)})),time:({language:a,props:r})=>e("form-select",Object.assign({},r,{clearable:!0,fetcher:async()=>{const e=[];if(Array.isArray(r.span)&&Array.isArray(r.min)&&Array.isArray(r.max)&&r.format){let a=t({offsets:r.min}),i=t({offsets:r.max});for(;l.isBefore(a,i)||l.isEqual(a,i);)e.push({value:l.format(a,r.format),label:l.format(a,r.format)}),a=t({offsets:r.span,date:a})}return e},language:a})),currentVehicleBrand:({form:l,language:a,props:r,locale:i})=>e("form-select",Object.assign({},r,{searchable:!0,fetcher:async({signal:e})=>{var a;const r=null===(a=l.context.structure)||void 0===a?void 0:a.data.currentVehiclesApi,t=await fetch(r,{signal:e,headers:{"Accept-Language":"en"}});return[...(await t.json()).filter((e=>"Other"!==e.name)).map((e=>({label:e.Name,value:`${e.ID}`,meta:Object.assign({},e)}))),{value:"Other",label:i.Other}]},language:a})),currentVehicleModel:({form:l,language:a,props:r,locale:i})=>{l.addWatcher("currentVehicleBrand");const t=null==l?void 0:l.getValue("currentVehicleBrand");return e("form-select",Object.assign({},r,{searchable:!0,fetcher:async({})=>{var e,a;if(!t)return[];const r=null===(a=null===(e=l.context.currentVehicleBrandList)||void 0===e?void 0:e.find((e=>e.value===t)))||void 0===a?void 0:a.meta;return r?[...null==r?void 0:r.Models.map((e=>({label:e.Name,value:`${e.ID}`}))),{value:"Other",label:i.Other}]:[]},language:a,resetKey:t,fetcherKey:t,isRequired:"Other"!==t,isDisabled:!t||"Other"===t}))},ownVehicle:({language:l,props:a})=>e("form-select",Object.assign({},a,{fetcher:async({})=>{var e,r,i,t;return[{value:"yes",label:null===(r=null===(e=null==a?void 0:a.localization)||void 0===e?void 0:e[l])||void 0===r?void 0:r.yes},{value:"no",label:null===(t=null===(i=null==a?void 0:a.localization)||void 0===i?void 0:i[l])||void 0===t?void 0:t.no}]},language:l})),conditionalCurrentVehicleBrand:({form:l,language:a,props:r,locale:i})=>{l.addWatcher("ownVehicle");const t="yes"===(null==l?void 0:l.getValue("ownVehicle"));return e("form-select",Object.assign({},r,{searchable:!0,fetcher:async({signal:e})=>{const l=null==r?void 0:r.brandApi,a=await fetch(l,{signal:e,headers:{"Accept-Language":"en"}});return[...(await a.json()).filter((e=>"Other"!==e.name)).map((e=>({label:e.Name,value:(null==r?void 0:r.useNamedValue)?e.Name:`${e.ID}`,meta:Object.assign({},e)}))),{value:"Other",label:i.Other}]},language:a,resetKey:t,isRequired:t,isDisabled:!t}))},conditionalCurrentVehicleModel:({form:l,language:a,props:r,locale:i})=>{l.addWatcher("ownVehicle"),l.addWatcher("conditionalCurrentVehicleBrand");const t="yes"===(null==l?void 0:l.getValue("ownVehicle")),o=null==l?void 0:l.getValue("conditionalCurrentVehicleBrand");return e("form-select",Object.assign({},r,{searchable:!0,fetcher:async({})=>{var e,a;if(!o)return[];const t=null===(a=null===(e=l.context.conditionalCurrentVehicleBrandList)||void 0===e?void 0:e.find((e=>e.value===o)))||void 0===a?void 0:a.meta;return t?[...null==t?void 0:t.Models.map((e=>({label:e.Name,value:(null==r?void 0:r.useNamedValue)?e.Name:`${e.ID}`}))),{value:"Other",label:i.Other}]:[]},language:a,resetKey:o,fetcherKey:o,isRequired:t&&"Other"!==o,isDisabled:!o||"Other"===o}))}},i),v=()=>({phoneValidator:void 0});export{v as a,u as g}
5
+ import{h as e}from"./p-Bf4Ol6Qt.js";import"./p-CWP4hZcw.js";import{d as l}from"./p-BILW0yP6.js";import{L as a,g as r}from"./p-DOQtgS4h.js";import{c as i}from"./p-BK16Cn81.js";import{d as t}from"./p-XyQhTm0V.js";import{g as o}from"./p-D0IHkGuC.js";const n={};let c="";const s=({form:l})=>{var r,t,o,s;l.addWatcher("vehicle");let d=l.getValue("vehicle"),u=!!d;const v=null===(r=l.context.vehicleList)||void 0===r?void 0:r.find((e=>e.value===d));let p;v?(p=null===(t=null==v?void 0:v.meta)||void 0===t?void 0:t.image,d=v.value):l.context.vehicleList&&l.context.vehicleList[0]&&(p=null===(s=null===(o=l.context.vehicleList[0])||void 0===o?void 0:o.meta)||void 0===s?void 0:s.image,d=l.context.vehicleList[0].value);let h=!1;return n[d]?c=n[d]:l&&p&&d&&(((e,l,a)=>{fetch(l).then((e=>e.blob())).then((l=>{const r=new FileReader;r.onloadend=()=>{n[a]=r.result,e.rerender({rerenderForm:!0})},r.readAsDataURL(l)})).catch((e=>{console.log(e)}))})(l,p,d),h=!0),e("flexible-container",{isOpened:u},e("div",{style:{"min-height":"60px"},part:"vehicle-image-wrapper",class:i("vehicle-image-wrapper",{loading:h})},e("div",{part:i("vehicle-image-loading-wrapper",{"vehicle-image-active-loading-wrapper":h}),class:i("loading-wrapper vehicle-image-loading-wrapper",{"vehicle-image-active-loading-wrapper":h})},e(a,{part:"vehicle-image-loader-icon",class:"img vehicle-image-loader-icon"})),e("img",{alt:"vehicle image",part:"vehicle-image",src:c,style:{"border-radius":"6px",transition:"opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);",opacity:h?"0":"1"}})))},d=l=>e("svg",Object.assign({fill:"none"},l,{"stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"}),e("path",{d:"M8 2v4"}),e("path",{d:"M16 2v4"}),e("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e("path",{d:"M3 10h18"}),e("path",{d:"M8 14h.01"}),e("path",{d:"M12 14h.01"}),e("path",{d:"M16 14h.01"}),e("path",{d:"M8 18h.01"}),e("path",{d:"M12 18h.01"}),e("path",{d:"M16 18h.01"})),u=(a,i={})=>Object.assign({submit:({props:l})=>e("form-submit",Object.assign({},l)),name:({props:l})=>e("form-input",Object.assign({},l)),lastName:({props:l})=>e("form-input",Object.assign({},l)),email:({props:l})=>e("form-input",Object.assign({type:"email"},l)),message:({props:l})=>e("form-text-area",Object.assign({},l)),vin:({props:l})=>e("form-vin-input",Object.assign({},l)),vehicleImage:({form:l})=>e(s,{form:l}),phone:({props:l,isLoading:i})=>(a.phoneValidator||(a.phoneValidator=r((null==l?void 0:l.countryCode)||"")),e("form-phone-number",Object.assign({defaultValue:a.phoneValidator.default},l,{isLoading:i,validator:a.phoneValidator}))),vehicle:({language:l,props:a})=>e("form-select",Object.assign({},a,{searchable:!0,fetcher:async({signal:e,context:r})=>{var i,t;let n=null===(i=new URLSearchParams(window.location.search).get(null==a?void 0:a.vehicleIdQueryParam)||"")||void 0===i?void 0:i.toLowerCase();const c=a.vehicleApi,s=await fetch(c,{signal:e,headers:{"Accept-Language":l}});let d,u=-1;return(null==a?void 0:a.dynamic)?(d=((e,l)=>{const a=[];return o(e,l.items).forEach((e=>{const r=o(e,l["item-value"]),i=o(e,l["item-label"]),t={value:(null==l?void 0:l.useNamedValue)?i:r,label:i};t.meta=Object.assign({},e),a.push(t)})),a})(await s.json(),a),d.forEach(((e,l)=>{var r,i;a.defaultValue||!n||(null===(r=null==e?void 0:e.label)||void 0===r?void 0:r.toLowerCase())!==n&&(null===(i=`${e.value}`)||void 0===i?void 0:i.toLowerCase())!==n||(u=l)}))):(null==a?void 0:a.vehiclesApiStrapiFormat)?(d=(await s.json()).data,d=d.map(((e,l)=>{var r,i,t;return a.defaultValue||!n||(null===(r=null==e?void 0:e.GradeName)||void 0===r?void 0:r.toLowerCase())!==n&&(null===(i=`${e.id}`)||void 0===i?void 0:i.toLowerCase())!==n||(u=l),{label:e.attributes.GradeName,value:(null==a?void 0:a.useNamedValue)?`${null===(t=null==e?void 0:e.attributes)||void 0===t?void 0:t.GradeName}`:`${e.id}`,meta:Object.assign(Object.assign({},e),{image:e.attributes.Cover.data.attributes.url})}}))):(d=await s.json(),d=d.map(((e,l)=>{var r,i;return a.defaultValue||!n||(null===(r=null==e?void 0:e.Title)||void 0===r?void 0:r.toLowerCase())!==n&&(null===(i=`${e.ID}`)||void 0===i?void 0:i.toLowerCase())!==n||(u=l),{label:e.Title,value:(null==a?void 0:a.useNamedValue)?`${e.Title}`:`${e.ID}`,meta:Object.assign(Object.assign({},e),{image:e.Image})}}))),r.defaultValue=(null==a?void 0:a.defaultValue)?null==a?void 0:a.defaultValue:u>-1?null===(t=d[u])||void 0===t?void 0:t.value:"",d},language:l})),companyBranchId:({language:l,props:a})=>e("form-select",Object.assign({},a,{clearable:!0,searchable:!0,fetcher:async({signal:e})=>{const r=null==a?void 0:a.branchApi,i=await fetch(r,{signal:e,headers:{"Accept-Language":l}});return(await i.json()).map((e=>({label:e.Name,value:`${e.ID}`,meta:Object.assign({},e)})))},language:l})),cityId:({language:l,props:a})=>e("form-select",Object.assign({},a,{clearable:!0,searchable:!0,fetcher:async({signal:e})=>{const r=null==a?void 0:a.cityApi,i=await fetch(r,{signal:e,headers:{"Accept-Language":l}});return(await i.json()).map((e=>({label:e.Name,value:`${e.ID}`,meta:Object.assign({},e)})))},language:l})),date:({props:l})=>e("form-picker-input",Object.assign({type:"date"},l,{icon:e(d,null)})),time:({language:a,props:r})=>e("form-select",Object.assign({},r,{clearable:!0,fetcher:async()=>{const e=[];if(Array.isArray(r.span)&&Array.isArray(r.min)&&Array.isArray(r.max)&&r.format){let a=t({offsets:r.min}),i=t({offsets:r.max});for(;l.isBefore(a,i)||l.isEqual(a,i);)e.push({value:l.format(a,r.format),label:l.format(a,r.format)}),a=t({offsets:r.span,date:a})}return e},language:a})),currentVehicleBrand:({form:l,language:a,props:r,locale:i})=>e("form-select",Object.assign({},r,{searchable:!0,fetcher:async({signal:e})=>{var a;const r=null===(a=l.context.structure)||void 0===a?void 0:a.data.currentVehiclesApi,t=await fetch(r,{signal:e,headers:{"Accept-Language":"en"}});return[...(await t.json()).filter((e=>"Other"!==e.name)).map((e=>({label:e.Name,value:`${e.ID}`,meta:Object.assign({},e)}))),{value:"Other",label:i.Other}]},language:a})),currentVehicleModel:({form:l,language:a,props:r,locale:i})=>{l.addWatcher("currentVehicleBrand");const t=null==l?void 0:l.getValue("currentVehicleBrand");return e("form-select",Object.assign({},r,{searchable:!0,fetcher:async({})=>{var e,a;if(!t)return[];const r=null===(a=null===(e=l.context.currentVehicleBrandList)||void 0===e?void 0:e.find((e=>e.value===t)))||void 0===a?void 0:a.meta;return r?[...null==r?void 0:r.Models.map((e=>({label:e.Name,value:`${e.ID}`}))),{value:"Other",label:i.Other}]:[]},language:a,resetKey:t,fetcherKey:t,isRequired:"Other"!==t,isDisabled:!t||"Other"===t}))},ownVehicle:({language:l,props:a})=>e("form-select",Object.assign({},a,{fetcher:async({})=>{var e,r,i,t;return[{value:"yes",label:null===(r=null===(e=null==a?void 0:a.localization)||void 0===e?void 0:e[l])||void 0===r?void 0:r.yes},{value:"no",label:null===(t=null===(i=null==a?void 0:a.localization)||void 0===i?void 0:i[l])||void 0===t?void 0:t.no}]},language:l})),conditionalCurrentVehicleBrand:({form:l,language:a,props:r,locale:i})=>{l.addWatcher("ownVehicle");const t="yes"===(null==l?void 0:l.getValue("ownVehicle"));return e("form-select",Object.assign({},r,{searchable:!0,fetcher:async({signal:e})=>{const l=null==r?void 0:r.brandApi,a=await fetch(l,{signal:e,headers:{"Accept-Language":"en"}});return[...(await a.json()).filter((e=>"Other"!==e.name)).map((e=>({label:e.Name,value:(null==r?void 0:r.useNamedValue)?e.Name:`${e.ID}`,meta:Object.assign({},e)}))),{value:"Other",label:i.Other}]},language:a,resetKey:t,isRequired:t,isDisabled:!t}))},conditionalCurrentVehicleModel:({form:l,language:a,props:r,locale:i})=>{l.addWatcher("ownVehicle"),l.addWatcher("conditionalCurrentVehicleBrand");const t="yes"===(null==l?void 0:l.getValue("ownVehicle")),o=null==l?void 0:l.getValue("conditionalCurrentVehicleBrand");return e("form-select",Object.assign({},r,{searchable:!0,fetcher:async({})=>{var e,a;if(!o)return[];const t=null===(a=null===(e=l.context.conditionalCurrentVehicleBrandList)||void 0===e?void 0:e.find((e=>e.value===o)))||void 0===a?void 0:a.meta;return t?[...null==t?void 0:t.Models.map((e=>({label:e.Name,value:(null==r?void 0:r.useNamedValue)?e.Name:`${e.ID}`}))),{value:"Other",label:i.Other}]:[]},language:a,resetKey:o,fetcherKey:o,isRequired:t&&"Other"!==o,isDisabled:!o||"Other"===o}))}},i),v=()=>({phoneValidator:void 0});export{v as a,u as g}