hemfixarna-web-components 1.5.6 → 1.6.1

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 (38) hide show
  1. package/dist/cjs/{hemfixarna-address_34.cjs.entry.js → hemfixarna-address_36.cjs.entry.js} +106 -103
  2. package/dist/cjs/{hemfixarna-address_34.cjs.entry.js.map → hemfixarna-address_36.cjs.entry.js.map} +1 -1
  3. package/dist/cjs/hemfixarna-components.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/collection-manifest.json +2 -0
  6. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js +113 -0
  7. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js.map +1 -0
  8. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js +113 -0
  9. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js.map +1 -0
  10. package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js +34 -38
  11. package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -1
  12. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +1 -1
  13. package/dist/collection/components/hemfixarna-component/hemfixarna.css +6 -0
  14. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js +1 -2
  15. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -1
  16. package/dist/collection/store/index.js.map +1 -1
  17. package/dist/collection/types/index.js +2 -0
  18. package/dist/collection/types/index.js.map +1 -1
  19. package/dist/collection/utils/api.js +1 -24
  20. package/dist/collection/utils/api.js.map +1 -1
  21. package/dist/collection/utils/felixApi.js.map +1 -1
  22. package/dist/esm/{hemfixarna-address_34.entry.js → hemfixarna-address_36.entry.js} +88 -87
  23. package/dist/esm/{hemfixarna-address_34.entry.js.map → hemfixarna-address_36.entry.js.map} +1 -1
  24. package/dist/esm/hemfixarna-components.js +1 -1
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
  27. package/dist/hemfixarna-components/p-211cfa04.entry.js +2 -0
  28. package/dist/types/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.d.ts +9 -0
  29. package/dist/types/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.d.ts +9 -0
  30. package/dist/types/components/hemfixarna-checkout/hemfixarna-checkout.d.ts +3 -4
  31. package/dist/types/components.d.ts +46 -0
  32. package/dist/types/store/index.d.ts +1 -2
  33. package/dist/types/types/index.d.ts +5 -13
  34. package/dist/types/utils/api.d.ts +1 -2
  35. package/dist/types/utils/felixApi.d.ts +2 -0
  36. package/package.json +1 -1
  37. package/dist/hemfixarna-components/p-e767ccfc.entry.js +0 -2
  38. /package/dist/hemfixarna-components/{p-e767ccfc.entry.js.map → p-211cfa04.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"hemfixarna-address.hemfixarna-box.hemfixarna-breadcrumbs.hemfixarna-byggmax.hemfixarna-cart.hemfixarna-category.hemfixarna-checkout.hemfixarna-component.hemfixarna-contact.hemfixarna-demo.hemfixarna-doro.hemfixarna-elfa.hemfixarna-fargvaruhuset.hemfixarna-flyttsmart.hemfixarna-forebygg.hemfixarna-getuser.hemfixarna-hornbach.hemfixarna-info.hemfixarna-invoice.hemfixarna-kbygg.hemfixarna-klint.hemfixarna-kund.hemfixarna-norrgavel.hemfixarna-order.hemfixarna-orderrows.hemfixarna-power.hemfixarna-product.hemfixarna-service.hemfixarna-skanska.hemfixarna-sparfonster.hemfixarna-start.hemfixarna-string-furniture.hemfixarna-tesla.hemfixarna-zaptec.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"hemfixarna-address.hemfixarna-box.hemfixarna-breadcrumbs.hemfixarna-byggmax.hemfixarna-cart.hemfixarna-category.hemfixarna-checkout.hemfixarna-component.hemfixarna-contact.hemfixarna-demo.hemfixarna-doro.hemfixarna-elfa.hemfixarna-fargvaruhuset.hemfixarna-flyttsmart.hemfixarna-forebygg.hemfixarna-getuser.hemfixarna-hornbach.hemfixarna-info.hemfixarna-invoice.hemfixarna-kbygg.hemfixarna-klint.hemfixarna-kund.hemfixarna-norrgavel.hemfixarna-order.hemfixarna-orderrows.hemfixarna-power.hemfixarna-product.hemfixarna-service.hemfixarna-skanska.hemfixarna-sparfonster.hemfixarna-start.hemfixarna-string-furniture.hemfixarna-superfront.hemfixarna-tesla.hemfixarna-traningspartner.hemfixarna-zaptec.entry.cjs.js","mappings":";;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -20,7 +20,7 @@ const patchBrowser = () => {
20
20
  };
21
21
 
22
22
  patchBrowser().then(options => {
23
- return index.bootstrapLazy([["hemfixarna-address_34.cjs",[[1,"hemfixarna-demo",{"selectedSlug":[32],"selectedID":[32],"tooltipText":[32],"tree":[32],"customer":[32],"widgetStyle":[32],"buttonBg":[32],"buttonColor":[32],"partner":[32],"colorAccessibility":[32]}],[1,"hemfixarna-byggmax",{"slug":[1],"id":[1],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[1,"load-from-query"],"customer":[1],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"tree":[32]}],[1,"hemfixarna-doro",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-elfa",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-fargvaruhuset",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-flyttsmart",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-forebygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-hornbach",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-kbygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-klint",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-kund",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-norrgavel",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-power",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-skanska",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-sparfonster",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-string-furniture",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-tesla",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-zaptec",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-component",{"slug":[1],"id":[1],"business":[1],"topCategory":[1,"top-category"],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"nav":[16],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"modal":[32],"showModal":[32],"tree":[32],"product":[32],"proppedProduct":[32]},[[0,"click","handleClick"]]],[0,"hemfixarna-cart",{"tree":[16]}],[0,"hemfixarna-category"],[0,"hemfixarna-order",{"tree":[16]}],[0,"hemfixarna-product",{"amount":[32],"hideDescription":[32]}],[0,"hemfixarna-service"],[0,"hemfixarna-start",{"tree":[16],"slug":[1]}],[0,"hemfixarna-breadcrumbs",{"tree":[16],"closeModal":[16],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"]}],[0,"hemfixarna-checkout",{"date":[32],"dateError":[32],"generalError":[32],"loading":[32],"enteredPin":[32],"selectedSource":[32],"selectedSubSource":[32],"sellerId":[32],"partnerOrderId":[32]}],[0,"hemfixarna-contact",{"vertical":[4]}],[0,"hemfixarna-invoice",{"formError":[32],"displayImages":[32],"formImages":[32],"formState":[32]}],[0,"hemfixarna-address",{"street":[32],"streetError":[32],"zip":[32],"zipError":[32],"town":[32],"townError":[32]}],[0,"hemfixarna-getuser",{"email":[32],"emailError":[32],"phone":[32],"phoneError":[32],"ssn":[32],"ssnError":[32]}],[0,"hemfixarna-orderrows",{"cart":[4],"tree":[16]}],[0,"hemfixarna-box",{"post":[16],"category":[16],"icon":[1],"postTitle":[1,"post-title"]}],[0,"hemfixarna-info"]]]], options);
23
+ return index.bootstrapLazy([["hemfixarna-address_36.cjs",[[1,"hemfixarna-demo",{"selectedSlug":[32],"selectedID":[32],"tooltipText":[32],"tree":[32],"customer":[32],"widgetStyle":[32],"buttonBg":[32],"buttonColor":[32],"partner":[32],"colorAccessibility":[32]}],[1,"hemfixarna-byggmax",{"slug":[1],"id":[1],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[1,"load-from-query"],"customer":[1],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"tree":[32]}],[1,"hemfixarna-doro",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-elfa",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-fargvaruhuset",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-flyttsmart",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-forebygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-hornbach",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-kbygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-klint",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-kund",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-norrgavel",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-power",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-skanska",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-sparfonster",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-string-furniture",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-superfront",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-tesla",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-traningspartner",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-zaptec",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-component",{"slug":[1],"id":[1],"business":[1],"topCategory":[1,"top-category"],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"nav":[16],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"modal":[32],"showModal":[32],"tree":[32],"product":[32],"proppedProduct":[32]},[[0,"click","handleClick"]]],[0,"hemfixarna-cart",{"tree":[16]}],[0,"hemfixarna-category"],[0,"hemfixarna-order",{"tree":[16]}],[0,"hemfixarna-product",{"amount":[32],"hideDescription":[32]}],[0,"hemfixarna-service"],[0,"hemfixarna-start",{"tree":[16],"slug":[1]}],[0,"hemfixarna-breadcrumbs",{"tree":[16],"closeModal":[16],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"]}],[0,"hemfixarna-checkout",{"date":[32],"dateError":[32],"generalError":[32],"loading":[32],"enteredPin":[32],"selectedSubSource":[32],"partnerOrderId":[32],"showSources":[32],"sellerID":[32],"RefferalID":[32]}],[0,"hemfixarna-contact",{"vertical":[4]}],[0,"hemfixarna-invoice",{"formError":[32],"displayImages":[32],"formImages":[32],"formState":[32]}],[0,"hemfixarna-address",{"street":[32],"streetError":[32],"zip":[32],"zipError":[32],"town":[32],"townError":[32]}],[0,"hemfixarna-getuser",{"email":[32],"emailError":[32],"phone":[32],"phoneError":[32],"ssn":[32],"ssnError":[32]}],[0,"hemfixarna-orderrows",{"cart":[4],"tree":[16]}],[0,"hemfixarna-box",{"post":[16],"category":[16],"icon":[1],"postTitle":[1,"post-title"]}],[0,"hemfixarna-info"]]]], options);
24
24
  });
25
25
 
26
26
  exports.setNonce = index.setNonce;
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["hemfixarna-address_34.cjs",[[1,"hemfixarna-demo",{"selectedSlug":[32],"selectedID":[32],"tooltipText":[32],"tree":[32],"customer":[32],"widgetStyle":[32],"buttonBg":[32],"buttonColor":[32],"partner":[32],"colorAccessibility":[32]}],[1,"hemfixarna-byggmax",{"slug":[1],"id":[1],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[1,"load-from-query"],"customer":[1],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"tree":[32]}],[1,"hemfixarna-doro",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-elfa",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-fargvaruhuset",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-flyttsmart",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-forebygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-hornbach",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-kbygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-klint",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-kund",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-norrgavel",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-power",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-skanska",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-sparfonster",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-string-furniture",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-tesla",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-zaptec",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-component",{"slug":[1],"id":[1],"business":[1],"topCategory":[1,"top-category"],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"nav":[16],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"modal":[32],"showModal":[32],"tree":[32],"product":[32],"proppedProduct":[32]},[[0,"click","handleClick"]]],[0,"hemfixarna-cart",{"tree":[16]}],[0,"hemfixarna-category"],[0,"hemfixarna-order",{"tree":[16]}],[0,"hemfixarna-product",{"amount":[32],"hideDescription":[32]}],[0,"hemfixarna-service"],[0,"hemfixarna-start",{"tree":[16],"slug":[1]}],[0,"hemfixarna-breadcrumbs",{"tree":[16],"closeModal":[16],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"]}],[0,"hemfixarna-checkout",{"date":[32],"dateError":[32],"generalError":[32],"loading":[32],"enteredPin":[32],"selectedSource":[32],"selectedSubSource":[32],"sellerId":[32],"partnerOrderId":[32]}],[0,"hemfixarna-contact",{"vertical":[4]}],[0,"hemfixarna-invoice",{"formError":[32],"displayImages":[32],"formImages":[32],"formState":[32]}],[0,"hemfixarna-address",{"street":[32],"streetError":[32],"zip":[32],"zipError":[32],"town":[32],"townError":[32]}],[0,"hemfixarna-getuser",{"email":[32],"emailError":[32],"phone":[32],"phoneError":[32],"ssn":[32],"ssnError":[32]}],[0,"hemfixarna-orderrows",{"cart":[4],"tree":[16]}],[0,"hemfixarna-box",{"post":[16],"category":[16],"icon":[1],"postTitle":[1,"post-title"]}],[0,"hemfixarna-info"]]]], options);
17
+ return index.bootstrapLazy([["hemfixarna-address_36.cjs",[[1,"hemfixarna-demo",{"selectedSlug":[32],"selectedID":[32],"tooltipText":[32],"tree":[32],"customer":[32],"widgetStyle":[32],"buttonBg":[32],"buttonColor":[32],"partner":[32],"colorAccessibility":[32]}],[1,"hemfixarna-byggmax",{"slug":[1],"id":[1],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[1,"load-from-query"],"customer":[1],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"tree":[32]}],[1,"hemfixarna-doro",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-elfa",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-fargvaruhuset",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-flyttsmart",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-forebygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-hornbach",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-kbygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-klint",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-kund",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-norrgavel",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}],[1,"hemfixarna-power",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-skanska",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-sparfonster",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-string-furniture",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-superfront",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-tesla",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-traningspartner",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-zaptec",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}],[1,"hemfixarna-component",{"slug":[1],"id":[1],"business":[1],"topCategory":[1,"top-category"],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"nav":[16],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"modal":[32],"showModal":[32],"tree":[32],"product":[32],"proppedProduct":[32]},[[0,"click","handleClick"]]],[0,"hemfixarna-cart",{"tree":[16]}],[0,"hemfixarna-category"],[0,"hemfixarna-order",{"tree":[16]}],[0,"hemfixarna-product",{"amount":[32],"hideDescription":[32]}],[0,"hemfixarna-service"],[0,"hemfixarna-start",{"tree":[16],"slug":[1]}],[0,"hemfixarna-breadcrumbs",{"tree":[16],"closeModal":[16],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"]}],[0,"hemfixarna-checkout",{"date":[32],"dateError":[32],"generalError":[32],"loading":[32],"enteredPin":[32],"selectedSubSource":[32],"partnerOrderId":[32],"showSources":[32],"sellerID":[32],"RefferalID":[32]}],[0,"hemfixarna-contact",{"vertical":[4]}],[0,"hemfixarna-invoice",{"formError":[32],"displayImages":[32],"formImages":[32],"formState":[32]}],[0,"hemfixarna-address",{"street":[32],"streetError":[32],"zip":[32],"zipError":[32],"town":[32],"townError":[32]}],[0,"hemfixarna-getuser",{"email":[32],"emailError":[32],"phone":[32],"phoneError":[32],"ssn":[32],"ssnError":[32]}],[0,"hemfixarna-orderrows",{"cart":[4],"tree":[16]}],[0,"hemfixarna-box",{"post":[16],"category":[16],"icon":[1],"postTitle":[1,"post-title"]}],[0,"hemfixarna-info"]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -15,7 +15,9 @@
15
15
  "./components/customers/hemfixarna-skanska/hemfixarna-skanska.js",
16
16
  "./components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js",
17
17
  "./components/customers/hemfixarna-string/hemfixarna-string-furniture.js",
18
+ "./components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js",
18
19
  "./components/customers/hemfixarna-tesla/hemfixarna-tesla.js",
20
+ "./components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js",
19
21
  "./components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js",
20
22
  "./components/hemfixarna-address/hemfixarna-address.js",
21
23
  "./components/hemfixarna-box/hemfixarna-box.js",
@@ -0,0 +1,113 @@
1
+ import { h } from '@stencil/core';
2
+ import { Business, WidgetStyle } from '../../../types';
3
+ export class MyComponent {
4
+ constructor() {
5
+ this.id = undefined;
6
+ this.loadFromQuery = undefined;
7
+ this.widgetStyle = WidgetStyle.standard;
8
+ this.buttonColor = undefined;
9
+ this.buttonBg = undefined;
10
+ }
11
+ render() {
12
+ return (h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, loadFromQuery: Boolean(this.loadFromQuery), id: this.id, business: Business.superfront }));
13
+ }
14
+ static get is() { return "hemfixarna-superfront"; }
15
+ static get encapsulation() { return "shadow"; }
16
+ static get properties() {
17
+ return {
18
+ "id": {
19
+ "type": "string",
20
+ "mutable": false,
21
+ "complexType": {
22
+ "original": "string",
23
+ "resolved": "string",
24
+ "references": {}
25
+ },
26
+ "required": false,
27
+ "optional": true,
28
+ "docs": {
29
+ "tags": [],
30
+ "text": ""
31
+ },
32
+ "attribute": "id",
33
+ "reflect": false
34
+ },
35
+ "loadFromQuery": {
36
+ "type": "string",
37
+ "mutable": false,
38
+ "complexType": {
39
+ "original": "string",
40
+ "resolved": "string",
41
+ "references": {}
42
+ },
43
+ "required": false,
44
+ "optional": true,
45
+ "docs": {
46
+ "tags": [],
47
+ "text": ""
48
+ },
49
+ "attribute": "load-from-query",
50
+ "reflect": false,
51
+ "defaultValue": "undefined"
52
+ },
53
+ "widgetStyle": {
54
+ "type": "string",
55
+ "mutable": false,
56
+ "complexType": {
57
+ "original": "WidgetStyle",
58
+ "resolved": "WidgetStyle.alternative | WidgetStyle.alternative_2 | WidgetStyle.alternative_3 | WidgetStyle.standard",
59
+ "references": {
60
+ "WidgetStyle": {
61
+ "location": "import",
62
+ "path": "../../../types"
63
+ }
64
+ }
65
+ },
66
+ "required": false,
67
+ "optional": true,
68
+ "docs": {
69
+ "tags": [],
70
+ "text": ""
71
+ },
72
+ "attribute": "widget-style",
73
+ "reflect": false,
74
+ "defaultValue": "WidgetStyle.standard"
75
+ },
76
+ "buttonColor": {
77
+ "type": "string",
78
+ "mutable": false,
79
+ "complexType": {
80
+ "original": "string",
81
+ "resolved": "string",
82
+ "references": {}
83
+ },
84
+ "required": false,
85
+ "optional": true,
86
+ "docs": {
87
+ "tags": [],
88
+ "text": ""
89
+ },
90
+ "attribute": "button-color",
91
+ "reflect": false
92
+ },
93
+ "buttonBg": {
94
+ "type": "string",
95
+ "mutable": false,
96
+ "complexType": {
97
+ "original": "string",
98
+ "resolved": "string",
99
+ "references": {}
100
+ },
101
+ "required": false,
102
+ "optional": true,
103
+ "docs": {
104
+ "tags": [],
105
+ "text": ""
106
+ },
107
+ "attribute": "button-bg",
108
+ "reflect": false
109
+ }
110
+ };
111
+ }
112
+ }
113
+ //# sourceMappingURL=hemfixarna-superfront.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemfixarna-superfront.js","sourceRoot":"","sources":["../../../../src/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMvD,MAAM,OAAO,WAAW;;;yBAEW,SAAS;uBACN,WAAW,CAAC,QAAQ;;;;EAIxD,MAAM;IACJ,OAAO,CACL,4BACE,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAC1C,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,QAAQ,EAAE,QAAQ,CAAC,UAAU,GACP,CACzB,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { Business, WidgetStyle } from '../../../types';\n\n@Component({\n tag: 'hemfixarna-superfront',\n shadow: true,\n})\nexport class MyComponent {\n @Prop() id?: string;\n @Prop() loadFromQuery?: string = undefined;\n @Prop() widgetStyle?: WidgetStyle = WidgetStyle.standard;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n\n render() {\n return (\n <hemfixarna-component\n widgetStyle={this.widgetStyle}\n buttonBg={this.buttonBg}\n buttonColor={this.buttonColor}\n loadFromQuery={Boolean(this.loadFromQuery)}\n id={this.id}\n business={Business.superfront}\n ></hemfixarna-component>\n );\n }\n}\n"]}
@@ -0,0 +1,113 @@
1
+ import { h } from '@stencil/core';
2
+ import { Business, WidgetStyle } from '../../../types';
3
+ export class MyComponent {
4
+ constructor() {
5
+ this.id = undefined;
6
+ this.loadFromQuery = undefined;
7
+ this.widgetStyle = WidgetStyle.standard;
8
+ this.buttonColor = undefined;
9
+ this.buttonBg = undefined;
10
+ }
11
+ render() {
12
+ return (h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, loadFromQuery: Boolean(this.loadFromQuery), id: this.id, business: Business.traningspartner }));
13
+ }
14
+ static get is() { return "hemfixarna-traningspartner"; }
15
+ static get encapsulation() { return "shadow"; }
16
+ static get properties() {
17
+ return {
18
+ "id": {
19
+ "type": "string",
20
+ "mutable": false,
21
+ "complexType": {
22
+ "original": "string",
23
+ "resolved": "string",
24
+ "references": {}
25
+ },
26
+ "required": false,
27
+ "optional": true,
28
+ "docs": {
29
+ "tags": [],
30
+ "text": ""
31
+ },
32
+ "attribute": "id",
33
+ "reflect": false
34
+ },
35
+ "loadFromQuery": {
36
+ "type": "string",
37
+ "mutable": false,
38
+ "complexType": {
39
+ "original": "string",
40
+ "resolved": "string",
41
+ "references": {}
42
+ },
43
+ "required": false,
44
+ "optional": true,
45
+ "docs": {
46
+ "tags": [],
47
+ "text": ""
48
+ },
49
+ "attribute": "load-from-query",
50
+ "reflect": false,
51
+ "defaultValue": "undefined"
52
+ },
53
+ "widgetStyle": {
54
+ "type": "string",
55
+ "mutable": false,
56
+ "complexType": {
57
+ "original": "WidgetStyle",
58
+ "resolved": "WidgetStyle.alternative | WidgetStyle.alternative_2 | WidgetStyle.alternative_3 | WidgetStyle.standard",
59
+ "references": {
60
+ "WidgetStyle": {
61
+ "location": "import",
62
+ "path": "../../../types"
63
+ }
64
+ }
65
+ },
66
+ "required": false,
67
+ "optional": true,
68
+ "docs": {
69
+ "tags": [],
70
+ "text": ""
71
+ },
72
+ "attribute": "widget-style",
73
+ "reflect": false,
74
+ "defaultValue": "WidgetStyle.standard"
75
+ },
76
+ "buttonColor": {
77
+ "type": "string",
78
+ "mutable": false,
79
+ "complexType": {
80
+ "original": "string",
81
+ "resolved": "string",
82
+ "references": {}
83
+ },
84
+ "required": false,
85
+ "optional": true,
86
+ "docs": {
87
+ "tags": [],
88
+ "text": ""
89
+ },
90
+ "attribute": "button-color",
91
+ "reflect": false
92
+ },
93
+ "buttonBg": {
94
+ "type": "string",
95
+ "mutable": false,
96
+ "complexType": {
97
+ "original": "string",
98
+ "resolved": "string",
99
+ "references": {}
100
+ },
101
+ "required": false,
102
+ "optional": true,
103
+ "docs": {
104
+ "tags": [],
105
+ "text": ""
106
+ },
107
+ "attribute": "button-bg",
108
+ "reflect": false
109
+ }
110
+ };
111
+ }
112
+ }
113
+ //# sourceMappingURL=hemfixarna-traningspartner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemfixarna-traningspartner.js","sourceRoot":"","sources":["../../../../src/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMvD,MAAM,OAAO,WAAW;;;yBAEW,SAAS;uBACN,WAAW,CAAC,QAAQ;;;;EAIxD,MAAM;IACJ,OAAO,CACL,4BACE,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAC1C,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,QAAQ,EAAE,QAAQ,CAAC,eAAe,GACZ,CACzB,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { Business, WidgetStyle } from '../../../types';\n\n@Component({\n tag: 'hemfixarna-traningspartner',\n shadow: true,\n})\nexport class MyComponent {\n @Prop() id?: string;\n @Prop() loadFromQuery?: string = undefined;\n @Prop() widgetStyle?: WidgetStyle = WidgetStyle.standard;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n\n render() {\n return (\n <hemfixarna-component\n widgetStyle={this.widgetStyle}\n buttonBg={this.buttonBg}\n buttonColor={this.buttonColor}\n loadFromQuery={Boolean(this.loadFromQuery)}\n id={this.id}\n business={Business.traningspartner}\n ></hemfixarna-component>\n );\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { Fragment, getAssetPath, h } from '@stencil/core';
2
2
  import state from '../../store';
3
3
  import { Business } from '../../types';
4
- import { getSources, postOrder } from '../../utils/api';
4
+ import { postOrder } from '../../utils/api';
5
5
  import { postPerson } from '../../utils/felixApi';
6
6
  import { hideField } from '../../utils/form';
7
7
  import { scrollToTop } from '../../utils/scroll';
@@ -53,8 +53,10 @@ export class HemfixarnaCheckout {
53
53
  ].flat(),
54
54
  creditSafe: state.creditSafeUser,
55
55
  customer: state.business,
56
- id_source: (_b = (_a = this.selectedSource) === null || _a === void 0 ? void 0 : _a.fieldData._id) !== null && _b !== void 0 ? _b : '',
57
- id_sub_source: (_c = this.selectedSubSource) !== null && _c !== void 0 ? _c : '',
56
+ id_source: state.customer.source ? state.customer.source.fieldData._id : '',
57
+ id_sub_source: (_a = this.selectedSubSource) !== null && _a !== void 0 ? _a : '',
58
+ seller_id: (_b = this.sellerID) !== null && _b !== void 0 ? _b : '',
59
+ referral_id: (_c = this.RefferalID) !== null && _c !== void 0 ? _c : '',
58
60
  };
59
61
  const felixOrder = await postPerson(order);
60
62
  if (!felixOrder || !((_e = (_d = felixOrder.response) === null || _d === void 0 ? void 0 : _d.scriptResult) === null || _e === void 0 ? void 0 : _e.includes('OK'))) {
@@ -80,7 +82,6 @@ export class HemfixarnaCheckout {
80
82
  this.loading = false;
81
83
  };
82
84
  this.handleSubmit = (e) => {
83
- var _a, _b;
84
85
  e.preventDefault();
85
86
  this.generalError = null;
86
87
  const validDate = this.date.length > 0;
@@ -92,30 +93,27 @@ export class HemfixarnaCheckout {
92
93
  if (notValidTerms) {
93
94
  this.generalError = 'Du måste godkänna villkoren';
94
95
  }
95
- if (state.sources) {
96
- if (!this.sellerId) {
97
- this.generalError = 'Ange säljar id';
98
- return;
99
- }
100
- if (!this.selectedSource) {
101
- this.generalError = 'Välj källa';
102
- return;
103
- }
104
- if (this.selectedSource && ((_b = (_a = this.selectedSource.portalData) === null || _a === void 0 ? void 0 : _a.So_SubSource) === null || _b === void 0 ? void 0 : _b.length) && !this.selectedSubSource) {
105
- this.generalError = 'Välj underkälla';
106
- return;
107
- }
108
- }
96
+ // if (state.customer.source) {
97
+ // if (!this.sellerID) {
98
+ // this.generalError = 'Ange säljare';
99
+ // return;
100
+ // }
101
+ // if (state.customer.source.sub_sources?.length && !this.selectedSubSource) {
102
+ // this.generalError = 'Välj underkälla';
103
+ // return;
104
+ // }
105
+ // }
109
106
  if (validDate && !notValidTerms) {
110
107
  this.sendOrder();
111
108
  }
112
109
  };
113
110
  this.handleKeyDown = (event) => {
114
111
  this.enteredPin += event.key;
115
- const correctPin = '+0000frfrfr';
112
+ const correctPin = '+0033';
116
113
  if (this.enteredPin.length === correctPin.length) {
117
114
  if (this.enteredPin === correctPin) {
118
- this.handleSources();
115
+ localStorage.setItem('show_sources', 'true');
116
+ this.showSources = true;
119
117
  window.removeEventListener('keydown', this.handleKeyDown);
120
118
  }
121
119
  this.enteredPin = '';
@@ -124,7 +122,7 @@ export class HemfixarnaCheckout {
124
122
  this.pinTimeout = setTimeout(() => (this.enteredPin = ''), 5000);
125
123
  };
126
124
  this.render = () => {
127
- var _a, _b;
125
+ var _a;
128
126
  const dateLogo = getAssetPath(`./assets/date.svg`);
129
127
  const down = getAssetPath(`./assets/down.svg`);
130
128
  const loading = getAssetPath(`./assets/spinner.gif`);
@@ -135,11 +133,7 @@ export class HemfixarnaCheckout {
135
133
  return h("hemfixarna-getuser", null);
136
134
  }
137
135
  else if (state.checkoutStep === 2) {
138
- return (h("div", { class: "mb-2" }, h("div", { class: "hemfixarna_addressinfo" }, h("div", null, h("p", null, hideField(state.user.firstName)), h("p", null, hideField(state.user.lastName)), h("p", null, state.user.email), h("p", null, state.user.phone)), h("div", null, h("p", null, hideField(state.user.street)), h("p", null, hideField(state.user.zip)), h("p", null, hideField(state.user.town))), h("button", { onClick: () => (state.checkoutEdit = true) }, "Beh\u00F6ver du \u00E4ndra adressen?")), h("form", { onSubmit: e => this.handleSubmit(e) }, h("div", null, h("img", { src: dateLogo, width: 24 }), h("input", { class: `${this.date.length ? 'input_active' : ''}`, min: new Date().toISOString().split('T')[0], onChange: e => this.handleChangeDate(e), type: "date", name: "date", value: this.date }), h("label", { htmlFor: "date" }, "Tidigaste datum f\u00F6r hembes\u00F6k"), h("img", { src: down, width: 24 })), state.sources ? (h(Fragment, null, h("div", null, h("input", { type: "text", placeholder: "Ange s\u00E4ljar id", onChange: e => (this.sellerId = e.target.value) })), h("div", null, h("input", { type: "text", placeholder: "Ange partner order id", onChange: e => (this.partnerOrderId = e.target.value) })), h("div", null, h("select", { onChange: e => {
139
- this.selectedSource = state.sources.find(s => s.fieldData._id === e.target.value);
140
- this.selectedSubSource = null;
141
- console.log(this.selectedSource.portalData.So_SubSource);
142
- } }, h("option", { disabled: true, selected: true, value: "null" }, "V\u00E4lj k\u00E4lla"), state.sources.map(source => (h("option", { value: source.fieldData._id }, source.fieldData.So01_Name))))), this.selectedSource && ((_b = (_a = this.selectedSource.portalData) === null || _a === void 0 ? void 0 : _a.So_SubSource) === null || _b === void 0 ? void 0 : _b.length) ? (h("div", null, h("select", { key: this.selectedSource.fieldData._id, onChange: e => (this.selectedSubSource = e.target.value) }, h("option", { disabled: true, selected: true, value: "null" }, "V\u00E4lj underk\u00E4lla"), this.selectedSource.portalData.So_SubSource.map(sub => (h("option", { value: sub['So_SubSource::_id'] }, sub['So_SubSource::Sus01_Name'])))))) : null)) : null, this.dateError && h("span", null, this.dateError), h("label", { class: "hemfixarna_checkbox" }, h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), h("span", { innerHTML: state.options.terms })), state.cart
136
+ return (h("div", { class: "mb-2" }, h("div", { class: "hemfixarna_addressinfo" }, h("div", null, h("p", null, hideField(state.user.firstName)), h("p", null, hideField(state.user.lastName)), h("p", null, state.user.email), h("p", null, state.user.phone)), h("div", null, h("p", null, hideField(state.user.street)), h("p", null, hideField(state.user.zip)), h("p", null, hideField(state.user.town))), h("button", { onClick: () => (state.checkoutEdit = true) }, "Beh\u00F6ver du \u00E4ndra adressen?")), h("form", { onSubmit: e => this.handleSubmit(e) }, h("div", null, h("img", { src: dateLogo, width: 24 }), h("input", { class: `${this.date.length ? 'input_active' : ''}`, min: new Date().toISOString().split('T')[0], onChange: e => this.handleChangeDate(e), type: "date", name: "date", value: this.date }), h("label", { htmlFor: "date" }, "Tidigaste datum f\u00F6r hembes\u00F6k"), h("img", { src: down, width: 24 })), this.dateError && h("span", null, this.dateError), state.customer.source && this.showSources ? (h(Fragment, null, h("p", null, "Inloggad som:", h("strong", null, " ", state.customer.source.fieldData.So01_Name)), h("label", null, "S\u00E4ljare (S\u00E4ljarId)", h("input", { type: "text", value: this.sellerID, onChange: e => (this.sellerID = e.target.value) })), h("label", null, "PartnerOrderID (RefferalID)", h("input", { type: "text", value: this.RefferalID, onChange: e => (this.RefferalID = e.target.value) })), ((_a = state.customer.source.sub_sources) === null || _a === void 0 ? void 0 : _a.length) ? (h("div", null, h("select", { onChange: e => (this.selectedSubSource = e.target.value) }, h("option", { disabled: true, selected: true, value: "null" }, "V\u00E4lj underk\u00E4lla"), state.customer.source.sub_sources.map(sub => (h("option", { value: sub['So_SubSource::_id'] }, sub['So_SubSource::Sus01_Name'])))))) : (h("h4", null, "Det finns inga underk\u00E4llor att v\u00E4lja")))) : null, h("label", { class: "hemfixarna_checkbox" }, h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), h("span", { innerHTML: state.options.terms })), state.cart
143
137
  .filter(i => { var _a; return (_a = i.terms_checkout) === null || _a === void 0 ? void 0 : _a.length; })
144
138
  .map(item => (h(Fragment, null, h("label", { class: "hemfixarna_checkbox" }, h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), h("span", null, item.terms_checkout))))), this.generalError && h("span", null, this.generalError), h("div", { class: this.loading ? 'loading' : '' }, h("input", { type: "submit", value: this.loading ? '' : 'Skicka bokning' }), h("img", { width: 20, height: 20, src: loading, alt: "spinner" })))));
145
139
  }
@@ -149,22 +143,23 @@ export class HemfixarnaCheckout {
149
143
  this.generalError = null;
150
144
  this.loading = false;
151
145
  this.enteredPin = '';
152
- this.selectedSource = null;
153
146
  this.selectedSubSource = null;
154
- this.sellerId = null;
155
147
  this.partnerOrderId = null;
156
- }
157
- async handleSources() {
158
- const sources = await getSources();
159
- if (sources === null || sources === void 0 ? void 0 : sources.length) {
160
- state.sources = sources.filter(s => s.fieldData.So457_Aktiv_ac === 1 && s.fieldData.So39_WebSource === 1);
161
- }
148
+ this.showSources = false;
149
+ this.sellerID = null;
150
+ this.RefferalID = null;
162
151
  }
163
152
  componentWillLoad() {
164
153
  if (Boolean(state.user && state.user.street)) {
165
154
  state.checkoutStep = 2;
166
155
  }
167
- window.addEventListener('keydown', this.handleKeyDown);
156
+ if (state.customer && state.customer.source) {
157
+ window.addEventListener('keydown', this.handleKeyDown);
158
+ }
159
+ const showSources = localStorage.getItem('show_sources');
160
+ if (showSources) {
161
+ this.showSources = true;
162
+ }
168
163
  }
169
164
  disconnectedCallback() {
170
165
  window.removeEventListener('keydown', this.handleKeyDown);
@@ -177,10 +172,11 @@ export class HemfixarnaCheckout {
177
172
  "generalError": {},
178
173
  "loading": {},
179
174
  "enteredPin": {},
180
- "selectedSource": {},
181
175
  "selectedSubSource": {},
182
- "sellerId": {},
183
- "partnerOrderId": {}
176
+ "partnerOrderId": {},
177
+ "showSources": {},
178
+ "sellerID": {},
179
+ "RefferalID": {}
184
180
  };
185
181
  }
186
182
  static get elementRef() { return "el"; }
@@ -1 +1 @@
1
- {"version":3,"file":"hemfixarna-checkout.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-checkout/hemfixarna-checkout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAU,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAc,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,kBAAkB;;IAa7B,qBAAgB,GAAG,CAAC,CAAQ,EAAE,EAAE;MAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;MACtB,IAAI,CAAC,IAAI,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC;IACnD,CAAC,CAAC;IAEF,sBAAiB,GAAG,GAAG,EAAE;MACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC,CAAC;IAEF,cAAS,GAAG,KAAK,IAAI,EAAE;;MACrB,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO;MACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;MACpB,IAAI,KAAK,GAAe;QACtB,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS;QACzC,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ;QACvC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM;QACzB,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG;QACnB,IAAI,EAAE,KA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E;MACnB,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC;KAC3G;EACH,CAAC;EAmBD,iBAAiB;IACf,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;MAC5C,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;KACxB;IACD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;EACzD,CAAC;EAED,oBAAoB;IAClB,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;EAC5D,CAAC;;;;;;;;;;;;;;CAyGF","sourcesContent":["import { Component, Element, Fragment, State, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Source } from '../../types';\nimport { getSources, postOrder } from '../../utils/api';\nimport { FelixOrder, postPerson } from '../../utils/felixApi';\nimport { hideField } from '../../utils/form';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-checkout',\n shadow: false,\n})\nexport class HemfixarnaCheckout {\n @State() date: string = '';\n @State() dateError: string | null = null;\n @State() generalError: string | null = null;\n @State() loading = false;\n @State() enteredPin: string = '';\n @Element() private el: HTMLElement;\n private pinTimeout: any;\n @State() selectedSource: Source | null = null;\n @State() selectedSubSource: string | null = null;\n @State() sellerId: string | null = null;\n @State() partnerOrderId: string | null = null;\n\n handleChangeDate = (e: Event) => {\n this.dateError = null;\n this.date = (e.target as HTMLInputElement).value;\n };\n\n handleChangeTerms = () => {\n this.generalError = null;\n };\n\n sendOrder = async () => {\n if (this.loading) return;\n this.loading = true;\n let order: FelixOrder = {\n firstName: state.creditSafeUser.firstName,\n lastName: state.creditSafeUser.lastName,\n street: state.user.street,\n zip: state.user.zip,\n town: state.user.town,\n ssn: state.user.ssn,\n email: state.user.email,\n phone: state.user.phone,\n url: `${state.business === Business.string ? 'string' : state.business}-webk`,\n date: this.date,\n products: [\n ...state.cart.map(item => {\n const parts = item.parts.map(part => ({\n id: String(part.id),\n name: part.name,\n quantity: part.amount,\n rut: 0,\n rot: 0,\n }));\n return [\n {\n id: String(item.id),\n name: item.name,\n quantity: item.amount,\n rot: item.rot ? 1 : 0,\n rut: item.rut ? 1 : 0,\n },\n ...parts,\n ];\n }),\n ].flat(),\n creditSafe: state.creditSafeUser,\n customer: state.business,\n id_source: this.selectedSource?.fieldData._id ?? '',\n id_sub_source: this.selectedSubSource ?? '',\n };\n\n const felixOrder = await postPerson(order);\n if (!felixOrder || !felixOrder.response?.scriptResult?.includes('OK')) {\n order = { ...order, felixStatus: 'error' };\n } else {\n order = { ...order, felixStatus: 'success' };\n }\n\n try {\n const { data: orderConfirm, status } = await postOrder(order);\n if (orderConfirm && status && status === 200) {\n state.step = 6;\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n } else {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n } catch (error) {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n this.loading = false;\n };\n\n handleSubmit = (e: Event) => {\n e.preventDefault();\n this.generalError = null;\n const validDate = this.date.length > 0;\n if (!validDate) {\n this.dateError = 'Ange ett giltigt datum';\n }\n const checkBoxes = Array.from(this.el.querySelectorAll('input[type=\"checkbox\"]'));\n const notValidTerms = checkBoxes.find(i => !(i as HTMLInputElement).checked);\n if (notValidTerms) {\n this.generalError = 'Du måste godkänna villkoren';\n }\n if (state.sources) {\n if (!this.sellerId) {\n this.generalError = 'Ange säljar id';\n return;\n }\n if (!this.selectedSource) {\n this.generalError = 'Välj källa';\n return;\n }\n if (this.selectedSource && this.selectedSource.portalData?.So_SubSource?.length && !this.selectedSubSource) {\n this.generalError = 'Välj underkälla';\n return;\n }\n }\n if (validDate && !notValidTerms) {\n this.sendOrder();\n }\n };\n\n async handleSources() {\n const sources = await getSources();\n if (sources?.length) {\n state.sources = sources.filter(s => s.fieldData.So457_Aktiv_ac === 1 && s.fieldData.So39_WebSource === 1);\n }\n }\n\n handleKeyDown = (event: KeyboardEvent) => {\n this.enteredPin += event.key;\n\n const correctPin = '+0000frfrfr';\n\n if (this.enteredPin.length === correctPin.length) {\n if (this.enteredPin === correctPin) {\n this.handleSources();\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n this.enteredPin = '';\n }\n\n clearTimeout(this.pinTimeout);\n this.pinTimeout = setTimeout(() => (this.enteredPin = ''), 5000);\n };\n\n componentWillLoad() {\n if (Boolean(state.user && state.user.street)) {\n state.checkoutStep = 2;\n }\n window.addEventListener('keydown', this.handleKeyDown);\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n\n render = () => {\n const dateLogo = getAssetPath(`./assets/date.svg`);\n const down = getAssetPath(`./assets/down.svg`);\n const loading = getAssetPath(`./assets/spinner.gif`);\n\n if (state.checkoutEdit) {\n return <hemfixarna-address />;\n } else if (state.checkoutStep === 1) {\n return <hemfixarna-getuser />;\n } else if (state.checkoutStep === 2) {\n return (\n <div class=\"mb-2\">\n <div class=\"hemfixarna_addressinfo\">\n <div>\n <p>{hideField(state.user.firstName)}</p>\n <p>{hideField(state.user.lastName)}</p>\n <p>{state.user.email}</p>\n <p>{state.user.phone}</p>\n </div>\n <div>\n <p>{hideField(state.user.street)}</p>\n <p>{hideField(state.user.zip)}</p>\n <p>{hideField(state.user.town)}</p>\n </div>\n <button onClick={() => (state.checkoutEdit = true)}>Behöver du ändra adressen?</button>\n </div>\n <form onSubmit={e => this.handleSubmit(e)}>\n <div>\n <img src={dateLogo} width={24} />\n <input\n class={`${this.date.length ? 'input_active' : ''}`}\n min={new Date().toISOString().split('T')[0]}\n onChange={e => this.handleChangeDate(e)}\n type=\"date\"\n name=\"date\"\n value={this.date}\n />\n <label htmlFor=\"date\">Tidigaste datum för hembesök</label>\n <img src={down} width={24} />\n </div>\n {state.sources ? (\n <Fragment>\n <div>\n <input type=\"text\" placeholder=\"Ange säljar id\" onChange={e => (this.sellerId = (e.target as HTMLInputElement).value)} />\n </div>\n <div>\n <input type=\"text\" placeholder=\"Ange partner order id\" onChange={e => (this.partnerOrderId = (e.target as HTMLInputElement).value)} />\n </div>\n <div>\n <select\n onChange={e => {\n this.selectedSource = state.sources.find(s => s.fieldData._id === (e.target as HTMLSelectElement).value);\n this.selectedSubSource = null;\n console.log(this.selectedSource.portalData.So_SubSource);\n }}\n >\n <option disabled selected value=\"null\">\n Välj källa\n </option>\n {state.sources.map(source => (\n <option value={source.fieldData._id}>{source.fieldData.So01_Name}</option>\n ))}\n </select>\n </div>\n {this.selectedSource && this.selectedSource.portalData?.So_SubSource?.length ? (\n <div>\n <select key={this.selectedSource.fieldData._id} onChange={e => (this.selectedSubSource = (e.target as HTMLSelectElement).value)}>\n <option disabled selected value=\"null\">\n Välj underkälla\n </option>\n {this.selectedSource.portalData.So_SubSource.map(sub => (\n <option value={sub['So_SubSource::_id']}>{sub['So_SubSource::Sus01_Name']}</option>\n ))}\n </select>\n </div>\n ) : null}\n </Fragment>\n ) : null}\n {this.dateError && <span>{this.dateError}</span>}\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span innerHTML={state.options.terms} />\n </label>\n {state.cart\n .filter(i => i.terms_checkout?.length)\n .map(item => (\n <Fragment>\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span>{item.terms_checkout}</span>\n </label>\n </Fragment>\n ))}\n {this.generalError && <span>{this.generalError}</span>}\n <div class={this.loading ? 'loading' : ''}>\n <input type=\"submit\" value={this.loading ? '' : 'Skicka bokning'} />\n <img width={20} height={20} src={loading} alt=\"spinner\" />\n </div>\n </form>\n </div>\n );\n }\n };\n}\n"]}
1
+ {"version":3,"file":"hemfixarna-checkout.js","source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I,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,GAAI;cACpE,WAAK,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,SAAS,GAAG,CACtD,CACD,CACH,CACP,CAAC;OACH;IACH,CAAC,CAAC;gBAnPsB,EAAE;qBACU,IAAI;wBACD,IAAI;mBACxB,KAAK;sBACM,EAAE;6BAGY,IAAI;0BACP,IAAI;uBACtB,KAAK;oBACO,IAAI;sBACF,IAAI;;EAyHzC,iBAAiB;IACf,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;MAC5C,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;KACxB;IACD,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE;MAC3C,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;KACxD;IACD,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IACzD,IAAI,WAAW,EAAE;MACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;KACzB;EACH,CAAC;EAED,oBAAoB;IAClB,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;EAC5D,CAAC;;;;;;;;;;;;;;;CAiGF","sourcesContent":["import { Component, Element, Fragment, State, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business } from '../../types';\nimport { postOrder } from '../../utils/api';\nimport { FelixOrder, postPerson } from '../../utils/felixApi';\nimport { hideField } from '../../utils/form';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-checkout',\n shadow: false,\n})\nexport class HemfixarnaCheckout {\n @State() date: string = '';\n @State() dateError: string | null = null;\n @State() generalError: string | null = null;\n @State() loading = false;\n @State() enteredPin: string = '';\n @Element() private el: HTMLElement;\n private pinTimeout: any;\n @State() selectedSubSource: string | null = null;\n @State() partnerOrderId: string | null = null;\n @State() showSources = false;\n @State() sellerID: string | null = null;\n @State() RefferalID: string | null = null;\n\n handleChangeDate = (e: Event) => {\n this.dateError = null;\n this.date = (e.target as HTMLInputElement).value;\n };\n\n handleChangeTerms = () => {\n this.generalError = null;\n };\n\n sendOrder = async () => {\n if (this.loading) return;\n this.loading = true;\n let order: FelixOrder = {\n firstName: state.creditSafeUser.firstName,\n lastName: state.creditSafeUser.lastName,\n street: state.user.street,\n zip: state.user.zip,\n town: state.user.town,\n ssn: state.user.ssn,\n email: state.user.email,\n phone: state.user.phone,\n url: `${state.business === Business.string ? 'string' : state.business}-webk`,\n date: this.date,\n products: [\n ...state.cart.map(item => {\n const parts = item.parts.map(part => ({\n id: String(part.id),\n name: part.name,\n quantity: part.amount,\n rut: 0,\n rot: 0,\n }));\n return [\n {\n id: String(item.id),\n name: item.name,\n quantity: item.amount,\n rot: item.rot ? 1 : 0,\n rut: item.rut ? 1 : 0,\n },\n ...parts,\n ];\n }),\n ].flat(),\n creditSafe: state.creditSafeUser,\n customer: state.business,\n id_source: state.customer.source ? state.customer.source.fieldData._id : '',\n id_sub_source: this.selectedSubSource ?? '',\n seller_id: this.sellerID ?? '',\n referral_id: this.RefferalID ?? '',\n };\n\n const felixOrder = await postPerson(order);\n if (!felixOrder || !felixOrder.response?.scriptResult?.includes('OK')) {\n order = { ...order, felixStatus: 'error' };\n } else {\n order = { ...order, felixStatus: 'success' };\n }\n\n try {\n const { data: orderConfirm, status } = await postOrder(order);\n if (orderConfirm && status && status === 200) {\n state.step = 6;\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n } else {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n } catch (error) {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n this.loading = false;\n };\n\n handleSubmit = (e: Event) => {\n e.preventDefault();\n this.generalError = null;\n const validDate = this.date.length > 0;\n if (!validDate) {\n this.dateError = 'Ange ett giltigt datum';\n }\n const checkBoxes = Array.from(this.el.querySelectorAll('input[type=\"checkbox\"]'));\n const notValidTerms = checkBoxes.find(i => !(i as HTMLInputElement).checked);\n if (notValidTerms) {\n this.generalError = 'Du måste godkänna villkoren';\n }\n // if (state.customer.source) {\n // if (!this.sellerID) {\n // this.generalError = 'Ange säljare';\n // return;\n // }\n // if (state.customer.source.sub_sources?.length && !this.selectedSubSource) {\n // this.generalError = 'Välj underkälla';\n // return;\n // }\n // }\n if (validDate && !notValidTerms) {\n this.sendOrder();\n }\n };\n\n handleKeyDown = (event: KeyboardEvent) => {\n this.enteredPin += event.key;\n\n const correctPin = '+0033';\n\n if (this.enteredPin.length === correctPin.length) {\n if (this.enteredPin === correctPin) {\n localStorage.setItem('show_sources', 'true');\n this.showSources = true;\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n this.enteredPin = '';\n }\n\n clearTimeout(this.pinTimeout);\n this.pinTimeout = setTimeout(() => (this.enteredPin = ''), 5000);\n };\n\n componentWillLoad() {\n if (Boolean(state.user && state.user.street)) {\n state.checkoutStep = 2;\n }\n if (state.customer && state.customer.source) {\n window.addEventListener('keydown', this.handleKeyDown);\n }\n const showSources = localStorage.getItem('show_sources');\n if (showSources) {\n this.showSources = true;\n }\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n\n render = () => {\n const dateLogo = getAssetPath(`./assets/date.svg`);\n const down = getAssetPath(`./assets/down.svg`);\n const loading = getAssetPath(`./assets/spinner.gif`);\n\n if (state.checkoutEdit) {\n return <hemfixarna-address />;\n } else if (state.checkoutStep === 1) {\n return <hemfixarna-getuser />;\n } else if (state.checkoutStep === 2) {\n return (\n <div class=\"mb-2\">\n <div class=\"hemfixarna_addressinfo\">\n <div>\n <p>{hideField(state.user.firstName)}</p>\n <p>{hideField(state.user.lastName)}</p>\n <p>{state.user.email}</p>\n <p>{state.user.phone}</p>\n </div>\n <div>\n <p>{hideField(state.user.street)}</p>\n <p>{hideField(state.user.zip)}</p>\n <p>{hideField(state.user.town)}</p>\n </div>\n <button onClick={() => (state.checkoutEdit = true)}>Behöver du ändra adressen?</button>\n </div>\n <form onSubmit={e => this.handleSubmit(e)}>\n <div>\n <img src={dateLogo} width={24} />\n <input\n class={`${this.date.length ? 'input_active' : ''}`}\n min={new Date().toISOString().split('T')[0]}\n onChange={e => this.handleChangeDate(e)}\n type=\"date\"\n name=\"date\"\n value={this.date}\n />\n <label htmlFor=\"date\">Tidigaste datum för hembesök</label>\n <img src={down} width={24} />\n </div>\n {this.dateError && <span>{this.dateError}</span>}\n {state.customer.source && this.showSources ? (\n <Fragment>\n <p>\n Inloggad som:\n <strong> {state.customer.source.fieldData.So01_Name}</strong>\n </p>\n <label>\n Säljare (SäljarId)\n <input type=\"text\" value={this.sellerID} onChange={e => (this.sellerID = (e.target as HTMLInputElement).value)} />\n </label>\n <label>\n PartnerOrderID (RefferalID)\n <input type=\"text\" value={this.RefferalID} onChange={e => (this.RefferalID = (e.target as HTMLInputElement).value)} />\n </label>\n {state.customer.source.sub_sources?.length ? (\n <div>\n <select onChange={e => (this.selectedSubSource = (e.target as HTMLSelectElement).value)}>\n <option disabled selected value=\"null\">\n Välj underkälla\n </option>\n {state.customer.source.sub_sources.map(sub => (\n <option value={sub['So_SubSource::_id']}>{sub['So_SubSource::Sus01_Name']}</option>\n ))}\n </select>\n </div>\n ) : (\n <h4>Det finns inga underkällor att välja</h4>\n )}\n </Fragment>\n ) : null}\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span innerHTML={state.options.terms} />\n </label>\n {state.cart\n .filter(i => i.terms_checkout?.length)\n .map(item => (\n <Fragment>\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span>{item.terms_checkout}</span>\n </label>\n </Fragment>\n ))}\n {this.generalError && <span>{this.generalError}</span>}\n <div class={this.loading ? 'loading' : ''}>\n <input type=\"submit\" value={this.loading ? '' : 'Skicka bokning'} />\n <img width={20} height={20} src={loading} alt=\"spinner\" />\n </div>\n </form>\n </div>\n );\n }\n };\n}\n"]}
@@ -284,7 +284,7 @@ export class HemfixarnaComponent {
284
284
  "mutable": false,
285
285
  "complexType": {
286
286
  "original": "Business",
287
- "resolved": "Business.byggmax | Business.doro | Business.elfa | Business.fargvaruhuset | Business.flyttsmart | Business.forebygg | Business.hornbach | Business.kbygg | Business.klint | Business.kund | Business.lg | Business.norrgavel | Business.power | Business.skanska | Business.sparfonster | Business.string | Business.tesla | Business.zaptec",
287
+ "resolved": "Business.byggmax | Business.doro | Business.elfa | Business.fargvaruhuset | Business.flyttsmart | Business.forebygg | Business.hornbach | Business.kbygg | Business.klint | Business.kund | Business.lg | Business.norrgavel | Business.power | Business.skanska | Business.sparfonster | Business.string | Business.superfront | Business.tesla | Business.traningspartner | Business.zaptec",
288
288
  "references": {
289
289
  "Business": {
290
290
  "location": "import",
@@ -14,6 +14,12 @@
14
14
  :host {
15
15
  font-family: "Inter", sans-serif;
16
16
  }
17
+ :host input[type=text] {
18
+ padding: 16px;
19
+ width: 100%;
20
+ font-size: 16px;
21
+ border: 1px solid #fcd9c9;
22
+ }
17
23
  :host .mb-2 {
18
24
  margin-bottom: 32px;
19
25
  }