adp-web-components 0.3.19 → 0.3.21
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/{branch-slot-dropdown_15.cjs.entry.js → branch-date-dropdown_17.cjs.entry.js} +961 -70
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +9 -9
- package/dist/cjs/flexible-container.cjs.entry.js +3 -3
- package/dist/cjs/form-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/form-date-picker.cjs.entry.js +5 -5
- package/dist/cjs/form-input_7.cjs.entry.js +19 -17
- package/dist/cjs/form-switch.cjs.entry.js +2 -2
- package/dist/cjs/form-time-picker.cjs.entry.js +6 -6
- package/dist/cjs/{functions-DL7oNhTD.js → functions-COlPGX7F.js} +44 -19
- package/dist/cjs/general-form.cjs.entry.js +6 -6
- package/dist/cjs/general-inquiry-form.cjs.entry.js +6 -6
- package/dist/cjs/{get-local-language-BuK1vyX4.js → get-local-language-rWhci9Es.js} +1 -1
- package/dist/cjs/{get-mock-files-D0TNQtTV.js → get-mock-files-Cceb_318.js} +1 -1
- package/dist/cjs/information-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +2 -2
- package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +3 -3
- package/dist/cjs/{mappers-BlH-TAo7.js → mappers-DnWgECCv.js} +54 -18
- package/dist/cjs/part-lookup.cjs.entry.js +2 -2
- package/dist/cjs/service-booking-form.cjs.entry.js +6 -6
- package/dist/cjs/shift-accordion.cjs.entry.js +1 -1
- package/dist/cjs/shift-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/shift-components.cjs.js +1 -1
- package/dist/cjs/shift-slider.cjs.entry.js +1 -1
- package/dist/cjs/shift-switch.cjs.entry.js +2 -2
- package/dist/cjs/shift-tab-content.cjs.entry.js +2 -2
- package/dist/cjs/shift-tabs_2.cjs.entry.js +10 -10
- package/dist/cjs/ssc-lookup-form.cjs.entry.js +6 -6
- package/dist/cjs/test-drive-form.cjs.entry.js +6 -6
- package/dist/cjs/vehicle-accessories_8.cjs.entry.js +21 -21
- package/dist/cjs/vehicle-lookup.cjs.entry.js +3 -3
- package/dist/cjs/vehicle-quotation-form.cjs.entry.js +17 -18
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/components/empty.css +1 -1
- package/dist/collection/components/components/flexible-container.css +1 -1
- package/dist/collection/components/components/flexible-container.js +2 -2
- package/dist/collection/components/components/information-table.css +1 -1
- package/dist/collection/components/components/loading-spinner.css +1 -1
- package/dist/collection/components/components/loading-spinner.js +1 -1
- package/dist/collection/components/components/shift-accordion.js +1 -1
- package/dist/collection/components/components/shift-checkbox.js +1 -1
- package/dist/collection/components/components/shift-portal.css +1 -1
- package/dist/collection/components/components/shift-select-dropdown.js +2 -2
- package/dist/collection/components/components/shift-select.js +3 -3
- package/dist/collection/components/components/shift-slider.js +1 -1
- package/dist/collection/components/components/shift-switch.js +1 -1
- package/dist/collection/components/components/shift-tab-content.css +1 -1
- package/dist/collection/components/components/shift-tab-content.js +1 -1
- package/dist/collection/components/components/shift-tabs.css +1 -1
- package/dist/collection/components/components/shift-tabs.js +2 -2
- package/dist/collection/components/form-elements/branch-date-dropdown.css +1 -0
- package/dist/collection/components/form-elements/branch-date-dropdown.js +682 -0
- package/dist/collection/components/form-elements/branch-date-picker.css +1 -0
- package/dist/collection/components/form-elements/branch-date-picker.js +1197 -0
- package/dist/collection/components/form-elements/branch-slot-dropdown.css +1 -1
- package/dist/collection/components/form-elements/branch-slot-dropdown.js +11 -6
- package/dist/collection/components/form-elements/branch-slot-picker.css +1 -1
- package/dist/collection/components/form-elements/branch-slot-picker.js +166 -18
- package/dist/collection/components/form-elements/form-checkbox.js +1 -1
- package/dist/collection/components/form-elements/form-date-picker-legacy.js +4 -4
- package/dist/collection/components/form-elements/form-dialog.css +1 -1
- package/dist/collection/components/form-elements/form-dialog.js +1 -1
- package/dist/collection/components/form-elements/form-file.js +2 -2
- package/dist/collection/components/form-elements/form-input.js +6 -4
- package/dist/collection/components/form-elements/form-inputs.css +1 -1
- package/dist/collection/components/form-elements/form-phone-number.js +4 -2
- package/dist/collection/components/form-elements/form-picker-input.js +6 -4
- package/dist/collection/components/form-elements/form-shadow-input.js +1 -1
- package/dist/collection/components/form-elements/form-stepper-control.js +2 -2
- package/dist/collection/components/form-elements/form-stepper-submit.js +2 -2
- package/dist/collection/components/form-elements/form-stepper.js +1 -1
- package/dist/collection/components/form-elements/form-structure-error.js +1 -1
- package/dist/collection/components/form-elements/form-structure.js +3 -2
- package/dist/collection/components/form-elements/form-submit.js +2 -2
- package/dist/collection/components/form-elements/form-switch.js +1 -1
- package/dist/collection/components/form-elements/form-text-area.js +6 -4
- package/dist/collection/components/form-elements/form-time-picker-legacy.js +5 -5
- package/dist/collection/components/form-elements/form-vin-input.js +6 -4
- package/dist/collection/components/forms/defaults/mappers.js +54 -18
- package/dist/collection/components/forms/defaults/style.css +1 -1
- package/dist/collection/components/forms/general-form.js +2 -2
- package/dist/collection/components/forms/general-inquiry.js +2 -2
- package/dist/collection/components/forms/service-booking.js +2 -2
- package/dist/collection/components/forms/ssc-lookup.js +2 -2
- package/dist/collection/components/forms/test-drive.js +2 -2
- package/dist/collection/components/forms/vehicle-quotation/themes.css +1 -1
- package/dist/collection/components/forms/vehicle-quotation.js +15 -16
- package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +2 -2
- package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +2 -2
- package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-part-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-part-lookup.js +1 -1
- package/dist/collection/components/part-lookup/part-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +5 -5
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.js +6 -6
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-timeline.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-timeline.js +1 -1
- package/dist/collection/components/vin-extractor/vin-extractor.css +1 -1
- package/dist/collection/components/vin-extractor/vin-extractor.js +1 -1
- package/dist/collection/features/form-hook/functions.js +42 -18
- package/dist/collection/global/lib/slot-day-rules.js +65 -0
- package/dist/collection/templates/assets/favicon.svg +17 -0
- package/dist/collection/templates/forms/docs-content/params.js +1199 -0
- package/dist/collection/templates/forms/docs-content/structure.js +1153 -0
- package/dist/collection/templates/forms/docs-content/theming.js +1240 -0
- package/dist/collection/templates/harness.js +595 -84
- package/dist/collection/templates/highlight.js +194 -0
- package/dist/collection/templates/nav.js +320 -0
- package/dist/collection/templates/site-header.js +642 -0
- package/dist/collection/templates/site-locales.js +771 -0
- package/dist/components/branch-date-dropdown.d.ts +11 -0
- package/dist/components/branch-date-dropdown.js +5 -0
- package/dist/components/branch-date-picker.d.ts +11 -0
- package/dist/components/branch-date-picker.js +5 -0
- package/dist/components/branch-slot-dropdown.js +1 -1
- package/dist/components/branch-slot-picker.js +1 -1
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/flexible-container.js +1 -1
- package/dist/components/form-checkbox.js +1 -1
- package/dist/components/form-date-picker.js +1 -1
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-file.js +1 -1
- package/dist/components/form-input-preview.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-phone-number.js +1 -1
- package/dist/components/form-picker-input.js +1 -1
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.js +1 -1
- package/dist/components/form-stepper-control.js +1 -1
- package/dist/components/form-stepper-submit.js +1 -1
- package/dist/components/form-stepper.js +1 -1
- package/dist/components/form-structure-error.js +1 -1
- package/dist/components/form-structure.js +1 -1
- package/dist/components/form-submit.js +1 -1
- package/dist/components/form-switch.js +1 -1
- package/dist/components/form-text-area.js +1 -1
- package/dist/components/form-time-picker.js +1 -1
- package/dist/components/form-vin-input.js +1 -1
- package/dist/components/general-form.js +1 -1
- package/dist/components/general-inquiry-form.js +1 -1
- package/dist/components/information-table.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/manufacturer-part-lookup.js +1 -1
- package/dist/components/p--lk4OUJg.js +5 -0
- package/dist/components/p-3450p9UN.js +5 -0
- package/dist/components/{p-Dd_Xnn2b.js → p-3kY-T9ID.js} +1 -1
- package/dist/components/p-40jijfEq.js +5 -0
- package/dist/components/{p-_apNp6J3.js → p-BJrbtmnU.js} +1 -1
- package/dist/components/p-BTt7sEhA.js +5 -0
- package/dist/components/p-BcbFXFPI.js +5 -0
- package/dist/components/{p-DpXLfNHS.js → p-BgJljKxp.js} +1 -1
- package/dist/components/{p-1fzw9lBq.js → p-BiTpOAiT.js} +1 -1
- package/dist/components/p-BoQgpmtN.js +5 -0
- package/dist/components/p-BpHkd1L9.js +5 -0
- package/dist/components/{p-CC16uGpN.js → p-BwKzJeLy.js} +1 -1
- package/dist/components/{p-C8S2P4sw.js → p-BwcxrN3h.js} +1 -1
- package/dist/components/{p-CwbJMZVZ.js → p-C1I6zBo7.js} +1 -1
- package/dist/components/{p-DcMgXNpe.js → p-CC5K40ze.js} +1 -1
- package/dist/components/{p-B8hl68AM.js → p-CDdYNb7K.js} +1 -1
- package/dist/components/p-CE9wNugx.js +5 -0
- package/dist/components/p-CU0gZwVU.js +5 -0
- package/dist/components/{p-BdPZ7u2w.js → p-CUTQhKeo.js} +1 -1
- package/dist/components/{p-BbQAkWw4.js → p-CXigg5tn.js} +1 -1
- package/dist/components/p-CYuQunRn.js +5 -0
- package/dist/components/{p-B9xLzbPr.js → p-Ce2mazYo.js} +1 -1
- package/dist/components/p-CjQ2hRI-.js +5 -0
- package/dist/components/{p-l2FHTMzv.js → p-CjdYtmBI.js} +1 -1
- package/dist/components/{p-C6U9Fs9H.js → p-CmIFPUXD.js} +1 -1
- package/dist/components/{p-ClT5CzCZ.js → p-CsXGhc7r.js} +1 -1
- package/dist/components/{p-7Gq_FyNj.js → p-D1JLecvO.js} +1 -1
- package/dist/components/p-DDhVlLOx.js +5 -0
- package/dist/components/{p-D7Sj02XY.js → p-DFKEx7TJ.js} +1 -1
- package/dist/components/p-DQSUv7pB.js +5 -0
- package/dist/components/{p-Bb2xDuqh.js → p-DU9WzEFX.js} +1 -1
- package/dist/components/{p-LkNhSGDO.js → p-DaQOYb2R.js} +1 -1
- package/dist/components/p-Dd_3uKgv.js +5 -0
- package/dist/components/{p-DbnN292R.js → p-DdgLsuaX.js} +1 -1
- package/dist/components/p-DeeDRJ2C.js +5 -0
- package/dist/components/{p-Dsk1SNut.js → p-Dl0BmrLe.js} +1 -1
- package/dist/components/{p-B2w49gNR.js → p-Dsu3xdDz.js} +1 -1
- package/dist/components/{p-B7G2HjX0.js → p-Dts2Iuoc.js} +1 -1
- package/dist/components/p-DvcOTV3l.js +5 -0
- package/dist/components/{p-BaZAgTxG.js → p-HpXp7TBt.js} +1 -1
- package/dist/components/p-KSvRVGk-.js +5 -0
- package/dist/components/{p-BKzXBxxc.js → p-O0AragmD.js} +1 -1
- package/dist/components/{p-CL5G_ZDE.js → p-OdEwTuBq.js} +1 -1
- package/dist/components/{p-R_rAJ4hF.js → p-UeoCFDF-.js} +1 -1
- package/dist/components/{p-Qh1y1RV2.js → p-Wfd6v4yE.js} +1 -1
- package/dist/components/p-g-v1c-Sz.js +5 -0
- package/dist/components/{p-DtZM3yHS.js → p-kvRYCMvP.js} +1 -1
- package/dist/components/p-nX_t9aCK.js +5 -0
- package/dist/components/p-yWyKiQgx.js +5 -0
- package/dist/components/p-zeGxLJvE.js +5 -0
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-booking-form.js +1 -1
- package/dist/components/shift-accordion.js +1 -1
- package/dist/components/shift-checkbox.js +1 -1
- package/dist/components/shift-portal.js +1 -1
- package/dist/components/shift-select-dropdown.js +1 -1
- package/dist/components/shift-select.js +1 -1
- package/dist/components/shift-slider.js +1 -1
- package/dist/components/shift-switch.js +1 -1
- package/dist/components/shift-tab-content.js +1 -1
- package/dist/components/shift-tabs.js +1 -1
- package/dist/components/ssc-lookup-form.js +1 -1
- package/dist/components/test-drive-form.js +1 -1
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-claimable-items.js +1 -1
- package/dist/components/vehicle-item-claim-form.js +1 -1
- package/dist/components/vehicle-lookup.js +1 -1
- package/dist/components/vehicle-paint-thickness.js +1 -1
- package/dist/components/vehicle-quotation-form.js +1 -1
- package/dist/components/vehicle-sale-information.js +1 -1
- package/dist/components/vehicle-service-history.js +1 -1
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/vehicle-warranty-details.js +1 -1
- package/dist/components/vehicle-warranty-timeline.js +1 -1
- package/dist/components/vin-extractor.js +1 -1
- package/dist/esm/{branch-slot-dropdown_15.entry.js → branch-date-dropdown_17.entry.js} +960 -71
- package/dist/esm/dead-stock-lookup_3.entry.js +9 -9
- package/dist/esm/flexible-container.entry.js +3 -3
- package/dist/esm/form-checkbox.entry.js +2 -2
- package/dist/esm/form-date-picker.entry.js +5 -5
- package/dist/esm/form-input_7.entry.js +19 -17
- package/dist/esm/form-switch.entry.js +2 -2
- package/dist/esm/form-time-picker.entry.js +6 -6
- package/dist/esm/{functions-Ccrile_u.js → functions-DJ_k25ew.js} +44 -20
- package/dist/esm/general-form.entry.js +6 -6
- package/dist/esm/general-inquiry-form.entry.js +6 -6
- package/dist/esm/{get-local-language-oNw84Rsz.js → get-local-language-Bx6zWD91.js} +1 -1
- package/dist/esm/{get-mock-files-C26lznN1.js → get-mock-files-BBSjMVMQ.js} +1 -1
- package/dist/esm/information-table.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-spinner.entry.js +2 -2
- package/dist/esm/manufacturer-part-lookup.entry.js +3 -3
- package/dist/esm/{mappers-9IKbvPiR.js → mappers-CZs2R7k6.js} +54 -18
- package/dist/esm/part-lookup.entry.js +2 -2
- package/dist/esm/service-booking-form.entry.js +6 -6
- package/dist/esm/shift-accordion.entry.js +1 -1
- package/dist/esm/shift-checkbox.entry.js +2 -2
- package/dist/esm/shift-components.js +1 -1
- package/dist/esm/shift-slider.entry.js +1 -1
- package/dist/esm/shift-switch.entry.js +2 -2
- package/dist/esm/shift-tab-content.entry.js +2 -2
- package/dist/esm/shift-tabs_2.entry.js +10 -10
- package/dist/esm/ssc-lookup-form.entry.js +6 -6
- package/dist/esm/test-drive-form.entry.js +6 -6
- package/dist/esm/vehicle-accessories_8.entry.js +21 -21
- package/dist/esm/vehicle-lookup.entry.js +3 -3
- package/dist/esm/vehicle-quotation-form.entry.js +17 -18
- package/dist/integration-manifest.json +1 -1
- package/dist/shift-components/{p-BugYpTL6.js → p--hCDlSpp.js} +1 -1
- package/dist/shift-components/p-020fbe81.entry.js +5 -0
- package/dist/shift-components/p-0398f3c4.entry.js +5 -0
- package/dist/shift-components/{p-0da97a29.entry.js → p-10882717.entry.js} +1 -1
- package/dist/shift-components/p-165ff895.entry.js +5 -0
- package/dist/shift-components/{p-d59276b6.entry.js → p-1a0b40e6.entry.js} +1 -1
- package/dist/shift-components/{p-e90c354a.entry.js → p-1be40385.entry.js} +1 -1
- package/dist/shift-components/{p-31718ec2.entry.js → p-327774de.entry.js} +1 -1
- package/dist/shift-components/{p-urLq-GEs.js → p-3YRvA44H.js} +1 -1
- package/dist/shift-components/{p-323ffb6e.entry.js → p-79e08717.entry.js} +1 -1
- package/dist/shift-components/{p-34e9053b.entry.js → p-7b1c5abb.entry.js} +1 -1
- package/dist/shift-components/{p-30e84a3b.entry.js → p-7e89d3fc.entry.js} +1 -1
- package/dist/shift-components/{p-729d8d4b.entry.js → p-7f2e2763.entry.js} +1 -1
- package/dist/shift-components/{p-eb265a3e.entry.js → p-81257775.entry.js} +1 -1
- package/dist/shift-components/{p-3aad8840.entry.js → p-8870420e.entry.js} +1 -1
- package/dist/shift-components/{p-c9ba7fd5.entry.js → p-8d205235.entry.js} +1 -1
- package/dist/shift-components/{p-09a0fd99.entry.js → p-95a4096f.entry.js} +1 -1
- package/dist/shift-components/p-B9INqdFT.js +5 -0
- package/dist/shift-components/p-DwFtCPcT.js +5 -0
- package/dist/shift-components/{p-d58404bd.entry.js → p-a0dc1bcc.entry.js} +1 -1
- package/dist/shift-components/{p-53cd54e8.entry.js → p-a1b97bce.entry.js} +1 -1
- package/dist/shift-components/p-bd1a0763.entry.js +5 -0
- package/dist/shift-components/{p-a15fdf1e.entry.js → p-c197b86b.entry.js} +1 -1
- package/dist/shift-components/{p-63713eae.entry.js → p-c2512cb2.entry.js} +1 -1
- package/dist/shift-components/{p-f2a546db.entry.js → p-cc900265.entry.js} +1 -1
- package/dist/shift-components/{p-1355934b.entry.js → p-d23d9d1f.entry.js} +1 -1
- package/dist/shift-components/p-ddf6c6f6.entry.js +5 -0
- package/dist/shift-components/{p-68722c7b.entry.js → p-e02f3a3f.entry.js} +1 -1
- package/dist/shift-components/{p-9b13a82b.entry.js → p-e72947e0.entry.js} +1 -1
- package/dist/shift-components/p-f30a355a.entry.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/stencil-docs.json +1677 -12
- package/dist/templates/production-host/vehicle-service-history.html +14 -0
- package/dist/types/components/form-elements/branch-date-dropdown.d.ts +74 -0
- package/dist/types/components/form-elements/branch-date-picker.d.ts +174 -0
- package/dist/types/components/form-elements/branch-slot-dropdown.d.ts +6 -0
- package/dist/types/components/form-elements/branch-slot-picker.d.ts +27 -0
- package/dist/types/components/forms/defaults/mappers.d.ts +15 -9
- package/dist/types/components.d.ts +533 -6
- package/dist/types/features/form-hook/functions.d.ts +14 -0
- package/dist/types/global/lib/slot-day-rules.d.ts +25 -0
- package/dist/types/locales/vehicleLookup/serviceHistory/type.d.ts +2 -2
- package/dist/types/locales/vehicleLookup/warrantyTimeline/type.d.ts +4 -4
- package/dist/types/locales/vehicleLookup/wrapper-type.d.ts +2 -2
- package/package.json +6 -1
- package/dist/components/p-6RmAcc2q.js +0 -5
- package/dist/components/p-8jIkK-Kb.js +0 -5
- package/dist/components/p-BUepGDZV.js +0 -5
- package/dist/components/p-B__72-PA.js +0 -5
- package/dist/components/p-Bj3cvdzl.js +0 -5
- package/dist/components/p-BvMcY9Sk.js +0 -5
- package/dist/components/p-C-yTwaAA.js +0 -5
- package/dist/components/p-C8B9jarP.js +0 -5
- package/dist/components/p-CCounVqq.js +0 -5
- package/dist/components/p-CIPh05sT.js +0 -5
- package/dist/components/p-CKwgX_v0.js +0 -5
- package/dist/components/p-CPBmhspv.js +0 -5
- package/dist/components/p-Cm94OAx9.js +0 -5
- package/dist/components/p-DWjIts4C.js +0 -5
- package/dist/components/p-DeipsN8N.js +0 -5
- package/dist/components/p-DkagL-e-.js +0 -5
- package/dist/components/p-G7teNuSi.js +0 -5
- package/dist/shift-components/p-12e295ba.entry.js +0 -5
- package/dist/shift-components/p-138af7f3.entry.js +0 -5
- package/dist/shift-components/p-327fddd8.entry.js +0 -5
- package/dist/shift-components/p-8374f629.entry.js +0 -5
- package/dist/shift-components/p-awXOnuq1.js +0 -5
- package/dist/shift-components/p-c25a6c0d.entry.js +0 -5
- package/dist/shift-components/p-dacdff2a.entry.js +0 -5
- package/dist/shift-components/p-hABirfUj.js +0 -5
- /package/dist/collection/templates/{vehicle-lookup → prototypes}/prototype-assets/extended-warranty/adp-logo.svg +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by ShiftSoftware
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*/
|
|
5
|
-
import{h as e,r as t,H as i,g as a}from"./p-CteZTPhq.js";import{L as o}from"./p-OlAbjfKx.js";import{c as l}from"./p-BK16Cn81.js";import{c as n,b as r,s}from"./p-BDhR4pDq.js";import{a as d,b as c,c as h,d as u,g as p,e as v,h as f,i as m,j as w}from"./p-awXOnuq1.js";import{g}from"./p-DzV_ls5o.js";import"./p-BugYpTL6.js";const b={};let y="";const x=({form:t})=>{var i,a,n,r;t.addWatcher("vehicle");let s=t.getValue("vehicle");const d=!!s,c=null===(i=t.context.vehicleList)||void 0===i?void 0:i.find((e=>e.value===s));let h;c?(h=null===(a=null==c?void 0:c.meta)||void 0===a?void 0:a.image,s=c.value):t.context.vehicleList&&t.context.vehicleList[0]&&(h=null===(r=null===(n=t.context.vehicleList[0])||void 0===n?void 0:n.meta)||void 0===r?void 0:r.image,s=t.context.vehicleList[0].value);let u=!1;return b[s]?y=b[s]:t&&h&&s&&(((e,t,i)=>{fetch(t).then((e=>e.blob())).then((t=>{const a=new FileReader;a.onloadend=()=>{b[i]=a.result,e.rerender({rerenderForm:!0})},a.readAsDataURL(t)})).catch((e=>{console.log(e)}))})(t,h,s),u=!0),e("flexible-container",{isOpened:d},e("div",{style:{"min-height":"60px"},part:"vehicle-image-wrapper",class:l("vehicle-image-wrapper",{loading:u})},e("div",{part:l("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,l;let n;return n=a.defaultValue?a.defaultValue:new URLSearchParams(window.location.search).get(null===(l=null===(o=t.context.structure)||void 0===o?void 0:o.data)||void 0===l?void 0:l.vehicleIdQueryParam),e("form-select",Object.assign({},a,{defaultValue:n,searchable:!0,fetcher:async({signal:e})=>{var a,o,l,n;const r=null===(o=null===(a=t.context.structure)||void 0===a?void 0:a.data)||void 0===o?void 0:o.vehicleApi,s=await fetch(r,{signal:e,headers:{"Accept-Language":i}});return(null===(n=null===(l=t.context.structure)||void 0===l?void 0:l.data)||void 0===n?void 0:n.vehiclesApiStrapiFormat)?(await s.json()).data.map((e=>{var t,i,a,o,l,n;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===(n=null===(l=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===l?void 0:l.attributes)||void 0===n?void 0:n.url)})}})):(await s.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,o;const l=null===(o=null===(a=t.context.structure)||void 0===a?void 0:a.data)||void 0===o?void 0:o.dealerApi,n=await fetch(l,{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 l="yes"===t.getValue("ownVehicle");return e("form-select",Object.assign({},a,{searchable:!0,fetcher:async({signal:e})=>{var i,a;const l=null===(a=null===(i=t.context.structure)||void 0===i?void 0:i.data)||void 0===a?void 0:a.currentVehiclesApi,n=await fetch(l,{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:l,isRequired:l,isDisabled:!l}))},currentVehicleModel:({form:t,language:i,props:a,locale:o})=>{t.addWatcher("ownVehicle"),t.addWatcher("currentVehicleBrand");const l="yes"===t.getValue("ownVehicle"),n=t.getValue("currentVehicleBrand");return e("form-select",Object.assign({},a,{searchable:!0,fetcher:async({})=>{var e,i;if(!n)return[];const a=null===(i=null===(e=t.context.currentVehicleBrandList)||void 0===e?void 0:e.find((e=>e.value===n)))||void 0===i?void 0:i.meta;return a?[...a.Models.map((e=>({label:e.Name,value:`${e.ID}`}))),{value:"Other",label:o.Other}]:[]},language:i,resetKey:n,fetcherKey:n,isRequired:l&&"Other"!==n,isDisabled:!n||"Other"===n}))},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,o;const l=null===(o=null===(a=t.context.structure)||void 0===a?void 0:a.data)||void 0===o?void 0:o.cityApi,n=await fetch(l,{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=n({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 d(this,e)}setIsLoading(e){c(this,e)}setErrorCallback(e){h(this,e)}setSuccessCallback(e){u(this,e)}async componentWillLoad(){this.language||(this.language=g())}async formSubmit(e){var t,i,a,o,l,n,r,s,d,c,h,u,v,f,m,w,g,b,y,x,j,k,O,V,z,q,L,T,C,M;try{this.setIsLoading(!0);const F=null===(i=null===(t=this.structure)||void 0===t?void 0:t.data)||void 0===i?void 0:i.nameContactedVehicles,S=p(this.structure);let $=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"},S);if(F){if($.vehicle=(null===(l=this.vehicleList.find((t=>t.value===e.vehicle)))||void 0===l?void 0:l.label)||"","yes"===(null==e?void 0:e.ownVehicle)){const t=(null===(n=this.currentVehicleBrandList.find((t=>t.value===e.currentVehicleBrand)))||void 0===n?void 0:n.meta)||!1;let i;t&&(i=t.Models.find((t=>`${t.ID}`===e.currentVehicleModel))||!1),$.currentOrTradeInVehicle=`${(null==t?void 0:t.Name)||this.locale.Other} - ${(null==i?void 0:i.Name)||this.locale.Other}`}}else $.vehicle=e.vehicle,$.additionalData={DoYouOwnAVehicle:"yes"===(null==e?void 0:e.ownVehicle)},"yes"===(null==e?void 0:e.ownVehicle)&&($.additionalData.yourCurrentVehicle=(null==e?void 0:e.currentVehicleBrand)||this.locale.Other,$.additionalData.vehicleModel=(null==e?void 0:e.currentVehicleModel)||this.locale.Other);const D={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 A="";if(Object.hasOwn(null===(d=this.structure)||void 0===d?void 0:d.data,"isMobileForm")?null===(h=null===(c=this.structure)||void 0===c?void 0:c.data)||void 0===h?void 0:h.isMobileForm:this.isMobileForm){const e=await this.getMobileToken();e.toLowerCase().startsWith("bearer")?(D.Authorization=e,A=null===(v=null===(u=this.structure)||void 0===u?void 0:u.data)||void 0===v?void 0:v.requestAppUrl):(D["verification-token"]=e,A=null===(m=null===(f=this.structure)||void 0===f?void 0:f.data)||void 0===m?void 0:m.requestAppCheckUrl)}else{A=null===(g=null===(w=this.structure)||void 0===w?void 0:w.data)||void 0===g?void 0:g.requestUrl;const e=await grecaptcha.execute(null===(y=null===(b=this.structure)||void 0===b?void 0:b.data)||void 0===y?void 0:y.recaptchaKey,{action:"submit"});D["Recaptcha-Token"]=e}this.isDev&&(A=A.replaceAll("production=true","production=false")),(null===(j=null===(x=this.structure)||void 0===x?void 0:x.data)||void 0===j?void 0:j.extraPayload)&&($=Object.assign(Object.assign({},$),null===(O=null===(k=this.structure)||void 0===k?void 0:k.data)||void 0===O?void 0:O.extraPayload));const B=await fetch(A,{headers:D,method:"POST",body:JSON.stringify($)});if(!(null==B?void 0:B.ok)){const e=(B.headers.get("content-type")||"").includes("application/json")?null!==(M=null===(C=null===(T=await B.json().catch((()=>({}))))||void 0===T?void 0:T.message)||void 0===C?void 0:C.body)&&void 0!==M?M:"":await B.text().catch((()=>""));throw new Error(e)}{const t=await(null==B?void 0:B.json().catch((()=>({})))),i=null===(z=null===(V=this.structure)||void 0===V?void 0:V.data)||void 0===z?void 0:z.pushAnalyticsEventTo;i&&(window[i]=window[i]||[],window[i].push({event:"get_a_quote",phone:e.phone,fullname:e.name,dealer:null===(q=this.dealerList.find((t=>t.value===e.dealer)))||void 0===q?void 0:q.label,vehicle:null===(L=this.vehicleList.find((t=>t.value===e.vehicle)))||void 0===L?void 0:L.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 f(this)}async submit(){await m(this)}async structureChanged(e){await w(this,e)}render(){var t,a;return e(i,{key:"3a243073f0accae367a712832effb94fa0b8b6dd",translate:"no"},e("div",{key:"25c72f27028a2a920e2a05d7210590005b0ae370",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:"380473aa158960dc05e4a3ca8040c6d8e7095135",part:"form-container",class:"relative min-h-[150px]"},e("div",{key:"940e58324a9f22574f2a3a9331748919f32c4815",part:"form-loader-container",class:l("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:"fc2080503a341f40e72fd2fb73453b3006254ef6",part:"form-loader-icon",class:"img"})),e("flexible-container",{key:"d678008d342b1b15a5be527e251d4cdfc012acef",onlyForMounting:!0,isOpened:this.structureRendered},!!this.form&&e("form-structure",{key:"1fa9257913012d58c4925db087f711bfcda432a8",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:"071d84ba975bdbfe83e769ee5f671f2aaa11f851"}))))))}get el(){return a(this)}static get watchers(){return{language:[{changeLanguage:0}],structureRendered:[{structureChanged:0}]}}};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;}: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-DzV_ls5o.js";import"./p-BDhR4pDq.js";import{b as i}from"./p-BugYpTL6.js";import{d as l}from"./p-OlAbjfKx.js";const t=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 l=await i.json(),t=Object.values(l.files).find((o=>null==o?void 0:o.filename.endsWith(".json")));if(!t)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==t?void 0:t.content)}catch(o){console.error("Error fetching gist JSON:",o.message)}};async function n(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,l)=>{var t,n,e,d,r;const a=await i(l),v=null===(n=null===(t=o.structure)||void 0===t?void 0:t.data)||void 0===n?void 0:n.localization,c="object"==typeof v&&null!==(d=null!==(e=null==v?void 0:v[l])&&void 0!==e?e:null==v?void 0:v.en)&&void 0!==d?d:{};o.locale=Object.assign(Object.assign({},c),{sharedFormLocales:Object.assign(Object.assign({},a),null==c?void 0:c.sharedFormLocales)}),o.localeLanguage=l,null===(r=o.form)||void 0===r||r.rerender({rerenderAll:!0})},d=async(o,i)=>{var l,t,n,e,d;const r=(null==i?void 0:i.message)||(null===(l=null==i?void 0:i.Message)||void 0===l?void 0:l.Body)||(null===(t=null==i?void 0:i.message)||void 0===t?void 0:t.body)||(null===(d=null===(e=null===(n=o.locale)||void 0===n?void 0:n.sharedFormLocales)||void 0===e?void 0:e.errors)||void 0===d?void 0:d.wildCard)||"";let a=!0;(null==o?void 0:o.errorCallback)&&(a=!!await o.errorCallback(i,r)),a&&(o.errorMessage=r)},r=async(o,i)=>{o.isLoading=i,o.loadingChanges&&o.loadingChanges(i)},a=async(o,i)=>{let l=!0;if(o.successCallback&&(l=!!await o.successCallback(i,o.locale["Form submitted successfully."]||"")),l&&o.form.openDialog(),!o.disableScrollToTop){const i=o.el.shadowRoot||o.el,l=i instanceof ShadowRoot?i.firstElementChild:i;if(l){const o=-100,i=l.getBoundingClientRect().top+window.pageYOffset+o;window.scrollTo({top:Math.max(i,0),behavior:"smooth"})}}},v=async(i,l)=>{var e,d,r,a,v;if(!i.structure)if(i.gistId){const[o]=await Promise.all([t(i.gistId),i.changeLanguage(i.language)]);i.structure=o}else if(i.structureUrl){const[o]=await Promise.all([n(i.structureUrl),i.changeLanguage(i.language)]);i.structure=o}if(i.localeLanguage=i.language,await i.changeLanguage(i.language),!(Object.hasOwn(null===(e=i.structure)||void 0===e?void 0:e.data,"isMobileForm")?null===(r=null===(d=i.structure)||void 0===d?void 0:d.data)||void 0===r?void 0:r.isMobileForm:i.isMobileForm))try{const o=null===(v=null===(a=i.structure)||void 0===a?void 0:a.data)||void 0===v?void 0:v.recaptchaKey;if(o){const l=document.createElement("script");l.src=`https://www.google.com/recaptcha/api.js?render=${o}&hl=${i.language}`,l.async=!0,l.defer=!0,document.head.appendChild(l)}}catch(o){console.log(o)}i.form=new o(i,l)},c=async o=>{if(o.form)return o.form},u=async o=>{if(o.form)return o.form.submit()},s=async(o,i)=>{var l;i&&(null===(l=o.formReadyCallback)||void 0===l||l.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 l=new URLSearchParams(window.location.search);if("string"==typeof l.get("disable_utm_log")&&"true"===l.get("disable_utm_log"))return{};const t={};return f.forEach((o=>{l.get(o)&&(t[o]=l.get(o))})),t},b={formLanguageChange:e,formErrorHandler:d,handleFormSubmit:u,formLoadingHandler:r,formSuccessHandler:a,formDidLoadHandler:v,formGetFormHandler:c,onFormSubmit:async({context:o,formValues:i,middleware:t,afterSuccess:n})=>{var e,d,r,a,v,c,u,s,f,b,w,j,p,O,h,g,y,S,$,_,F,A,H,P,E,L,T,N,D,J,R,x,B,M,q,z,C,G,V,I,K;try{o.setIsLoading(!0),Object.keys(i).forEach((l=>{o[`${l}-format`]&&(i[l]=o[`${l}-format`])}));const U=!!(null===(d=null===(e=o.structure)||void 0===e?void 0:e.data)||void 0===d?void 0:d.truncatedFields)&&!!(null===(v=Object.keys(null===(a=null===(r=o.structure)||void 0===r?void 0:r.data)||void 0===a?void 0:a.truncatedFields))||void 0===v?void 0:v.length),Y={},Z=m(null==o?void 0:o.structure);let k=Object.assign({},i);(null===(u=null===(c=o.structure)||void 0===c?void 0:c.data)||void 0===u?void 0:u.extraPayload)&&(k=Object.assign(Object.assign({},k),null===(f=null===(s=o.structure)||void 0===s?void 0:s.data)||void 0===f?void 0:f.extraPayload)),U&&(k.additionalData=Object.assign({},Y)),(null==o?void 0:o.extraPayload)&&(k=Object.assign(Object.assign({},k),null==o?void 0:o.extraPayload)),U&&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 l="";i.forEach((o=>{l+=k[o.toString()]||o.toString()})),k=Object.assign(Object.assign({},k),{[o]:l})}else if("string"==typeof i&&i)if(o.startsWith("parse date: ")){const t=o.replaceAll("parse date: ","");k[t]=l.parse(k[t],i,new Date)}else if(o.startsWith("format date: ")){const i=o.replaceAll("format date: ","");k[i]=l.formatISO(k[i])}else Y[i]=k[o],delete k[o]}));let Q={"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)&&(Q=Object.assign(Object.assign({},Q),null==o?void 0:o.extraHeader)),(null===(h=null===(O=o.structure)||void 0===O?void 0:O.data)||void 0===h?void 0:h.extraHeader)&&(Q=Object.assign(Object.assign({},Q),null===(y=null===(g=o.structure)||void 0===g?void 0:g.data)||void 0===y?void 0:y.extraHeader));let W="";if(Object.hasOwn(null===(S=o.structure)||void 0===S?void 0:S.data,"isMobileForm")?null===(_=null===($=o.structure)||void 0===$?void 0:$.data)||void 0===_?void 0:_.isMobileForm:o.isMobileForm){const i=await o.getMobileToken();i.toLowerCase().startsWith("bearer")?(Q.Authorization=i,W=null===(A=null===(F=o.structure)||void 0===F?void 0:F.data)||void 0===A?void 0:A.requestAppUrl):(Q["verification-token"]=i,W=null===(P=null===(H=o.structure)||void 0===H?void 0:H.data)||void 0===P?void 0:P.requestAppCheckUrl)}else if(W=null===(L=null===(E=o.structure)||void 0===E?void 0:E.data)||void 0===L?void 0:L.requestUrl,null===(N=null===(T=o.structure)||void 0===T?void 0:T.data)||void 0===N?void 0:N.recaptchaKey){const i=await grecaptcha.execute(null===(J=null===(D=o.structure)||void 0===D?void 0:D.data)||void 0===J?void 0:J.recaptchaKey,{action:"submit"});Q["Recaptcha-Token"]=i}if(o.isDev&&(W=W.replaceAll("production=true","production=false")),!W)throw new Error("Request endpoint is not configured");const X=(null===(x=null===(R=o.structure)||void 0===R?void 0:R.data)||void 0===x?void 0:x.requestMethod)||"POST";if(["get","head"].includes(X.toLowerCase())?Q=Object.assign(Object.assign({},Q),Z):k=Object.assign(Object.assign({},k),Z),t){const o=t(k,Q,W);k=Object.assign({},o.payload),Q=Object.assign({},o.header),W=o.url}await Promise.all(Object.values(o.form.pendingRequests).map((o=>o())));const oo=await fetch(W,Object.assign({headers:Q,method:(null===(M=null===(B=o.structure)||void 0===B?void 0:B.data)||void 0===M?void 0:M.requestMethod)||"POST"},"get"===(null===(C=null===(z=null===(q=o.structure)||void 0===q?void 0:q.data)||void 0===z?void 0:z.requestMethod)||void 0===C?void 0:C.toLowerCase())?{}:{body:JSON.stringify(k)}));if(!oo.ok){let o;if((oo.headers.get("content-type")||"").includes("application/json")){const i=await oo.json().catch((()=>({})));o=null!==(K=null!==(V=null===(G=null==i?void 0:i.message)||void 0===G?void 0:G.body)&&void 0!==V?V:null===(I=null==i?void 0:i.Message)||void 0===I?void 0:I.Body)&&void 0!==K?K:""}else o=await oo.text().catch((()=>""));throw new Error(o)}{const i=await oo.json().catch((()=>({})));n&&await n(k,Q),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:s};export{e as a,r as b,d as c,a as d,v as e,b as f,m as g,c as h,u as i,s as j}
|