adp-web-components 0.3.5 → 0.3.6

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 (187) hide show
  1. package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +2 -2
  2. package/dist/cjs/flexible-container.cjs.entry.js +1 -1
  3. package/dist/cjs/form-checkbox.cjs.entry.js +1 -1
  4. package/dist/cjs/form-date-picker.cjs.entry.js +1 -1
  5. package/dist/cjs/form-dialog_13.cjs.entry.js +12 -12
  6. package/dist/cjs/form-input_7.cjs.entry.js +6 -6
  7. package/dist/cjs/form-switch.cjs.entry.js +1 -1
  8. package/dist/cjs/form-time-picker.cjs.entry.js +1 -1
  9. package/dist/cjs/{functions-DC-3KJ-_.js → functions-6wd25AaT.js} +18 -14
  10. package/dist/cjs/general-form.cjs.entry.js +2 -2
  11. package/dist/cjs/general-inquiry-form.cjs.entry.js +2 -2
  12. package/dist/cjs/{get-local-language-DIQpDaV7.js → get-local-language-BQSfH8mZ.js} +1 -1
  13. package/dist/cjs/{get-mock-files-B9fP-17M.js → get-mock-files-Cj3vMTmp.js} +1 -1
  14. package/dist/cjs/information-table.cjs.entry.js +1 -1
  15. package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
  16. package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +1 -1
  17. package/dist/cjs/part-lookup.cjs.entry.js +1 -1
  18. package/dist/cjs/service-booking-form.cjs.entry.js +2 -2
  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 +2 -2
  22. package/dist/cjs/test-drive-form.cjs.entry.js +2 -2
  23. package/dist/cjs/vehicle-accessories_7.cjs.entry.js +8 -8
  24. package/dist/cjs/vehicle-lookup.cjs.entry.js +3 -3
  25. package/dist/cjs/vehicle-quotation-form.cjs.entry.js +18 -16
  26. package/dist/collection/components/components/flexible-container.css +1 -1
  27. package/dist/collection/components/components/information-table.css +1 -1
  28. package/dist/collection/components/components/loading-spinner.css +1 -1
  29. package/dist/collection/components/components/shift-portal.css +1 -1
  30. package/dist/collection/components/components/shift-select.css +1 -1
  31. package/dist/collection/components/components/shift-tab-content.css +1 -1
  32. package/dist/collection/components/components/shift-tabs.css +1 -1
  33. package/dist/collection/components/form-elements/form-inputs.css +1 -1
  34. package/dist/collection/components/forms/vehicle-quotation.js +16 -14
  35. package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
  36. package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
  37. package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
  38. package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
  39. package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
  40. package/dist/collection/components/vehicle-lookup/vehicle-sale-information.css +1 -1
  41. package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -1
  42. package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
  43. package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -1
  44. package/dist/collection/features/form-hook/functions.js +17 -13
  45. package/dist/components/dead-stock-lookup.js +1 -1
  46. package/dist/components/distributor-lookup.js +1 -1
  47. package/dist/components/flexible-container.js +1 -1
  48. package/dist/components/form-checkbox.js +1 -1
  49. package/dist/components/form-date-picker.js +1 -1
  50. package/dist/components/form-file.js +1 -1
  51. package/dist/components/form-input-preview.js +1 -1
  52. package/dist/components/form-input.js +1 -1
  53. package/dist/components/form-phone-number.js +1 -1
  54. package/dist/components/form-picker-input.js +1 -1
  55. package/dist/components/form-select.js +1 -1
  56. package/dist/components/form-shadow-input.js +1 -1
  57. package/dist/components/form-stepper-control.js +1 -1
  58. package/dist/components/form-stepper-submit.js +1 -1
  59. package/dist/components/form-stepper.js +1 -1
  60. package/dist/components/form-structure-error.js +1 -1
  61. package/dist/components/form-structure.js +1 -1
  62. package/dist/components/form-submit.js +1 -1
  63. package/dist/components/form-switch.js +1 -1
  64. package/dist/components/form-text-area.js +1 -1
  65. package/dist/components/form-time-picker.js +1 -1
  66. package/dist/components/form-vin-input.js +1 -1
  67. package/dist/components/general-form.js +1 -1
  68. package/dist/components/general-inquiry-form.js +1 -1
  69. package/dist/components/information-table.js +1 -1
  70. package/dist/components/loading-spinner.js +1 -1
  71. package/dist/components/manufacturer-lookup.js +1 -1
  72. package/dist/components/manufacturer-part-lookup.js +1 -1
  73. package/dist/components/{p-DEM2hIgy.js → p-06PpSY0r.js} +1 -1
  74. package/dist/components/{p-CzSSnZq4.js → p-30txOy_y.js} +1 -1
  75. package/dist/components/{p-CqwOTGw4.js → p-5mG_2OOy.js} +1 -1
  76. package/dist/components/{p-C-d7kN0K.js → p-5qs4uDaJ.js} +1 -1
  77. package/dist/components/{p-B_K-EPZ9.js → p-7AGhzEho.js} +1 -1
  78. package/dist/components/{p-BpOLXV7_.js → p-B2lwoUK5.js} +1 -1
  79. package/dist/components/{p-B-_E_d08.js → p-BUUxvYwf.js} +1 -1
  80. package/dist/components/{p-DP2c7jPd.js → p-BUY9qVMx.js} +1 -1
  81. package/dist/components/{p-CY9FOxIz.js → p-BV1OquJe.js} +1 -1
  82. package/dist/components/{p-DPUhGcwP.js → p-BdqxnYP4.js} +1 -1
  83. package/dist/components/{p-DQXyJFgJ.js → p-Bj2ygQLZ.js} +1 -1
  84. package/dist/components/{p-CrCzcL3W.js → p-BjxCEjBQ.js} +1 -1
  85. package/dist/components/{p-D5lPxGQr.js → p-BqpPyNbD.js} +1 -1
  86. package/dist/components/{p-BnlM0cxH.js → p-BrlBmSQR.js} +1 -1
  87. package/dist/components/{p-FAKXe6SK.js → p-By0M3npW.js} +1 -1
  88. package/dist/components/p-C6PeGOgg.js +5 -0
  89. package/dist/components/{p-43ODoVyL.js → p-CNzTUKEB.js} +1 -1
  90. package/dist/components/{p-BLmef6Eu.js → p-CTNsc8c1.js} +1 -1
  91. package/dist/components/{p-B36KHgxn.js → p-CZWoTJUk.js} +1 -1
  92. package/dist/components/{p-ecmObcUU.js → p-CaQfxae9.js} +1 -1
  93. package/dist/components/{p-Dokx0QgX.js → p-CdXLLROz.js} +1 -1
  94. package/dist/components/{p-DOiAwNG1.js → p-CpYBh3fY.js} +1 -1
  95. package/dist/components/{p-BYGJmyST.js → p-Cs_CRM_L.js} +1 -1
  96. package/dist/components/{p-AVQQouLN.js → p-D-IiXHky.js} +1 -1
  97. package/dist/components/p-DEqxuUV4.js +5 -0
  98. package/dist/components/{p-Bl19uBGg.js → p-DPNzNCfN.js} +1 -1
  99. package/dist/components/{p-eEqj5CsU.js → p-DR2PKhri.js} +1 -1
  100. package/dist/components/{p-Bh2gl-9W.js → p-DSaDRJcg.js} +1 -1
  101. package/dist/components/{p-BxeWKBae.js → p-DbkOsb73.js} +1 -1
  102. package/dist/components/{p-BaMdP3Cj.js → p-Djf8ss4Z.js} +1 -1
  103. package/dist/components/{p-BjY31LlB.js → p-DskaE7Dv.js} +1 -1
  104. package/dist/components/p-Dth6P9w5.js +5 -0
  105. package/dist/components/{p-C0cZkks1.js → p-DuXuuWQu.js} +1 -1
  106. package/dist/components/{p-DVbjwCPX.js → p-DwpWYY23.js} +1 -1
  107. package/dist/components/{p-C_JQwJID.js → p-_0Sj1vUl.js} +1 -1
  108. package/dist/components/{p-BDDpnJFQ.js → p-m5ACfcSk.js} +1 -1
  109. package/dist/components/{p-yXZsvoTm.js → p-tXI_crV8.js} +1 -1
  110. package/dist/components/{p-_kEZrNzs.js → p-xM7H-WwD.js} +1 -1
  111. package/dist/components/part-lookup.js +1 -1
  112. package/dist/components/service-booking-form.js +1 -1
  113. package/dist/components/shift-accordion.js +1 -1
  114. package/dist/components/shift-portal.js +1 -1
  115. package/dist/components/shift-select.js +1 -1
  116. package/dist/components/shift-slider.js +1 -1
  117. package/dist/components/shift-tab-content.js +1 -1
  118. package/dist/components/shift-tabs.js +1 -1
  119. package/dist/components/ssc-lookup-form.js +1 -1
  120. package/dist/components/test-drive-form.js +1 -1
  121. package/dist/components/vehicle-accessories.js +1 -1
  122. package/dist/components/vehicle-claimable-items.js +1 -1
  123. package/dist/components/vehicle-item-claim-form.js +1 -1
  124. package/dist/components/vehicle-lookup.js +1 -1
  125. package/dist/components/vehicle-paint-thickness.js +1 -1
  126. package/dist/components/vehicle-quotation-form.js +1 -1
  127. package/dist/components/vehicle-sale-information.js +1 -1
  128. package/dist/components/vehicle-service-history.js +1 -1
  129. package/dist/components/vehicle-specification.js +1 -1
  130. package/dist/components/vehicle-warranty-details.js +1 -1
  131. package/dist/esm/dead-stock-lookup_3.entry.js +2 -2
  132. package/dist/esm/flexible-container.entry.js +1 -1
  133. package/dist/esm/form-checkbox.entry.js +1 -1
  134. package/dist/esm/form-date-picker.entry.js +1 -1
  135. package/dist/esm/form-dialog_13.entry.js +12 -12
  136. package/dist/esm/form-input_7.entry.js +6 -6
  137. package/dist/esm/form-switch.entry.js +1 -1
  138. package/dist/esm/form-time-picker.entry.js +1 -1
  139. package/dist/esm/{functions-D7NlqKlJ.js → functions-fJpet8ST.js} +18 -14
  140. package/dist/esm/general-form.entry.js +2 -2
  141. package/dist/esm/general-inquiry-form.entry.js +2 -2
  142. package/dist/esm/{get-local-language-BJ17wmuS.js → get-local-language-hPU2z-LE.js} +1 -1
  143. package/dist/esm/{get-mock-files-DXrQXv5Z.js → get-mock-files-BECwjBHt.js} +1 -1
  144. package/dist/esm/information-table.entry.js +1 -1
  145. package/dist/esm/loading-spinner.entry.js +1 -1
  146. package/dist/esm/manufacturer-part-lookup.entry.js +1 -1
  147. package/dist/esm/part-lookup.entry.js +1 -1
  148. package/dist/esm/service-booking-form.entry.js +2 -2
  149. package/dist/esm/shift-tab-content.entry.js +1 -1
  150. package/dist/esm/shift-tabs_2.entry.js +2 -2
  151. package/dist/esm/ssc-lookup-form.entry.js +2 -2
  152. package/dist/esm/test-drive-form.entry.js +2 -2
  153. package/dist/esm/vehicle-accessories_7.entry.js +8 -8
  154. package/dist/esm/vehicle-lookup.entry.js +3 -3
  155. package/dist/esm/vehicle-quotation-form.entry.js +18 -16
  156. package/dist/shift-components/{p-87379b2d.entry.js → p-0881c2c4.entry.js} +1 -1
  157. package/dist/shift-components/{p-9329b740.entry.js → p-1691c4a2.entry.js} +1 -1
  158. package/dist/shift-components/{p-48f90a7a.entry.js → p-172f3860.entry.js} +1 -1
  159. package/dist/shift-components/{p-1b232b56.entry.js → p-2de20bde.entry.js} +1 -1
  160. package/dist/shift-components/{p-9e8c5086.entry.js → p-3893490a.entry.js} +1 -1
  161. package/dist/shift-components/{p-f34259cf.entry.js → p-3f68b714.entry.js} +1 -1
  162. package/dist/shift-components/p-5042c40f.entry.js +5 -0
  163. package/dist/shift-components/{p-b2953bb3.entry.js → p-5532d454.entry.js} +1 -1
  164. package/dist/shift-components/{p-a1796f28.entry.js → p-5ee91770.entry.js} +1 -1
  165. package/dist/shift-components/{p-be530654.entry.js → p-7007a63e.entry.js} +1 -1
  166. package/dist/shift-components/{p-e8a3d36c.entry.js → p-7b168988.entry.js} +1 -1
  167. package/dist/shift-components/{p-0940f715.entry.js → p-7e12e52c.entry.js} +1 -1
  168. package/dist/shift-components/{p-36bec68b.entry.js → p-7fe65640.entry.js} +1 -1
  169. package/dist/shift-components/{p-231d3333.entry.js → p-98ed617d.entry.js} +1 -1
  170. package/dist/shift-components/{p-Y2flmXwm.js → p-BEJlFbxp.js} +1 -1
  171. package/dist/shift-components/p-CA3r4AKs.js +5 -0
  172. package/dist/shift-components/{p-CNLbMjEP.js → p-Dbvud7l3.js} +1 -1
  173. package/dist/shift-components/{p-58f4a189.entry.js → p-a1a4f076.entry.js} +1 -1
  174. package/dist/shift-components/{p-605c322a.entry.js → p-a29147ac.entry.js} +1 -1
  175. package/dist/shift-components/{p-ea64baf9.entry.js → p-ac16fc11.entry.js} +1 -1
  176. package/dist/shift-components/{p-d6dfd1e3.entry.js → p-b5104e81.entry.js} +1 -1
  177. package/dist/shift-components/{p-e03ab1c6.entry.js → p-cc65284e.entry.js} +1 -1
  178. package/dist/shift-components/{p-ff3a35b2.entry.js → p-d0c0e943.entry.js} +1 -1
  179. package/dist/shift-components/{p-3fb91268.entry.js → p-d31d0149.entry.js} +1 -1
  180. package/dist/shift-components/{p-6549214a.entry.js → p-d674327e.entry.js} +1 -1
  181. package/dist/shift-components/shift-components.esm.js +1 -1
  182. package/package.json +1 -1
  183. package/dist/components/p-C_caRW2s.js +0 -5
  184. package/dist/components/p-D20qPwBv.js +0 -5
  185. package/dist/components/p-DDBNQkdo.js +0 -5
  186. package/dist/shift-components/p-8cc077bf.entry.js +0 -5
  187. package/dist/shift-components/p-CvHo3UBf.js +0 -5
@@ -1,5 +0,0 @@
1
- /*!
2
- * Built by ShiftSoftware
3
- * Copyright (c)
4
- */
5
- import"./index.js";import{v as e}from"./p-BaMdP3Cj.js";const t={"part-lookup":"generated/standard-dealer/part-lookup.json","vehicle-lookup":"generated/standard-dealer/vehicle-lookup.json"},o={};async function n(n,r=""){const a=t[n];if(!a||!a.length)throw new Error(`Mock file not found for: ${n}`);const c=await async function(t,n){if(o[t])return await o[t];try{let r;r=n&&n.trim().length?n:`https://cdn.jsdelivr.net/npm/adp-web-components@${e}/dist/mocks/${t}`;const a=fetch(r).then((e=>(e.ok||delete o[t],e.json())));o[t]=a;const c=await a,s=Object.keys(c).length;return console.log(`✅ Loaded mock: ${t} (${s} items)`),console.table(Object.entries(c).map((([e,t])=>({key:e,value:t})))),o[t]=c,c}catch(e){return delete o[t],{}}}(a,r);return c}export{n as g}
@@ -1,5 +0,0 @@
1
- /*!
2
- * Built by ShiftSoftware
3
- * Copyright (c)
4
- */
5
- import{h as e,r as t,H as i,a}from"./p-jNkxdTjc.js";import{L as o}from"./p-CAlGd4kD.js";import{c as n}from"./p-BK16Cn81.js";import{c as l,b as r,s}from"./p-BDhR4pDq.js";import{a as c,b as d,c as h,d as u,g as p,e as v,h as m,i as f,j as w}from"./p-CvHo3UBf.js";import{g as b}from"./p-B03BLbR_.js";import"./p-CNLbMjEP.js";const g={};let y="";const x=({form:t})=>{var i,a,l,r;t.addWatcher("vehicle");let s=t.getValue("vehicle"),c=!!s;const d=null===(i=t.context.vehicleList)||void 0===i?void 0:i.find((e=>e.value===s));let h;d?(h=null===(a=null==d?void 0:d.meta)||void 0===a?void 0:a.image,s=d.value):t.context.vehicleList&&t.context.vehicleList[0]&&(h=null===(r=null===(l=t.context.vehicleList[0])||void 0===l?void 0:l.meta)||void 0===r?void 0:r.image,s=t.context.vehicleList[0].value);let u=!1;return g[s]?y=g[s]:t&&h&&s&&(((e,t,i)=>{fetch(t).then((e=>e.blob())).then((t=>{const a=new FileReader;a.onloadend=()=>{g[i]=a.result,e.rerender({rerenderForm:!0})},a.readAsDataURL(t)})).catch((e=>{console.log(e)}))})(t,h,s),u=!0),e("flexible-container",{isOpened:c},e("div",{style:{"min-height":"60px"},part:"vehicle-image-wrapper",class:n("vehicle-image-wrapper",{loading:u})},e("div",{part:n("vehicle-image-loading-wrapper",{"vehicle-image-active-loading-wrapper":u}),class:"loading-wrapper"},e(o,{part:"vehicle-image-loader-icon",class:"img"})),e("img",{alt:"vehicle image",part:"vehicle-image",src:y,style:{"border-radius":"6px",transition:"opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);",opacity:u?"0":"1"}})))},j={submit:({props:t})=>e("form-submit",Object.assign({},t)),name:({props:t})=>e("form-input",Object.assign({},t)),phone:({props:t,isLoading:i})=>e("form-phone-number",Object.assign({isLoading:i},t)),vehicle:({form:t,language:i,props:a})=>{var o;let n;return n=a.defaultValue?a.defaultValue:new URLSearchParams(window.location.search).get(null===(o=t.context.structure.data)||void 0===o?void 0:o.vehicleIdQueryParam),e("form-select",Object.assign({},a,{defaultValue:n,searchable:!0,fetcher:async({signal:e})=>{var a,o,n;const l=null===(a=t.context.structure)||void 0===a?void 0:a.data.vehicleApi,r=await fetch(l,{signal:e,headers:{"Accept-Language":i}});return(null===(n=null===(o=t.context.structure)||void 0===o?void 0:o.data)||void 0===n?void 0:n.vehiclesApiStrapiFormat)?(await r.json()).data.map((e=>{var t,i,a,o,n,l;return{label:(null==e?void 0:e.GradeName)||(null===(t=null==e?void 0:e.attributes)||void 0===t?void 0:t.GradeName),value:`${e.id}`,meta:Object.assign(Object.assign({},e),{image:(null===(i=null==e?void 0:e.Cover)||void 0===i?void 0:i.url)||(null===(l=null===(n=null===(o=null===(a=null==e?void 0:e.attributes)||void 0===a?void 0:a.Cover)||void 0===o?void 0:o.data)||void 0===n?void 0:n.attributes)||void 0===l?void 0:l.url)})}})):(await r.json()).map((e=>({label:e.Title,value:`${e.ID}`,meta:Object.assign(Object.assign({},e),{image:e.Image})})))},language:i}))},dealer:({form:t,language:i,props:a})=>e("form-select",Object.assign({},a,{clearable:!0,searchable:!0,fetcher:async({signal:e})=>{var a;const o=null===(a=t.context.structure)||void 0===a?void 0:a.data.dealerApi,n=await fetch(o,{signal:e,headers:{"Accept-Language":i}});return(await n.json()).map((e=>({label:e.Name,value:`${e.ID}`,meta:Object.assign({},e)})))},language:i})),paymentType:({language:t,props:i,locale:a})=>e("form-select",Object.assign({},i,{clearable:!0,fetcher:async({})=>[{value:"Cash",label:null==a?void 0:a.Cash},{value:"Installments",label:a.Installments},{value:"Flexible",label:a.Flexible}],language:t})),contactTime:({language:t,props:i,locale:a})=>e("form-select",Object.assign({},i,{clearable:!0,fetcher:async({})=>[{value:"Morning",label:null==a?void 0:a.Morning},{value:"Noon",label:null==a?void 0:a.Noon},{value:"Afternoon",label:null==a?void 0:a.Afternoon}],language:t})),ownVehicle:({language:t,props:i,locale:a})=>e("form-select",Object.assign({},i,{fetcher:async({})=>[{value:"yes",label:null==a?void 0:a.Yes},{value:"no",label:null==a?void 0:a.No}],language:t})),currentVehicleBrand:({form:t,language:i,props:a,locale:o})=>{t.addWatcher("ownVehicle");const n="yes"===t.getValue("ownVehicle");return e("form-select",Object.assign({},a,{searchable:!0,fetcher:async({signal:e})=>{var i;const a=null===(i=t.context.structure)||void 0===i?void 0:i.data.currentVehiclesApi,n=await fetch(a,{signal:e,headers:{"Accept-Language":"en"}});return[...(await n.json()).filter((e=>"Other"!==e.name)).map((e=>({label:e.Name,value:`${e.ID}`,meta:Object.assign({},e)}))),{value:"Other",label:o.Other}]},language:i,resetKey:n,isRequired:n,isDisabled:!n}))},currentVehicleModel:({form:t,language:i,props:a,locale:o})=>{t.addWatcher("ownVehicle"),t.addWatcher("currentVehicleBrand");const n="yes"===t.getValue("ownVehicle"),l=t.getValue("currentVehicleBrand");return e("form-select",Object.assign({},a,{searchable:!0,fetcher:async({})=>{var e,i;if(!l)return[];const a=null===(i=null===(e=t.context.currentVehicleBrandList)||void 0===e?void 0:e.find((e=>e.value===l)))||void 0===i?void 0:i.meta;return a?[...null==a?void 0:a.Models.map((e=>({label:e.Name,value:`${e.ID}`}))),{value:"Other",label:o.Other}]:[]},language:i,resetKey:l,fetcherKey:l,isRequired:n&&"Other"!==l,isDisabled:!l||"Other"===l}))},vehicleImage:({form:t})=>e(x,{form:t}),choose:({locale:t})=>e("h1",{part:"section-title"},t.Choose),"current car":({locale:t})=>e("h1",{part:"section-title"},t["Your current car"]),"contact information":({locale:t})=>e("h1",{part:"section-title"},t["Contact Information"]),city:({form:t,language:i,props:a})=>e("form-select",Object.assign({},a,{clearable:!0,searchable:!0,fetcher:async({signal:e})=>{var a;const o=null===(a=t.context.structure)||void 0===a?void 0:a.data.cityApi,n=await fetch(o,{signal:e,headers:{"Accept-Language":i}});return(await n.json()).map((e=>({label:e.Name,value:`${e.ID}`,meta:Object.assign({},e)})))},language:i}))},k=l({vehicle:r().meta({label:"Vehicle",placeholder:"Please select a Vehicle"}).required("This field is required."),name:r().meta({label:"Full name",placeholder:"Full name"}).required("Full name is required").min(3,"Full name minimum"),dealer:r().meta({label:"Dealer",placeholder:"Select a dealer"}).required("Dealer is required"),city:r().meta({label:"City",placeholder:"Select a City"}).required("This field is required."),paymentType:r().meta({label:"Preferred purchasing method",placeholder:"Select the purchasing method"}).when("$paymentTypeRequired",{is:!0,otherwise:e=>e.optional(),then:e=>e.required("This field is required.")}),contactTime:r().meta({label:"Preferred contact time",placeholder:"Please select a time"}).when("$contactTimeRequired",{is:!0,otherwise:e=>e.optional(),then:e=>e.required("This field is required.")}),ownVehicle:r().meta({label:"Do you own a vehicle?",placeholder:"Do you own a vehicle?"}).when("$ownVehicleRequired",{is:!0,otherwise:e=>e.optional(),then:e=>e.required("This field is required.")}),currentVehicleBrand:r().meta({label:"Your current vehicle",placeholder:"Your current vehicle"}).when("ownVehicle",{is:e=>"yes"===e,then:e=>e.required("Please answer this field"),otherwise:e=>e.optional()}),currentVehicleModel:r().meta({label:"Vehicle Model",placeholder:"Vehicle Model"}).when(["ownVehicle","currentVehicleBrand"],{is:(e,t)=>"yes"===e&&"Other"!==t,then:e=>e.required("Please answer this field"),otherwise:e=>e.optional()})}),O=class{constructor(e){t(this,e),this.locale={sharedFormLocales:s.getDefault()},this.isLoading=!1,this.structureRendered=!1,this.isDev=!1,this.isMobileForm=!1}async changeLanguage(e){await c(this,e)}setIsLoading(e){d(this,e)}setErrorCallback(e){h(this,e)}setSuccessCallback(e){u(this,e)}async componentWillLoad(){this.language||(this.language=b())}async formSubmit(e){var t,i,a,o,n,l,r,s,c,d,h,u,v,m,f,w,b,g,y,x,j,k,O,V,L,z,T;try{this.setIsLoading(!0);const q=null===(i=null===(t=this.structure)||void 0===t?void 0:t.data)||void 0===i?void 0:i.nameContactedVehicles,C=p(this.structure);let M=Object.assign({name:e.name,phone:e.phone,companyBranchId:e.dealer,cityId:null==e?void 0:e.city,vehicleQuotationType:null===(o=null===(a=this.structure)||void 0===a?void 0:a.data)||void 0===o?void 0:o.quotationType,preferredContactTime:(null==e?void 0:e.contactTime)||"NotSpecified",preferredPaymentMethod:(null==e?void 0:e.paymentType)||"Flexible"},C);if(q){if(M.vehicle=(null===(n=this.vehicleList.find((t=>t.value===e.vehicle)))||void 0===n?void 0:n.label)||"","yes"===(null==e?void 0:e.ownVehicle)){const t=(null===(l=this.currentVehicleBrandList.find((t=>t.value===e.currentVehicleBrand)))||void 0===l?void 0:l.meta)||!1;let i;t&&(i=t.Models.find((t=>`${t.ID}`===e.currentVehicleModel))||!1),M.currentOrTradeInVehicle=`${(null==t?void 0:t.Name)||this.locale.Other} - ${(null==i?void 0:i.Name)||this.locale.Other}`}}else M.vehicle=e.vehicle,M.additionalData={DoYouOwnAVehicle:"yes"===(null==e?void 0:e.ownVehicle)},"yes"===(null==e?void 0:e.ownVehicle)&&(M.additionalData.yourCurrentVehicle=(null==e?void 0:e.currentVehicleBrand)||this.locale.Other,M.additionalData.vehicleModel=(null==e?void 0:e.currentVehicleModel)||this.locale.Other);const F={Brand:null===(s=null===(r=this.structure)||void 0===r?void 0:r.data)||void 0===s?void 0:s.brandId,"Accept-Language":this.localeLanguage||"en","Content-Type":"application/json"};let S="";if(this.isMobileForm){const e=await this.getMobileToken();e.toLowerCase().startsWith("bearer")?(F.Authorization=e,S=null===(d=null===(c=this.structure)||void 0===c?void 0:c.data)||void 0===d?void 0:d.requestAppUrl):(F["verification-token"]=e,S=null===(u=null===(h=this.structure)||void 0===h?void 0:h.data)||void 0===u?void 0:u.requestAppCheckUrl)}else{S=null===(m=null===(v=this.structure)||void 0===v?void 0:v.data)||void 0===m?void 0:m.requestUrl;const e=await grecaptcha.execute(null===(w=null===(f=this.structure)||void 0===f?void 0:f.data)||void 0===w?void 0:w.recaptchaKey,{action:"submit"});F["Recaptcha-Token"]=e}this.isDev&&(S=S.replaceAll("production=true","production=false")),(null===(g=null===(b=this.structure)||void 0===b?void 0:b.data)||void 0===g?void 0:g.extraPayload)&&(M=Object.assign(Object.assign({},M),null===(x=null===(y=this.structure)||void 0===y?void 0:y.data)||void 0===x?void 0:x.extraPayload));const $=await fetch(S,{headers:F,method:"POST",body:JSON.stringify(M)});if(!(null==$?void 0:$.ok)){const e=($.headers.get("content-type")||"").includes("application/json")?null!==(T=null===(z=null===(L=await $.json().catch((()=>({}))))||void 0===L?void 0:L.message)||void 0===z?void 0:z.body)&&void 0!==T?T:"":await $.text().catch((()=>""));throw new Error(e)}{const t=await(null==$?void 0:$.json().catch((()=>({})))),i=null===(k=null===(j=this.structure)||void 0===j?void 0:j.data)||void 0===k?void 0:k.pushAnalyticsEventTo;i&&(window[i]=window[i]||[],window[i].push({event:"get_a_quote",phone:e.phone,fullname:e.name,dealer:null===(O=this.dealerList.find((t=>t.value===e.dealer)))||void 0===O?void 0:O.label,vehicle:null===(V=this.vehicleList.find((t=>t.value===e.vehicle)))||void 0===V?void 0:V.label})),this.setSuccessCallback(t),setTimeout((()=>{this.form.reset(),this.form.rerender({rerenderForm:!0,rerenderAll:!0})}),100)}}catch(e){console.error(e),this.setErrorCallback(e)}finally{this.setIsLoading(!1)}}async componentDidLoad(){await v(this,k)}async getForm(){return await m(this)}async submit(){await f(this)}async structureChanged(e){await w(this,e)}render(){var t,a;return e(i,{key:"fdc919a8b52675e1dd598408cc7f056d992c1517",translate:"no"},e("div",{key:"d11a5531f061e778038eedea7cca02b0ad834332",part:`shift-form vehicle-quotation-${null===(a=null===(t=this.structure)||void 0===t?void 0:t.data)||void 0===a?void 0:a.theme}`},e("div",{key:"abac151f3be810dbd850b63e7c692afe4e5f14fe",part:"form-container",class:"relative min-h-[150px]"},e("div",{key:"e6dcec2bd78ddef371e3adb5f249b4c3e7e8587c",part:"form-loader-container",class:n("form-loader-container absolute top-0 left-0 w-full h-full pointer-events-none flex justify-center items-center transition-opacity duration-500",{"opacity-0":this.structureRendered})},e(o,{key:"155668175e0735e2314ce55b586bd82df4a3c2df",part:"form-loader-icon",class:"img"})),e("flexible-container",{key:"61dea530ef1a00cd09a2b2871262573e8b1248a3",onlyForMounting:!0,isOpened:this.structureRendered},!!this.form&&e("form-structure",{key:"572c108a4d67e1443ca9f90585fa3339a5ffaea5",form:this.form,fields:this.fields,formId:this.formId,formLocale:this.locale,structure:this.structure,isLoading:this.isLoading,language:this.localeLanguage,errorMessage:this.errorMessage,formElementMapper:j,successMessage:this.locale["Form submitted successfully."]},e("slot",{key:"8e0b1e969144912d4ce5c87edb8d7ede708be3e0"}))))))}get el(){return a(this)}static get watchers(){return{language:["changeLanguage"],structureRendered:["structureChanged"]}}};O.style='*,: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.17 | 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}.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))}:host{all:initial!important;display:block;font-family:inherit!important}@keyframes spin{to{transform:rotate(1turn)}}.form-loader-container .img{animation:spin 2s linear infinite;height:32px;width:32px}*{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pointer-events-none{pointer-events:none}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.top-0{top:0}.flex{display:flex}.h-full{height:100%}.min-h-\\[150px\\]{min-height:150px}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.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-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-500{transition-duration:.5s}.\\!h-auto{height:auto!important}.min-w-full{min-width:100%}.resize{resize:both}.overflow-hidden{overflow:hidden}.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-none{transition-property:none!important}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-0{transition-duration:0s!important}.\\!duration-500{transition-duration:.5s!important}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.cursor-pointer{cursor:pointer}';export{O as vehicle_quotation_form}
@@ -1,5 +0,0 @@
1
- /*!
2
- * Built by ShiftSoftware
3
- * Copyright (c)
4
- */
5
- import{F as o}from"./p-B03BLbR_.js";import"./p-BDhR4pDq.js";import{b as i}from"./p-CNLbMjEP.js";import{d as t}from"./p-CAlGd4kD.js";const n=async o=>{try{const i=await fetch(`https://api.github.com/gists/${o}`,{headers:{Accept:"application/vnd.github+json"}});if(!i.ok)throw new Error(`GitHub API error: ${i.status} ${i.statusText}`);const t=await i.json(),n=Object.values(t.files).find((o=>null==o?void 0:o.filename.endsWith(".json")));if(!n)throw new Error("No JSON file found in this gist");return function(o){try{let i=o.trim();return i=i.replace(/,\s*([}\]])/g,"$1"),i=i.replace(/([{,]\s*)([A-Za-z_]\w*)\s*:/g,'$1"$2":'),i=i.replace(/'([^'\\]*(?:\\.[^'\\]*)*)'/g,((o,i)=>`"${i.replace(/"/g,'\\"')}"`)),JSON.parse(i)}catch(o){return console.error("Failed to parse loose JSON content:",o.message),null}}(null==n?void 0:n.content)}catch(o){console.error("Error fetching gist JSON:",o.message)}};async function l(o){const i=await fetch(o);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return await i.json()}const e=async(o,t)=>{var n,l,e,d,a;const r=await i(t),c=null===(l=null===(n=o.structure)||void 0===n?void 0:n.data)||void 0===l?void 0:l.localization,v="object"==typeof c&&null!==(d=null!==(e=null==c?void 0:c[t])&&void 0!==e?e:null==c?void 0:c.en)&&void 0!==d?d:{};o.locale=Object.assign(Object.assign({},v),{sharedFormLocales:Object.assign(Object.assign({},r),null==v?void 0:v.sharedFormLocales)}),o.localeLanguage=t,null===(a=o.form)||void 0===a||a.rerender({rerenderAll:!0})},d=async(o,i)=>{var t,n,l;const e=i.message||(null===(l=null===(n=null===(t=o.locale)||void 0===t?void 0:t.sharedFormLocales)||void 0===n?void 0:n.errors)||void 0===l?void 0:l.wildCard)||"";let d=!0;(null==o?void 0:o.errorCallback)&&(d=!!await o.errorCallback(i,e)),d&&(o.errorMessage=e)},a=async(o,i)=>{o.isLoading=i,o.loadingChanges&&o.loadingChanges(i)},r=async(o,i)=>{let t=!0;if(o.successCallback&&(t=!!await o.successCallback(i,o.locale["Form submitted successfully."]||"")),t&&o.form.openDialog(),!o.disableScrollToTop){const i=o.el.shadowRoot||o.el,t=-100,n=(i instanceof ShadowRoot?i.firstElementChild:i).getBoundingClientRect().top+window.pageYOffset+t;window.scrollTo({top:Math.max(n,0),behavior:"smooth"})}},c=async(i,t)=>{var e,d;if(!i.structure)if(i.gistId){const[o]=await Promise.all([n(i.gistId),i.changeLanguage(i.language)]);i.structure=o}else if(i.structureUrl){const[o]=await Promise.all([l(i.structureUrl),i.changeLanguage(i.language)]);i.structure=o}if(i.localeLanguage=i.language,await i.changeLanguage(i.language),!i.isMobileForm)try{const o=null===(d=null===(e=i.structure)||void 0===e?void 0:e.data)||void 0===d?void 0:d.recaptchaKey;if(o){const t=document.createElement("script");t.src=`https://www.google.com/recaptcha/api.js?render=${o}&hl=${i.language}`,t.async=!0,t.defer=!0,document.head.appendChild(t)}}catch(o){console.log(o)}i.form=new o(i,t)},v=async o=>{if(o.form)return o.form},s=async o=>{if(o.form)return o.form.submit()},u=async(o,i)=>{var t;i&&(null===(t=o.formReadyCallback)||void 0===t||t.call(o))},f=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","fbclid"],m=o=>{var i;if(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.disableUTMLog)return{};const t=new URLSearchParams(window.location.search);if("string"==typeof t.get("disable_utm_log")&&"true"===t.get("disable_utm_log"))return{};const n={};return f.forEach((o=>{t.get(o)&&(n[o]=t.get(o))})),n},b={formLanguageChange:e,formErrorHandler:d,handleFormSubmit:s,formLoadingHandler:a,formSuccessHandler:r,formDidLoadHandler:c,formGetFormHandler:v,onFormSubmit:async({context:o,formValues:i,middleware:n,afterSuccess:l})=>{var e,d,a,r,c,v,s,u,f,b,w,j,p,h,O,g,y,S,$,_,A,E,H,L,P,F,N,R,T,D,J,B,C,G,q,x,M;try{o.setIsLoading(!0),Object.keys(i).forEach((t=>{o[`${t}-format`]&&(i[t]=o[`${t}-format`])}));const k=!!(null===(d=null===(e=o.structure)||void 0===e?void 0:e.data)||void 0===d?void 0:d.truncatedFields)&&!!(null===(c=Object.keys(null===(r=null===(a=o.structure)||void 0===a?void 0:a.data)||void 0===r?void 0:r.truncatedFields))||void 0===c?void 0:c.length);let z={};const I=m(null==o?void 0:o.structure);let U=Object.assign({},i);(null===(s=null===(v=o.structure)||void 0===v?void 0:v.data)||void 0===s?void 0:s.extraPayload)&&(U=Object.assign(Object.assign({},U),null===(f=null===(u=o.structure)||void 0===u?void 0:u.data)||void 0===f?void 0:f.extraPayload)),k&&(U.additionalData=Object.assign({},z)),(null==o?void 0:o.extraPayload)&&(U=Object.assign(Object.assign({},U),null==o?void 0:o.extraPayload)),k&&Object.entries(null===(w=null===(b=o.structure)||void 0===b?void 0:b.data)||void 0===w?void 0:w.truncatedFields).forEach((([o,i])=>{if(Array.isArray(i)){let t="";i.forEach((o=>{t+=U[o.toString()]||o.toString()})),U=Object.assign(Object.assign({},U),{[o]:t})}else if("string"==typeof i&&i)if(o.startsWith("parse date: ")){let n=o.replaceAll("parse date: ","");U[n]=t.parse(U[n],i,new Date)}else if(o.startsWith("format date: ")){let i=o.replaceAll("format date: ","");U[i]=t.formatISO(U[i])}else z[i]=U[o],delete U[o]}));let V={"Content-Type":"application/json",Brand:null===(p=null===(j=o.structure)||void 0===j?void 0:j.data)||void 0===p?void 0:p.brandId,"Accept-Language":o.localeLanguage||"en"};(null==o?void 0:o.extraHeader)&&(V=Object.assign(Object.assign({},V),null==o?void 0:o.extraHeader)),(null===(O=null===(h=o.structure)||void 0===h?void 0:h.data)||void 0===O?void 0:O.extraHeader)&&(V=Object.assign(Object.assign({},V),null===(y=null===(g=o.structure)||void 0===g?void 0:g.data)||void 0===y?void 0:y.extraHeader));let Z="";if(o.isMobileForm){const i=await o.getMobileToken();i.toLowerCase().startsWith("bearer")?(V.Authorization=i,Z=null===($=null===(S=o.structure)||void 0===S?void 0:S.data)||void 0===$?void 0:$.requestAppUrl):(V["verification-token"]=i,Z=null===(A=null===(_=o.structure)||void 0===_?void 0:_.data)||void 0===A?void 0:A.requestAppCheckUrl)}else if(Z=null===(H=null===(E=o.structure)||void 0===E?void 0:E.data)||void 0===H?void 0:H.requestUrl,null===(P=null===(L=o.structure)||void 0===L?void 0:L.data)||void 0===P?void 0:P.recaptchaKey){const i=await grecaptcha.execute(null===(N=null===(F=o.structure)||void 0===F?void 0:F.data)||void 0===N?void 0:N.recaptchaKey,{action:"submit"});V["Recaptcha-Token"]=i}if(o.isDev&&(Z=Z.replaceAll("production=true","production=false")),!Z)throw new Error("Request endpoint is not configured");const K=(null===(T=null===(R=o.structure)||void 0===R?void 0:R.data)||void 0===T?void 0:T.requestMethod)||"POST";if(["get","head"].includes(K.toLowerCase())?V=Object.assign(Object.assign({},V),I):U=Object.assign(Object.assign({},U),I),n){const o=n(U,V,Z);U=Object.assign({},o.payload),V=Object.assign({},o.header),Z=o.url}Object.values(o.form.pendingRequests).forEach((async o=>{try{await o()}catch(o){console.error(o)}}));const Q=await fetch(Z,Object.assign({headers:V,method:(null===(J=null===(D=o.structure)||void 0===D?void 0:D.data)||void 0===J?void 0:J.requestMethod)||"POST"},"get"===(null===(G=null===(C=null===(B=o.structure)||void 0===B?void 0:B.data)||void 0===C?void 0:C.requestMethod)||void 0===G?void 0:G.toLowerCase())?{}:{body:JSON.stringify(U)}));if(!Q.ok){const o=(Q.headers.get("content-type")||"").includes("application/json")?null!==(M=null===(x=null===(q=await Q.json().catch((()=>({}))))||void 0===q?void 0:q.message)||void 0===x?void 0:x.body)&&void 0!==M?M:"":await Q.text().catch((()=>""));throw new Error(o)}{const i=await Q.json().catch((()=>({})));l&&await l(U,V),o.setSuccessCallback(i),setTimeout((()=>{o.form.reset(),o.form.rerender({rerenderForm:!0,rerenderAll:!0})}),100)}}catch(i){console.error(i),o.setErrorCallback(i)}finally{o.setIsLoading(!1)}},formStructureRenderedHandler:u};export{e as a,a as b,d as c,r as d,c as e,b as f,m as g,v as h,s as i,u as j}