hemfixarna-web-components 0.3.1 → 0.9.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 (56) hide show
  1. package/dist/hemfixarna-components/api-3a3e41fd.js +43 -0
  2. package/dist/hemfixarna-components/api-3a3e41fd.js.map +1 -0
  3. package/dist/hemfixarna-components/{calc-a9ece205.js → calc-c54e0b20.js} +36 -3
  4. package/dist/hemfixarna-components/calc-c54e0b20.js.map +1 -0
  5. package/dist/hemfixarna-components/form-b1c4b8a6.js +9 -0
  6. package/dist/hemfixarna-components/form-b1c4b8a6.js.map +1 -0
  7. package/dist/hemfixarna-components/hemfixarna-address.entry.js +15 -6
  8. package/dist/hemfixarna-components/hemfixarna-address.entry.js.map +1 -1
  9. package/dist/hemfixarna-components/hemfixarna-box.entry.js +3 -3
  10. package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js +2 -2
  11. package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js +1 -1
  12. package/dist/hemfixarna-components/hemfixarna-cart.entry.js +3 -64
  13. package/dist/hemfixarna-components/hemfixarna-cart.entry.js.map +1 -1
  14. package/dist/hemfixarna-components/hemfixarna-category.entry.js +6 -3
  15. package/dist/hemfixarna-components/hemfixarna-category.entry.js.map +1 -1
  16. package/dist/hemfixarna-components/hemfixarna-checkout.entry.js +44 -9
  17. package/dist/hemfixarna-components/hemfixarna-checkout.entry.js.map +1 -1
  18. package/dist/hemfixarna-components/hemfixarna-component.entry.js +10 -11
  19. package/dist/hemfixarna-components/hemfixarna-component.entry.js.map +1 -1
  20. package/dist/hemfixarna-components/hemfixarna-components.esm.js +3 -3
  21. package/dist/hemfixarna-components/hemfixarna-demo.entry.js +2 -2
  22. package/dist/hemfixarna-components/hemfixarna-getuser.entry.js +362 -9
  23. package/dist/hemfixarna-components/hemfixarna-getuser.entry.js.map +1 -1
  24. package/dist/hemfixarna-components/hemfixarna-info.entry.js +2 -2
  25. package/dist/hemfixarna-components/hemfixarna-order.entry.js +10 -4
  26. package/dist/hemfixarna-components/hemfixarna-order.entry.js.map +1 -1
  27. package/dist/hemfixarna-components/hemfixarna-orderrows.entry.js +42 -0
  28. package/dist/hemfixarna-components/hemfixarna-orderrows.entry.js.map +1 -0
  29. package/dist/hemfixarna-components/hemfixarna-product.entry.js +5 -7
  30. package/dist/hemfixarna-components/hemfixarna-product.entry.js.map +1 -1
  31. package/dist/hemfixarna-components/hemfixarna-service.entry.js +6 -3
  32. package/dist/hemfixarna-components/hemfixarna-service.entry.js.map +1 -1
  33. package/dist/hemfixarna-components/hemfixarna-start.entry.js +6 -3
  34. package/dist/hemfixarna-components/hemfixarna-start.entry.js.map +1 -1
  35. package/dist/hemfixarna-components/{index-75ed3bb8.js → index-871f8d65.js} +5 -2
  36. package/dist/hemfixarna-components/index-871f8d65.js.map +1 -0
  37. package/dist/hemfixarna-components/{index-59ed730c.js → index-ff4893e5.js} +2 -2
  38. package/dist/hemfixarna-components/{index-59ed730c.js.map → index-ff4893e5.js.map} +1 -1
  39. package/dist/types/components/hemfixarna-address/hemfixarna-address.d.ts +1 -0
  40. package/dist/types/components/hemfixarna-cart/hemfixarna-cart.d.ts +1 -9
  41. package/dist/types/components/hemfixarna-checkout/hemfixarna-checkout.d.ts +3 -1
  42. package/dist/types/components/hemfixarna-getuser/hemfixarna-getuser.d.ts +1 -1
  43. package/dist/types/components/hemfixarna-order/hemfixarna-order.d.ts +3 -0
  44. package/dist/types/components/hemfixarna-orderrows/hemfixarna-orderrows.d.ts +8 -0
  45. package/dist/types/components.d.ts +19 -0
  46. package/dist/types/store/index.d.ts +2 -6
  47. package/dist/types/types/index.d.ts +18 -7
  48. package/dist/types/utils/api.d.ts +20 -2
  49. package/dist/types/utils/calc.d.ts +5 -1
  50. package/dist/types/utils/creditSafe.d.ts +3 -0
  51. package/dist/types/utils/form.d.ts +2 -0
  52. package/package.json +2 -1
  53. package/dist/hemfixarna-components/api-3228fe30.js +0 -28
  54. package/dist/hemfixarna-components/api-3228fe30.js.map +0 -1
  55. package/dist/hemfixarna-components/calc-a9ece205.js.map +0 -1
  56. package/dist/hemfixarna-components/index-75ed3bb8.js.map +0 -1
@@ -0,0 +1,43 @@
1
+ const base = "http://hemfixare.se.test" ? `${"http://hemfixare.se.test"}/wp-json/headless` : 'https://hemfixarna.se/wp-json/headless';
2
+ const getTaxonomy = async (endpoint) => {
3
+ if (!endpoint) {
4
+ return;
5
+ }
6
+ const type = endpoint.split('/')[0];
7
+ const slug = endpoint.split('/')[1];
8
+ try {
9
+ const res = await fetch(`${base}/${type}/${slug}`);
10
+ return await res.json();
11
+ }
12
+ catch (error) {
13
+ console.log(error);
14
+ }
15
+ };
16
+ const getOptions = async () => {
17
+ try {
18
+ const res = await fetch(`${base}/webcoptions`);
19
+ return (await res.json());
20
+ }
21
+ catch (error) {
22
+ console.log(error);
23
+ }
24
+ };
25
+ const postOrder = async (data) => {
26
+ try {
27
+ const res = await fetch(`${base}/weborder`, {
28
+ method: 'POST',
29
+ body: JSON.stringify(data),
30
+ headers: {
31
+ 'Content-Type': 'application/json',
32
+ },
33
+ });
34
+ return (await res.json());
35
+ }
36
+ catch (error) {
37
+ console.log(error);
38
+ }
39
+ };
40
+
41
+ export { getOptions as a, getTaxonomy as g, postOrder as p };
42
+
43
+ //# sourceMappingURL=api-3a3e41fd.js.map
@@ -0,0 +1 @@
1
+ {"file":"api-3a3e41fd.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,4 +1,4 @@
1
- import { s as state } from './index-75ed3bb8.js';
1
+ import { s as state } from './index-871f8d65.js';
2
2
 
3
3
  const getRutPrice = (price) => {
4
4
  return Math.ceil(price / 2);
@@ -79,7 +79,40 @@ const getStartFee = () => {
79
79
  return { rut: 0, rot: 0, length: 0 };
80
80
  }
81
81
  };
82
+ const getItemPrice = (item) => {
83
+ const partsPrice = item.parts.reduce((acc, curr) => {
84
+ return acc + curr.price * curr.amount;
85
+ }, 0);
86
+ return getProductPrice(item, item.price * item.amount + partsPrice);
87
+ };
88
+ const calculateRot = () => {
89
+ const totalWithRot = state.cart.reduce((acc, curr) => {
90
+ return curr.rot ? acc + getItemPrice(curr) : acc;
91
+ }, 0) + getStartFee().rot;
92
+ const totalWithoutRot = state.cart.reduce((acc, curr) => {
93
+ const partsPrice = curr.parts.reduce((acc, curr) => {
94
+ return acc + curr.price * curr.amount;
95
+ }, 0);
96
+ return curr.rot ? acc + curr.price * curr.amount + partsPrice : acc;
97
+ }, 0) + Number(state.options.start_fee);
98
+ return totalWithoutRot - totalWithRot;
99
+ };
100
+ const calculateRut = () => {
101
+ const totalWithRut = state.cart.reduce((acc, curr) => {
102
+ return curr.rut ? acc + getItemPrice(curr) : acc;
103
+ }, 0) + getStartFee().rut;
104
+ const totalWithoutRut = state.cart.reduce((acc, curr) => {
105
+ const partsPrice = curr.parts.reduce((acc, curr) => {
106
+ return acc + curr.price * curr.amount;
107
+ }, 0);
108
+ return curr.rut ? acc + curr.price * curr.amount + partsPrice : acc;
109
+ }, 0) + Number(state.options.start_fee);
110
+ return totalWithoutRut - totalWithRut;
111
+ };
112
+ const getTotalPrice = () => {
113
+ return state.cart.reduce((acc, curr) => acc + getItemPrice(curr), 0) + getStartFee().rot + getStartFee().rut;
114
+ };
82
115
 
83
- export { getProductPrice as a, getStartFee as b, getPartPrice as c, getProductPriceWithRotAndRut as g };
116
+ export { getProductPrice as a, getPartPrice as b, getStartFee as c, getTotalPrice as d, calculateRot as e, calculateRut as f, getProductPriceWithRotAndRut as g };
84
117
 
85
- //# sourceMappingURL=calc-a9ece205.js.map
118
+ //# sourceMappingURL=calc-c54e0b20.js.map
@@ -0,0 +1 @@
1
+ {"file":"calc-c54e0b20.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -0,0 +1,9 @@
1
+ const hideField = (field) => {
2
+ return field.split(' ').reduce((acc, curr) => {
3
+ return curr.length < 2 ? curr : acc + curr.slice(0, 1) + '*'.repeat(curr.length - 2) + curr.slice(curr.length - 1, curr.length) + ' ';
4
+ }, '');
5
+ };
6
+
7
+ export { hideField as h };
8
+
9
+ //# sourceMappingURL=form-b1c4b8a6.js.map
@@ -0,0 +1 @@
1
+ {"file":"form-b1c4b8a6.js","mappings":";;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,5 +1,6 @@
1
- import { r as registerInstance, h } from './index-59ed730c.js';
2
- import { s as state } from './index-75ed3bb8.js';
1
+ import { r as registerInstance, h } from './index-ff4893e5.js';
2
+ import { s as state } from './index-871f8d65.js';
3
+ import { h as hideField } from './form-b1c4b8a6.js';
3
4
 
4
5
  const HemfixarnaAddress = class {
5
6
  constructor(hostRef) {
@@ -19,24 +20,25 @@ const HemfixarnaAddress = class {
19
20
  this.townError = 'Ange en ort';
20
21
  }
21
22
  if (streetValid && zipValid && townValid) {
23
+ state.user = Object.assign(Object.assign({}, state.user), { street: this.street, zip: this.zip, town: this.town });
22
24
  state.checkoutStep = 2;
23
25
  state.checkoutEdit = false;
24
26
  }
25
27
  };
26
28
  this.handleChangeStreet = (e) => {
27
29
  this.streetError = null;
28
- this.street = e.target.value;
30
+ this.street = this.street === state.user.street ? '' : e.target.value;
29
31
  };
30
32
  this.handleChangeZip = (e) => {
31
33
  this.zipError = null;
32
- this.zip = e.target.value;
34
+ this.zip = this.zip === state.user.zip ? '' : e.target.value;
33
35
  };
34
36
  this.handleChangeTown = (e) => {
35
37
  this.townError = null;
36
- this.town = e.target.value;
38
+ this.town = this.town === state.user.town ? '' : e.target.value;
37
39
  };
38
40
  this.render = () => {
39
- return (h("form", { class: "hemfixarna_address", onSubmit: e => this.handleSubmit(e) }, h("div", null, h("input", { class: `${this.street.length ? 'input_active' : ''}`, onChange: e => this.handleChangeStreet(e), type: "text", name: "street", value: this.street }), h("label", { htmlFor: "street" }, "Gatuaddress ")), this.streetError && h("span", null, this.streetError), h("div", null, h("input", { class: `${this.zip.length ? 'input_active' : ''}`, onChange: e => this.handleChangeZip(e), type: "tel", name: "zip", value: this.zip }), h("label", { htmlFor: "zip" }, "Postnummer ")), this.zipError && h("span", null, this.zipError), h("div", null, h("input", { class: `${this.town.length ? 'input_active' : ''}`, onChange: e => this.handleChangeTown(e), type: "text", name: "town", value: this.town }), h("label", { htmlFor: "town" }, "Ort ")), this.townError && h("span", null, this.townError), h("input", { type: "submit", value: "Forts\u00E4tt och Boka" })));
41
+ return (h("form", { class: "hemfixarna_address", onSubmit: e => this.handleSubmit(e) }, h("div", null, h("input", { class: `${this.street.length ? 'input_active' : ''}`, onInput: this.handleChangeStreet, type: "text", name: "street", value: this.street === state.user.street ? hideField(this.street) : this.street }), h("label", { htmlFor: "street" }, "Gatuaddress ")), this.streetError && h("span", null, this.streetError), h("div", null, h("input", { class: `${this.zip.length ? 'input_active' : ''}`, onInput: this.handleChangeZip, type: "tel", name: "zip", value: this.zip === state.user.zip ? hideField(this.zip) : this.zip }), h("label", { htmlFor: "zip" }, "Postnummer ")), this.zipError && h("span", null, this.zipError), h("div", null, h("input", { class: `${this.town.length ? 'input_active' : ''}`, onInput: this.handleChangeTown, type: "text", name: "town", value: this.town === state.user.town ? hideField(this.town) : this.town }), h("label", { htmlFor: "town" }, "Ort ")), this.townError && h("span", null, this.townError), h("input", { type: "submit", value: "Forts\u00E4tt och Boka" })));
40
42
  };
41
43
  this.street = '';
42
44
  this.streetError = null;
@@ -45,6 +47,13 @@ const HemfixarnaAddress = class {
45
47
  this.town = '';
46
48
  this.townError = null;
47
49
  }
50
+ componentWillLoad() {
51
+ if (state.user) {
52
+ this.street = state.user.street;
53
+ this.zip = state.user.zip;
54
+ this.town = state.user.town;
55
+ }
56
+ }
48
57
  };
49
58
 
50
59
  export { HemfixarnaAddress as hemfixarna_address };
@@ -1 +1 @@
1
- {"file":"hemfixarna-address.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"hemfixarna-address.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,6 +1,6 @@
1
- import { r as registerInstance, h } from './index-59ed730c.js';
2
- import { s as state } from './index-75ed3bb8.js';
3
- import { a as getProductPrice } from './calc-a9ece205.js';
1
+ import { r as registerInstance, h } from './index-ff4893e5.js';
2
+ import { s as state } from './index-871f8d65.js';
3
+ import { a as getProductPrice } from './calc-c54e0b20.js';
4
4
 
5
5
  const HemfixarnaBox = class {
6
6
  constructor(hostRef) {
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, g as getAssetPath, h } from './index-59ed730c.js';
2
- import { s as state } from './index-75ed3bb8.js';
1
+ import { r as registerInstance, g as getAssetPath, h } from './index-ff4893e5.js';
2
+ import { s as state } from './index-871f8d65.js';
3
3
 
4
4
  const HemfixarnaBreadcrumbs = class {
5
5
  constructor(hostRef) {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-59ed730c.js';
1
+ import { r as registerInstance, h } from './index-ff4893e5.js';
2
2
  import { B as Business, T as TopCategory } from './index-2bf8566c.js';
3
3
 
4
4
  const hemfixarnaByggmaxCss = "";
@@ -1,77 +1,16 @@
1
- import { r as registerInstance, g as getAssetPath, h } from './index-59ed730c.js';
2
- import { s as state } from './index-75ed3bb8.js';
3
- import { a as getProductPrice, b as getStartFee, c as getPartPrice } from './calc-a9ece205.js';
1
+ import { r as registerInstance, g as getAssetPath, h } from './index-ff4893e5.js';
2
+ import { s as state } from './index-871f8d65.js';
4
3
 
5
4
  const HemfixarnaCart = class {
6
5
  constructor(hostRef) {
7
6
  registerInstance(this, hostRef);
8
7
  this.tree = undefined;
9
8
  }
10
- getItemPrice(item) {
11
- const partsPrice = item.parts.reduce((acc, curr) => {
12
- return acc + curr.price * curr.amount;
13
- }, 0);
14
- return getProductPrice(item, item.price * item.amount + partsPrice);
15
- }
16
- getTotalPrice() {
17
- return state.cart.reduce((acc, curr) => acc + this.getItemPrice(curr), 0) + getStartFee().rot + getStartFee().rut;
18
- }
19
- goToProduct(id) {
20
- const services = this.tree.sub_cats.map((c) => c.services).flat();
21
- const products = services.map((s) => s.products).flat();
22
- const product = products.find((p) => p.ID === id);
23
- const service = services.find((s) => s.products.find((p) => p.ID === id));
24
- const category = this.tree.sub_cats.find((c) => c.services.find((s) => s.products.find((p) => p.ID === id)));
25
- state.selectedCategory = category;
26
- state.selectedService = service;
27
- state.selectedProduct = product;
28
- state.step = 4;
29
- }
30
- toggleRot() {
31
- state.rot = !state.rot;
32
- }
33
- toggleRut() {
34
- state.rut = !state.rut;
35
- }
36
- calculateRot() {
37
- const totalWithRot = state.cart.reduce((acc, curr) => {
38
- return curr.rot ? acc + this.getItemPrice(curr) : acc;
39
- }, 0) + getStartFee().rot;
40
- const totalWithoutRot = state.cart.reduce((acc, curr) => {
41
- const partsPrice = curr.parts.reduce((acc, curr) => {
42
- return acc + curr.price * curr.amount;
43
- }, 0);
44
- return curr.rot ? acc + curr.price * curr.amount + partsPrice : acc;
45
- }, 0) + Number(state.options.start_fee);
46
- return totalWithoutRot - totalWithRot;
47
- }
48
- calculateRut() {
49
- const totalWithRut = state.cart.reduce((acc, curr) => {
50
- return curr.rut ? acc + this.getItemPrice(curr) : acc;
51
- }, 0) + getStartFee().rut;
52
- const totalWithoutRut = state.cart.reduce((acc, curr) => {
53
- const partsPrice = curr.parts.reduce((acc, curr) => {
54
- return acc + curr.price * curr.amount;
55
- }, 0);
56
- return curr.rut ? acc + curr.price * curr.amount + partsPrice : acc;
57
- }, 0) + Number(state.options.start_fee);
58
- return totalWithoutRut - totalWithRut;
59
- }
60
- openMontering() {
61
- state.modal = {
62
- title: 'Monteringsavgift',
63
- text: [
64
- 'Monteringsavgiften är en fast avgift som läggs på din beställning. Avgiften täcker kostnader för att montera produkterna du beställer.',
65
- 'Monteringsavgiften debiteras per påbörjat nytt uppdrag. Om du bokar ett uppdrag som både innehåller RUT- och ROT-avdrag så kommer uppdraget att delas upp och således kommer två monteringsavgifter att debiteras och två fakturor att utställas.',
66
- ],
67
- };
68
- }
69
9
  render() {
70
10
  const back = getAssetPath(`./assets/back.svg`);
71
- const info = getAssetPath(`./assets/info.svg`);
72
11
  return (h("div", { class: "hemfixarna_cart" }, h("div", { class: "hemfixarna_cart--left" }, h("h2", null, state.checkoutStep === 2 && !state.checkoutEdit && (h("button", { onClick: () => {
73
12
  state.checkoutStep = 1;
74
- } }, h("img", { width: 24, src: back, alt: "back arrow" }))), "Din bokning"), h("ul", { class: "hemfixarna_cart--items" }, state.cart.map(item => (h("li", { class: "hemfixarna_cart--item" }, h("div", null, h("div", null, item.icon && h("img", { width: 30, src: item.icon, alt: item.name }), h("p", null, h("strong", null, item.amount, "x "), item.name)), h("button", { onClick: () => this.goToProduct(item.id) }, "\u00C4ndra")), h("p", null, h("strong", null, getProductPrice(item, item.price, item.amount), "kr")), item.parts.length > 0 && (h("ul", null, item.parts.map(part => (h("li", null, h("p", null, h("strong", null, part.amount, "x "), part.name), h("p", null, h("strong", null, getPartPrice(part, item, part.amount), "kr"))))))))))), h("div", { class: "hemfixarna_cart--additional" }, getStartFee().length > 0 && (h("div", { class: "hemfixarna_cart--startfee" }, h("p", null, getStartFee().length, "x", ' ', h("strong", { onClick: () => this.openMontering() }, "Monteringsavgift", h("img", { height: 16, src: info, alt: "info monteringsavgift" }))), h("p", null, getStartFee().rot + getStartFee().rut, "kr"))), state.cart.find((item) => item.rot) && (h("div", { class: "hemfixarna_cart--rutrot" }, h("div", null, h("label", { class: "switch" }, h("input", { checked: state.rot, onChange: () => this.toggleRot(), type: "checkbox" }), h("span", { class: "slider" })), h("p", null, "ROT-avdrag")), h("p", null, "(-", state.rot ? this.calculateRot() : 0, "kr)"))), state.cart.find((item) => item.rut) && (h("div", { class: "hemfixarna_cart--rutrot" }, h("div", null, h("label", { class: "switch" }, h("input", { onChange: () => this.toggleRut(), checked: state.rut, type: "checkbox" }), h("span", { class: "slider" })), h("p", null, "RUT-avdrag")), h("p", null, "(-", state.rut ? this.calculateRut() : 0, "kr)")))), h("div", { class: "hemfixarna_cart--price" }, h("h2", null, "Totalbelopp: "), h("h2", null, this.getTotalPrice(), "kr"))), h("div", { class: "hemfixarna_cart--right" }, h("h2", null, state.checkoutStep === 2 && !state.checkoutEdit && (h("button", { onClick: () => {
13
+ } }, h("img", { width: 24, src: back, alt: "back arrow" }))), "Din bokning"), h("hemfixarna-orderrows", { tree: this.tree })), h("div", { class: "hemfixarna_cart--right" }, h("h2", null, state.checkoutStep === 2 && !state.checkoutEdit && (h("button", { onClick: () => {
75
14
  state.checkoutStep = 1;
76
15
  } }, h("img", { width: 24, src: back, alt: "back arrow" }))), "Dina uppgifter"), h("hemfixarna-checkout", null), h("hemfixarna-info", null))));
77
16
  }
@@ -1 +1 @@
1
- {"file":"hemfixarna-cart.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"hemfixarna-cart.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h } from './index-59ed730c.js';
2
- import { s as state } from './index-75ed3bb8.js';
1
+ import { r as registerInstance, h } from './index-ff4893e5.js';
2
+ import { s as state } from './index-871f8d65.js';
3
3
 
4
4
  const HemfixarnaCategory = class {
5
5
  constructor(hostRef) {
@@ -12,7 +12,10 @@ const HemfixarnaCategory = class {
12
12
  render() {
13
13
  return (h("div", null, h("h2", null, state.selectedCategory.name), h("div", { class: "hemfixarna_categories--wrapper" }, h("div", null, h("ul", { class: "hemfixarna_categories" }, state.selectedCategory.services
14
14
  .sort((a, b) => (a.post_title < b.post_title ? -1 : 1))
15
- .map(s => (h("hemfixarna-box", { post: s, icon: s.icon.url, postTitle: s.post_title }))))), h("hemfixarna-info", { list: state.options.trust }))));
15
+ .map(s => {
16
+ var _a;
17
+ return (h("hemfixarna-box", { post: s, icon: (_a = s.icon.url) !== null && _a !== void 0 ? _a : s.icon, postTitle: s.post_title }));
18
+ }))), h("hemfixarna-info", { list: state.options.trust }))));
16
19
  }
17
20
  };
18
21
 
@@ -1 +1 @@
1
- {"file":"hemfixarna-category.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"hemfixarna-category.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,5 +1,8 @@
1
- import { r as registerInstance, g as getAssetPath, h, F as Fragment, e as getElement } from './index-59ed730c.js';
2
- import { s as state } from './index-75ed3bb8.js';
1
+ import { r as registerInstance, g as getAssetPath, h, F as Fragment, e as getElement } from './index-ff4893e5.js';
2
+ import { s as state } from './index-871f8d65.js';
3
+ import { h as hideField } from './form-b1c4b8a6.js';
4
+ import { a as getProductPrice, b as getPartPrice, c as getStartFee, d as getTotalPrice } from './calc-c54e0b20.js';
5
+ import { p as postOrder } from './api-3a3e41fd.js';
3
6
 
4
7
  const HemfixarnaCheckout = class {
5
8
  constructor(hostRef) {
@@ -9,10 +12,38 @@ const HemfixarnaCheckout = class {
9
12
  this.date = e.target.value;
10
13
  };
11
14
  this.handleChangeTerms = () => {
12
- this.termsError = null;
15
+ this.generalError = null;
16
+ };
17
+ this.sendOrder = async () => {
18
+ // Test order post (remove later)
19
+ const order = {
20
+ name: state.user.firstName + ' ' + state.user.lastName,
21
+ customer: state.business,
22
+ phone: state.user.phone,
23
+ social_security_number: state.user.ssn,
24
+ email: state.user.email,
25
+ address: `${state.user.street} | ${state.user.zip} | ${state.user.town}`,
26
+ earliest_visit_date: this.date,
27
+ order_items: JSON.stringify(state.cart.map(item => `${item.amount}st ${item.name} ${getProductPrice(item, item.price, item.amount)}kr ${item.parts.length ? `| ${item.parts.map(part => `${part.amount}st ${part.name} ${getPartPrice(part, item, part.amount)}kr`).join(' | ')} ` : ''} ${item.rot && state.rot ? '(med rot)' : state.rut && item.rut ? '(med rut)' : '(utan rut/rot)'}`)),
28
+ start_fee: `${getStartFee().rut > 0 ? `Rut: ${getStartFee().rut}kr` : 'Rut: 0'} ` + `${getStartFee().rot > 0 ? `Rot: ${getStartFee().rot}kr` : 'Rot: 0'}`,
29
+ total: getTotalPrice(),
30
+ };
31
+ try {
32
+ const { data: orderConfirm, status } = await postOrder(order);
33
+ if (orderConfirm && status && status === 200) {
34
+ state.step = 6;
35
+ }
36
+ else {
37
+ this.generalError = 'Något gick fel, försök igen senare';
38
+ }
39
+ }
40
+ catch (_) {
41
+ this.generalError = 'Något gick fel, försök igen senare';
42
+ }
13
43
  };
14
44
  this.handleSubmit = (e) => {
15
45
  e.preventDefault();
46
+ this.generalError = null;
16
47
  const validDate = this.date.length > 0;
17
48
  if (!validDate) {
18
49
  this.dateError = 'Ange ett giltigt datum';
@@ -20,11 +51,10 @@ const HemfixarnaCheckout = class {
20
51
  const checkBoxes = Array.from(this.el.querySelectorAll('input[type="checkbox"]'));
21
52
  const notValidTerms = checkBoxes.find(i => !i.checked);
22
53
  if (notValidTerms) {
23
- this.termsError = 'Du måste godkänna villkoren';
54
+ this.generalError = 'Du måste godkänna villkoren';
24
55
  }
25
56
  if (validDate && !notValidTerms) {
26
- state.step = 6;
27
- state.cart = [];
57
+ this.sendOrder();
28
58
  }
29
59
  };
30
60
  this.render = () => {
@@ -37,14 +67,19 @@ const HemfixarnaCheckout = class {
37
67
  return h("hemfixarna-getuser", null);
38
68
  }
39
69
  else if (state.checkoutStep === 2) {
40
- return (h("div", { class: "mb-2" }, h("div", { class: "hemfixarna_addressinfo" }, h("p", null, "namn"), h("p", null, state.user.email), h("p", null, state.user.phone), 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), h("label", { class: "hemfixarna_checkbox" }, h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), h("span", { innerHTML: state.options.terms })), state.cart
70
+ 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), h("label", { class: "hemfixarna_checkbox" }, h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), h("span", { innerHTML: state.options.terms })), state.cart
41
71
  .filter(i => i.terms_checkout && i.terms_show_checkbox)
42
- .map(item => (h(Fragment, null, h("label", { class: "hemfixarna_checkbox" }, h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), h("span", null, item.terms_checkout))))), this.termsError && h("span", null, this.termsError), h("input", { type: "submit", value: "Slutf\u00F6r Bokning" }))));
72
+ .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("input", { type: "submit", value: "Slutf\u00F6r Bokning" }))));
43
73
  }
44
74
  };
45
75
  this.date = '';
46
76
  this.dateError = null;
47
- this.termsError = null;
77
+ this.generalError = null;
78
+ }
79
+ componentWillLoad() {
80
+ if (Boolean(state.user && state.user.street)) {
81
+ state.checkoutStep = 2;
82
+ }
48
83
  }
49
84
  get el() { return getElement(this); }
50
85
  };
@@ -1 +1 @@
1
- {"file":"hemfixarna-checkout.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"hemfixarna-checkout.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,9 +1,9 @@
1
- import { r as registerInstance, g as getAssetPath, h, e as getElement } from './index-59ed730c.js';
2
- import { s as state } from './index-75ed3bb8.js';
3
- import { g as getTaxonomy, a as getOptions } from './api-3228fe30.js';
4
- import { g as getProductPriceWithRotAndRut } from './calc-a9ece205.js';
1
+ import { r as registerInstance, g as getAssetPath, h, e as getElement } from './index-ff4893e5.js';
2
+ import { s as state } from './index-871f8d65.js';
3
+ import { g as getTaxonomy, a as getOptions } from './api-3a3e41fd.js';
4
+ import { g as getProductPriceWithRotAndRut } from './calc-c54e0b20.js';
5
5
 
6
- const hemfixarnaCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); *{box-sizing:border-box}:host{font-family:\"Inter\", sans-serif}:host .mb-2{margin-bottom:2rem}:host form{display:flex;flex-direction:column;gap:1rem}:host form img{position:absolute;top:50%;transform:translateY(-50%);pointer-events:none}:host form img:first-of-type{left:1rem}:host form img:last-of-type{right:1rem}:host form span{margin-top:-0.5rem;color:#ec6632}:host form p{text-align:center}:host form p{margin:0}:host form div{position:relative}:host form div label{pointer-events:none;position:absolute;left:1rem;top:50%;transform:translateY(-50%);background:#fff;padding:0.25rem;transition:0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host form div input{padding:1rem;width:100%;font-size:1rem;border:1px solid #fcd9c9}:host form div input:focus~label,:host form div .input_active~label{top:0;transform:translateY(-50%);background:linear-gradient(180deg, #fffaf2 50%, #fff 50%)}:host h1{font-size:24px;font-weight:400;line-height:32px;letter-spacing:-3%;text-align:left;margin:0 0 0.5rem}:host h2{margin:0 0 1.5rem;font-weight:700;font-size:20px;line-height:28px;letter-spacing:-3%}:host p{font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna{width:100%;}:host .hemfixarna .switch{position:relative;display:inline-block;width:40px;height:20px}:host .hemfixarna .switch input{opacity:0;width:0;height:0}:host .hemfixarna .slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:0.4s;transition:0.4s;border-radius:34px}:host .hemfixarna .slider:before{position:absolute;content:\"\";height:18px;width:18px;left:2px;bottom:1px;background-color:white;-webkit-transition:0.4s;transition:0.4s;border-radius:50%}:host .hemfixarna input:checked+.slider{background-color:#fcd9c9}:host .hemfixarna input:focus+.slider{box-shadow:0 0 1px #fcd9c9}:host .hemfixarna input:checked+.slider:before{-webkit-transform:translateX(18px);-ms-transform:translateX(18px);transform:translateX(18px);background:#ec6632}:host .hemfixarna_checkbox{display:grid;grid-template-columns:2.5rem auto;font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna_checkbox>span{transform:translateY(6px)}:host .hemfixarna_checkbox span,:host .hemfixarna_checkbox span p{color:#474444;font-size:14px}:host .hemfixarna_checkbox p{text-align:left}:host .hemfixarna_info{display:flex;flex-direction:column;gap:1.5rem;padding:2rem;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);border-radius:0.25rem;border:1px solid #fcd9c9}:host .hemfixarna_info h2{margin:0}@media (min-width: 769px){:host .hemfixarna_info{position:sticky;top:0}}:host .hemfixarna_infomodal{position:absolute;top:40%;left:50%;transform:translate(-50%, -50%);width:100%;max-width:80%;background:#fffaf2;border:1px solid #fcd9c9;padding:2rem;z-index:99;border-radius:0.25rem;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;flex-direction:column;gap:1rem}:host .hemfixarna_infomodal button{background:#ec6632;color:#fff;border-radius:60px;font-size:16px;padding:0.5rem 1rem}:host .hemfixarna_addressinfo{padding:1rem 1rem 4rem;border:1px solid #fcd9c9;position:relative;margin-bottom:2rem}:host .hemfixarna_addressinfo button{position:absolute;bottom:1rem;right:1rem;font-weight:500;text-underline-offset:2px;text-decoration:underline}:host .hemfixarna_part{background:#fff;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:grid;padding:1rem;grid-template-columns:auto 75px}:host .hemfixarna_counter{display:flex;align-items:center}:host .hemfixarna_counter span{padding:0 0.5rem}:host .hemfixarna_counter img{cursor:pointer}:host .hemfixarna_counter img:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_terms{font-size:14px}:host .hemfixarna_terms a{color:inherit}:host .hemfixarna_logo{height:4rem}:host .hemfixarna_box{padding:1rem;display:flex;align-items:center;justify-content:space-between;background:#fffaf2;border:1px solid #fcd9c9;width:100%;box-sizing:border-box;border-radius:0.25rem;gap:1rem 0.5rem}:host .hemfixarna_box>div{display:grid;gap:0.5rem}:host .hemfixarna_btn,:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{border:none;border-radius:60px;font-weight:600;letter-spacing:0.5px;line-height:20px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_btn:not(.disabled):hover,:host .hemfixarna_buy:not(.disabled):hover,:host .hemfixarna input[type=submit]:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_btn{font-size:14px;background:#c84e18;color:#fff;padding:1rem 2rem;white-space:nowrap;position:relative}:host .hemfixarna_btn span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-0.5rem;right:-0.75rem}:host .hemfixarna_btn span{background:#25a710;color:#fff;right:0 !important}:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{font-size:21px;background:#25a710;color:#fff;padding:1rem 1.5rem}:host .hemfixarna .disabled{opacity:0.5;cursor:default}:host .hemfixarna_modal{position:fixed;background:#fffaf2;border:1px solid #fcd9c9;border-radius:0.25rem;top:50%;left:50%;z-index:1000;transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);transform:translate(-50%, -50%) scale(0.7);opacity:0;height:92%;width:92%;max-width:920px;display:flex;flex-direction:column;gap:0.5rem}:host .hemfixarna_modal--open{opacity:1;transform:translate(-50%, -50%) scale(1)}:host .hemfixarna_backdrop{z-index:999;position:fixed;background:#474444;top:0;left:0;bottom:0;right:0;opacity:0;transition:transform 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946), opacity 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host .hemfixarna_backdrop--open{opacity:0.3}:host .hemfixarna_order{position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;background-repeat:no-repeat !important;background-size:cover !important;background-position:center !important;display:grid;grid-template-columns:1fr 1fr;padding:3rem 2rem 4rem}@media (max-width: 768px){:host .hemfixarna_order{grid-template-columns:1fr;grid-template-rows:0 auto}}:host .hemfixarna_order div:last-of-type{background:#fffaf2;padding:2rem;display:flex;flex-direction:column}:host .hemfixarna_order img{cursor:pointer}:host .hemfixarna_order button{margin:1rem 0;padding:0;text-decoration:underline;text-underline-offset:2px;font-size:14px;font-weight:600}:host .hemfixarna_cart{display:grid;grid-template-columns:1fr 1fr;gap:2rem}@media (max-width: 768px){:host .hemfixarna_cart{grid-template-columns:1fr;gap:0}}:host .hemfixarna_cart--right h2,:host .hemfixarna_cart--left h2{display:flex;align-items:center}:host .hemfixarna_cart--right h2 img,:host .hemfixarna_cart--left h2 img{margin-top:0.2rem}@media (min-width: 769px){:host .hemfixarna_cart--left h2 button{display:none}}@media (max-width: 768px){:host .hemfixarna_cart--right h2 button{display:none}}:host .hemfixarna_cart--startfee{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot div{display:flex;gap:1rem;align-items:center}:host .hemfixarna_cart--additional{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--additional p{font-size:14px}:host .hemfixarna_cart--additional strong{text-decoration:underline;text-underline-offset:2px;cursor:pointer;position:relative}:host .hemfixarna_cart--additional strong img{position:absolute;top:50%;transform:translateY(-50%);right:-1.5rem}:host .hemfixarna_cart--price{border-top:1px solid #fcd9c9;padding:1rem;display:flex;justify-content:space-between}:host .hemfixarna_cart--price h3{margin:0}:host .hemfixarna_cart--item{display:flex;flex-direction:column;gap:0.5rem;padding:1rem 0;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--item>div{display:flex;justify-content:space-between}:host .hemfixarna_cart--item>div>div{display:flex;align-items:center;gap:1rem}:host .hemfixarna_cart--item>div button{color:#ec6632}:host .hemfixarna_categories{display:grid;gap:1.5rem}:host .hemfixarna_categories--wrapper{gap:2rem;display:grid;grid-template-columns:1fr 1fr}@media (max-width: 768px){:host .hemfixarna_categories--wrapper{grid-template-columns:1fr}}:host .hemfixarna_categories li{position:relative;background:#fff;border-radius:0.25rem;min-height:132px;padding:1.5rem;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;align-items:center;gap:1.5rem;cursor:pointer}:host .hemfixarna_categories li:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_categories li>button{height:100%;width:100%}:host .hemfixarna_categories li .price{font-weight:700}:host .hemfixarna_content{height:100%;overflow:auto;padding:0 2rem 4rem}:host .hemfixarna_content--5{padding-top:1rem}:host .hemfixarna_crumbs{position:relative;padding:1rem 1.5rem;border-bottom:1px solid #fcd9c9;display:flex;justify-content:space-between}:host .hemfixarna_crumbs--back{padding:1rem 1.5rem 0.5rem;display:flex;align-items:center;gap:0.5rem;box-shadow:none !important}:host .hemfixarna_crumbs--back:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs img{cursor:pointer}:host .hemfixarna_crumbs .close{position:absolute;right:-1rem;top:-1rem;z-index:9}:host .hemfixarna_crumbs .cart{padding-left:1rem;position:relative}:host .hemfixarna_crumbs .cart img{cursor:inherit}:host .hemfixarna_crumbs .cart span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-0.5rem;right:-0.75rem}:host .hemfixarna_crumbs .cart_active{cursor:pointer}:host .hemfixarna_crumbs .cart_active span{background:#25a710;color:#fff}:host .hemfixarna_crumbs--links{display:flex;align-items:center;gap:1rem;overflow:auto}@media (min-width: 769px){:host .hemfixarna_crumbs--links{-ms-overflow-style:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar{display:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar-button{display:none}}:host .hemfixarna_crumbs button{white-space:nowrap;background:#f1ded6;border-radius:4rem;padding:0.75rem 1rem;font-size:12px;font-weight:600;letter-spacing:0.3px;box-shadow:none !important}:host .hemfixarna_crumbs button:not(.active):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs .active{background:#fffaf2;cursor:default}:host .hemfixarna_features{gap:0.75rem !important}:host .hemfixarna_features li{display:flex;gap:1rem;align-items:center}:host .hemfixarna_address{margin-bottom:1rem}:host .hemfixarna_product{display:grid;gap:1rem}:host .hemfixarna_product--link{font-weight:700;color:#474444;text-underline-offset:0.25rem}:host .hemfixarna_product--left{gap:2rem}:host .hemfixarna_product--right{gap:2rem}:host .hemfixarna_product--price{margin-top:0.25rem;font-weight:700}:host .hemfixarna_product--total{text-align:center;margin:-1rem 0;font-size:21px;line-height:28px}:host .hemfixarna_product--item{background:#fff;padding:1rem;display:grid;grid-template-columns:auto 75px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_product--grid{display:grid;grid-template-columns:1fr 1fr;gap:2rem}@media (max-width: 768px){:host .hemfixarna_product--grid{grid-template-columns:1fr}}:host .hemfixarna_product--grid>div{display:flex;flex-direction:column}:host .hemfixarna_product--grid ul{display:flex;flex-direction:column;gap:0.5rem}:host .hemfixarna_product p{margin:0}:host .hemfixarna_product--top{display:flex;gap:2rem}:host .hemfixarna_product--top>div{width:100%}:host .hemfixarna_product--top>div h1{max-width:80%}@media (max-width: 768px){:host .hemfixarna_product--top>div h1{max-width:100%}}:host .hemfixarna_product--top h4{margin-bottom:0.5rem}:host h5,:host p{margin:0}:host input[type=submit]{cursor:pointer}:host input[type=date]~label{left:3.5rem}:host input[type=date]{border:1px solid #fcd9c9;padding-left:4rem}:host input[type=checkbox]{height:1.125rem;width:1.125rem;border:1px solid #fcd9c9}:host input[type=checkbox]:checked{background:red}:host input[type=date]::-webkit-calendar-picker-indicator{background:transparent;bottom:0;color:transparent;cursor:pointer;height:auto;left:0;position:absolute;right:0;top:0;width:auto}:host button,:host a{cursor:pointer;background:none;border:none}:host ul{list-style:none;margin:0;padding:0}";
6
+ const hemfixarnaCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); *{box-sizing:border-box}:host{font-family:\"Inter\", sans-serif}:host .mb-2{margin-bottom:2rem}:host form{display:flex;flex-direction:column;gap:1rem}:host form img{position:absolute;top:50%;transform:translateY(-50%);pointer-events:none}:host form img:first-of-type{left:1rem}:host form img:last-of-type{right:1rem}:host form span{margin-top:-0.5rem;color:#ec6632}:host form p{text-align:center}:host form p{margin:0}:host form div{position:relative}:host form div label{pointer-events:none;position:absolute;left:1rem;top:50%;transform:translateY(-50%);background:#fff;padding:0.25rem;transition:0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host form div input{padding:1rem;width:100%;font-size:1rem;border:1px solid #fcd9c9}:host form div input:focus~label,:host form div .input_active~label{top:0;transform:translateY(-50%);background:linear-gradient(180deg, #fffaf2 50%, #fff 50%)}:host h1{font-size:24px;font-weight:400;line-height:32px;letter-spacing:-3%;text-align:left;margin:0 0 0.5rem}:host h2{margin:0 0 1.5rem;font-weight:700;font-size:20px;line-height:28px;letter-spacing:-3%}:host p{font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna{width:100%;}:host .hemfixarna .switch{position:relative;display:inline-block;width:40px;height:20px}:host .hemfixarna .switch input{opacity:0;width:0;height:0}:host .hemfixarna .slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:0.4s;transition:0.4s;border-radius:34px}:host .hemfixarna .slider:before{position:absolute;content:\"\";height:18px;width:18px;left:2px;bottom:1px;background-color:white;-webkit-transition:0.4s;transition:0.4s;border-radius:50%}:host .hemfixarna input:checked+.slider{background-color:#fcd9c9}:host .hemfixarna input:focus+.slider{box-shadow:0 0 1px #fcd9c9}:host .hemfixarna input:checked+.slider:before{-webkit-transform:translateX(18px);-ms-transform:translateX(18px);transform:translateX(18px);background:#ec6632}:host .hemfixarna_checkbox{display:grid;grid-template-columns:2.5rem auto;font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna_checkbox>span{transform:translateY(6px)}:host .hemfixarna_checkbox span,:host .hemfixarna_checkbox span p{color:#474444;font-size:14px}:host .hemfixarna_checkbox p{text-align:left}:host .hemfixarna_info{display:flex;flex-direction:column;gap:1.5rem;padding:2rem;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);border-radius:0.25rem;border:1px solid #fcd9c9}:host .hemfixarna_info h2{margin:0}@media (min-width: 769px){:host .hemfixarna_info{position:sticky;top:0}}:host .hemfixarna_infomodal{position:absolute;top:40%;left:50%;transform:translate(-50%, -50%);width:100%;max-width:80%;background:#fffaf2;border:1px solid #fcd9c9;padding:2rem;z-index:99;border-radius:0.25rem;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;flex-direction:column;gap:1rem}:host .hemfixarna_infomodal button{background:#ec6632;color:#fff;border-radius:60px;font-size:16px;padding:0.5rem 1rem}:host .hemfixarna_addressinfo{padding:1rem 1rem 4rem;border:1px solid #fcd9c9;position:relative;margin-bottom:2rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem}:host .hemfixarna_addressinfo button{position:absolute;bottom:1rem;right:1rem;font-weight:500;text-underline-offset:2px;text-decoration:underline}:host .hemfixarna_part{background:#fff;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:grid;padding:1rem;grid-template-columns:auto 75px}:host .hemfixarna_counter{display:flex;align-items:center}:host .hemfixarna_counter span{padding:0 0.5rem}:host .hemfixarna_counter img{cursor:pointer}:host .hemfixarna_counter img:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_terms{font-size:14px}:host .hemfixarna_terms a{color:inherit}:host .hemfixarna_logo{height:4rem}:host .hemfixarna_box{padding:1rem;display:flex;align-items:center;justify-content:space-between;background:#fffaf2;border:1px solid #fcd9c9;width:100%;box-sizing:border-box;border-radius:0.25rem;gap:1rem 0.5rem}:host .hemfixarna_box>div{display:grid;gap:0.5rem}:host .hemfixarna_btn,:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{border:none;border-radius:60px;font-weight:600;letter-spacing:0.5px;line-height:20px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_btn:not(.disabled):hover,:host .hemfixarna_buy:not(.disabled):hover,:host .hemfixarna input[type=submit]:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_btn{font-size:14px;background:#c84e18;color:#fff;padding:1rem 2rem;white-space:nowrap;position:relative}:host .hemfixarna_btn span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-0.5rem;right:-0.75rem}:host .hemfixarna_btn span{background:#25a710;color:#fff;right:0 !important}:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{font-size:21px;background:#25a710;color:#fff;padding:1rem 1.5rem}:host .hemfixarna .disabled{opacity:0.5;cursor:default}:host .hemfixarna_modal{position:fixed;background:#fffaf2;border:1px solid #fcd9c9;border-radius:0.25rem;top:50%;left:50%;z-index:1000;transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);transform:translate(-50%, -50%) scale(0.7);opacity:0;height:92%;width:92%;max-width:920px;display:flex;flex-direction:column;gap:0.5rem}:host .hemfixarna_modal--open{opacity:1;transform:translate(-50%, -50%) scale(1)}:host .hemfixarna_backdrop{z-index:999;position:fixed;background:#474444;top:0;left:0;bottom:0;right:0;opacity:0;transition:transform 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946), opacity 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host .hemfixarna_backdrop--open{opacity:0.3}:host .hemfixarna_order{position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;background-repeat:no-repeat !important;background-size:cover !important;background-position:center !important;display:grid;grid-template-columns:1fr 1fr;padding:3rem 2rem 4rem}@media (max-width: 768px){:host .hemfixarna_order{grid-template-columns:1fr;grid-template-rows:0 auto}}:host .hemfixarna_order>div:last-of-type{background:#fffaf2;padding:2rem;display:flex;flex-direction:column;max-height:100%;overflow:auto}:host .hemfixarna_order img{cursor:pointer}:host .hemfixarna_order button{margin:1rem 0;padding:0;text-decoration:underline;text-underline-offset:2px;font-size:14px;font-weight:600}:host .hemfixarna_cart{display:grid;grid-template-columns:1fr 1fr;gap:2rem}@media (max-width: 768px){:host .hemfixarna_cart{grid-template-columns:1fr;gap:0}}:host .hemfixarna_cart--right h2,:host .hemfixarna_cart--left h2{display:flex;align-items:center}:host .hemfixarna_cart--right h2 img,:host .hemfixarna_cart--left h2 img{margin-top:0.2rem}@media (min-width: 769px){:host .hemfixarna_cart--left h2 button{display:none}}@media (max-width: 768px){:host .hemfixarna_cart--right h2 button{display:none}}:host .hemfixarna_cart--startfee{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot div{display:flex;gap:1rem;align-items:center}:host .hemfixarna_cart--additional{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--additional p{font-size:14px}:host .hemfixarna_cart--additional strong{text-decoration:underline;text-underline-offset:2px;cursor:pointer;position:relative}:host .hemfixarna_cart--additional strong img{position:absolute;top:50%;transform:translateY(-50%);right:-1.5rem}:host .hemfixarna_cart--price{border-top:1px solid #fcd9c9;padding:1rem;display:flex;justify-content:space-between}:host .hemfixarna_cart--price h3{margin:0}:host .hemfixarna_cart--item{display:flex;flex-direction:column;gap:0.5rem;padding:1rem 0;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--item>div{display:flex;justify-content:space-between}:host .hemfixarna_cart--item>div>div{display:flex;align-items:center;gap:1rem}:host .hemfixarna_cart--item>div button{color:#ec6632}:host .hemfixarna_categories{display:grid;gap:1.5rem}:host .hemfixarna_categories--wrapper{gap:2rem;display:grid;grid-template-columns:1fr 1fr}@media (max-width: 768px){:host .hemfixarna_categories--wrapper{grid-template-columns:1fr}}:host .hemfixarna_categories li{position:relative;background:#fff;border-radius:0.25rem;min-height:132px;padding:1.5rem;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;align-items:center;gap:1.5rem;cursor:pointer}:host .hemfixarna_categories li:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_categories li>button{height:100%;width:100%}:host .hemfixarna_categories li .price{font-weight:700}:host .hemfixarna_content{height:100%;overflow:auto;padding:0 2rem 4rem}:host .hemfixarna_content--5{padding-top:1rem}:host .hemfixarna_crumbs{position:relative;padding:1rem 1.5rem;border-bottom:1px solid #fcd9c9;display:flex;justify-content:space-between}:host .hemfixarna_crumbs--back{padding:1rem 1.5rem 0.5rem;display:flex;align-items:center;gap:0.5rem;box-shadow:none !important}:host .hemfixarna_crumbs--back:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs img{cursor:pointer}:host .hemfixarna_crumbs .close{position:absolute;right:-1rem;top:-1rem;z-index:9}:host .hemfixarna_crumbs .cart{padding-left:1rem;position:relative}:host .hemfixarna_crumbs .cart img{cursor:inherit}:host .hemfixarna_crumbs .cart span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-0.5rem;right:-0.75rem}:host .hemfixarna_crumbs .cart_active{cursor:pointer}:host .hemfixarna_crumbs .cart_active span{background:#25a710;color:#fff}:host .hemfixarna_crumbs--links{display:flex;align-items:center;gap:1rem;overflow:auto}@media (min-width: 769px){:host .hemfixarna_crumbs--links{-ms-overflow-style:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar{display:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar-button{display:none}}:host .hemfixarna_crumbs button{white-space:nowrap;background:#f1ded6;border-radius:4rem;padding:0.75rem 1rem;font-size:12px;font-weight:600;letter-spacing:0.3px;box-shadow:none !important}:host .hemfixarna_crumbs button:not(.active):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs .active{background:#fffaf2;cursor:default}:host .hemfixarna_features{gap:0.75rem !important}:host .hemfixarna_features li{display:flex;gap:1rem;align-items:center}:host .hemfixarna_address{margin-bottom:1rem}:host .hemfixarna_product{display:grid;gap:1rem}:host .hemfixarna_product--link{font-weight:700;color:#474444;text-underline-offset:0.25rem}:host .hemfixarna_product--left{gap:2rem}:host .hemfixarna_product--right{gap:2rem}:host .hemfixarna_product--price{margin-top:0.25rem;font-weight:700}:host .hemfixarna_product--total{text-align:center;margin:-1rem 0;font-size:21px;line-height:28px}:host .hemfixarna_product--item{background:#fff;padding:1rem;display:grid;grid-template-columns:auto 75px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_product--grid{display:grid;grid-template-columns:1fr 1fr;gap:2rem}@media (max-width: 768px){:host .hemfixarna_product--grid{grid-template-columns:1fr}}:host .hemfixarna_product--grid>div{display:flex;flex-direction:column}:host .hemfixarna_product--grid ul{display:flex;flex-direction:column;gap:0.5rem}:host .hemfixarna_product p{margin:0}:host .hemfixarna_product--top{display:flex;gap:2rem}:host .hemfixarna_product--top>div{width:100%}:host .hemfixarna_product--top>div h1{max-width:80%}@media (max-width: 768px){:host .hemfixarna_product--top>div h1{max-width:100%}}:host .hemfixarna_product--top h4{margin-bottom:0.5rem}:host h5,:host p{margin:0}:host input[type=submit]{cursor:pointer}:host input[type=date]~label{left:3.5rem}:host input[type=date]{border:1px solid #fcd9c9;padding-left:4rem}:host input[type=checkbox]{height:1.125rem;width:1.125rem;border:1px solid #fcd9c9}:host input[type=checkbox]:checked{background:red}:host input[type=date]::-webkit-calendar-picker-indicator{background:transparent;bottom:0;color:transparent;cursor:pointer;height:auto;left:0;position:absolute;right:0;top:0;width:auto}:host button,:host a{cursor:pointer;background:none;border:none}:host ul{list-style:none;margin:0;padding:0}";
7
7
 
8
8
  const HemfixarnaComponent = class {
9
9
  constructor(hostRef) {
@@ -37,13 +37,16 @@ const HemfixarnaComponent = class {
37
37
  if (cart) {
38
38
  state.cart = JSON.parse(cart);
39
39
  }
40
+ const user = window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);
41
+ if (user) {
42
+ state.user = JSON.parse(user);
43
+ }
40
44
  const tree = await getTaxonomy(this.topCategory);
41
45
  if ((tree === null || tree === void 0 ? void 0 : tree.code) === 'not_found') {
42
46
  console.warn('tree not found');
43
47
  }
44
48
  else if (tree) {
45
49
  this.tree = tree;
46
- console.log(this.tree);
47
50
  }
48
51
  if (this.slug) {
49
52
  const res = await getTaxonomy(this.slug);
@@ -56,10 +59,6 @@ const HemfixarnaComponent = class {
56
59
  }
57
60
  const options = await getOptions();
58
61
  state.options = options;
59
- // const token = await initializeFelix();
60
- // if (token) {
61
- // console.log(token);
62
- // }
63
62
  }
64
63
  setTaxonomy(taxonomy) {
65
64
  if (taxonomy) {
@@ -118,7 +117,7 @@ const HemfixarnaComponent = class {
118
117
  render() {
119
118
  var _a, _b;
120
119
  const logo = getAssetPath(`./assets/hemfixarna.svg`);
121
- return (h("div", { class: "hemfixarna" }, h("div", { class: "hemfixarna_box" }, h("div", null, h("div", null, h("p", null, ((_a = this.product) === null || _a === void 0 ? void 0 : _a.post_title) || (h("span", null, "Montering/Installation p\u00E5 plats - ", h("strong", null, "se priser h\u00E4r"))), this.product && ((_b = this.slug) === null || _b === void 0 ? void 0 : _b.includes('product')) ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.product), "kr"))) : null)), h("img", { src: logo, width: 104 })), h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn" }, "Till montering", this.getCartLength() > 0 && h("span", null, this.getCartLength()))), this.modal && (h("div", null, h("div", { class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` }, state.modal && (h("div", { class: "hemfixarna_infomodal" }, h("h2", null, state.modal.title), state.modal.text.map((t) => (h("p", null, t))), h("div", null, h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), this.tree && h("hemfixarna-breadcrumbs", { closeModal: () => this.closeModal(), tree: this.tree }), h("div", { class: `hemfixarna_content hemfixarna_content--${state.step}` }, state.step === 1 && this.tree && h("hemfixarna-start", { tree: this.tree }), state.step === 2 && state.selectedCategory && h("hemfixarna-category", null), state.step === 3 && state.selectedService && h("hemfixarna-service", null), state.step === 4 && state.selectedProduct && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", null))), h("div", { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` })))));
120
+ return (h("div", { class: "hemfixarna" }, h("div", { class: "hemfixarna_box" }, h("div", null, h("div", null, h("p", null, ((_a = this.product) === null || _a === void 0 ? void 0 : _a.post_title) || (h("span", null, "Montering/Installation p\u00E5 plats - ", h("strong", null, "se priser h\u00E4r"))), this.product && ((_b = this.slug) === null || _b === void 0 ? void 0 : _b.includes('product')) ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.product), "kr"))) : null)), h("img", { src: logo, width: 104 })), h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn" }, "Till montering", this.getCartLength() > 0 && h("span", null, this.getCartLength()))), this.modal && (h("div", null, h("div", { class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` }, state.modal && (h("div", { class: "hemfixarna_infomodal" }, h("h2", null, state.modal.title), state.modal.text.map((t) => (h("p", null, t))), h("div", null, h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), this.tree && h("hemfixarna-breadcrumbs", { closeModal: () => this.closeModal(), tree: this.tree }), h("div", { class: `hemfixarna_content hemfixarna_content--${state.step}` }, state.step === 1 && this.tree && h("hemfixarna-start", { tree: this.tree }), state.step === 2 && state.selectedCategory && h("hemfixarna-category", null), state.step === 3 && state.selectedService && h("hemfixarna-service", null), state.step === 4 && state.selectedProduct && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", { tree: this.tree }))), h("div", { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` })))));
122
121
  }
123
122
  static get assetsDirs() { return ["assets"]; }
124
123
  get el() { return getElement(this); }
@@ -1 +1 @@
1
- {"file":"hemfixarna-component.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"hemfixarna-component.entry.esm.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,5 +1,5 @@
1
- import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-59ed730c.js';
2
- export { s as setNonce } from './index-59ed730c.js';
1
+ import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-ff4893e5.js';
2
+ export { s as setNonce } from './index-ff4893e5.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
@@ -157,7 +157,7 @@ const patchCloneNodeFix = (HTMLElementPrototype) => {
157
157
 
158
158
  patchBrowser().then(options => {
159
159
  globalScripts();
160
- return bootstrapLazy([["hemfixarna-cart",[[0,"hemfixarna-cart",{"tree":[16]}]]],["hemfixarna-category",[[0,"hemfixarna-category"]]],["hemfixarna-service",[[0,"hemfixarna-service"]]],["hemfixarna-start",[[0,"hemfixarna-start",{"tree":[16]}]]],["hemfixarna-product",[[0,"hemfixarna-product",{"amount":[32]}]]],["hemfixarna-breadcrumbs",[[0,"hemfixarna-breadcrumbs",{"tree":[16],"closeModal":[16]}]]],["hemfixarna-order",[[0,"hemfixarna-order"]]],["hemfixarna-address",[[0,"hemfixarna-address",{"street":[32],"streetError":[32],"zip":[32],"zipError":[32],"town":[32],"townError":[32]}]]],["hemfixarna-getuser",[[0,"hemfixarna-getuser",{"email":[32],"emailError":[32],"phone":[32],"phoneError":[32],"ssn":[32],"ssnError":[32]}]]],["hemfixarna-checkout",[[0,"hemfixarna-checkout",{"date":[32],"dateError":[32],"termsError":[32]}]]],["hemfixarna-box",[[0,"hemfixarna-box",{"post":[16],"icon":[1],"postTitle":[1,"post-title"]}]]],["hemfixarna-info",[[0,"hemfixarna-info",{"list":[16]}]]],["hemfixarna-component",[[1,"hemfixarna-component",{"slug":[1],"business":[1],"topCategory":[1,"top-category"],"modal":[32],"showModal":[32],"tree":[32],"product":[32]},[[0,"click","handleClick"]]]]],["hemfixarna-byggmax",[[1,"hemfixarna-byggmax",{"slug":[1],"tree":[32]}]]],["hemfixarna-demo",[[1,"hemfixarna-demo",{"selectedSlug":[32],"tooltipText":[32],"tree":[32]}]]]], options);
160
+ return bootstrapLazy([["hemfixarna-cart",[[0,"hemfixarna-cart",{"tree":[16]}]]],["hemfixarna-category",[[0,"hemfixarna-category"]]],["hemfixarna-order",[[0,"hemfixarna-order",{"tree":[16]}]]],["hemfixarna-service",[[0,"hemfixarna-service"]]],["hemfixarna-start",[[0,"hemfixarna-start",{"tree":[16]}]]],["hemfixarna-product",[[0,"hemfixarna-product",{"amount":[32]}]]],["hemfixarna-breadcrumbs",[[0,"hemfixarna-breadcrumbs",{"tree":[16],"closeModal":[16]}]]],["hemfixarna-address",[[0,"hemfixarna-address",{"street":[32],"streetError":[32],"zip":[32],"zipError":[32],"town":[32],"townError":[32]}]]],["hemfixarna-getuser",[[0,"hemfixarna-getuser",{"email":[32],"emailError":[32],"phone":[32],"phoneError":[32],"ssn":[32],"ssnError":[32]}]]],["hemfixarna-checkout",[[0,"hemfixarna-checkout",{"date":[32],"dateError":[32],"generalError":[32]}]]],["hemfixarna-orderrows",[[0,"hemfixarna-orderrows",{"cart":[4],"tree":[16]}]]],["hemfixarna-box",[[0,"hemfixarna-box",{"post":[16],"icon":[1],"postTitle":[1,"post-title"]}]]],["hemfixarna-info",[[0,"hemfixarna-info",{"list":[16]}]]],["hemfixarna-component",[[1,"hemfixarna-component",{"slug":[1],"business":[1],"topCategory":[1,"top-category"],"modal":[32],"showModal":[32],"tree":[32],"product":[32]},[[0,"click","handleClick"]]]]],["hemfixarna-byggmax",[[1,"hemfixarna-byggmax",{"slug":[1],"tree":[32]}]]],["hemfixarna-demo",[[1,"hemfixarna-demo",{"selectedSlug":[32],"tooltipText":[32],"tree":[32]}]]]], options);
161
161
  });
162
162
 
163
163
  //# sourceMappingURL=hemfixarna-components.esm.js.map
@@ -1,6 +1,6 @@
1
- import { r as registerInstance, g as getAssetPath, h } from './index-59ed730c.js';
1
+ import { r as registerInstance, g as getAssetPath, h } from './index-ff4893e5.js';
2
2
  import { B as Business, T as TopCategory } from './index-2bf8566c.js';
3
- import { g as getTaxonomy } from './api-3228fe30.js';
3
+ import { g as getTaxonomy } from './api-3a3e41fd.js';
4
4
 
5
5
  const hemfixarnaDemoCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); :host{font-family:\"Inter\", sans-serif}:host .hemfixarna_example{margin-bottom:1rem;background:#000;padding:1rem;color:#fff;display:flex;justify-content:space-between;cursor:pointer;max-width:500px;box-sizing:border-box;position:relative}:host .hemfixarna_example--tooltip{background:#000;top:-3rem;font-size:16px;left:40%;color:white;padding:0.5rem;position:absolute;opacity:0}:host .hemfixarna_example--tooltip::after{content:\"\";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}:host .hemfixarna_example:hover .hemfixarna_example--tooltip{opacity:1}:host .hemfixarna_example p{font-size:14px}:host .hemfixarna_example img{filter:invert(1)}:host .hemfixarna_install{display:grid;gap:0.5rem;margin-top:1rem}:host .hemfixarna_categories{max-height:100%;overflow:auto;position:relative}:host .hemfixarna_categories--label{display:flex;align-items:center;justify-content:space-between;padding:0.5rem}:host .hemfixarna_categories--label button{background:#3f3a92;border:none;font-weight:600;padding:0.2rem 0.6rem;border-radius:10px;margin-right:0.5rem;color:#ece8e8}:host .hemfixarna_categories--label button:active{transform:scale(0.95)}:host .hemfixarna_categories--label--big{font-weight:600;background:#9f9da9}:host p{margin:0}:host span{color:darkolivegreen;font-size:10px}:host button{cursor:pointer}:host>div{display:grid;gap:2rem;width:100%;grid-template-columns:1fr 1fr;height:100vh;place-items:center;overflow:hidden;padding:1rem 2rem;box-sizing:border-box}:host>div>*{width:100%}:host>div>div{max-width:500px}:host>div ul{margin:0;padding:0;list-style:none}:host>div ul ul{background:#000;gap:1px;display:grid}:host>div ul li{padding-left:1rem;background:#fff}";
6
6