hemfixarna-web-components 1.4.5 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/hemfixarna-address_32.cjs.entry.js +1 -1
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.js +1 -1
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.js.map +1 -1
- package/dist/esm/hemfixarna-address_32.entry.js +1 -1
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
- package/dist/hemfixarna-components/{p-d2942ebb.entry.js → p-3b2da615.entry.js} +2 -2
- package/package.json +1 -1
- /package/dist/hemfixarna-components/{p-d2942ebb.entry.js.map → p-3b2da615.entry.js.map} +0 -0
@@ -2503,7 +2503,7 @@ const HemfixarnaProduct = class {
|
|
2503
2503
|
? 'https://painting-dev.vercel.app/static/js/main.js'
|
2504
2504
|
: 'https://painting-frontend.vercel.app/static/js/main.js', defer: true, async: true }), index.h("hemfixare-calculator", { title: state.options.maleri_title, subtitle: state.options.maleri_text, modal: "true", customer: state.business === Business.string ? 'string' : state.business })));
|
2505
2505
|
}
|
2506
|
-
return state.selectedProduct ? (index.h("div", { class: "hemfixarna_product" }, index.h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (index.h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.title })), index.h("div", null, index.h("h1", null, state.selectedProduct.title), !state.selectedProduct.invoice ? index.h("h2", null, getProductPrice(state.selectedProduct), " kr/st") : index.h("h2", null, state.selectedProduct.invoice_price))), index.h("div", { class: "hemfixarna_product--grid" }, index.h("div", { class: "hemfixarna_product--left" }, ((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) && (index.h("ul", { class: "hemfixarna_features" }, state.selectedProduct.list.map(l => (index.h("li", { key: l.bullet }, index.h("img", { src: checked, alt: "checked" }), index.h("p", null, l.bullet)))))), state.selectedProduct.description && (index.h("p", { onClick: () => (this.hideDescription = false), class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`, innerHTML: state.selectedProduct.description }))), index.h("div", { class: "hemfixarna_product--right" }, state.selectedProduct.invoice ? (index.h("hemfixarna-invoice", null)) : (index.h(index.Fragment, null, index.h("ul", null, index.h("li", { class: "hemfixarna_product--item" }, index.h("div", null, index.h("p", null,
|
2506
|
+
return state.selectedProduct ? (index.h("div", { class: "hemfixarna_product" }, index.h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (index.h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.title })), index.h("div", null, index.h("h1", null, state.selectedProduct.title), !state.selectedProduct.invoice ? index.h("h2", null, getProductPrice(state.selectedProduct), " kr/st") : index.h("h2", null, state.selectedProduct.invoice_price))), index.h("div", { class: "hemfixarna_product--grid" }, index.h("div", { class: "hemfixarna_product--left" }, ((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) && (index.h("ul", { class: "hemfixarna_features" }, state.selectedProduct.list.map(l => (index.h("li", { key: l.bullet }, index.h("img", { src: checked, alt: "checked" }), index.h("p", null, l.bullet)))))), state.selectedProduct.description && (index.h("p", { onClick: () => (this.hideDescription = false), class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`, innerHTML: state.selectedProduct.description }))), index.h("div", { class: "hemfixarna_product--right" }, state.selectedProduct.invoice ? (index.h("hemfixarna-invoice", null)) : (index.h(index.Fragment, null, index.h("ul", null, index.h("li", { class: "hemfixarna_product--item" }, index.h("div", null, index.h("p", null, state.selectedProduct.title), index.h("p", { class: "hemfixarna_product--price" }, getProductPrice(state.selectedProduct), "kr/st")), index.h("div", { class: "hemfixarna_counter" }, index.h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removeProduct() }), index.h("span", null, this.getAmount()), index.h("img", { src: plus, onClick: () => this.addProduct() }))), ((_c = state.selectedProduct.parts) === null || _c === void 0 ? void 0 : _c.length) &&
|
2507
2507
|
state.selectedProduct.parts.map(p => {
|
2508
2508
|
var _a;
|
2509
2509
|
return (index.h("li", { class: "hemfixarna_part" }, index.h("div", null, index.h("p", null, (_a = p.title) !== null && _a !== void 0 ? _a : p.title), index.h("p", { class: "hemfixarna_product--price" }, getPartPrice(p, state.selectedProduct), "kr/st")), index.h("div", { class: "hemfixarna_counter" }, index.h("img", { class: `${this.getPartAmount(p.ID) === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removePart(p) }), index.h("span", null, this.getPartAmount(p.ID)), index.h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: plus, onClick: () => this.addPart(p) }))));
|
@@ -137,7 +137,7 @@ export class HemfixarnaProduct {
|
|
137
137
|
? 'https://painting-dev.vercel.app/static/js/main.js'
|
138
138
|
: 'https://painting-frontend.vercel.app/static/js/main.js', defer: true, async: true }), h("hemfixare-calculator", { title: state.options.maleri_title, subtitle: state.options.maleri_text, modal: "true", customer: state.business === Business.string ? 'string' : state.business })));
|
139
139
|
}
|
140
|
-
return state.selectedProduct ? (h("div", { class: "hemfixarna_product" }, h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.title })), h("div", null, h("h1", null, state.selectedProduct.title), !state.selectedProduct.invoice ? h("h2", null, getProductPrice(state.selectedProduct), " kr/st") : h("h2", null, state.selectedProduct.invoice_price))), h("div", { class: "hemfixarna_product--grid" }, h("div", { class: "hemfixarna_product--left" }, ((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) && (h("ul", { class: "hemfixarna_features" }, state.selectedProduct.list.map(l => (h("li", { key: l.bullet }, h("img", { src: checked, alt: "checked" }), h("p", null, l.bullet)))))), state.selectedProduct.description && (h("p", { onClick: () => (this.hideDescription = false), class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`, innerHTML: state.selectedProduct.description }))), h("div", { class: "hemfixarna_product--right" }, state.selectedProduct.invoice ? (h("hemfixarna-invoice", null)) : (h(Fragment, null, h("ul", null, h("li", { class: "hemfixarna_product--item" }, h("div", null, h("p", null,
|
140
|
+
return state.selectedProduct ? (h("div", { class: "hemfixarna_product" }, h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.title })), h("div", null, h("h1", null, state.selectedProduct.title), !state.selectedProduct.invoice ? h("h2", null, getProductPrice(state.selectedProduct), " kr/st") : h("h2", null, state.selectedProduct.invoice_price))), h("div", { class: "hemfixarna_product--grid" }, h("div", { class: "hemfixarna_product--left" }, ((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) && (h("ul", { class: "hemfixarna_features" }, state.selectedProduct.list.map(l => (h("li", { key: l.bullet }, h("img", { src: checked, alt: "checked" }), h("p", null, l.bullet)))))), state.selectedProduct.description && (h("p", { onClick: () => (this.hideDescription = false), class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`, innerHTML: state.selectedProduct.description }))), h("div", { class: "hemfixarna_product--right" }, state.selectedProduct.invoice ? (h("hemfixarna-invoice", null)) : (h(Fragment, null, h("ul", null, h("li", { class: "hemfixarna_product--item" }, h("div", null, h("p", null, state.selectedProduct.title), h("p", { class: "hemfixarna_product--price" }, getProductPrice(state.selectedProduct), "kr/st")), h("div", { class: "hemfixarna_counter" }, h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removeProduct() }), h("span", null, this.getAmount()), h("img", { src: plus, onClick: () => this.addProduct() }))), ((_c = state.selectedProduct.parts) === null || _c === void 0 ? void 0 : _c.length) &&
|
141
141
|
state.selectedProduct.parts.map(p => {
|
142
142
|
var _a;
|
143
143
|
return (h("li", { class: "hemfixarna_part" }, h("div", null, h("p", null, (_a = p.title) !== null && _a !== void 0 ? _a : p.title), h("p", { class: "hemfixarna_product--price" }, getPartPrice(p, state.selectedProduct), "kr/st")), h("div", { class: "hemfixarna_counter" }, h("img", { class: `${this.getPartAmount(p.ID) === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removePart(p) }), h("span", null, this.getPartAmount(p.ID)), h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: plus, onClick: () => this.addPart(p) }))));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hemfixarna-product.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-product/hemfixarna-product.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,EAAc,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOjD,MAAM,OAAO,iBAAiB;;kBACF,CAAC;2BACS,IAAI;;EAGxC,UAAU;IACR,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC9E,IAAI,aAAa,EAAE;MACjB,aAAa,CAAC,MAAM,EAAE,CAAC;MACvB,KAAK,CAAC,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;KAC9B;SAAM;MACL,KAAK,CAAC,IAAI,GAAG;QACX,GAAG,KAAK,CAAC,IAAI;QACb;UACE,EAAE,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE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U,CAAC,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAU;YAC9H,aAAM;YACN,YAAM,SAAS,EAAE,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,GAAS,CAC7H,CACL;UACA,KAAK,CAAC,OAAO,IAAI,uBAAiB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,GAAI,CAC5D,CACF,CACF,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;EACX,CAAC;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, State, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Icon, Part } from '../../types';\nimport { getPartPrice, getProductPrice } from '../../utils/calc';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-product',\n styleUrl: 'hemfixarna-product.scss',\n shadow: false,\n})\nexport class HemfixarnaProduct {\n @State() amount: number = 0;\n @State() hideDescription: boolean = true;\n @Element() private el: HTMLElement;\n\n addProduct() {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n productInCart.amount++;\n state.cart = [...state.cart];\n } else {\n state.cart = [\n ...state.cart,\n {\n id: state.selectedProduct.ID,\n rut: state.selectedProduct.rut,\n rot: state.selectedProduct.rot,\n green: state.selectedProduct.green,\n amount: 1,\n parts: [],\n price: state.selectedProduct.price,\n name: state.selectedProduct.title,\n start_fee: !state.selectedProduct.hide_start_fee,\n terms_checkout: state.selectedProduct.terms_checkout,\n icon: state.selectedProduct.icon,\n },\n ];\n }\n }\n\n removeProduct() {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart && productInCart.amount > 1) {\n productInCart.amount--;\n state.cart = [...state.cart];\n } else {\n state.cart = state.cart.filter(p => p.id !== state.selectedProduct.ID);\n }\n }\n\n //Handle cart and parts\n addPart(part: Part) {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n const partInCart = productInCart.parts.find(sp => sp.id === part.ID);\n if (partInCart) {\n partInCart.amount++;\n productInCart.parts = [...productInCart.parts];\n } else {\n productInCart.parts = [...productInCart.parts, { id: part.ID, amount: 1, price: part.price, name: part.title ?? part.title }];\n }\n state.cart = [...state.cart.filter(p => p.id !== productInCart.id), productInCart];\n }\n }\n\n removePart(part: Part) {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n const partInCart = productInCart.parts.find(sp => sp.id === part.ID);\n if (partInCart && partInCart.amount > 1) {\n partInCart.amount--;\n productInCart.parts = [...productInCart.parts];\n } else {\n productInCart.parts = productInCart.parts.filter(sp => sp.id !== part.ID);\n }\n state.cart = [...state.cart.filter(p => p.id !== productInCart.id), productInCart];\n }\n }\n\n goToCart() {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n state.step = 5;\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n }\n }\n\n getAmount() {\n return state.cart.find(p => p.id === state.selectedProduct.ID)?.amount || 0;\n }\n\n getPartAmount(partId: number) {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n return productInCart?.parts.find(sp => sp.id === partId)?.amount || 0;\n }\n\n getTotalPrice() {\n let price = 0;\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n const partsPrice = productInCart.parts.reduce((acc, curr) => {\n const part = state.selectedProduct.parts.find(p => p.ID === curr.id);\n if (part) {\n return acc + part.price * curr.amount;\n }\n return acc;\n }, 0);\n price = state.selectedProduct.price * productInCart.amount + partsPrice;\n } else {\n price = state.selectedProduct.price;\n }\n return getProductPrice(state.selectedProduct, price);\n }\n\n componentDidRender() {\n const linkElem = document.createElement('link');\n linkElem.setAttribute('rel', 'stylesheet');\n linkElem.setAttribute('href', 'https://painting-frontend.vercel.app/static/css/main.css');\n const fonts = document.createElement('link');\n fonts.setAttribute('rel', 'stylesheet');\n fonts.setAttribute('href', 'https://painting-frontend.vercel.app/fonts.css');\n\n const checkAndInjectCSS = () => {\n const parents = this.el.getElementsByTagName('hemfixare-calculator');\n if (parents.length > 0 && parents[0].shadowRoot !== null) {\n parents[0].shadowRoot.appendChild(linkElem);\n parents[0].shadowRoot.appendChild(fonts);\n } else {\n setTimeout(checkAndInjectCSS, 1);\n }\n };\n\n checkAndInjectCSS();\n }\n\n render() {\n const checked = getAssetPath(`./assets/checked.svg`);\n const plus = getAssetPath(`./assets/plus.svg`);\n const minus = getAssetPath(`./assets/minus.svg`);\n\n if (state.maleri) {\n return (\n <div class=\"hemfixarna_painting\">\n <script\n type=\"text/javascript\"\n src={\n ['localhost', 'vercel'].some(v => window.location.href.includes(v))\n ? 'https://painting-dev.vercel.app/static/js/main.js'\n : 'https://painting-frontend.vercel.app/static/js/main.js'\n }\n defer\n async\n ></script>\n <hemfixare-calculator\n title={state.options.maleri_title}\n subtitle={state.options.maleri_text}\n modal=\"true\"\n customer={state.business === Business.string ? 'string' : state.business}\n ></hemfixare-calculator>\n </div>\n );\n }\n\n return state.selectedProduct ? (\n <div class=\"hemfixarna_product\">\n <div class=\"hemfixarna_product--top\">\n {state.selectedProduct.icon && (\n <img width={80} src={(state.selectedProduct.icon as Icon).url ?? (state.selectedProduct.icon as string)} alt={state.selectedProduct.title} />\n )}\n <div>\n <h1>{state.selectedProduct.title}</h1>\n {!state.selectedProduct.invoice ? <h2>{getProductPrice(state.selectedProduct)} kr/st</h2> : <h2>{state.selectedProduct.invoice_price}</h2>}\n </div>\n </div>\n\n <div class=\"hemfixarna_product--grid\">\n <div class=\"hemfixarna_product--left\">\n {state.selectedProduct.list?.length && (\n <ul class=\"hemfixarna_features\">\n {state.selectedProduct.list.map(l => (\n <li key={l.bullet}>\n <img src={checked} alt=\"checked\" />\n <p>{l.bullet}</p>\n </li>\n ))}\n </ul>\n )}\n {state.selectedProduct.description && (\n <p\n onClick={() => (this.hideDescription = false)}\n class={`hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`}\n innerHTML={state.selectedProduct.description}\n ></p>\n )}\n </div>\n <div class=\"hemfixarna_product--right\">\n {state.selectedProduct.invoice ? (\n <hemfixarna-invoice />\n ) : (\n <Fragment>\n <ul>\n <li class=\"hemfixarna_product--item\">\n <div>\n <p>Antal {state.selectedProduct.title}</p>\n <p class=\"hemfixarna_product--price\">{getProductPrice(state.selectedProduct)}kr/st</p>\n </div>\n <div class=\"hemfixarna_counter\">\n <img class={`${this.getAmount() === 0 ? 'disabled' : ''}`} src={minus} onClick={() => this.removeProduct()} />\n <span>{this.getAmount()}</span>\n <img src={plus} onClick={() => this.addProduct()} />\n </div>\n </li>\n {state.selectedProduct.parts?.length &&\n state.selectedProduct.parts.map(p => (\n <li class=\"hemfixarna_part\">\n <div>\n <p>{p.title ?? p.title}</p>\n <p class=\"hemfixarna_product--price\">{getPartPrice(p, state.selectedProduct)}kr/st</p>\n </div>\n <div class=\"hemfixarna_counter\">\n <img class={`${this.getPartAmount(p.ID) === 0 ? 'disabled' : ''}`} src={minus} onClick={() => this.removePart(p)} />\n <span>{this.getPartAmount(p.ID)}</span>\n <img class={`${this.getAmount() === 0 ? 'disabled' : ''}`} src={plus} onClick={() => this.addPart(p)} />\n </div>\n </li>\n ))}\n </ul>\n <h4 class=\"hemfixarna_product--total\">Totalt {this.getTotalPrice()} kr</h4>\n <button onClick={() => this.goToCart()} class={`hemfixarna_buy ${this.getAmount() === 0 ? 'disabled' : ''}`}>\n Fortsätt\n </button>\n </Fragment>\n )}\n {!state.selectedProduct.hide_start_fee && (state.selectedProduct.rot || state.selectedProduct.rut) && state.rutOptions && state.rotOptions && (\n <p class=\"hemfixarna_terms\">\n <strong>{state.selectedProduct.rot ? state.rotOptions.rot_start_fee_heading : state.rutOptions.rut_start_fee_heading}</strong>\n <br />\n <span innerHTML={state.selectedProduct.rot ? state.rotOptions.rot_start_fee_text : state.rutOptions.rut_start_fee_text}></span>\n </p>\n )}\n {state.options && <hemfixarna-info list={state.options.trust} />}\n </div>\n </div>\n </div>\n ) : null;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"hemfixarna-product.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-product/hemfixarna-product.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,EAAc,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOjD,MAAM,OAAO,iBAAiB;;kBACF,CAAC;2BACS,IAAI;;EAGxC,UAAU;IACR,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC9E,IAAI,aAAa,EAAE;MACjB,aAAa,CAAC,MAAM,EAAE,CAAC;MACvB,KAAK,CAAC,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;KAC9B;SAAM;MACL,KAAK,CAAC,IAAI,GAAG;QACX,GAAG,KAAK,CAAC,IAAI;QACb;UACE,EAAE,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE;UAC5B,GAAG,EAAE,KAAK,CAAC,eAAe,CAAC,GAAG;UAC9B,GAAG,EAAE,KAAK,CAAC,eAAe,CAAC,GAAG;UAC9B,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,KAAK;UAClC,MAAM,EAAE,CAAC;UACT,KAAK,EAAE,EAAE;UACT,KAAK,EAAE,KAAK,CAAC,eAA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kBAAkB,GAAS,CAC7H,CACL;UACA,KAAK,CAAC,OAAO,IAAI,uBAAiB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,GAAI,CAC5D,CACF,CACF,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;EACX,CAAC;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, State, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Icon, Part } from '../../types';\nimport { getPartPrice, getProductPrice } from '../../utils/calc';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-product',\n styleUrl: 'hemfixarna-product.scss',\n shadow: false,\n})\nexport class HemfixarnaProduct {\n @State() amount: number = 0;\n @State() hideDescription: boolean = true;\n @Element() private el: HTMLElement;\n\n addProduct() {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n productInCart.amount++;\n state.cart = [...state.cart];\n } else {\n state.cart = [\n ...state.cart,\n {\n id: state.selectedProduct.ID,\n rut: state.selectedProduct.rut,\n rot: state.selectedProduct.rot,\n green: state.selectedProduct.green,\n amount: 1,\n parts: [],\n price: state.selectedProduct.price,\n name: state.selectedProduct.title,\n start_fee: !state.selectedProduct.hide_start_fee,\n terms_checkout: state.selectedProduct.terms_checkout,\n icon: state.selectedProduct.icon,\n },\n ];\n }\n }\n\n removeProduct() {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart && productInCart.amount > 1) {\n productInCart.amount--;\n state.cart = [...state.cart];\n } else {\n state.cart = state.cart.filter(p => p.id !== state.selectedProduct.ID);\n }\n }\n\n //Handle cart and parts\n addPart(part: Part) {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n const partInCart = productInCart.parts.find(sp => sp.id === part.ID);\n if (partInCart) {\n partInCart.amount++;\n productInCart.parts = [...productInCart.parts];\n } else {\n productInCart.parts = [...productInCart.parts, { id: part.ID, amount: 1, price: part.price, name: part.title ?? part.title }];\n }\n state.cart = [...state.cart.filter(p => p.id !== productInCart.id), productInCart];\n }\n }\n\n removePart(part: Part) {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n const partInCart = productInCart.parts.find(sp => sp.id === part.ID);\n if (partInCart && partInCart.amount > 1) {\n partInCart.amount--;\n productInCart.parts = [...productInCart.parts];\n } else {\n productInCart.parts = productInCart.parts.filter(sp => sp.id !== part.ID);\n }\n state.cart = [...state.cart.filter(p => p.id !== productInCart.id), productInCart];\n }\n }\n\n goToCart() {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n state.step = 5;\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n }\n }\n\n getAmount() {\n return state.cart.find(p => p.id === state.selectedProduct.ID)?.amount || 0;\n }\n\n getPartAmount(partId: number) {\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n return productInCart?.parts.find(sp => sp.id === partId)?.amount || 0;\n }\n\n getTotalPrice() {\n let price = 0;\n const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);\n if (productInCart) {\n const partsPrice = productInCart.parts.reduce((acc, curr) => {\n const part = state.selectedProduct.parts.find(p => p.ID === curr.id);\n if (part) {\n return acc + part.price * curr.amount;\n }\n return acc;\n }, 0);\n price = state.selectedProduct.price * productInCart.amount + partsPrice;\n } else {\n price = state.selectedProduct.price;\n }\n return getProductPrice(state.selectedProduct, price);\n }\n\n componentDidRender() {\n const linkElem = document.createElement('link');\n linkElem.setAttribute('rel', 'stylesheet');\n linkElem.setAttribute('href', 'https://painting-frontend.vercel.app/static/css/main.css');\n const fonts = document.createElement('link');\n fonts.setAttribute('rel', 'stylesheet');\n fonts.setAttribute('href', 'https://painting-frontend.vercel.app/fonts.css');\n\n const checkAndInjectCSS = () => {\n const parents = this.el.getElementsByTagName('hemfixare-calculator');\n if (parents.length > 0 && parents[0].shadowRoot !== null) {\n parents[0].shadowRoot.appendChild(linkElem);\n parents[0].shadowRoot.appendChild(fonts);\n } else {\n setTimeout(checkAndInjectCSS, 1);\n }\n };\n\n checkAndInjectCSS();\n }\n\n render() {\n const checked = getAssetPath(`./assets/checked.svg`);\n const plus = getAssetPath(`./assets/plus.svg`);\n const minus = getAssetPath(`./assets/minus.svg`);\n\n if (state.maleri) {\n return (\n <div class=\"hemfixarna_painting\">\n <script\n type=\"text/javascript\"\n src={\n ['localhost', 'vercel'].some(v => window.location.href.includes(v))\n ? 'https://painting-dev.vercel.app/static/js/main.js'\n : 'https://painting-frontend.vercel.app/static/js/main.js'\n }\n defer\n async\n ></script>\n <hemfixare-calculator\n title={state.options.maleri_title}\n subtitle={state.options.maleri_text}\n modal=\"true\"\n customer={state.business === Business.string ? 'string' : state.business}\n ></hemfixare-calculator>\n </div>\n );\n }\n\n return state.selectedProduct ? (\n <div class=\"hemfixarna_product\">\n <div class=\"hemfixarna_product--top\">\n {state.selectedProduct.icon && (\n <img width={80} src={(state.selectedProduct.icon as Icon).url ?? (state.selectedProduct.icon as string)} alt={state.selectedProduct.title} />\n )}\n <div>\n <h1>{state.selectedProduct.title}</h1>\n {!state.selectedProduct.invoice ? <h2>{getProductPrice(state.selectedProduct)} kr/st</h2> : <h2>{state.selectedProduct.invoice_price}</h2>}\n </div>\n </div>\n\n <div class=\"hemfixarna_product--grid\">\n <div class=\"hemfixarna_product--left\">\n {state.selectedProduct.list?.length && (\n <ul class=\"hemfixarna_features\">\n {state.selectedProduct.list.map(l => (\n <li key={l.bullet}>\n <img src={checked} alt=\"checked\" />\n <p>{l.bullet}</p>\n </li>\n ))}\n </ul>\n )}\n {state.selectedProduct.description && (\n <p\n onClick={() => (this.hideDescription = false)}\n class={`hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`}\n innerHTML={state.selectedProduct.description}\n ></p>\n )}\n </div>\n <div class=\"hemfixarna_product--right\">\n {state.selectedProduct.invoice ? (\n <hemfixarna-invoice />\n ) : (\n <Fragment>\n <ul>\n <li class=\"hemfixarna_product--item\">\n <div>\n <p>{state.selectedProduct.title}</p>\n <p class=\"hemfixarna_product--price\">{getProductPrice(state.selectedProduct)}kr/st</p>\n </div>\n <div class=\"hemfixarna_counter\">\n <img class={`${this.getAmount() === 0 ? 'disabled' : ''}`} src={minus} onClick={() => this.removeProduct()} />\n <span>{this.getAmount()}</span>\n <img src={plus} onClick={() => this.addProduct()} />\n </div>\n </li>\n {state.selectedProduct.parts?.length &&\n state.selectedProduct.parts.map(p => (\n <li class=\"hemfixarna_part\">\n <div>\n <p>{p.title ?? p.title}</p>\n <p class=\"hemfixarna_product--price\">{getPartPrice(p, state.selectedProduct)}kr/st</p>\n </div>\n <div class=\"hemfixarna_counter\">\n <img class={`${this.getPartAmount(p.ID) === 0 ? 'disabled' : ''}`} src={minus} onClick={() => this.removePart(p)} />\n <span>{this.getPartAmount(p.ID)}</span>\n <img class={`${this.getAmount() === 0 ? 'disabled' : ''}`} src={plus} onClick={() => this.addPart(p)} />\n </div>\n </li>\n ))}\n </ul>\n <h4 class=\"hemfixarna_product--total\">Totalt {this.getTotalPrice()} kr</h4>\n <button onClick={() => this.goToCart()} class={`hemfixarna_buy ${this.getAmount() === 0 ? 'disabled' : ''}`}>\n Fortsätt\n </button>\n </Fragment>\n )}\n {!state.selectedProduct.hide_start_fee && (state.selectedProduct.rot || state.selectedProduct.rut) && state.rutOptions && state.rotOptions && (\n <p class=\"hemfixarna_terms\">\n <strong>{state.selectedProduct.rot ? state.rotOptions.rot_start_fee_heading : state.rutOptions.rut_start_fee_heading}</strong>\n <br />\n <span innerHTML={state.selectedProduct.rot ? state.rotOptions.rot_start_fee_text : state.rutOptions.rut_start_fee_text}></span>\n </p>\n )}\n {state.options && <hemfixarna-info list={state.options.trust} />}\n </div>\n </div>\n </div>\n ) : null;\n }\n}\n"]}
|
@@ -2499,7 +2499,7 @@ const HemfixarnaProduct = class {
|
|
2499
2499
|
? 'https://painting-dev.vercel.app/static/js/main.js'
|
2500
2500
|
: 'https://painting-frontend.vercel.app/static/js/main.js', defer: true, async: true }), h("hemfixare-calculator", { title: state.options.maleri_title, subtitle: state.options.maleri_text, modal: "true", customer: state.business === Business.string ? 'string' : state.business })));
|
2501
2501
|
}
|
2502
|
-
return state.selectedProduct ? (h("div", { class: "hemfixarna_product" }, h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.title })), h("div", null, h("h1", null, state.selectedProduct.title), !state.selectedProduct.invoice ? h("h2", null, getProductPrice(state.selectedProduct), " kr/st") : h("h2", null, state.selectedProduct.invoice_price))), h("div", { class: "hemfixarna_product--grid" }, h("div", { class: "hemfixarna_product--left" }, ((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) && (h("ul", { class: "hemfixarna_features" }, state.selectedProduct.list.map(l => (h("li", { key: l.bullet }, h("img", { src: checked, alt: "checked" }), h("p", null, l.bullet)))))), state.selectedProduct.description && (h("p", { onClick: () => (this.hideDescription = false), class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`, innerHTML: state.selectedProduct.description }))), h("div", { class: "hemfixarna_product--right" }, state.selectedProduct.invoice ? (h("hemfixarna-invoice", null)) : (h(Fragment, null, h("ul", null, h("li", { class: "hemfixarna_product--item" }, h("div", null, h("p", null,
|
2502
|
+
return state.selectedProduct ? (h("div", { class: "hemfixarna_product" }, h("div", { class: "hemfixarna_product--top" }, state.selectedProduct.icon && (h("img", { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.title })), h("div", null, h("h1", null, state.selectedProduct.title), !state.selectedProduct.invoice ? h("h2", null, getProductPrice(state.selectedProduct), " kr/st") : h("h2", null, state.selectedProduct.invoice_price))), h("div", { class: "hemfixarna_product--grid" }, h("div", { class: "hemfixarna_product--left" }, ((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) && (h("ul", { class: "hemfixarna_features" }, state.selectedProduct.list.map(l => (h("li", { key: l.bullet }, h("img", { src: checked, alt: "checked" }), h("p", null, l.bullet)))))), state.selectedProduct.description && (h("p", { onClick: () => (this.hideDescription = false), class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`, innerHTML: state.selectedProduct.description }))), h("div", { class: "hemfixarna_product--right" }, state.selectedProduct.invoice ? (h("hemfixarna-invoice", null)) : (h(Fragment, null, h("ul", null, h("li", { class: "hemfixarna_product--item" }, h("div", null, h("p", null, state.selectedProduct.title), h("p", { class: "hemfixarna_product--price" }, getProductPrice(state.selectedProduct), "kr/st")), h("div", { class: "hemfixarna_counter" }, h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removeProduct() }), h("span", null, this.getAmount()), h("img", { src: plus, onClick: () => this.addProduct() }))), ((_c = state.selectedProduct.parts) === null || _c === void 0 ? void 0 : _c.length) &&
|
2503
2503
|
state.selectedProduct.parts.map(p => {
|
2504
2504
|
var _a;
|
2505
2505
|
return (h("li", { class: "hemfixarna_part" }, h("div", null, h("p", null, (_a = p.title) !== null && _a !== void 0 ? _a : p.title), h("p", { class: "hemfixarna_product--price" }, getPartPrice(p, state.selectedProduct), "kr/st")), h("div", { class: "hemfixarna_counter" }, h("img", { class: `${this.getPartAmount(p.ID) === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removePart(p) }), h("span", null, this.getPartAmount(p.ID)), h("img", { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: plus, onClick: () => this.addPart(p) }))));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{p as o,b as t}from"./p-33d37833.js";export{s as setNonce}from"./p-33d37833.js";const e=()=>{const t=import.meta.url;const e={};if(t!==""){e.resourcesUrl=new URL(".",t).href}return o(e)};e().then((o=>t([["p-
|
1
|
+
import{p as o,b as t}from"./p-33d37833.js";export{s as setNonce}from"./p-33d37833.js";const e=()=>{const t=import.meta.url;const e={};if(t!==""){e.resourcesUrl=new URL(".",t).href}return o(e)};e().then((o=>t([["p-3b2da615",[[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-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]}],[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",{list:[16]}]]]],o)));
|
2
2
|
//# sourceMappingURL=hemfixarna-components.esm.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{g as n,f as t,r as i,h as e,a as s,F as a,c as r}from"./p-33d37833.js";const o=(n,t,i)=>{const e=n.get(t);if(!e){n.set(t,[i])}else if(!e.includes(i)){e.push(i)}};const l=(n,t)=>{let i;return(...e)=>{if(i){clearTimeout(i)}i=setTimeout((()=>{i=0;n(...e)}),t)}};const h=n=>!("isConnected"in n)||n.isConnected;const c=l((n=>{for(let t of n.keys()){n.set(t,n.get(t).filter(h))}}),2e3);const d=()=>{if(typeof n!=="function"){return{}}const i=new Map;return{dispose:()=>i.clear(),get:t=>{const e=n();if(e){o(i,t,e)}},set:n=>{const e=i.get(n);if(e){i.set(n,e.filter(t))}c(i)},reset:()=>{i.forEach((n=>n.forEach(t)));c(i)}}};const u=n=>typeof n==="function"?n():n;const p=(n,t=((n,t)=>n!==t))=>{const i=u(n);let e=new Map(Object.entries(i!==null&&i!==void 0?i:{}));const s={dispose:[],get:[],set:[],reset:[]};const a=()=>{var t;e=new Map(Object.entries((t=u(n))!==null&&t!==void 0?t:{}));s.reset.forEach((n=>n()))};const r=()=>{s.dispose.forEach((n=>n()));a()};const o=n=>{s.get.forEach((t=>t(n)));return e.get(n)};const l=(n,i)=>{const a=e.get(n);if(t(i,a,n)){e.set(n,i);s.set.forEach((t=>t(n,i,a)))}};const h=typeof Proxy==="undefined"?{}:new Proxy(i,{get(n,t){return o(t)},ownKeys(n){return Array.from(e.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(n,t){return e.has(t)},set(n,t,i){l(t,i);return true}});const c=(n,t)=>{s[n].push(t);return()=>{f(s[n],t)}};const d=(t,i)=>{const e=c("set",((n,e)=>{if(n===t){i(e)}}));const s=c("reset",(()=>i(u(n)[t])));return()=>{e();s()}};const p=(...n)=>{const t=n.reduce(((n,t)=>{if(t.set){n.push(c("set",t.set))}if(t.get){n.push(c("get",t.get))}if(t.reset){n.push(c("reset",t.reset))}if(t.dispose){n.push(c("dispose",t.dispose))}return n}),[]);return()=>t.forEach((n=>n()))};const m=n=>{const t=e.get(n);s.set.forEach((i=>i(n,t,t)))};return{state:h,get:o,set:l,on:c,onChange:d,use:p,dispose:r,reset:a,forceUpdate:m}};const f=(n,t)=>{const i=n.indexOf(t);if(i>=0){n[i]=n[n.length-1];n.length--}};const m=(n,t)=>{const i=p(n,t);i.use(d());return i};const{state:x,onChange:g}=m({step:1,checkoutStep:1,checkoutEdit:false,selectedCategory:null,selectedService:null,selectedProduct:null,cart:[],business:"undefined",options:null,rut:true,rot:true,green:true,token:null,user:null,modal:null,rutOptions:null,rotOptions:null,greenOptions:null,customer:null,selectedCustomerCategory:null,parentCategory:null,creditSafeUser:null,checkoutInvoice:false,maleri:false});g("cart",(n=>{window.sessionStorage.setItem(`hemfixarna-${x.business}-cart`,JSON.stringify(n))}));g("user",(n=>{window.sessionStorage.setItem(`hemfixarna-${x.business}-user`,JSON.stringify(n))}));g("creditSafeUser",(n=>{window.sessionStorage.setItem(`hemfixarna-${x.business}-creditSafeUser`,JSON.stringify(n))}));g("selectedProduct",(n=>{if(!x.customer||!n)return;const t=[...x.customer.categories,...x.customer.categories.map((n=>{var t;return(t=n.sub_categories)!==null&&t!==void 0?t:[]}))].flat();const i=t.find((t=>t&&t.id===n.category));if(i){x.parentCategory=i;return}x.parentCategory=null}));g("selectedCustomerCategory",(n=>{if(!x.customer||!n)return;if(n.parent){const t=x.customer.categories.find((t=>t.id===n.parent));if(t){x.parentCategory=t;return}}x.parentCategory=null}));const b=n=>n.split(" ").reduce(((n,t)=>{if(t.length<=2){return n+t.slice(0,1)+"* "}else{return n+t.slice(0,1)+"*".repeat(t.length-2)+t.slice(-1)+" "}}),"");const v=n=>{if(!n)return;n.scrollTo({top:0,behavior:"smooth"})};const _=class{constructor(n){i(this,n);this.handleSubmit=n=>{n.preventDefault();const t=this.street.length>0;if(!t){this.streetError="Ange en gatuadress"}const i=this.zip.length>0;const e=/^\s*\d[\d\s]*$/.test(this.zip);if(!e){this.zipError="Postnummer får endast innehålla siffror"}if(!i){this.zipError="Ange ett postnummer"}const s=/^[^\d\s]{2,}$/.test(this.town);if(!s){this.townError="Ange en ort"}if(t&&i&&s&&e){x.user=Object.assign(Object.assign({},x.user),{street:this.street,zip:this.zip,town:this.town});x.checkoutStep=2;x.checkoutEdit=false;const n=this.el.closest(".hemfixarna_content");v(n)}};this.handleChangeStreet=n=>{this.streetError=null;this.street=this.street===x.user.street?"":n.target.value};this.handleChangeZip=n=>{this.zipError=null;this.zip=this.zip===x.user.zip?"":n.target.value};this.handleChangeTown=n=>{this.townError=null;this.town=this.town===x.user.town?"":n.target.value};this.render=()=>e("form",{class:"hemfixarna_address",onSubmit:n=>this.handleSubmit(n)},e("div",null,e("input",{class:`${this.street.length?"input_active":""}`,onInput:this.handleChangeStreet,type:"text",name:"street",value:this.street===x.user.street?b(this.street):this.street}),e("label",{htmlFor:"street"},"Gatuaddress ")),this.streetError&&e("span",null,this.streetError),e("div",null,e("input",{class:`${this.zip.length?"input_active":""}`,onInput:this.handleChangeZip,type:"tel",name:"zip",value:this.zip===x.user.zip?b(this.zip):this.zip}),e("label",{htmlFor:"zip"},"Postnummer ")),this.zipError&&e("span",null,this.zipError),e("div",null,e("input",{class:`${this.town.length?"input_active":""}`,onInput:this.handleChangeTown,type:"text",name:"town",value:this.town===x.user.town?b(this.town):this.town}),e("label",{htmlFor:"town"},"Ort ")),this.townError&&e("span",null,this.townError),e("input",{type:"submit",value:"Fortsätt"}));this.street="";this.streetError=null;this.zip="";this.zipError=null;this.town="";this.townError=null}componentWillLoad(){if(x.user){this.street=x.user.street;this.zip=x.user.zip;this.town=x.user.town}}get el(){return s(this)}};const y=n=>Math.ceil(n/2);const w=n=>Math.ceil(n*.7);const k=n=>Math.ceil(n*.5);const C=(n,t,i=1)=>{if(n.rot&&x.rot){return w((t||n.price)*i)}else if(n.rut&&x.rut){return y((t||n.price)*i)}else if(n.green&&x.green){return k((t||n.price)*i)}else{return(t||n.price)*i}};const $=n=>{if(n.rot){return w(n.price)}else if(n.rut&&x.rut){return y(n.price)}else{return n.price}};const S=(n,t,i=1)=>{if(t.rot&&x.rot){return w(n.price*i)}else if(t.rut&&x.rut){return y(n.price*i)}else{return n.price*i}};const z=()=>{if(!x.cart)return{rut:0,rot:0,green:0};const n=x.cart.some((n=>n.rut&&n.start_fee));const t=x.cart.some((n=>n.rot&&n.start_fee));const i=x.cart.some((n=>n.green&&n.start_fee));const e=x.rut?y(x.options.start_fee):x.options.start_fee*1;const s=x.rot?w(x.options.start_fee):x.options.start_fee*1;const a=x.green?k(x.options.start_fee):x.options.start_fee*1;return{rut:n?e:0,rot:t?s:0,green:i?a:0,length:[n,t,i].filter((n=>n)).length}};const B=n=>{const t=n.parts.reduce(((n,t)=>n+t.price*t.amount),0);return C(n,n.price*n.amount+t)};const T=()=>{const n=x.cart.reduce(((n,t)=>t.rot?n+B(t):n),0)+z().rot;const t=x.cart.reduce(((n,t)=>{const i=t.parts.reduce(((n,t)=>n+t.price*t.amount),0);return t.rot?n+t.price*t.amount+i:n}),0)+Number(x.options.start_fee);return t-n};const j=()=>{const n=x.cart.reduce(((n,t)=>t.rut?n+B(t):n),0)+z().rut;const t=x.cart.reduce(((n,t)=>{const i=t.parts.reduce(((n,t)=>n+t.price*t.amount),0);return t.rut?n+t.price*t.amount+i:n}),0)+Number(x.options.start_fee);return t-n};const O=()=>{const n=x.cart.reduce(((n,t)=>t.green?n+B(t):n),0)+z().green;const t=x.cart.reduce(((n,t)=>{const i=t.parts.reduce(((n,t)=>n+t.price*t.amount),0);return t.green?n+t.price*t.amount+i:n}),0)+Number(x.options.start_fee);return t-n};const D=()=>x.cart.reduce(((n,t)=>n+B(t)),0)+z().rot+z().rut;var I;(function(n){n["kund"]="kund";n["byggmax"]="byggmax";n["skanska"]="skanska";n["string"]="string-furniture";n["hornbach"]="hornbach";n["forebygg"]="forebygg";n["doro"]="doro";n["elfa"]="elfa";n["kbygg"]="k-bygg";n["norrgavel"]="norrgavel";n["fargvaruhuset"]="fargvaruhuset";n["zaptec"]="zaptec";n["tesla"]="tesla";n["klint"]="klint";n["flyttsmart"]="flyttsmart";n["lg"]="lg";n["sparfonster"]="sparfonster"})(I||(I={}));var F;(function(n){n["standard"]="standard";n["alternative"]="alternative";n["alternative_2"]="alternative_2";n["alternative_3"]="alternative_3"})(F||(F={}));var M;(function(n){n["byggmax"]="category/bygg"})(M||(M={}));const N=n=>n.post_name!==undefined;const L=n=>Object.values(I).includes(n);const A=class{constructor(n){i(this,n);this.post=undefined;this.category=undefined;this.icon=undefined;this.postTitle=undefined}setTaxonomy(n){if(n){if((n===null||n===void 0?void 0:n.taxonomy)==="service_cat"){x.selectedCategory=n;x.step=2}else if((n===null||n===void 0?void 0:n.post_type)==="service"){x.selectedService=n;x.step=3}else if((n===null||n===void 0?void 0:n.post_type)==="ikea_product"){x.selectedProduct=n;x.step=4}const t=this.el.closest(".hemfixarna_content");v(t)}}setProduct(){x.selectedProduct=this.category;x.step=4;x.selectedCustomerCategory=null;const n=this.el.closest(".hemfixarna_content");v(n)}render(){return this.category?e(a,null,N(this.category)?e("li",{onClick:()=>this.setProduct()},e("img",{class:"hemfixarna_logo",height:82,src:this.category.icon,alt:this.category.post_name}),e("div",null,e("p",null,this.category.title),!this.category.invoice?e("p",{class:"price"},"Från ",C(this.category),"kr"):null)):e("li",{onClick:()=>x.selectedCustomerCategory=this.category},e("img",{class:"hemfixarna_logo",height:82,src:this.category.icon,alt:this.category.name}),e("div",null,e("p",null,this.category.name)))):e("li",{onClick:()=>this.setTaxonomy(this.post)},this.post.icon&&e("img",{class:"hemfixarna_logo",height:82,src:this.icon,alt:this.postTitle}),e("div",null,e("p",null,this.postTitle),x.step===3&&e("p",{class:"price"},"Från ",C(this.post),"kr")))}get el(){return s(this)}};const P=class{constructor(n){i(this,n);this.triggerScrollTotop=()=>{const n=this.el.nextSibling;v(n)};this.tree=undefined;this.closeModal=undefined;this.loadFromQuery=false;this.isDemo=false}getCartLength(){return x.cart.reduce(((n,t)=>n+t.amount),0)}handleCartClick(){var n;if((n=x.cart)===null||n===void 0?void 0:n.length){x.step=5;this.triggerScrollTotop()}}handleHomePageClick(){x.step=1;x.parentCategory=null;x.selectedCustomerCategory=null;this.triggerScrollTotop();setTimeout((()=>{x.selectedCategory=null;x.selectedProduct=null;x.maleri=null;x.selectedService=null}),200)}render(){const n=r(`./assets/hemfixarna.svg`);const t=r(`./assets/close.svg`);const i=r(`./assets/cart.svg`);const s=r(`./assets/back.svg`);return e("div",null,e("div",{class:"hemfixarna_crumbs"},e("div",{class:"hemfixarna_crumbs--links"},e("img",{onClick:()=>this.handleHomePageClick(),src:n,width:110}),!this.loadFromQuery||this.isDemo?e("img",{onClick:()=>this.closeModal(),class:"close",src:t,width:32}):null,e("div",null,e("button",{onClick:()=>this.handleHomePageClick()},"Alla tjänster"))),e("div",{onClick:()=>this.handleCartClick(),class:`cart ${this.getCartLength()>0?"cart_active":""}`},e("img",{src:i,width:24}),e("span",null,this.getCartLength()))),[3,4].includes(x.step)&&!x.customer&&e("button",{class:"hemfixarna_crumbs--back",onClick:()=>{x.step=x.step===4?3:2}},e("img",{width:24,src:s,alt:"back arrow"}),e("span",null,"Se allt ",x.step===4?x.selectedService.post_title:x.selectedCategory.name)),x.parentCategory&&x.step<5&&e("button",{class:"hemfixarna_crumbs--back",onClick:()=>{x.step=1;x.selectedCustomerCategory=x.parentCategory;x.selectedProduct=null;x.maleri=null}},e("img",{width:24,src:s,alt:"back arrow"}),e("span",null,"Se allt ",x.parentCategory.name)))}get el(){return s(this)}};const K="";const R=class{constructor(n){i(this,n);this.tree=null;this.slug=undefined;this.id=undefined;this.forceOldTree=false;this.loadFromQuery=undefined;this.customer=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{forceOldTree:this.forceOldTree,id:this.id,slug:this.slug,business:I.byggmax,topCategory:M.byggmax,loadFromQuery:Boolean(this.loadFromQuery),widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor})}};R.style=K;const Q=class{constructor(n){i(this,n);this.tree=undefined}render(){const n=r(`./assets/back.svg`);return e("div",{class:"hemfixarna_cart"},e("div",{class:"hemfixarna_cart--left"},e("h2",null,x.checkoutStep===2&&!x.checkoutEdit&&e("button",{onClick:()=>{x.checkoutStep=1}},e("img",{width:24,src:n,alt:"back arrow"})),"Din bokning"),e("hemfixarna-orderrows",{tree:this.tree})),e("div",{class:"hemfixarna_cart--right"},e("h2",null,x.checkoutStep===2&&!x.checkoutEdit&&e("button",{onClick:()=>{x.checkoutStep=1}},e("img",{width:24,src:n,alt:"back arrow"})),"Dina uppgifter"),e("hemfixarna-checkout",null),e("hemfixarna-info",null)))}};const U=class{constructor(n){i(this,n)}setSelectedService(n){x.selectedService=n;x.step=3}render(){return e("div",null,e("h2",null,x.selectedCategory.name),e("div",{class:"hemfixarna_categories--wrapper"},e("div",null,e("ul",{class:"hemfixarna_categories"},x.selectedCategory.services.sort(((n,t)=>n.post_title<t.post_title?-1:1)).map((n=>{var t;return e("hemfixarna-box",{post:n,icon:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,postTitle:n.post_title})})))),e("hemfixarna-info",{list:x.options.trust})))}};const V=`${"https://hemfixarna.se"}/wp-json/headless`;async function J(n,t){const i=await fetch(n,t);const e=await i.json();return e}const H=async n=>{if(!n){return}const t=n.split("/")[0];const i=n.split("/")[1];try{const n=await fetch(`${V}/${t}/${i}`);return await n.json()}catch(n){console.log(n)}};const E=async n=>{try{const t=await fetch(`${V}/customer/${n}`);return await t.json()}catch(n){console.log(n)}};const W=async()=>{try{const n=await fetch(`${V}/webcoptions`);return await n.json()}catch(n){console.log(n)}};const X=async()=>{try{const n=await J(`${V}/rut`);return n}catch(n){console.log(n)}};const G=async()=>{try{const n=await fetch(`${V}/rot`);return await n.json()}catch(n){console.log(n)}};const Y=async()=>{try{const n=await fetch(`${V}/green-discount`);return await n.json()}catch(n){console.log(n)}};const q=async n=>{try{const t=await fetch(`${V}/weborder`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}});return await t.json()}catch(n){console.log(n)}};const Z=`${"https://hemfixarna.se"}/wp-json/felix`;const nn=async n=>{try{return await J(`${Z}/createperson`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}catch(n){console.log(n)}};const tn=class{constructor(n){i(this,n);this.handleChangeDate=n=>{this.dateError=null;this.date=n.target.value};this.handleChangeTerms=()=>{this.generalError=null};this.sendOrder=async()=>{var n,t;if(this.loading)return;this.loading=true;let i={firstName:x.creditSafeUser.firstName,lastName:x.creditSafeUser.lastName,street:x.user.street,zip:x.user.zip,town:x.user.town,ssn:x.user.ssn,email:x.user.email,phone:x.user.phone,url:`${x.business===I.string?"string":x.business}-webk`,date:this.date,products:[...x.cart.map((n=>{const t=n.parts.map((n=>({id:String(n.id),name:n.name,quantity:n.amount,rut:0,rot:0})));return[{id:String(n.id),name:n.name,quantity:n.amount,rot:n.rot?1:0,rut:n.rut?1:0},...t]}))].flat(),creditSafe:x.creditSafeUser,customer:x.business};const e=await nn(i);if(!e||!((t=(n=e.response)===null||n===void 0?void 0:n.scriptResult)===null||t===void 0?void 0:t.includes("OK"))){i=Object.assign(Object.assign({},i),{felixStatus:"error"})}else{i=Object.assign(Object.assign({},i),{felixStatus:"success"})}try{const{data:n,status:t}=await q(i);if(n&&t&&t===200){x.step=6;const n=this.el.closest(".hemfixarna_content");v(n)}else{this.generalError="Något gick fel, försök igen senare"}}catch(n){this.generalError="Något gick fel, försök igen senare"}this.loading=false};this.handleSubmit=n=>{n.preventDefault();this.generalError=null;const t=this.date.length>0;if(!t){this.dateError="Ange ett giltigt datum"}const i=Array.from(this.el.querySelectorAll('input[type="checkbox"]'));const e=i.find((n=>!n.checked));if(e){this.generalError="Du måste godkänna villkoren"}if(t&&!e){this.sendOrder()}};this.render=()=>{const n=r(`./assets/date.svg`);const t=r(`./assets/down.svg`);const i=r(`./assets/spinner.gif`);if(x.checkoutEdit){return e("hemfixarna-address",null)}else if(x.checkoutStep===1){return e("hemfixarna-getuser",null)}else if(x.checkoutStep===2){return e("div",{class:"mb-2"},e("div",{class:"hemfixarna_addressinfo"},e("div",null,e("p",null,b(x.user.firstName)),e("p",null,b(x.user.lastName)),e("p",null,x.user.email),e("p",null,x.user.phone)),e("div",null,e("p",null,b(x.user.street)),e("p",null,b(x.user.zip)),e("p",null,b(x.user.town))),e("button",{onClick:()=>x.checkoutEdit=true},"Behöver du ändra adressen?")),e("form",{onSubmit:n=>this.handleSubmit(n)},e("div",null,e("img",{src:n,width:24}),e("input",{class:`${this.date.length?"input_active":""}`,min:(new Date).toISOString().split("T")[0],onChange:n=>this.handleChangeDate(n),type:"date",name:"date",value:this.date}),e("label",{htmlFor:"date"},"Tidigaste datum för hembesök"),e("img",{src:t,width:24})),this.dateError&&e("span",null,this.dateError),e("label",{class:"hemfixarna_checkbox"},e("input",{onChange:()=>this.handleChangeTerms(),type:"checkbox"}),e("span",{innerHTML:x.options.terms})),x.cart.filter((n=>{var t;return(t=n.terms_checkout)===null||t===void 0?void 0:t.length})).map((n=>e(a,null,e("label",{class:"hemfixarna_checkbox"},e("input",{onChange:()=>this.handleChangeTerms(),type:"checkbox"}),e("span",null,n.terms_checkout))))),this.generalError&&e("span",null,this.generalError),e("div",{class:this.loading?"loading":""},e("input",{type:"submit",value:this.loading?"":"Skicka bokning"}),e("img",{width:20,height:20,src:i,alt:"spinner"}))))}};this.date="";this.dateError=null;this.generalError=null;this.loading=false}componentWillLoad(){if(Boolean(x.user&&x.user.street)){x.checkoutStep=2}}get el(){return s(this)}};const en='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap");\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n* {\n box-sizing: border-box;\n}\n\n:host {\n font-family: "Inter", sans-serif;\n}\n:host .mb-2 {\n margin-bottom: 32px;\n}\n:host button {\n color: #474444;\n}\n:host form {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n:host form img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n pointer-events: none;\n}\n:host form img:first-of-type {\n left: 16px;\n}\n:host form img:last-of-type {\n right: 16px;\n}\n:host form span {\n margin-top: -8px;\n color: #ec6632;\n}\n:host form p {\n text-align: center;\n}\n:host form p {\n margin: 0;\n}\n:host form div {\n position: relative;\n}\n:host form div label {\n pointer-events: none;\n position: absolute;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n background: #fff;\n padding: 4px;\n transition: 0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n}\n:host form div input {\n padding: 16px;\n width: 100%;\n font-size: 16px;\n border: 1px solid #fcd9c9;\n}\n:host form div input:focus ~ label,\n:host form div .input_active ~ label {\n top: 0;\n transform: translateY(-50%);\n background: linear-gradient(180deg, #fffaf2 50%, #fff 50%);\n}\n:host h1 {\n font-size: 24px;\n font-weight: 400;\n line-height: 32px;\n letter-spacing: -3%;\n text-align: left;\n margin: 0 0 8px;\n}\n:host h2 {\n margin: 0 0 24px;\n font-weight: 700;\n font-size: 20px;\n line-height: 28px;\n letter-spacing: -3%;\n}\n:host p {\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna {\n width: 100%;\n /* Hide default HTML checkbox */\n /* The slider */\n}\n:host .hemfixarna_painting {\n opacity: 0;\n padding: 0 1rem;\n animation: fadeIn 0.5s forwards 0.3s;\n}\n:host .hemfixarna_painting > h2,\n:host .hemfixarna_painting p {\n text-align: center;\n padding: 0 16px;\n}\n:host .hemfixarna_painting > h2 {\n margin: 0 0 8px;\n}\n:host .hemfixarna_partnerlogo {\n max-height: 50px;\n min-height: 45px;\n object-fit: contain;\n max-width: 150px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_partnerlogo {\n max-width: 200px;\n }\n}\n:host .hemfixarna_nav {\n position: absolute;\n top: 0;\n width: 100dvw;\n left: 0;\n height: 80px;\n z-index: 9999;\n}\n:host .hemfixarna_nav--links {\n display: none !important;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav--links {\n display: flex !important;\n }\n}\n:host .hemfixarna_nav--links a {\n color: #ec6632;\n text-decoration: none;\n border: 1px solid rgba(255, 255, 255, 0.3);\n border-radius: 56px;\n padding: 8px 32px;\n text-transform: capitalize;\n}\n:host .hemfixarna_nav > div {\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 16px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav > div {\n padding: 0 32px;\n }\n}\n:host .hemfixarna_nav > div > div {\n display: flex;\n gap: 32px;\n justify-content: space-between;\n}\n:host .hemfixarna_nav > div > img {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: -1;\n}\n:host .hemfixarna_nav a {\n text-decoration: none;\n}\n:host .hemfixarna_nav p {\n color: #474444;\n}\n:host .hemfixarna_nav p.with-bg {\n color: #fff;\n}\n:host .hemfixarna_standalone .hemfixarna_backdrop {\n background: #fffaf2;\n opacity: 1;\n}\n:host .hemfixarna_standalone .hemfixarna_modal {\n top: 80px;\n transform: translateX(-50%);\n border: none;\n height: calc(100dvh - 80px);\n opacity: 0;\n}\n:host .hemfixarna_standalone .hemfixarna_modal--open {\n opacity: 1;\n}\n:host .hemfixarna .switch {\n position: relative;\n display: inline-block;\n width: 40px;\n height: 20px;\n}\n:host .hemfixarna .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n}\n:host .hemfixarna .slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 34px;\n}\n:host .hemfixarna .slider:before {\n position: absolute;\n content: "";\n height: 18px;\n width: 18px;\n left: 2px;\n bottom: 1px;\n background-color: white;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 50%;\n}\n:host .hemfixarna input:checked + .slider {\n background-color: #fcd9c9;\n}\n:host .hemfixarna input:focus + .slider {\n box-shadow: 0 0 1px #fcd9c9;\n}\n:host .hemfixarna input:checked + .slider:before {\n -webkit-transform: translateX(18px);\n -ms-transform: translateX(18px);\n transform: translateX(18px);\n background: #ec6632;\n}\n:host .hemfixarna_maleribox {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n width: 100%;\n min-height: 132px;\n padding: 24px;\n display: flex;\n align-items: center;\n gap: 24px;\n text-align: left;\n}\n:host .hemfixarna_maleribox:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_checkbox {\n display: grid;\n grid-template-columns: 40px auto;\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna_checkbox > span {\n transform: translateY(6px);\n}\n:host .hemfixarna_checkbox span,\n:host .hemfixarna_checkbox span p {\n color: #474444;\n font-size: 14px;\n}\n:host .hemfixarna_checkbox p {\n text-align: left;\n}\n:host .hemfixarna_info {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 32px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n border-radius: 4px;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_info h2 {\n margin: 0;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_info {\n position: sticky;\n top: 0;\n }\n}\n:host .hemfixarna_infomodal {\n position: absolute;\n top: 40%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n max-width: 80%;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n padding: 32px;\n z-index: 99;\n border-radius: 4px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n:host .hemfixarna_infomodal p,\n:host .hemfixarna_infomodal h4 {\n margin: 0;\n}\n:host .hemfixarna_infomodal button {\n background: #ec6632;\n color: #fff;\n border-radius: 60px;\n font-size: 16px;\n padding: 8px 16px;\n}\n:host .hemfixarna_addressinfo {\n padding: 16px 16px 64px;\n border: 1px solid #fcd9c9;\n position: relative;\n margin-bottom: 32px;\n display: grid;\n grid-template-columns: 1fr;\n gap: 8px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_addressinfo {\n grid-template-columns: 1fr 1fr;\n }\n}\n:host .hemfixarna_addressinfo button {\n position: absolute;\n bottom: 16px;\n right: 16px;\n font-weight: 500;\n text-underline-offset: 2px;\n text-decoration: underline;\n}\n:host .hemfixarna_part {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: grid;\n padding: 16px;\n grid-template-columns: auto 75px;\n}\n:host .hemfixarna_counter {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_counter span {\n padding: 0 8px;\n}\n:host .hemfixarna_counter img {\n cursor: pointer;\n}\n:host .hemfixarna_counter img:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_description {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_description ul {\n list-style: disc;\n padding-right: 12px;\n transform: translateX(12px);\n}\n:host .hemfixarna_description--hidden {\n max-height: 140px;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n}\n:host .hemfixarna_description--hidden::after {\n content: "";\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 128px;\n background: linear-gradient(180deg, rgba(255, 253, 250, 0), rgba(255, 253, 250, 0.46) 50%, #fffaf2);\n}\n:host .hemfixarna_terms {\n font-size: 14px;\n}\n:host .hemfixarna_terms a {\n color: inherit;\n}\n:host .hemfixarna_logo {\n height: 64px;\n}\n:host .hemfixarna_box {\n padding: 16px;\n display: flex;\n align-items: center;\n width: 100%;\n box-sizing: border-box;\n border-radius: 4px;\n gap: 16px 8px;\n border-radius: 4px;\n gap: 16px 8px;\n}\n:host .hemfixarna_box p,\n:host .hemfixarna_box span {\n font-size: 15px;\n}\n:host .hemfixarna_box .underline {\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n:host .hemfixarna_box .pointer {\n cursor: pointer;\n}\n:host .hemfixarna_box .p-s {\n font-size: 12px;\n}\n:host .hemfixarna_box > div {\n display: grid;\n gap: 8px;\n}\n:host .hemfixarna_box--standard {\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_box--alternative, :host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n background: transparent;\n border: 1px solid #e3e3e3;\n}\n:host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n box-shadow: 0px 2px 16px 0px rgba(0, 0, 0, 0.0784313725);\n}\n:host .hemfixarna_box--alternative_3 {\n justify-content: center;\n}\n:host .hemfixarna_altbtn {\n display: flex !important;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n margin-left: auto;\n}\n:host .hemfixarna_btn {\n margin-left: auto;\n}\n:host .hemfixarna_btn, :host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n border: none;\n border-radius: 60px;\n font-weight: 600;\n letter-spacing: 0.5px;\n line-height: 20px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_btn:not(.disabled):hover, :host .hemfixarna_buy:not(.disabled):hover,\n:host .hemfixarna input[type=submit]:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna div:has(> input[type=submit]) {\n position: relative;\n}\n:host .hemfixarna div:has(> input[type=submit]) input {\n cursor: pointer;\n}\n:host .hemfixarna div:has(> input[type=submit]) img {\n display: none;\n}\n:host .hemfixarna .loading {\n cursor: default;\n opacity: 0.6;\n}\n:host .hemfixarna .loading > img {\n display: initial !important;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n:host .hemfixarna_btn {\n font-size: 14px;\n background: #c84e18;\n color: #fff;\n padding: 16px 24px;\n white-space: nowrap;\n position: relative;\n}\n:host .hemfixarna_btn span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -8px;\n right: -12px;\n}\n:host .hemfixarna_btn span {\n background: #25a710;\n color: #fff;\n right: 0 !important;\n}\n:host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n font-size: 21px;\n background: #25a710;\n color: #fff;\n padding: 16px 24px;\n}\n:host .hemfixarna .disabled {\n opacity: 0.5;\n cursor: default;\n}\n:host .hemfixarna_modal {\n position: fixed;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n border-radius: 4px;\n top: 50%;\n left: 50%;\n z-index: 1000;\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n transform: translate(-50%, -50%) scale(0.7);\n opacity: 0;\n height: 92%;\n width: 92%;\n max-width: 920px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n:host .hemfixarna_modal--open {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n}\n:host .hemfixarna_backdrop {\n z-index: 999;\n position: fixed;\n background: #474444;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n 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);\n}\n:host .hemfixarna_backdrop--open {\n opacity: 0.3;\n}\n:host .hemfixarna_order {\n position: absolute;\n top: -1px;\n left: -1px;\n right: -1px;\n bottom: -1px;\n background-repeat: no-repeat !important;\n background-size: cover !important;\n background-position: center !important;\n display: grid;\n grid-template-columns: 1fr 1fr;\n padding: 48px 32px 64px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_order {\n grid-template-columns: 1fr;\n grid-template-rows: 0 auto;\n }\n}\n:host .hemfixarna_order > div:last-of-type {\n background: #fffaf2;\n padding: 32px;\n display: flex;\n flex-direction: column;\n max-height: 100%;\n overflow: auto;\n}\n:host .hemfixarna_order img {\n cursor: pointer;\n}\n:host .hemfixarna_order button {\n margin: 16px 0;\n padding: 0;\n text-decoration: underline;\n text-underline-offset: 2px;\n font-size: 14px;\n font-weight: 600;\n}\n:host .hemfixarna_cart {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart {\n grid-template-columns: 1fr;\n gap: 0;\n }\n}\n:host .hemfixarna_cart--right h2, :host .hemfixarna_cart--left h2 {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_cart--right h2 img, :host .hemfixarna_cart--left h2 img {\n margin-top: 3.2px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_cart--left h2 button {\n display: none;\n }\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart--right h2 button {\n display: none;\n }\n}\n:host .hemfixarna_cart--startfee {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot div {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_cart--additional {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 16px;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--additional p {\n font-size: 14px;\n}\n:host .hemfixarna_cart--additional strong {\n text-decoration: underline;\n text-underline-offset: 2px;\n cursor: pointer;\n position: relative;\n}\n:host .hemfixarna_cart--additional strong img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: -24px;\n}\n:host .hemfixarna_cart--price {\n border-top: 1px solid #fcd9c9;\n padding: 16px;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--price h3 {\n margin: 0;\n}\n:host .hemfixarna_cart--item {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 16px 0;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--item span {\n font-size: 12px;\n}\n:host .hemfixarna_cart--item > div {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--item > div > div {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n:host .hemfixarna_cart--item > div button {\n color: #ec6632;\n}\n:host .hemfixarna_categories {\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n:host .hemfixarna_categories--wrapper {\n gap: 32px;\n display: grid;\n grid-template-columns: 1fr 1fr;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_categories--wrapper {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_categories li {\n position: relative;\n background: #fff;\n border-radius: 4px;\n min-height: 132px;\n padding: 24px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n align-items: center;\n gap: 24px;\n cursor: pointer;\n}\n:host .hemfixarna_categories li:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_categories li > button {\n height: 100%;\n width: 100%;\n}\n:host .hemfixarna_categories li .price {\n font-weight: 700;\n}\n:host .hemfixarna_content {\n height: 100%;\n overflow: auto;\n padding: 0 32px 64px;\n}\n:host .hemfixarna_content--5 {\n padding-top: 16px;\n}\n:host .hemfixarna_content--painting {\n padding: 0;\n overflow: initial;\n}\n:host .hemfixarna_crumbs {\n position: relative;\n padding: 16px 24px;\n border-bottom: 1px solid #fcd9c9;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_crumbs--back {\n padding: 16px 24px 8px;\n display: flex;\n align-items: center;\n gap: 8px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs--back:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_crumbs img {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .close {\n position: absolute;\n right: -16px;\n top: -16px;\n z-index: 9;\n}\n:host .hemfixarna_crumbs .cart {\n padding-left: 16px;\n position: relative;\n}\n:host .hemfixarna_crumbs .cart img {\n cursor: inherit;\n}\n:host .hemfixarna_crumbs .cart span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -8px;\n right: -12px;\n}\n:host .hemfixarna_crumbs .cart_active {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .cart_active span {\n background: #25a710;\n color: #fff;\n}\n:host .hemfixarna_crumbs--links {\n display: flex;\n align-items: center;\n gap: 16px;\n overflow: auto;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_crumbs--links {\n -ms-overflow-style: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar {\n display: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar-button {\n display: none;\n }\n}\n:host .hemfixarna_crumbs button {\n white-space: nowrap;\n background: #f1ded6;\n border-radius: 64px;\n padding: 12px 16px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.3px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs button:not(.active):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_crumbs .active {\n background: #fffaf2;\n cursor: default;\n}\n:host .hemfixarna_features {\n gap: 12px !important;\n}\n:host .hemfixarna_features li {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_address {\n margin-bottom: 16px;\n}\n:host .hemfixarna_product {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_product--link {\n font-weight: 700;\n color: #474444;\n text-underline-offset: 4px;\n}\n:host .hemfixarna_product--left {\n gap: 32px;\n}\n:host .hemfixarna_product--right {\n gap: 32px;\n}\n:host .hemfixarna_product--price {\n margin-top: 4px;\n font-weight: 700;\n}\n:host .hemfixarna_product--total {\n text-align: center;\n margin: -16px 0;\n font-size: 21px;\n line-height: 28px;\n}\n:host .hemfixarna_product--item {\n background: #fff;\n padding: 16px;\n display: grid;\n grid-template-columns: auto 75px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_product--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--grid {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_product--grid > div {\n display: flex;\n flex-direction: column;\n}\n:host .hemfixarna_product--grid ul {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n:host .hemfixarna_product p {\n margin: 0;\n}\n:host .hemfixarna_product--top {\n display: flex;\n gap: 32px;\n}\n:host .hemfixarna_product--top > div {\n width: 100%;\n}\n:host .hemfixarna_product--top > div h1 {\n max-width: 80%;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--top > div h1 {\n max-width: 100%;\n }\n}\n:host .hemfixarna_product--top h4 {\n margin-bottom: 8px;\n}\n:host h5,\n:host p {\n margin: 0;\n}\n:host input[type=submit] {\n cursor: pointer;\n}\n:host input[type=date] ~ label {\n left: 56px;\n}\n:host input[type=date] {\n border: 1px solid #fcd9c9;\n padding-left: 64px;\n}\n:host input[type=checkbox] {\n height: 18px;\n width: 18px;\n border: 1px solid #fcd9c9;\n}\n:host input[type=checkbox]:checked {\n background: red;\n}\n:host input[type=date]::-webkit-calendar-picker-indicator {\n background: transparent;\n bottom: 0;\n color: transparent;\n cursor: pointer;\n height: auto;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n width: auto;\n}\n:host button,\n:host a {\n cursor: pointer;\n background: none;\n border: none;\n}\n:host ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}';const sn=class{constructor(n){i(this,n);this.slugIsOldFormat=n=>{if(!n)return false;return["product","service","category"].some((t=>n.includes(t)))};this.triggerScrollTotop=()=>{const n=this.el.shadowRoot.querySelector(".hemfixarna_content");v(n)};this.modal=false;this.showModal=false;this.tree=null;this.product=null;this.proppedProduct=null;this.slug=undefined;this.id=undefined;this.business=undefined;this.topCategory=undefined;this.forceOldTree=false;this.loadFromQuery=false;this.isDemo=false;this.widgetStyle=undefined;this.nav=undefined;this.buttonColor=undefined;this.buttonBg=undefined}loadCategoryOrProduct(n){this.proppedProduct=null;if(n.startsWith("c-")){const t=[...x.customer.categories,...x.customer.categories.map((n=>{var t;return(t=n.sub_categories)!==null&&t!==void 0?t:[]}))].flat();const i=t.find((t=>t&&t.id===n.replace("c-","")));if(i){x.selectedCustomerCategory=i;x.step=2}}else{const t=x.customer.categories.map((n=>n.show_products?n.products:n.sub_categories?n.sub_categories.map((n=>n.products)):[])).flat().flat();const i=t.find((t=>t&&t.fields.ID===parseInt(n)));if(i){x.selectedProduct=i.fields;x.step=4;this.proppedProduct=i.fields}}}async watchSlugChange(n){if(this.slugIsOldFormat(n)){this.fetchNewTaxonomy(n)}else if(x.customer&&n){this.loadCategoryOrProduct(n)}}async watchIdChange(n){if(n&&x.customer){if(n==="maleri"){x.maleri=true;x.step=4}else{this.loadCategoryOrProduct(n)}}}async fetchNewTaxonomy(n){x.selectedCategory=null;x.selectedProduct=null;x.selectedService=null;x.maleri=null;const t=await H(n);if((t===null||t===void 0?void 0:t.code)==="not_found"||(t===null||t===void 0?void 0:t.code)==="rest_no_route"){console.log("taxonomy not found")}else if(t){this.setTaxonomy(t);if((t===null||t===void 0?void 0:t.post_type)==="ikea_product"){this.product=t}}}async componentWillLoad(){x.business=this.business;const n=window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);if(n){x.cart=JSON.parse(n)}const t=window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);if(t){x.user=JSON.parse(t)}const i=window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);if(i){x.creditSafeUser=JSON.parse(i)}const[e,s,a,r,o,l]=await Promise.all([this.topCategory?H(this.topCategory):null,this.slug?H(this.slug):Promise.resolve(null),W(),X(),G(),Y()]);if((!this.slug||!this.slugIsOldFormat(this.slug))&&!this.forceOldTree){try{const n=await E(this.business);if((n===null||n===void 0?void 0:n.code)==="not_found"){console.warn("customer not found")}else if(n){x.customer=n;if(this.id){if(this.id==="maleri"){x.maleri=true;x.step=4}else{this.loadCategoryOrProduct(this.id)}}else if(this.slug&&!this.slugIsOldFormat(this.slug)){this.loadCategoryOrProduct(this.slug)}}}catch(n){console.warn("customer not found")}}if((e===null||e===void 0?void 0:e.code)==="not_found");else if(e){this.tree=e}if((s===null||s===void 0?void 0:s.code)==="not_found"){console.log("taxonomy not found")}else if(s){this.setTaxonomy(s);if((s===null||s===void 0?void 0:s.post_type)==="ikea_product"){this.product=s}}if(this.loadFromQuery){const n=new URL(document.location.toString()).searchParams;this.id=n.get("id");if(!this.isDemo){this.openModal()}}x.rotOptions=o;x.rutOptions=r;x.greenOptions=l;x.options=a}setTaxonomy(n){if(n){if((n===null||n===void 0?void 0:n.taxonomy)==="service_cat"){x.selectedCategory=n;x.step=2}else if((n===null||n===void 0?void 0:n.post_type)==="service"){x.selectedService=n;x.selectedCategory=this.tree.sub_cats.find((t=>t.services.find((t=>t.ID===n.ID))));x.step=3}else if((n===null||n===void 0?void 0:n.post_type)==="ikea_product"){x.selectedProduct=n;x.selectedService=this.tree.sub_cats.map((n=>n.services)).flat().find((n=>n.products.find((n=>n.ID===x.selectedProduct.ID))));x.selectedCategory=this.tree.sub_cats.find((n=>n.services.find((n=>n.ID===x.selectedService.ID))));x.step=4}this.triggerScrollTotop()}}openModal(){this.modal=true;setTimeout((()=>{this.showModal=true}),50)}closeModal(){this.showModal=false;setTimeout((()=>{this.modal=false}),200)}handleClick(n){if(this.loadFromQuery&&!this.isDemo)return;if((n===null||n===void 0?void 0:n.composedPath()[0]).classList.contains("hemfixarna_backdrop")){this.closeModal()}const t=this.el.shadowRoot.querySelector(".hemfixarna_infomodal");if(t){const i=t.contains(n.composedPath()[0]);if(!i){x.modal=null}}}getCartLength(){return x.cart.reduce(((n,t)=>n+t.amount),0)}render(){var n,t,i,s,o,l,h,c,d,u,p,f,m,g,b,v;const _=r(`./assets/hemfixarna.svg`);const y=r(`./assets/pensel.svg`);const w=r(`./assets/montering.svg`);const k=((n=this.nav)===null||n===void 0?void 0:n.background)?r(this.nav.background):"";const C=((t=this.nav)===null||t===void 0?void 0:t.logo)?r(this.nav.logo):"";return e("div",{class:`hemfixarna ${this.loadFromQuery?"hemfixarna_standalone":""}`},this.loadFromQuery&&!this.isDemo&&this.nav?e("nav",{class:"hemfixarna_nav",style:{backgroundColor:(i=this.nav.backgroundColor)!==null&&i!==void 0?i:""}},e("div",null,e("div",{class:"hemfixarna_nav--logos"},e("a",{href:this.nav.url,target:"_blank"},e("img",{class:"hemfixarna_partnerlogo",src:C,alt:`${this.business} logo`})),e("a",{href:"https://hemfixarna.se/",target:"_blank"},e("p",{class:k||this.nav.backgroundColor?"with-bg":""},"I samarbete med:"),e("img",{src:_,alt:"hemfixarna_logo",width:104}))),e("div",{class:"hemfixarna_nav--links"},e("a",{href:this.nav.url,target:"_blank"},"Till ",this.business),e("a",{href:"https://www.hemfixarna.se/",target:"_blank"},"Till Hemfixarna")),k?e("img",{src:k,class:"nav_background",alt:"nav_background"}):null)):null,!this.loadFromQuery||this.isDemo?e("div",{class:`hemfixarna_box hemfixarna_box--${this.widgetStyle}`},[F.alternative_2,F.alternative_3].includes(this.widgetStyle)?e("img",{src:this.id==="maleri"?y:w,alt:"montering logo",width:32,height:32}):null,e("div",null,e("div",null,e("p",{onClick:()=>this.openModal(),class:`pointer ${[F.alternative_2,F.alternative_3].includes(this.widgetStyle)&&x.selectedProduct?"underline":""}`},this.id==="maleri"?e("span",null,"Beräkna fast pris på måleri & tapetsering här"):e(a,null,((s=this.product)===null||s===void 0?void 0:s.title)||((o=this.proppedProduct)===null||o===void 0?void 0:o.title)||e("span",null,"Montering",e("wbr",null),"/Installation ",(h=(l=x.selectedCustomerCategory)===null||l===void 0?void 0:l.name)!==null&&h!==void 0?h:"på plats"," - ",e("strong",{class:"underline"},"se priser här")),this.product&&((c=this.slug)===null||c===void 0?void 0:c.includes("product"))||this.proppedProduct&&!((d=this.product)===null||d===void 0?void 0:d.invoice)&&!((u=this.proppedProduct)===null||u===void 0?void 0:u.invoice)?e("span",null," från"," ",e("strong",null,$(this.proppedProduct||this.product),"kr")):null,((p=this.product)===null||p===void 0?void 0:p.invoice)||((f=this.proppedProduct)===null||f===void 0?void 0:f.invoice)?e("span",null," - ",e("strong",{class:"underling"},"se priser här")):null))),this.widgetStyle===F.standard?e("img",{src:_,width:104}):null,this.widgetStyle===F.alternative?e("span",{class:"p-s"},"Utförs av ",e("strong",null,"Hemfixarna")):null),[F.standard,F.alternative].includes(this.widgetStyle)?e("button",{onClick:()=>this.openModal(),class:"hemfixarna_btn",style:{color:((m=this.buttonColor)===null||m===void 0?void 0:m.startsWith("#"))||!((g=this.buttonColor)===null||g===void 0?void 0:g.length)?this.buttonColor:`#${this.buttonColor}`,backgroundColor:((b=this.buttonBg)===null||b===void 0?void 0:b.startsWith("#"))||!((v=this.buttonBg)===null||v===void 0?void 0:v.length)?this.buttonBg:`#${this.buttonBg}`}},"Beställ här",this.getCartLength()>0&&e("span",null,this.getCartLength())):null,F.alternative_2===this.widgetStyle?e("div",{class:"hemfixarna_altbtn"},e("strong",{class:"p-s"},"Utförs av"),e("img",{src:_,alt:"hemfixarna logo",width:98})):null):null,this.modal&&e("div",null,e("div",{class:`hemfixarna_modal ${this.showModal?"hemfixarna_modal--open":""}`},x.modal&&e("div",{class:"hemfixarna_infomodal"},x.modal.title&&e("h2",null,x.modal.title),x.modal.text.map((n=>e("p",{innerHTML:n}))),e("div",null,e("button",{onClick:()=>x.modal=null},"Stäng"))),(this.tree||x.customer)&&e("hemfixarna-breadcrumbs",{isDemo:this.isDemo,loadFromQuery:this.loadFromQuery,closeModal:()=>this.closeModal(),tree:this.tree}),!x.customer||this.slugIsOldFormat(this.slug)?e("div",{class:`hemfixarna_content hemfixarna_content--${x.step}`},x.step===1&&this.tree&&e("hemfixarna-start",{tree:this.tree}),x.step===2&&x.selectedCategory&&e("hemfixarna-category",null),x.step===3&&x.selectedService&&e("hemfixarna-service",null),x.step===4&&x.selectedProduct&&e("hemfixarna-product",null),x.step===5&&e("hemfixarna-cart",{tree:this.tree}),x.step===6&&e("hemfixarna-order",{tree:this.tree})):e("div",{class:`hemfixarna_content hemfixarna_content--${x.step} ${x.step===4&&x.maleri?"hemfixarna_content--painting":""}`},x.step<4&&e("hemfixarna-start",null),x.step===4&&e("hemfixarna-product",null),x.step===5&&e("hemfixarna-cart",{tree:this.tree}),x.step===6&&e("hemfixarna-order",{tree:this.tree}))),!this.isDemo?e("div",{class:`hemfixarna_backdrop ${this.showModal?"hemfixarna_backdrop--open":""}`}):null))}static get assetsDirs(){return["assets"]}get el(){return s(this)}static get watchers(){return{slug:["watchSlugChange"],id:["watchIdChange"]}}};sn.style=en;const an='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap"); :host{font-family:"Inter", sans-serif}:host .hemfixarna_widgetstyles label{cursor:pointer}:host .hemfixarna_widgetstyles>div{display:flex;gap:1rem}:host .hemfixarna_widgetstyles h5{margin:1rem 0}:host .hemfixarna_example{margin-bottom:16px;background:#000;padding:16px;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:-48px;font-size:16px;left:40%;color:white;padding:8px;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:8px;margin-top:16px}:host .hemfixarna_product--label{background:#e1e0f5}:host .hemfixarna_categories{max-height:100%;overflow:auto;position:relative}:host .hemfixarna_categories--label{display:flex;align-items:center;justify-content:space-between;padding:8px}:host .hemfixarna_categories--label button{background:#3f3a92;border:none;font-weight:600;padding:3.2px 9.6px;border-radius:10px;margin-right:8px;color:#ece8e8}:host .hemfixarna_categories--label button:active{transform:scale(0.95)}:host .hemfixarna_categories--label--big{font-weight:600;border-bottom:1px solid black}:host p{margin:0}:host span{color:darkolivegreen;font-size:10px}:host button{cursor:pointer}:host>div{display:grid;gap:32px;width:100%;grid-template-columns:1fr 1fr;height:100vh;place-items:center;overflow:hidden;padding:16px 32px;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{gap:1px;display:grid}:host>div ul li{padding-left:16px;background:#fff}';const rn=class{constructor(n){i(this,n);this.debounce=null;this.cdnLink='<script type="module" src="https://cdn.jsdelivr.net/npm//hemfixarna-web-components@latest/dist/hemfixarna-components/hemfixarna-components.esm.js"><\/script>';this.selectedSlug=undefined;this.selectedID=undefined;this.tooltipText="Kopiera till urklipp";this.tree=null;this.customer=null;this.widgetStyle=F.standard;this.buttonBg="";this.buttonColor="";this.partner=undefined;this.colorAccessibility=undefined}debouncedFunction(){if(this.debounce!==null){clearTimeout(this.debounce);this.debounce=null}this.debounce=window.setTimeout((()=>{this.checkColorAccessibility();this.debounce=null}),1500)}async checkColorAccessibility(){const n="#fff";const t="#c84e18";const i=this.buttonBg.length?this.buttonBg.startsWith("#")?this.buttonBg:`#${this.buttonBg}`:t;const e=this.buttonColor.length?this.buttonColor.startsWith("#")?this.buttonColor:`#${this.buttonColor}`:n;fetch("https://www.aremycolorsaccessible.com/api/are-they",{mode:"cors",method:"POST",body:JSON.stringify({colors:[i,e]})}).then((n=>n.json())).then((n=>{if(n&&n){this.colorAccessibility=n}}))}getTopLevelCategory(){switch("flyttsmart"){case I.byggmax:return M.byggmax;default:return""}}getColor(n){switch(n){case"AAA":return"green";case"AA":return"orange";case"A":return"yellow";case"Fail":return"red";default:return"black"}}async componentWillLoad(){var n;if(process.env.FORCE_OLD_TREE){const n=await H(this.getTopLevelCategory());if((n===null||n===void 0?void 0:n.code)==="not_found");else if(n){this.tree=n}}else{const t=window.location.pathname.replace("/","");this.partner=L(t)?t:(n="flyttsmart")!==null&&n!==void 0?n:I.kund;const i=await E(this.partner);if(i.code!=="not_found"&&i){this.customer=i}}}getExample(){return`<hemfixarna-${this.partner}${this.selectedSlug?` slug="${this.selectedSlug}" `:""}${this.selectedID?` id="${this.selectedID}" `:""} ${this.widgetStyle===F.standard?"":`widget-style="${this.widgetStyle}"`} ${this.buttonColor.length?`button-color="${this.buttonColor}"`:""} ${this.buttonBg.length?`button-bg="${this.buttonBg}"`:""}></hemfixarna-${this.partner}>`}copyExample(){navigator.clipboard.writeText(this.getExample());this.tooltipText="Snippet kopierad";setTimeout((()=>{this.tooltipText="Kopiera till urklipp"}),2e3)}copyCdn(){navigator.clipboard.writeText(this.cdnLink);this.tooltipText="Text kopierad";setTimeout((()=>{this.tooltipText="Kopiera till urklipp"}),2e3)}copyNpmInstall(){navigator.clipboard.writeText("npm i hemfixarna-web-components");this.tooltipText="Text kopierad";setTimeout((()=>{this.tooltipText="Kopiera till urklipp"}),2e3)}showMaleri(){var n;const t=(n=this.customer)===null||n===void 0?void 0:n.categories.map((n=>n.sub_categories?n.sub_categories:n)).flat();return t===null||t===void 0?void 0:t.some((n=>n.add_painting))}render(){const n=r(`./assets/copy.png`);return e("div",null,e("div",null,e("div",{onClick:()=>this.copyExample(),class:"hemfixarna_example"},e("p",null,this.getExample()),e("img",{src:n,height:20}),e("span",{class:"hemfixarna_example--tooltip"},this.tooltipText)),this.partner===I.byggmax&&e("hemfixarna-byggmax",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,forceOldTree:Boolean(process.env.FORCE_OLD_TREE),slug:this.selectedSlug,id:this.selectedID}),this.partner===I.skanska&&e("hemfixarna-skanska",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.sparfonster&&e("hemfixarna-sparfonster",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.string&&e("hemfixarna-string-furniture",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.hornbach&&e("hemfixarna-hornbach",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.zaptec&&e("hemfixarna-zaptec",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.tesla&&e("hemfixarna-tesla",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.forebygg&&e("hemfixarna-forebygg",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.doro&&e("hemfixarna-doro",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.elfa&&e("hemfixarna-elfa",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.kbygg&&e("hemfixarna-kbygg",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.fargvaruhuset&&e("hemfixarna-fargvaruhuset",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.norrgavel&&e("hemfixarna-norrgavel",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.klint&&e("hemfixarna-klint",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.flyttsmart&&e("hemfixarna-flyttsmart",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.kund&&e("hemfixarna-kund",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),e("div",{class:"hemfixarna_install"},e("div",{onClick:()=>this.copyCdn(),class:"hemfixarna_example"},e("p",null,this.cdnLink),e("span",{class:"hemfixarna_example--tooltip"},this.tooltipText),e("img",{src:n,height:20}))),e("div",{class:"hemfixarna_widgetstyles"},e("h5",null,"Widget styles"),e("div",null,Object.values(F).map((n=>e("label",{key:n},e("input",{type:"radio",value:n,checked:this.widgetStyle===n,onChange:()=>this.widgetStyle=n}),n)))),e("div",null,e("div",null,e("h5",null,"Button background color"),e("input",{type:"text",value:this.buttonBg,onInput:n=>this.buttonBg=n.target.value})),e("div",null,e("h5",null,"Button text color"),e("input",{type:"text",value:this.buttonColor,onInput:n=>this.buttonColor=n.target.value})))),e("span",null,"Write an hexa code no # needed"),this.colorAccessibility?e("div",null,e("h5",null,"Tillgänglighetsrapport"),e("div",null,e("strong",null,"Liten text:"),e("span",{style:{color:this.getColor(this.colorAccessibility.small)}},this.colorAccessibility.small),e("br",null),e("strong",null,"Fet text:"),e("span",{style:{color:this.getColor(this.colorAccessibility.bold)}},this.colorAccessibility.bold),e("br",null),e("strong",null,"Stor text:"),e("span",{style:{color:this.getColor(this.colorAccessibility.large)}},this.colorAccessibility.large),e("br",null),e("strong",null,"Kontrastförhållande:")," ",this.colorAccessibility.contrast)):null),e("ul",{class:"hemfixarna_categories"},this.customer?e("div",null,this.showMaleri()?e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_categories--label--big"},e("div",null,e("p",null,"Måleriverktyget"),e("span",null,"maleri")),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText("maleri")},"Kopiera slug"),e("button",{onClick:()=>this.selectedID="maleri"},"Ladda måleri")))):null,this.customer.categories.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_categories--label--big"},e("div",null,e("p",null,n.name),e("span",null,`c-${n.id}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`c-${n.id}`)},"Kopiera ID"),e("button",{onClick:()=>this.selectedID=`c-${n.id}`},"Ladda kategori"))),n.show_products&&n.products?e("ul",null,n.products.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_product--label"},e("div",null,e("p",null,n.fields.title),e("span",null,n.fields.ID)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(String(n.fields.ID))},"Kopiera ID"),e("button",{onClick:()=>this.selectedID=String(n.fields.ID)},"Ladda produkt"))))))):e("ul",null,n.sub_categories&&n.sub_categories.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label"},e("div",null,e("p",null,n.name),e("span",null,`c-${n.id}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`c-${n.id}`)},"Kopiera ID"),e("button",{onClick:()=>this.selectedID=`c-${n.id}`},"Ladda kategori"))),e("ul",null,n.products.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_product--label"},e("div",null,e("p",null,n.fields.title),e("span",null,n.fields.ID)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(String(n.fields.ID))},"Kopiera ID"),e("button",{onClick:()=>this.selectedID=String(n.fields.ID)},"Ladda produkt"))))))))))))))):this.tree?e("div",null,this.tree.sub_cats.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_categories--label--big"},e("div",null,e("p",null,n.name),e("span",null,`category/${n.slug}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`category/${n.slug}`)},"Kopiera slug"),e("button",{onClick:()=>this.selectedSlug=`category/${n.slug}`},"Ladda kategori"))),e("ul",null,n.services.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label"},e("div",null,e("p",null,n.post_title),e("span",null,`service/${n.post_name}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`service/${n.post_name}`)},"Kopiera slug"),e("button",{onClick:()=>this.selectedSlug=`service/${n.post_name}`},"Ladda kategori"))),e("ul",null,n.products.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label"},e("div",null,e("p",null,n.post_title),e("span",null,`product/${n.post_name}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`product/${n.post_name}`)},"Kopiera slug"),e("button",{onClick:()=>this.selectedSlug=`product/${n.post_name}`},"Ladda produkt"))))))))))))))):null))}static get watchers(){return{buttonBg:["debouncedFunction"],buttonColor:["debouncedFunction"]}}};rn.style=an;const on="";const ln=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.doro})}};ln.style=on;const hn="";const cn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://elfa.com",logo:"assets/elfa.png"},loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.elfa,isDemo:this.isDemo})}};cn.style=hn;const dn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.fargvaruhuset,isDemo:this.isDemo})}};const un=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.flyttsmart,isDemo:this.isDemo})}};const pn="";const fn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.forebygg})}};fn.style=pn;var mn=class extends Error{constructor(){super("Invalid swedish personal identity number")}};var xn=(n,t)=>{const i=n.getTime()-t.getTime();return i<0?-1:i>0?1:i};var gn=(n,t)=>{const i=xn(n,t);const e=Math.abs(n.getFullYear()-t.getFullYear());n.setFullYear(n.getFullYear()-i*e);const s=xn(n,t)===-i;const a=i*(e-+s);return a===0?0:a};var bn=n=>{let t=0;n+="";for(let i=0,e=n.length;i<e;i++){let e=parseInt(n[i]);e*=2-i%2;if(e>9){e-=9}t+=e}return Math.ceil(t/10)*10-t};var vn=(n,t,i)=>{t-=1;const e=new Date(n,t,i);return!(e.getFullYear()!==n||e.getMonth()!==t||e.getDate()!==i)};var _n=class{constructor(n,t){this._century="";this._fullYear="";this._year="";this._month="";this._day="";this._sep="";this._num="";this._check="";this.parse(n,{allowCoordinationNumber:true,allowInterimNumber:false,...t})}get century(){return this._century}get fullYear(){return this._fullYear}get year(){return this._year}get month(){return this._month}get day(){return this._day}get sep(){return this._sep}get num(){return this._num}get check(){return this._check}static parse(n,t){return new _n(n,t)}static valid(n,t){try{_n.parse(n,t);return true}catch(n){return false}}parse(n,t){if(n.length<10||n.length>13){throw new mn}const i=/^(\d{2}){0,1}(\d{2})(\d{2})(\d{2})([+-]?)((?!000)\d{3}|[TRSUWXJKLMN]\d{2})(\d)$/;const e=i.exec(n);if(!e){throw new mn}const s=e[1];const a=e[2];const r=e[3];const o=e[4];const l=e[5];const h=e[6];const c=e[7];if(typeof s==="undefined"||!s.length){const n=new Date;let t=0;if(l==="+"){this._sep="+";t=n.getFullYear()-100}else{this._sep="-";t=n.getFullYear()}this._century=(""+(t-(t-parseInt(a))%100)).substr(0,2)}else{this._century=s;if((new Date).getFullYear()-parseInt(s+a,10)<100){this._sep="-"}else{this._sep="+"}}this._year=a;this._fullYear=this._century+a;this._month=r;this._day=o;this._num=h;this._check=c;if(!this.valid()){throw new mn}if(!(t==null?void 0:t.allowCoordinationNumber)&&this.isCoordinationNumber()){throw new mn}if(!(t==null?void 0:t.allowInterimNumber)&&this.isInterimNumber()){throw new mn}}valid(){const n=bn(this.year+this.month+this.day+this.num.replace(/[TRSUWXJKLMN]/,"1"))===+this.check&&!!this.check;if(n&&vn(parseInt(this.century+this.year),+this.month,+this.day)){return n}return n&&vn(parseInt(this.century+this.year),+this.month,+this.day-60)}format(n=false){if(n){return`${this.century}${this.year}${this.month}${this.day}${this.num}${this.check}`}return`${this.year}${this.month}${this.day}${this.sep}${this.num}${this.check}`}getAge(){const n=this.getDate();return gn(new Date(Date.now()),n)}getDate(){let n=+this.day;if(this.isCoordinationNumber()){n-=60}const t=this.century+this.year+"-"+this.month+"-"+(n<10?"0"+n:n);return new Date(t)}isInterimNumber(){return/[TRSUWXJKLMN]/.test(this.num[0])}isCoordinationNumber(){return vn(parseInt(this.century+this.year),+this.month,+this.day-60)}isFemale(){return!this.isMale()}isMale(){const n=parseInt(this.num.substr(-1));return n%2===1}};var yn=_n;function wn(n,t,i){return i={path:t,exports:{},require:function(n,t){return kn()}},n(i,i.exports),i.exports}function kn(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Cn=wn((function(n,t){Object.defineProperty(t,"__esModule",{value:true});t.utf8=void 0;t.utf8={encode:i,decode:e};function i(n){n=n.replace(/\r\n/g,"\n");var t="";for(var i=0;i<n.length;i++){var e=n.charCodeAt(i);if(e<128){t+=String.fromCharCode(e)}else if(e>127&&e<2048){t+=String.fromCharCode(e>>6|192);t+=String.fromCharCode(e&63|128)}else{t+=String.fromCharCode(e>>12|224);t+=String.fromCharCode(e>>6&63|128);t+=String.fromCharCode(e&63|128)}}return t}function e(n){var t="";var i=0;var e=0;var s=0;var a=0;while(i<n.length){e=n.charCodeAt(i);if(e<128){t+=String.fromCharCode(e);i++}else if(e>191&&e<224){s=n.charCodeAt(i+1);t+=String.fromCharCode((e&31)<<6|s&63);i+=2}else{s=n.charCodeAt(i+1);a=n.charCodeAt(i+2);t+=String.fromCharCode((e&15)<<12|(s&63)<<6|a&63);i+=3}}return t}}));var $n=wn((function(n,t){Object.defineProperty(t,"__esModule",{value:true});t.generate=void 0;function i(n){var t=[];var i;var e;var a;var r;var o;var l;var m;var x;var g;var b=7;var v=12;var _=17;var y=22;var w=5;var k=9;var C=14;var $=20;var S=4;var z=11;var B=16;var T=23;var j=6;var O=10;var D=15;var I=21;var F=Cn.utf8.encode(n);t=p(F);l=1732584193;m=4023233417;x=2562383102;g=271733878;for(i=0;i<t.length;i+=16){e=l;a=m;r=x;o=g;l=h(l,m,x,g,t[i+0],b,3614090360);g=h(g,l,m,x,t[i+1],v,3905402710);x=h(x,g,l,m,t[i+2],_,606105819);m=h(m,x,g,l,t[i+3],y,3250441966);l=h(l,m,x,g,t[i+4],b,4118548399);g=h(g,l,m,x,t[i+5],v,1200080426);x=h(x,g,l,m,t[i+6],_,2821735955);m=h(m,x,g,l,t[i+7],y,4249261313);l=h(l,m,x,g,t[i+8],b,1770035416);g=h(g,l,m,x,t[i+9],v,2336552879);x=h(x,g,l,m,t[i+10],_,4294925233);m=h(m,x,g,l,t[i+11],y,2304563134);l=h(l,m,x,g,t[i+12],b,1804603682);g=h(g,l,m,x,t[i+13],v,4254626195);x=h(x,g,l,m,t[i+14],_,2792965006);m=h(m,x,g,l,t[i+15],y,1236535329);l=c(l,m,x,g,t[i+1],w,4129170786);g=c(g,l,m,x,t[i+6],k,3225465664);x=c(x,g,l,m,t[i+11],C,643717713);m=c(m,x,g,l,t[i+0],$,3921069994);l=c(l,m,x,g,t[i+5],w,3593408605);g=c(g,l,m,x,t[i+10],k,38016083);x=c(x,g,l,m,t[i+15],C,3634488961);m=c(m,x,g,l,t[i+4],$,3889429448);l=c(l,m,x,g,t[i+9],w,568446438);g=c(g,l,m,x,t[i+14],k,3275163606);x=c(x,g,l,m,t[i+3],C,4107603335);m=c(m,x,g,l,t[i+8],$,1163531501);l=c(l,m,x,g,t[i+13],w,2850285829);g=c(g,l,m,x,t[i+2],k,4243563512);x=c(x,g,l,m,t[i+7],C,1735328473);m=c(m,x,g,l,t[i+12],$,2368359562);l=d(l,m,x,g,t[i+5],S,4294588738);g=d(g,l,m,x,t[i+8],z,2272392833);x=d(x,g,l,m,t[i+11],B,1839030562);m=d(m,x,g,l,t[i+14],T,4259657740);l=d(l,m,x,g,t[i+1],S,2763975236);g=d(g,l,m,x,t[i+4],z,1272893353);x=d(x,g,l,m,t[i+7],B,4139469664);m=d(m,x,g,l,t[i+10],T,3200236656);l=d(l,m,x,g,t[i+13],S,681279174);g=d(g,l,m,x,t[i+0],z,3936430074);x=d(x,g,l,m,t[i+3],B,3572445317);m=d(m,x,g,l,t[i+6],T,76029189);l=d(l,m,x,g,t[i+9],S,3654602809);g=d(g,l,m,x,t[i+12],z,3873151461);x=d(x,g,l,m,t[i+15],B,530742520);m=d(m,x,g,l,t[i+2],T,3299628645);l=u(l,m,x,g,t[i+0],j,4096336452);g=u(g,l,m,x,t[i+7],O,1126891415);x=u(x,g,l,m,t[i+14],D,2878612391);m=u(m,x,g,l,t[i+5],I,4237533241);l=u(l,m,x,g,t[i+12],j,1700485571);g=u(g,l,m,x,t[i+3],O,2399980690);x=u(x,g,l,m,t[i+10],D,4293915773);m=u(m,x,g,l,t[i+1],I,2240044497);l=u(l,m,x,g,t[i+8],j,1873313359);g=u(g,l,m,x,t[i+15],O,4264355552);x=u(x,g,l,m,t[i+6],D,2734768916);m=u(m,x,g,l,t[i+13],I,1309151649);l=u(l,m,x,g,t[i+4],j,4149444226);g=u(g,l,m,x,t[i+11],O,3174756917);x=u(x,g,l,m,t[i+2],D,718787259);m=u(m,x,g,l,t[i+9],I,3951481745);l=s(l,e);m=s(m,a);x=s(x,r);g=s(g,o)}return f(l)+f(m)+f(x)+f(g)}t.generate=i;function e(n,t){return n<<t|n>>>32-t}function s(n,t){var i;var e;var s;var a;var r;s=n&2147483648;a=t&2147483648;i=n&1073741824;e=t&1073741824;r=(n&1073741823)+(t&1073741823);if(i&e){return r^2147483648^s^a}if(i|e){if(r&1073741824){return r^3221225472^s^a}else{return r^1073741824^s^a}}else{return r^s^a}}function a(n,t,i){return n&t|~n&i}function r(n,t,i){return n&i|t&~i}function o(n,t,i){return n^t^i}function l(n,t,i){return t^(n|~i)}function h(n,t,i,r,o,l,h){n=s(n,s(s(a(t,i,r),o),h));return s(e(n,l),t)}function c(n,t,i,a,o,l,h){n=s(n,s(s(r(t,i,a),o),h));return s(e(n,l),t)}function d(n,t,i,a,r,l,h){n=s(n,s(s(o(t,i,a),r),h));return s(e(n,l),t)}function u(n,t,i,a,r,o,h){n=s(n,s(s(l(t,i,a),r),h));return s(e(n,o),t)}function p(n){var t;var i=n.length;var e=i+8;var s=(e-e%64)/64;var a=(s+1)*16;var r=Array(a-1);var o=0;var l=0;while(l<i){t=(l-l%4)/4;o=l%4*8;r[t]=r[t]|n.charCodeAt(l)<<o;l++}t=(l-l%4)/4;o=l%4*8;r[t]=r[t]|128<<o;r[a-2]=i<<3;r[a-1]=i>>>29;return r}function f(n){var t="";var i="";var e;var s;for(s=0;s<=3;s++){e=n>>>s*8&255;i="0"+e.toString(16);t=t+i.substr(i.length-2,2)}return t}}));var Sn=wn((function(n,t){Object.defineProperty(t,"__esModule",{value:true});t.MD5=t.generate=void 0;var i=$n;Object.defineProperty(t,"generate",{enumerable:true,get:function(){return i.generate}});t.MD5={generate:$n.generate}}));const zn=async n=>{var t;const i=await fetch((t="https://hemfixare-lookup.vercel.app/api")!==null&&t!==void 0?t:"https://hemfixare-lookup.vercel.app/api",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n,hash:Sn.MD5.generate(String.fromCharCode(83,101,67,82,101,116)+n)})});const e=await i.json();return e};const Bn=class{constructor(n){i(this,n);this.handleChangeEmail=n=>{this.emailError=null;this.email=n.target.value};this.handleChangePhone=n=>{this.phoneError=null;this.phone=n.target.value};this.handleChangessn=n=>{this.ssnError=null;this.ssn=n.target.value};this.handleSubmit=async n=>{n.preventDefault();const t=new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);const i=t.test(this.email);if(!i){this.emailError="Ange en giltig e-postadress"}const e=/^[\d\s()+-]{6,}$/.test(this.phone);if(!e){this.phoneError="Ange ett giltigt telefonnummer"}const s=yn.valid(this.ssn);if(!s){this.ssnError="Ange ett giltigt personnummer"}else if(s){const n=yn.parse(this.ssn).format(true);this.ssn=[n.slice(0,8),"-",n.slice(8)].join("")}if(i&&e&&s){try{const n=await zn(this.ssn);if(n){x.creditSafeUser=n;x.checkoutStep=2;x.user=Object.assign(Object.assign({},n),{email:this.email,phone:this.phone,ssn:this.ssn})}else{this.ssnError="Vi kunde tyvärr inte hitta en address med ditt angivna personnummer"}}catch(n){this.ssnError="Vi kunde tyvärr inte hitta en address med ditt angivna personnummer";console.log(n)}finally{const n=this.el.closest(".hemfixarna_content");v(n)}}};this.render=()=>e("form",{class:"mb-2",onSubmit:n=>this.handleSubmit(n)},e("div",null,e("input",{class:`${this.email.length?"input_active":""}`,onChange:n=>this.handleChangeEmail(n),type:"email",name:"email",value:this.email}),e("label",{htmlFor:"email"},"E-post ")),this.emailError&&e("span",null,this.emailError),e("div",null,e("input",{class:`${this.phone.length?"input_active":""}`,onChange:n=>this.handleChangePhone(n),type:"tel",name:"phone",value:this.phone}),e("label",{htmlFor:"phone"},"Mobiltelefon ")),this.phoneError&&e("span",null,this.phoneError),e("div",null,e("input",{class:`${this.ssn.length?"input_active":""}`,onChange:n=>this.handleChangessn(n),type:"tel",name:"ssn",value:this.ssn}),e("label",{htmlFor:"phone"},"Personnummer*")),this.ssnError&&e("span",null,this.ssnError),e("input",{type:"submit",value:"Fortsätt*"}),e("p",null,"*Vi hämtar din adress"));this.email="";this.emailError=null;this.phone="";this.phoneError=null;this.ssn="";this.ssnError=null}componentWillLoad(){if(x.user){this.email=x.user.email;this.phone=x.user.phone;this.ssn=x.user.ssn}}get el(){return s(this)}};const Tn="";const jn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.isDemo=false;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://www.hornbach.se/",logo:"assets/hornbach/logo.svg",background:"./assets/hornbach/nav.jpg"},isDemo:this.isDemo,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.hornbach})}};jn.style=Tn;const On=class{constructor(n){i(this,n);this.logo=r(`./assets/hemfixarna.svg`);this.checkoutList=[{trust_badge:"Efter att du fyllt i formuläret blir du kontaktad av en Hemfixare för bokning av tid."},{trust_badge:"När jobbet är klart kommer du få en faktura med RUT/ROT/Grön teknik avdrag."}];this.list=null}getList(){return this.list?this.list:this.checkoutList}render(){const n=r(`./assets/checked.svg`);return e("div",{class:"hemfixarna_info"},x.step<5?e(a,null,e("h2",null,"Vilka är Hemfixarna?"),e("p",null,"Vi fixar allt från krångliga datorer till montering av möbler. Vi finns i hela Sverige och är alltid redo att rycka ut.")):e("h2",null,"Vad händer nu?"),e("ul",{class:"hemfixarna_features"},this.getList().map((t=>e("li",{key:t.trust_badge},e("img",{src:n,alt:"checked"}),e("p",null,t.trust_badge))))),e("img",{src:this.logo,width:200,alt:"hemfixarna"}),e("a",{class:"hemfixarna_product--link",target:"_blank",href:x.options.link.url},x.options.link.title))}};const Dn=':host .invoice{gap:16px;display:grid}:host .invoice form>span{text-align:center;padding:16px 0}:host .invoice img{right:unset;left:unset;position:initial;transform:none}:host .invoice label{cursor:pointer;font-size:14px;display:flex;align-items:flex-start;padding:16px 0}:host .invoice label input{margin:0 5px 0 0;accent-color:#ea662c}:host .invoice-preview{display:flex;gap:4px}:host .invoice-preview div{position:relative}:host .invoice-preview div button{position:absolute;top:0;right:0;padding:0}:host .invoice-preview div button img{width:24px;height:24px}:host .invoice-preview div>img{width:100px;height:80px;object-fit:cover}:host .invoice input[type=email],:host .invoice input[type=tel],:host .invoice textarea{padding:16px;border:1px solid #fcd9c9;font-size:16px}:host .invoice textarea{resize:none;height:200px;font-family:"Inter", sans-serif}:host .invoice div:has(>input[type=file]){display:flex;align-items:center;justify-content:center;cursor:pointer;background:#fff;border:1px solid #fcd9c9;padding:32px 16px;gap:16px}:host .invoice div:has(>input[type=file]) span{color:#000;font-size:12px}:host .invoice input[type=file]{display:none}';const In=`${"https://hemfixarna.se"}/wp-json/headless`;const Fn=class{constructor(n){i(this,n);this.formError=null;this.displayImages=[];this.formImages=[];this.formState="initial"}isValidEmail(n){const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return t.test(n)}componentDidRender(){const n=this.el.querySelector("form");if(n){n.addEventListener("input",(()=>{this.formError=null}))}}disconnectedCallback(){const n=this.el.querySelector("form");if(n){n.removeEventListener("input",(()=>{this.formError=null}))}}async submit(n){var t;n.preventDefault();this.formState="loading";this.formError=null;const i=n.currentTarget.elements;const e={description:i.descriptionInput.value.length?i.descriptionInput.value:null,email:i.emailInput.value.length?i.emailInput.value:null,tel:i.telInput.value.length?i.telInput.value:null,terms:(t=i.termsInput)===null||t===void 0?void 0:t.checked};if(!e.description){this.formError="Vänligen fyll i formulärtexten";this.formState="initial";return}if(!e.email||!this.isValidEmail(e.email)){this.formError="Vänligen ange en giltig e-postadress";this.formState="initial";return}if(!e.tel){this.formError="Vänligen ange ditt telefonnummer";this.formState="initial";return}if(x.selectedProduct.terms_show_checkbox&&!e.terms){this.formError="Vänligen acceptera villkoren";this.formState="initial";return}const s=new FormData;s.append("text",e.description);s.append("email",e.email);s.append("tel",e.tel);s.append("customer",x.business);this.formImages.forEach((n=>{s.append("images[]",n)}));s.append("product",JSON.stringify({title:x.selectedProduct.title,amount:1,has_rut:x.selectedProduct.rut,has_rot:x.selectedProduct.rot,has_green:x.selectedProduct.green,ID:x.selectedProduct.ID,parts:[]}));try{const n=await fetch(`${In}/saveinvoiceproduct`,{method:"POST",body:s});const{response:t}=await n.json();if(t.code===200){x.checkoutInvoice=true;x.step=6}else{this.formError="Vi kan inte ta emot din beställning just nu";this.formState="initial"}}catch(n){this.formError="Vi kan inte ta emot din beställning just nu";this.formState="initial"}}handleImageDrop(n){n.preventDefault();const t=n.dataTransfer.files;for(let n=0;n<t.length;n++){const i=t[n];if(i.type.startsWith("image/")){const n=new FileReader;n.onload=()=>{this.displayImages=[...this.displayImages,n.result];this.formImages=[...this.formImages,i]};n.readAsDataURL(i)}}}handleFileInputChange(n){n.preventDefault();const t=n.target.files;for(let n=0;n<t.length;n++){const i=t[n];if(i.type.startsWith("image/")){const n=new FileReader;n.onload=()=>{this.displayImages=[...this.displayImages,n.result];this.formImages=[...this.formImages,i]};n.readAsDataURL(i)}}}handleImageClick(){this.el.querySelector(".hemfixarna-file-upload").click()}preventDragOver(n){n.preventDefault()}removeImage(n){this.displayImages=this.displayImages.filter(((t,i)=>i!==n));this.formImages=this.formImages.filter(((t,i)=>i!==n))}render(){const n=r(`./assets/drag-drop.svg`);return e("div",{class:"invoice"},e("p",null,x.selectedProduct.invoice_description),e("form",{onSubmit:n=>this.submit(n)},e("textarea",{name:"descriptionInput",placeholder:"Beskriv ditt ärende"}),e("div",{role:"button","aria-label":"upload image",onDragOver:n=>this.preventDragOver(n),onDrop:n=>this.handleImageDrop(n),onClick:()=>this.handleImageClick()},e("img",{src:n,alt:"hemfixarna_logo",width:24}),e("div",null,e("p",null,"Bifoga ev bilder"),e("span",null,"(dra bilder hit)")),e("input",{onChange:n=>this.handleFileInputChange(n),class:"hemfixarna-file-upload",accept:"image/*",type:"file",multiple:true,name:"fileInput"})),e("div",{class:"invoice-preview"},this.displayImages.map(((n,t)=>e("div",{key:t},e("img",{src:n,alt:"uploaded image"}),e("button",{onClick:()=>this.removeImage(t)},e("img",{src:r(`./assets/close.svg`),alt:"close"})))))),e("input",{placeholder:"E-post",type:"email",name:"emailInput"}),e("input",{placeholder:"Telefonnummer",type:"tel",name:"telInput"}),x.selectedProduct.terms_show_checkbox?e("label",null,e("input",{type:"checkbox",name:"termsInput"}),x.selectedProduct.terms):null,this.formError?e("span",null,this.formError):null,e("input",{type:"submit",value:this.formState==="loading"?"Skickar":"Kontakta mig"})))}get el(){return s(this)}};Fn.style=Dn;const Mn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://k-bygg.se",logo:"assets/kbygg.svg",backgroundColor:"#651d32"},loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.kbygg,isDemo:this.isDemo})}};const Nn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.klint})}};const Ln=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.kund})}};const An=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://norrgavel.se",logo:"assets/norrgavel.svg"},loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.norrgavel,isDemo:this.isDemo})}};const Pn=class{constructor(n){i(this,n);this.render=()=>e("div",{style:{background:`url(${x.options.thank_you_image})`},class:"hemfixarna_order"},e("div",null),e("div",null,e("h2",null,x.checkoutInvoice?"Tack för din förfrågan":"Tack för din bokning"),x.checkoutInvoice?e("p",null,"Vi återkommer inom kort till dig på angivet telefonnummer eller epost"):null,x.checkoutInvoice?e("div",null):e("hemfixarna-orderrows",{tree:this.tree,cart:false}),e("span",{onClick:()=>this.resetShop()},e("button",null,"Gör en ny bokning")),e("hemfixarna-info",{list:[{trust_badge:"Du kommer bli kontaktad av en Hemfixare för bokning av tid."},{trust_badge:"När jobbet är klart kommer du få en faktura med RUT/ROT/Grön teknik-avdrag."}]})));this.tree=undefined}resetShop(){x.step=1;x.cart=[];x.selectedCategory=null;x.selectedService=null;x.selectedProduct=null;x.maleri=null;x.checkoutStep=1}disconnectedCallback(){this.resetShop()}};const Kn=class{constructor(n){i(this,n);this.cart=true;this.tree=undefined}goToProduct(n){if(x.customer){const t=x.customer.categories.map((n=>n.show_products?n.products:n.sub_categories?n.sub_categories.map((n=>n.products)):[])).flat().flat();const i=t.find((t=>t&&t.fields.ID===n));if(i){x.selectedProduct=i.fields;x.step=4}}else{const t=this.tree.sub_cats.map((n=>n.services)).flat();const i=t.map((n=>n.products)).flat();const e=i.find((t=>t.ID===n));const s=t.find((t=>t.products.find((t=>t.ID===n))));const a=this.tree.sub_cats.find((t=>t.services.find((t=>t.products.find((t=>t.ID===n))))));x.selectedCategory=a;x.selectedService=s;x.selectedProduct=e;x.step=4}}openRot(){x.modal={title:x.rotOptions.rot_start_fee_heading,text:[x.rotOptions.rot_start_fee_text,x.rotOptions.rot_start_fee_text_secondary]}}openRut(){x.modal={title:x.rutOptions.rut_start_fee_heading,text:[x.rutOptions.rut_start_fee_text,x.rutOptions.rut_start_fee_text_secondary]}}openGreen(){x.modal={title:x.greenOptions.green_start_fee_heading,text:[x.greenOptions.green_start_fee_text,x.greenOptions.green_start_fee_text_secondary]}}getDiscountedInfo(n){if(n.rut&&x.rut){return" (efter RUT-avdrag)"}else if(n.rot&&x.rot){return" (efter ROT-avdrag)"}else if(n.green&&x.green){return" (efter Grön teknik avdrag)"}else{return""}}render(){const n=r(`./assets/info.svg`);return e(a,null,e("ul",{class:"hemfixarna_cart--items"},x.cart.map((n=>{var t;return e("li",{class:"hemfixarna_cart--item"},e("div",null,e("div",null,n.icon&&e("img",{width:30,src:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,alt:n.name}),e("p",null,e("strong",null,n.amount,"x "),n.name)),this.cart&&e("button",{onClick:()=>this.goToProduct(n.id)},"Ändra")),e("p",null,e("strong",null,C(n,n.price,n.amount),"kr"),e("span",null,this.getDiscountedInfo(n))),n.parts.length>0&&e("ul",null,n.parts.map((t=>e("li",null,e("p",null,e("strong",null,t.amount,"x "),t.name),e("p",null,e("strong",null,S(t,n,t.amount),"kr")))))))}))),e("div",{class:"hemfixarna_cart--additional"},e("div",null,z().rot>0&&e("div",{class:"hemfixarna_cart--startfee"},e("p",null,e("strong",{onClick:()=>this.openRot()},x.rotOptions.rot_start_fee_heading,e("img",{height:16,src:n,alt:"info monteringsavgift"}))),e("p",null,z().rot,"kr")),z().rut>0&&e("div",{class:"hemfixarna_cart--startfee"},e("p",null,e("strong",{onClick:()=>this.openRut()},x.rutOptions.rut_start_fee_heading,e("img",{height:16,src:n,alt:"info monteringsavgift"}))),e("p",null,z().rut,"kr")),z().green>0&&e("div",{class:"hemfixarna_cart--startfee"},e("p",null,e("strong",{onClick:()=>this.openGreen()},x.greenOptions.green_start_fee_heading,e("img",{height:16,src:n,alt:"info monteringsavgift"}))),e("p",null,z().green,"kr"))),x.cart.find((n=>n.rot))&&e("div",{class:"hemfixarna_cart--rutrot"},e("div",null,this.cart&&e("label",{class:"switch"},e("input",{checked:x.rot,onChange:()=>x.rot=!x.rot,type:"checkbox"}),e("span",{class:"slider"})),e("p",null,"ROT-avdrag")),e("p",null,"(-",x.rot?T():0,"kr)")),x.cart.find((n=>n.rut))&&e("div",{class:"hemfixarna_cart--rutrot"},e("div",null,e("label",{class:"switch"},e("input",{onChange:()=>x.rut=!x.rut,checked:x.rut,type:"checkbox"}),e("span",{class:"slider"})),e("p",null,"RUT-avdrag")),e("p",null,"(-",x.rut?j():0,"kr)")),x.cart.find((n=>n.green))&&e("div",{class:"hemfixarna_cart--rutrot"},e("div",null,e("label",{class:"switch"},e("input",{onChange:()=>x.green=!x.green,checked:x.green,type:"checkbox"}),e("span",{class:"slider"})),e("p",null,"Grön teknik avdrag")),e("p",null,"(-",x.green?O():0,"kr)"))),e("div",{class:"hemfixarna_cart--price"},e("h2",null,"Totalbelopp: "),e("h2",null,D(),"kr")))}};const Rn="";const Qn=class{constructor(n){i(this,n);this.amount=0;this.hideDescription=true}addProduct(){const n=x.cart.find((n=>n.id===x.selectedProduct.ID));if(n){n.amount++;x.cart=[...x.cart]}else{x.cart=[...x.cart,{id:x.selectedProduct.ID,rut:x.selectedProduct.rut,rot:x.selectedProduct.rot,green:x.selectedProduct.green,amount:1,parts:[],price:x.selectedProduct.price,name:x.selectedProduct.title,start_fee:!x.selectedProduct.hide_start_fee,terms_checkout:x.selectedProduct.terms_checkout,icon:x.selectedProduct.icon}]}}removeProduct(){const n=x.cart.find((n=>n.id===x.selectedProduct.ID));if(n&&n.amount>1){n.amount--;x.cart=[...x.cart]}else{x.cart=x.cart.filter((n=>n.id!==x.selectedProduct.ID))}}addPart(n){var t;const i=x.cart.find((n=>n.id===x.selectedProduct.ID));if(i){const e=i.parts.find((t=>t.id===n.ID));if(e){e.amount++;i.parts=[...i.parts]}else{i.parts=[...i.parts,{id:n.ID,amount:1,price:n.price,name:(t=n.title)!==null&&t!==void 0?t:n.title}]}x.cart=[...x.cart.filter((n=>n.id!==i.id)),i]}}removePart(n){const t=x.cart.find((n=>n.id===x.selectedProduct.ID));if(t){const i=t.parts.find((t=>t.id===n.ID));if(i&&i.amount>1){i.amount--;t.parts=[...t.parts]}else{t.parts=t.parts.filter((t=>t.id!==n.ID))}x.cart=[...x.cart.filter((n=>n.id!==t.id)),t]}}goToCart(){const n=x.cart.find((n=>n.id===x.selectedProduct.ID));if(n){x.step=5;const n=this.el.closest(".hemfixarna_content");v(n)}}getAmount(){var n;return((n=x.cart.find((n=>n.id===x.selectedProduct.ID)))===null||n===void 0?void 0:n.amount)||0}getPartAmount(n){var t;const i=x.cart.find((n=>n.id===x.selectedProduct.ID));return((t=i===null||i===void 0?void 0:i.parts.find((t=>t.id===n)))===null||t===void 0?void 0:t.amount)||0}getTotalPrice(){let n=0;const t=x.cart.find((n=>n.id===x.selectedProduct.ID));if(t){const i=t.parts.reduce(((n,t)=>{const i=x.selectedProduct.parts.find((n=>n.ID===t.id));if(i){return n+i.price*t.amount}return n}),0);n=x.selectedProduct.price*t.amount+i}else{n=x.selectedProduct.price}return C(x.selectedProduct,n)}componentDidRender(){const n=document.createElement("link");n.setAttribute("rel","stylesheet");n.setAttribute("href","https://painting-frontend.vercel.app/static/css/main.css");const t=document.createElement("link");t.setAttribute("rel","stylesheet");t.setAttribute("href","https://painting-frontend.vercel.app/fonts.css");const i=()=>{const e=this.el.getElementsByTagName("hemfixare-calculator");if(e.length>0&&e[0].shadowRoot!==null){e[0].shadowRoot.appendChild(n);e[0].shadowRoot.appendChild(t)}else{setTimeout(i,1)}};i()}render(){var n,t,i;const s=r(`./assets/checked.svg`);const o=r(`./assets/plus.svg`);const l=r(`./assets/minus.svg`);if(x.maleri){return e("div",{class:"hemfixarna_painting"},e("script",{type:"text/javascript",src:["localhost","vercel"].some((n=>window.location.href.includes(n)))?"https://painting-dev.vercel.app/static/js/main.js":"https://painting-frontend.vercel.app/static/js/main.js",defer:true,async:true}),e("hemfixare-calculator",{title:x.options.maleri_title,subtitle:x.options.maleri_text,modal:"true",customer:x.business===I.string?"string":x.business}))}return x.selectedProduct?e("div",{class:"hemfixarna_product"},e("div",{class:"hemfixarna_product--top"},x.selectedProduct.icon&&e("img",{width:80,src:(n=x.selectedProduct.icon.url)!==null&&n!==void 0?n:x.selectedProduct.icon,alt:x.selectedProduct.title}),e("div",null,e("h1",null,x.selectedProduct.title),!x.selectedProduct.invoice?e("h2",null,C(x.selectedProduct)," kr/st"):e("h2",null,x.selectedProduct.invoice_price))),e("div",{class:"hemfixarna_product--grid"},e("div",{class:"hemfixarna_product--left"},((t=x.selectedProduct.list)===null||t===void 0?void 0:t.length)&&e("ul",{class:"hemfixarna_features"},x.selectedProduct.list.map((n=>e("li",{key:n.bullet},e("img",{src:s,alt:"checked"}),e("p",null,n.bullet))))),x.selectedProduct.description&&e("p",{onClick:()=>this.hideDescription=false,class:`hemfixarna_description ${this.hideDescription?"hemfixarna_description--hidden":""}`,innerHTML:x.selectedProduct.description})),e("div",{class:"hemfixarna_product--right"},x.selectedProduct.invoice?e("hemfixarna-invoice",null):e(a,null,e("ul",null,e("li",{class:"hemfixarna_product--item"},e("div",null,e("p",null,"Antal ",x.selectedProduct.title),e("p",{class:"hemfixarna_product--price"},C(x.selectedProduct),"kr/st")),e("div",{class:"hemfixarna_counter"},e("img",{class:`${this.getAmount()===0?"disabled":""}`,src:l,onClick:()=>this.removeProduct()}),e("span",null,this.getAmount()),e("img",{src:o,onClick:()=>this.addProduct()}))),((i=x.selectedProduct.parts)===null||i===void 0?void 0:i.length)&&x.selectedProduct.parts.map((n=>{var t;return e("li",{class:"hemfixarna_part"},e("div",null,e("p",null,(t=n.title)!==null&&t!==void 0?t:n.title),e("p",{class:"hemfixarna_product--price"},S(n,x.selectedProduct),"kr/st")),e("div",{class:"hemfixarna_counter"},e("img",{class:`${this.getPartAmount(n.ID)===0?"disabled":""}`,src:l,onClick:()=>this.removePart(n)}),e("span",null,this.getPartAmount(n.ID)),e("img",{class:`${this.getAmount()===0?"disabled":""}`,src:o,onClick:()=>this.addPart(n)})))}))),e("h4",{class:"hemfixarna_product--total"},"Totalt ",this.getTotalPrice()," kr"),e("button",{onClick:()=>this.goToCart(),class:`hemfixarna_buy ${this.getAmount()===0?"disabled":""}`},"Fortsätt")),!x.selectedProduct.hide_start_fee&&(x.selectedProduct.rot||x.selectedProduct.rut)&&x.rutOptions&&x.rotOptions&&e("p",{class:"hemfixarna_terms"},e("strong",null,x.selectedProduct.rot?x.rotOptions.rot_start_fee_heading:x.rutOptions.rut_start_fee_heading),e("br",null),e("span",{innerHTML:x.selectedProduct.rot?x.rotOptions.rot_start_fee_text:x.rutOptions.rut_start_fee_text})),x.options&&e("hemfixarna-info",{list:x.options.trust})))):null}get el(){return s(this)}};Qn.style=Rn;const Un=class{constructor(n){i(this,n)}render(){return e("div",null,e("h2",null,x.selectedService.post_title),e("div",{class:"hemfixarna_categories--wrapper"},e("div",null,e("ul",{class:"hemfixarna_categories"},x.selectedService.products.sort(((n,t)=>n.post_title<t.post_title?-1:1)).map((n=>{var t;return e("hemfixarna-box",{post:n,icon:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,postTitle:n.title})})))),e("hemfixarna-info",{list:x.options.trust})))}};const Vn="";const Jn=class{constructor(n){i(this,n);this.id=undefined;this.customer=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.skanska})}};Jn.style=Vn;const Hn=class{constructor(n){i(this,n);this.id=undefined;this.customer=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.sparfonster})}};const En=class{constructor(n){i(this,n);this.tree=undefined;this.slug=undefined}isMainCategory(n){return n.show_products!==undefined}handleMaleriClick(){x.step=4;x.maleri=true}render(){var n;const t=r("./assets/gubbe-pensel.svg");return x.customer?e("div",null,e("h2",null,x.selectedCustomerCategory?x.selectedCustomerCategory.name:"Alla tjänster"),e("div",{class:"hemfixarna_categories--wrapper"},e("ul",{class:"hemfixarna_categories"},((n=x.selectedCustomerCategory)===null||n===void 0?void 0:n.add_painting)?e("button",{onClick:()=>this.handleMaleriClick(),class:"hemfixarna_maleribox"},e("img",{height:64,src:t,alt:"Måleri Logotyp"}),e("p",null,"Beräkna fast pris på måleri & tapetsering här")):null,x.selectedCustomerCategory?this.isMainCategory(x.selectedCustomerCategory)&&x.selectedCustomerCategory.sub_categories&&!x.selectedCustomerCategory.show_products?x.selectedCustomerCategory.sub_categories.map((n=>e("hemfixarna-box",{category:n}))):x.selectedCustomerCategory.products?x.selectedCustomerCategory.products.map((n=>e("hemfixarna-box",{category:n.fields}))):null:x.customer.categories.map((n=>e("hemfixarna-box",{category:n})))),e("hemfixarna-info",{list:x.options.trust}))):e("div",null,e("h2",null,"Alla tjänster"),e("div",{class:"hemfixarna_categories--wrapper"},e("ul",{class:"hemfixarna_categories"},this.tree.sub_cats.sort(((n,t)=>n.name<t.name?-1:1)).map((n=>{var t;return e("hemfixarna-box",{post:n,icon:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,postTitle:n.name})}))),e("hemfixarna-info",{list:x.options.trust})))}};const Wn="";const Xn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.string})}};Xn.style=Wn;const Gn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.isDemo=false;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://www.tesla.com/sv_se/home-charging",logo:"assets/tesla.svg"},isDemo:this.isDemo,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.tesla})}};const Yn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.isDemo=false;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://www.zaptec.com/sv/laddningslosningar/zaptec-go",logo:"assets/zaptec.svg"},isDemo:this.isDemo,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.zaptec})}};export{_ as hemfixarna_address,A as hemfixarna_box,P as hemfixarna_breadcrumbs,R as hemfixarna_byggmax,Q as hemfixarna_cart,U as hemfixarna_category,tn as hemfixarna_checkout,sn as hemfixarna_component,rn as hemfixarna_demo,ln as hemfixarna_doro,cn as hemfixarna_elfa,dn as hemfixarna_fargvaruhuset,un as hemfixarna_flyttsmart,fn as hemfixarna_forebygg,Bn as hemfixarna_getuser,jn as hemfixarna_hornbach,On as hemfixarna_info,Fn as hemfixarna_invoice,Mn as hemfixarna_kbygg,Nn as hemfixarna_klint,Ln as hemfixarna_kund,An as hemfixarna_norrgavel,Pn as hemfixarna_order,Kn as hemfixarna_orderrows,Qn as hemfixarna_product,Un as hemfixarna_service,Jn as hemfixarna_skanska,Hn as hemfixarna_sparfonster,En as hemfixarna_start,Xn as hemfixarna_string_furniture,Gn as hemfixarna_tesla,Yn as hemfixarna_zaptec};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{g as n,f as t,r as i,h as e,a as s,F as a,c as r}from"./p-33d37833.js";const o=(n,t,i)=>{const e=n.get(t);if(!e){n.set(t,[i])}else if(!e.includes(i)){e.push(i)}};const l=(n,t)=>{let i;return(...e)=>{if(i){clearTimeout(i)}i=setTimeout((()=>{i=0;n(...e)}),t)}};const h=n=>!("isConnected"in n)||n.isConnected;const c=l((n=>{for(let t of n.keys()){n.set(t,n.get(t).filter(h))}}),2e3);const d=()=>{if(typeof n!=="function"){return{}}const i=new Map;return{dispose:()=>i.clear(),get:t=>{const e=n();if(e){o(i,t,e)}},set:n=>{const e=i.get(n);if(e){i.set(n,e.filter(t))}c(i)},reset:()=>{i.forEach((n=>n.forEach(t)));c(i)}}};const u=n=>typeof n==="function"?n():n;const p=(n,t=((n,t)=>n!==t))=>{const i=u(n);let e=new Map(Object.entries(i!==null&&i!==void 0?i:{}));const s={dispose:[],get:[],set:[],reset:[]};const a=()=>{var t;e=new Map(Object.entries((t=u(n))!==null&&t!==void 0?t:{}));s.reset.forEach((n=>n()))};const r=()=>{s.dispose.forEach((n=>n()));a()};const o=n=>{s.get.forEach((t=>t(n)));return e.get(n)};const l=(n,i)=>{const a=e.get(n);if(t(i,a,n)){e.set(n,i);s.set.forEach((t=>t(n,i,a)))}};const h=typeof Proxy==="undefined"?{}:new Proxy(i,{get(n,t){return o(t)},ownKeys(n){return Array.from(e.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(n,t){return e.has(t)},set(n,t,i){l(t,i);return true}});const c=(n,t)=>{s[n].push(t);return()=>{f(s[n],t)}};const d=(t,i)=>{const e=c("set",((n,e)=>{if(n===t){i(e)}}));const s=c("reset",(()=>i(u(n)[t])));return()=>{e();s()}};const p=(...n)=>{const t=n.reduce(((n,t)=>{if(t.set){n.push(c("set",t.set))}if(t.get){n.push(c("get",t.get))}if(t.reset){n.push(c("reset",t.reset))}if(t.dispose){n.push(c("dispose",t.dispose))}return n}),[]);return()=>t.forEach((n=>n()))};const m=n=>{const t=e.get(n);s.set.forEach((i=>i(n,t,t)))};return{state:h,get:o,set:l,on:c,onChange:d,use:p,dispose:r,reset:a,forceUpdate:m}};const f=(n,t)=>{const i=n.indexOf(t);if(i>=0){n[i]=n[n.length-1];n.length--}};const m=(n,t)=>{const i=p(n,t);i.use(d());return i};const{state:x,onChange:g}=m({step:1,checkoutStep:1,checkoutEdit:false,selectedCategory:null,selectedService:null,selectedProduct:null,cart:[],business:"undefined",options:null,rut:true,rot:true,green:true,token:null,user:null,modal:null,rutOptions:null,rotOptions:null,greenOptions:null,customer:null,selectedCustomerCategory:null,parentCategory:null,creditSafeUser:null,checkoutInvoice:false,maleri:false});g("cart",(n=>{window.sessionStorage.setItem(`hemfixarna-${x.business}-cart`,JSON.stringify(n))}));g("user",(n=>{window.sessionStorage.setItem(`hemfixarna-${x.business}-user`,JSON.stringify(n))}));g("creditSafeUser",(n=>{window.sessionStorage.setItem(`hemfixarna-${x.business}-creditSafeUser`,JSON.stringify(n))}));g("selectedProduct",(n=>{if(!x.customer||!n)return;const t=[...x.customer.categories,...x.customer.categories.map((n=>{var t;return(t=n.sub_categories)!==null&&t!==void 0?t:[]}))].flat();const i=t.find((t=>t&&t.id===n.category));if(i){x.parentCategory=i;return}x.parentCategory=null}));g("selectedCustomerCategory",(n=>{if(!x.customer||!n)return;if(n.parent){const t=x.customer.categories.find((t=>t.id===n.parent));if(t){x.parentCategory=t;return}}x.parentCategory=null}));const b=n=>n.split(" ").reduce(((n,t)=>{if(t.length<=2){return n+t.slice(0,1)+"* "}else{return n+t.slice(0,1)+"*".repeat(t.length-2)+t.slice(-1)+" "}}),"");const v=n=>{if(!n)return;n.scrollTo({top:0,behavior:"smooth"})};const _=class{constructor(n){i(this,n);this.handleSubmit=n=>{n.preventDefault();const t=this.street.length>0;if(!t){this.streetError="Ange en gatuadress"}const i=this.zip.length>0;const e=/^\s*\d[\d\s]*$/.test(this.zip);if(!e){this.zipError="Postnummer får endast innehålla siffror"}if(!i){this.zipError="Ange ett postnummer"}const s=/^[^\d\s]{2,}$/.test(this.town);if(!s){this.townError="Ange en ort"}if(t&&i&&s&&e){x.user=Object.assign(Object.assign({},x.user),{street:this.street,zip:this.zip,town:this.town});x.checkoutStep=2;x.checkoutEdit=false;const n=this.el.closest(".hemfixarna_content");v(n)}};this.handleChangeStreet=n=>{this.streetError=null;this.street=this.street===x.user.street?"":n.target.value};this.handleChangeZip=n=>{this.zipError=null;this.zip=this.zip===x.user.zip?"":n.target.value};this.handleChangeTown=n=>{this.townError=null;this.town=this.town===x.user.town?"":n.target.value};this.render=()=>e("form",{class:"hemfixarna_address",onSubmit:n=>this.handleSubmit(n)},e("div",null,e("input",{class:`${this.street.length?"input_active":""}`,onInput:this.handleChangeStreet,type:"text",name:"street",value:this.street===x.user.street?b(this.street):this.street}),e("label",{htmlFor:"street"},"Gatuaddress ")),this.streetError&&e("span",null,this.streetError),e("div",null,e("input",{class:`${this.zip.length?"input_active":""}`,onInput:this.handleChangeZip,type:"tel",name:"zip",value:this.zip===x.user.zip?b(this.zip):this.zip}),e("label",{htmlFor:"zip"},"Postnummer ")),this.zipError&&e("span",null,this.zipError),e("div",null,e("input",{class:`${this.town.length?"input_active":""}`,onInput:this.handleChangeTown,type:"text",name:"town",value:this.town===x.user.town?b(this.town):this.town}),e("label",{htmlFor:"town"},"Ort ")),this.townError&&e("span",null,this.townError),e("input",{type:"submit",value:"Fortsätt"}));this.street="";this.streetError=null;this.zip="";this.zipError=null;this.town="";this.townError=null}componentWillLoad(){if(x.user){this.street=x.user.street;this.zip=x.user.zip;this.town=x.user.town}}get el(){return s(this)}};const y=n=>Math.ceil(n/2);const w=n=>Math.ceil(n*.7);const k=n=>Math.ceil(n*.5);const C=(n,t,i=1)=>{if(n.rot&&x.rot){return w((t||n.price)*i)}else if(n.rut&&x.rut){return y((t||n.price)*i)}else if(n.green&&x.green){return k((t||n.price)*i)}else{return(t||n.price)*i}};const $=n=>{if(n.rot){return w(n.price)}else if(n.rut&&x.rut){return y(n.price)}else{return n.price}};const S=(n,t,i=1)=>{if(t.rot&&x.rot){return w(n.price*i)}else if(t.rut&&x.rut){return y(n.price*i)}else{return n.price*i}};const z=()=>{if(!x.cart)return{rut:0,rot:0,green:0};const n=x.cart.some((n=>n.rut&&n.start_fee));const t=x.cart.some((n=>n.rot&&n.start_fee));const i=x.cart.some((n=>n.green&&n.start_fee));const e=x.rut?y(x.options.start_fee):x.options.start_fee*1;const s=x.rot?w(x.options.start_fee):x.options.start_fee*1;const a=x.green?k(x.options.start_fee):x.options.start_fee*1;return{rut:n?e:0,rot:t?s:0,green:i?a:0,length:[n,t,i].filter((n=>n)).length}};const B=n=>{const t=n.parts.reduce(((n,t)=>n+t.price*t.amount),0);return C(n,n.price*n.amount+t)};const T=()=>{const n=x.cart.reduce(((n,t)=>t.rot?n+B(t):n),0)+z().rot;const t=x.cart.reduce(((n,t)=>{const i=t.parts.reduce(((n,t)=>n+t.price*t.amount),0);return t.rot?n+t.price*t.amount+i:n}),0)+Number(x.options.start_fee);return t-n};const j=()=>{const n=x.cart.reduce(((n,t)=>t.rut?n+B(t):n),0)+z().rut;const t=x.cart.reduce(((n,t)=>{const i=t.parts.reduce(((n,t)=>n+t.price*t.amount),0);return t.rut?n+t.price*t.amount+i:n}),0)+Number(x.options.start_fee);return t-n};const O=()=>{const n=x.cart.reduce(((n,t)=>t.green?n+B(t):n),0)+z().green;const t=x.cart.reduce(((n,t)=>{const i=t.parts.reduce(((n,t)=>n+t.price*t.amount),0);return t.green?n+t.price*t.amount+i:n}),0)+Number(x.options.start_fee);return t-n};const D=()=>x.cart.reduce(((n,t)=>n+B(t)),0)+z().rot+z().rut;var I;(function(n){n["kund"]="kund";n["byggmax"]="byggmax";n["skanska"]="skanska";n["string"]="string-furniture";n["hornbach"]="hornbach";n["forebygg"]="forebygg";n["doro"]="doro";n["elfa"]="elfa";n["kbygg"]="k-bygg";n["norrgavel"]="norrgavel";n["fargvaruhuset"]="fargvaruhuset";n["zaptec"]="zaptec";n["tesla"]="tesla";n["klint"]="klint";n["flyttsmart"]="flyttsmart";n["lg"]="lg";n["sparfonster"]="sparfonster"})(I||(I={}));var F;(function(n){n["standard"]="standard";n["alternative"]="alternative";n["alternative_2"]="alternative_2";n["alternative_3"]="alternative_3"})(F||(F={}));var M;(function(n){n["byggmax"]="category/bygg"})(M||(M={}));const N=n=>n.post_name!==undefined;const L=n=>Object.values(I).includes(n);const A=class{constructor(n){i(this,n);this.post=undefined;this.category=undefined;this.icon=undefined;this.postTitle=undefined}setTaxonomy(n){if(n){if((n===null||n===void 0?void 0:n.taxonomy)==="service_cat"){x.selectedCategory=n;x.step=2}else if((n===null||n===void 0?void 0:n.post_type)==="service"){x.selectedService=n;x.step=3}else if((n===null||n===void 0?void 0:n.post_type)==="ikea_product"){x.selectedProduct=n;x.step=4}const t=this.el.closest(".hemfixarna_content");v(t)}}setProduct(){x.selectedProduct=this.category;x.step=4;x.selectedCustomerCategory=null;const n=this.el.closest(".hemfixarna_content");v(n)}render(){return this.category?e(a,null,N(this.category)?e("li",{onClick:()=>this.setProduct()},e("img",{class:"hemfixarna_logo",height:82,src:this.category.icon,alt:this.category.post_name}),e("div",null,e("p",null,this.category.title),!this.category.invoice?e("p",{class:"price"},"Från ",C(this.category),"kr"):null)):e("li",{onClick:()=>x.selectedCustomerCategory=this.category},e("img",{class:"hemfixarna_logo",height:82,src:this.category.icon,alt:this.category.name}),e("div",null,e("p",null,this.category.name)))):e("li",{onClick:()=>this.setTaxonomy(this.post)},this.post.icon&&e("img",{class:"hemfixarna_logo",height:82,src:this.icon,alt:this.postTitle}),e("div",null,e("p",null,this.postTitle),x.step===3&&e("p",{class:"price"},"Från ",C(this.post),"kr")))}get el(){return s(this)}};const P=class{constructor(n){i(this,n);this.triggerScrollTotop=()=>{const n=this.el.nextSibling;v(n)};this.tree=undefined;this.closeModal=undefined;this.loadFromQuery=false;this.isDemo=false}getCartLength(){return x.cart.reduce(((n,t)=>n+t.amount),0)}handleCartClick(){var n;if((n=x.cart)===null||n===void 0?void 0:n.length){x.step=5;this.triggerScrollTotop()}}handleHomePageClick(){x.step=1;x.parentCategory=null;x.selectedCustomerCategory=null;this.triggerScrollTotop();setTimeout((()=>{x.selectedCategory=null;x.selectedProduct=null;x.maleri=null;x.selectedService=null}),200)}render(){const n=r(`./assets/hemfixarna.svg`);const t=r(`./assets/close.svg`);const i=r(`./assets/cart.svg`);const s=r(`./assets/back.svg`);return e("div",null,e("div",{class:"hemfixarna_crumbs"},e("div",{class:"hemfixarna_crumbs--links"},e("img",{onClick:()=>this.handleHomePageClick(),src:n,width:110}),!this.loadFromQuery||this.isDemo?e("img",{onClick:()=>this.closeModal(),class:"close",src:t,width:32}):null,e("div",null,e("button",{onClick:()=>this.handleHomePageClick()},"Alla tjänster"))),e("div",{onClick:()=>this.handleCartClick(),class:`cart ${this.getCartLength()>0?"cart_active":""}`},e("img",{src:i,width:24}),e("span",null,this.getCartLength()))),[3,4].includes(x.step)&&!x.customer&&e("button",{class:"hemfixarna_crumbs--back",onClick:()=>{x.step=x.step===4?3:2}},e("img",{width:24,src:s,alt:"back arrow"}),e("span",null,"Se allt ",x.step===4?x.selectedService.post_title:x.selectedCategory.name)),x.parentCategory&&x.step<5&&e("button",{class:"hemfixarna_crumbs--back",onClick:()=>{x.step=1;x.selectedCustomerCategory=x.parentCategory;x.selectedProduct=null;x.maleri=null}},e("img",{width:24,src:s,alt:"back arrow"}),e("span",null,"Se allt ",x.parentCategory.name)))}get el(){return s(this)}};const K="";const R=class{constructor(n){i(this,n);this.tree=null;this.slug=undefined;this.id=undefined;this.forceOldTree=false;this.loadFromQuery=undefined;this.customer=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{forceOldTree:this.forceOldTree,id:this.id,slug:this.slug,business:I.byggmax,topCategory:M.byggmax,loadFromQuery:Boolean(this.loadFromQuery),widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor})}};R.style=K;const Q=class{constructor(n){i(this,n);this.tree=undefined}render(){const n=r(`./assets/back.svg`);return e("div",{class:"hemfixarna_cart"},e("div",{class:"hemfixarna_cart--left"},e("h2",null,x.checkoutStep===2&&!x.checkoutEdit&&e("button",{onClick:()=>{x.checkoutStep=1}},e("img",{width:24,src:n,alt:"back arrow"})),"Din bokning"),e("hemfixarna-orderrows",{tree:this.tree})),e("div",{class:"hemfixarna_cart--right"},e("h2",null,x.checkoutStep===2&&!x.checkoutEdit&&e("button",{onClick:()=>{x.checkoutStep=1}},e("img",{width:24,src:n,alt:"back arrow"})),"Dina uppgifter"),e("hemfixarna-checkout",null),e("hemfixarna-info",null)))}};const U=class{constructor(n){i(this,n)}setSelectedService(n){x.selectedService=n;x.step=3}render(){return e("div",null,e("h2",null,x.selectedCategory.name),e("div",{class:"hemfixarna_categories--wrapper"},e("div",null,e("ul",{class:"hemfixarna_categories"},x.selectedCategory.services.sort(((n,t)=>n.post_title<t.post_title?-1:1)).map((n=>{var t;return e("hemfixarna-box",{post:n,icon:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,postTitle:n.post_title})})))),e("hemfixarna-info",{list:x.options.trust})))}};const V=`${"https://hemfixarna.se"}/wp-json/headless`;async function J(n,t){const i=await fetch(n,t);const e=await i.json();return e}const H=async n=>{if(!n){return}const t=n.split("/")[0];const i=n.split("/")[1];try{const n=await fetch(`${V}/${t}/${i}`);return await n.json()}catch(n){console.log(n)}};const E=async n=>{try{const t=await fetch(`${V}/customer/${n}`);return await t.json()}catch(n){console.log(n)}};const W=async()=>{try{const n=await fetch(`${V}/webcoptions`);return await n.json()}catch(n){console.log(n)}};const X=async()=>{try{const n=await J(`${V}/rut`);return n}catch(n){console.log(n)}};const G=async()=>{try{const n=await fetch(`${V}/rot`);return await n.json()}catch(n){console.log(n)}};const Y=async()=>{try{const n=await fetch(`${V}/green-discount`);return await n.json()}catch(n){console.log(n)}};const q=async n=>{try{const t=await fetch(`${V}/weborder`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}});return await t.json()}catch(n){console.log(n)}};const Z=`${"https://hemfixarna.se"}/wp-json/felix`;const nn=async n=>{try{return await J(`${Z}/createperson`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}catch(n){console.log(n)}};const tn=class{constructor(n){i(this,n);this.handleChangeDate=n=>{this.dateError=null;this.date=n.target.value};this.handleChangeTerms=()=>{this.generalError=null};this.sendOrder=async()=>{var n,t;if(this.loading)return;this.loading=true;let i={firstName:x.creditSafeUser.firstName,lastName:x.creditSafeUser.lastName,street:x.user.street,zip:x.user.zip,town:x.user.town,ssn:x.user.ssn,email:x.user.email,phone:x.user.phone,url:`${x.business===I.string?"string":x.business}-webk`,date:this.date,products:[...x.cart.map((n=>{const t=n.parts.map((n=>({id:String(n.id),name:n.name,quantity:n.amount,rut:0,rot:0})));return[{id:String(n.id),name:n.name,quantity:n.amount,rot:n.rot?1:0,rut:n.rut?1:0},...t]}))].flat(),creditSafe:x.creditSafeUser,customer:x.business};const e=await nn(i);if(!e||!((t=(n=e.response)===null||n===void 0?void 0:n.scriptResult)===null||t===void 0?void 0:t.includes("OK"))){i=Object.assign(Object.assign({},i),{felixStatus:"error"})}else{i=Object.assign(Object.assign({},i),{felixStatus:"success"})}try{const{data:n,status:t}=await q(i);if(n&&t&&t===200){x.step=6;const n=this.el.closest(".hemfixarna_content");v(n)}else{this.generalError="Något gick fel, försök igen senare"}}catch(n){this.generalError="Något gick fel, försök igen senare"}this.loading=false};this.handleSubmit=n=>{n.preventDefault();this.generalError=null;const t=this.date.length>0;if(!t){this.dateError="Ange ett giltigt datum"}const i=Array.from(this.el.querySelectorAll('input[type="checkbox"]'));const e=i.find((n=>!n.checked));if(e){this.generalError="Du måste godkänna villkoren"}if(t&&!e){this.sendOrder()}};this.render=()=>{const n=r(`./assets/date.svg`);const t=r(`./assets/down.svg`);const i=r(`./assets/spinner.gif`);if(x.checkoutEdit){return e("hemfixarna-address",null)}else if(x.checkoutStep===1){return e("hemfixarna-getuser",null)}else if(x.checkoutStep===2){return e("div",{class:"mb-2"},e("div",{class:"hemfixarna_addressinfo"},e("div",null,e("p",null,b(x.user.firstName)),e("p",null,b(x.user.lastName)),e("p",null,x.user.email),e("p",null,x.user.phone)),e("div",null,e("p",null,b(x.user.street)),e("p",null,b(x.user.zip)),e("p",null,b(x.user.town))),e("button",{onClick:()=>x.checkoutEdit=true},"Behöver du ändra adressen?")),e("form",{onSubmit:n=>this.handleSubmit(n)},e("div",null,e("img",{src:n,width:24}),e("input",{class:`${this.date.length?"input_active":""}`,min:(new Date).toISOString().split("T")[0],onChange:n=>this.handleChangeDate(n),type:"date",name:"date",value:this.date}),e("label",{htmlFor:"date"},"Tidigaste datum för hembesök"),e("img",{src:t,width:24})),this.dateError&&e("span",null,this.dateError),e("label",{class:"hemfixarna_checkbox"},e("input",{onChange:()=>this.handleChangeTerms(),type:"checkbox"}),e("span",{innerHTML:x.options.terms})),x.cart.filter((n=>{var t;return(t=n.terms_checkout)===null||t===void 0?void 0:t.length})).map((n=>e(a,null,e("label",{class:"hemfixarna_checkbox"},e("input",{onChange:()=>this.handleChangeTerms(),type:"checkbox"}),e("span",null,n.terms_checkout))))),this.generalError&&e("span",null,this.generalError),e("div",{class:this.loading?"loading":""},e("input",{type:"submit",value:this.loading?"":"Skicka bokning"}),e("img",{width:20,height:20,src:i,alt:"spinner"}))))}};this.date="";this.dateError=null;this.generalError=null;this.loading=false}componentWillLoad(){if(Boolean(x.user&&x.user.street)){x.checkoutStep=2}}get el(){return s(this)}};const en='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap");\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n* {\n box-sizing: border-box;\n}\n\n:host {\n font-family: "Inter", sans-serif;\n}\n:host .mb-2 {\n margin-bottom: 32px;\n}\n:host button {\n color: #474444;\n}\n:host form {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n:host form img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n pointer-events: none;\n}\n:host form img:first-of-type {\n left: 16px;\n}\n:host form img:last-of-type {\n right: 16px;\n}\n:host form span {\n margin-top: -8px;\n color: #ec6632;\n}\n:host form p {\n text-align: center;\n}\n:host form p {\n margin: 0;\n}\n:host form div {\n position: relative;\n}\n:host form div label {\n pointer-events: none;\n position: absolute;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n background: #fff;\n padding: 4px;\n transition: 0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n}\n:host form div input {\n padding: 16px;\n width: 100%;\n font-size: 16px;\n border: 1px solid #fcd9c9;\n}\n:host form div input:focus ~ label,\n:host form div .input_active ~ label {\n top: 0;\n transform: translateY(-50%);\n background: linear-gradient(180deg, #fffaf2 50%, #fff 50%);\n}\n:host h1 {\n font-size: 24px;\n font-weight: 400;\n line-height: 32px;\n letter-spacing: -3%;\n text-align: left;\n margin: 0 0 8px;\n}\n:host h2 {\n margin: 0 0 24px;\n font-weight: 700;\n font-size: 20px;\n line-height: 28px;\n letter-spacing: -3%;\n}\n:host p {\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna {\n width: 100%;\n /* Hide default HTML checkbox */\n /* The slider */\n}\n:host .hemfixarna_painting {\n opacity: 0;\n padding: 0 1rem;\n animation: fadeIn 0.5s forwards 0.3s;\n}\n:host .hemfixarna_painting > h2,\n:host .hemfixarna_painting p {\n text-align: center;\n padding: 0 16px;\n}\n:host .hemfixarna_painting > h2 {\n margin: 0 0 8px;\n}\n:host .hemfixarna_partnerlogo {\n max-height: 50px;\n min-height: 45px;\n object-fit: contain;\n max-width: 150px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_partnerlogo {\n max-width: 200px;\n }\n}\n:host .hemfixarna_nav {\n position: absolute;\n top: 0;\n width: 100dvw;\n left: 0;\n height: 80px;\n z-index: 9999;\n}\n:host .hemfixarna_nav--links {\n display: none !important;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav--links {\n display: flex !important;\n }\n}\n:host .hemfixarna_nav--links a {\n color: #ec6632;\n text-decoration: none;\n border: 1px solid rgba(255, 255, 255, 0.3);\n border-radius: 56px;\n padding: 8px 32px;\n text-transform: capitalize;\n}\n:host .hemfixarna_nav > div {\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 16px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav > div {\n padding: 0 32px;\n }\n}\n:host .hemfixarna_nav > div > div {\n display: flex;\n gap: 32px;\n justify-content: space-between;\n}\n:host .hemfixarna_nav > div > img {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: -1;\n}\n:host .hemfixarna_nav a {\n text-decoration: none;\n}\n:host .hemfixarna_nav p {\n color: #474444;\n}\n:host .hemfixarna_nav p.with-bg {\n color: #fff;\n}\n:host .hemfixarna_standalone .hemfixarna_backdrop {\n background: #fffaf2;\n opacity: 1;\n}\n:host .hemfixarna_standalone .hemfixarna_modal {\n top: 80px;\n transform: translateX(-50%);\n border: none;\n height: calc(100dvh - 80px);\n opacity: 0;\n}\n:host .hemfixarna_standalone .hemfixarna_modal--open {\n opacity: 1;\n}\n:host .hemfixarna .switch {\n position: relative;\n display: inline-block;\n width: 40px;\n height: 20px;\n}\n:host .hemfixarna .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n}\n:host .hemfixarna .slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 34px;\n}\n:host .hemfixarna .slider:before {\n position: absolute;\n content: "";\n height: 18px;\n width: 18px;\n left: 2px;\n bottom: 1px;\n background-color: white;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 50%;\n}\n:host .hemfixarna input:checked + .slider {\n background-color: #fcd9c9;\n}\n:host .hemfixarna input:focus + .slider {\n box-shadow: 0 0 1px #fcd9c9;\n}\n:host .hemfixarna input:checked + .slider:before {\n -webkit-transform: translateX(18px);\n -ms-transform: translateX(18px);\n transform: translateX(18px);\n background: #ec6632;\n}\n:host .hemfixarna_maleribox {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n width: 100%;\n min-height: 132px;\n padding: 24px;\n display: flex;\n align-items: center;\n gap: 24px;\n text-align: left;\n}\n:host .hemfixarna_maleribox:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_checkbox {\n display: grid;\n grid-template-columns: 40px auto;\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna_checkbox > span {\n transform: translateY(6px);\n}\n:host .hemfixarna_checkbox span,\n:host .hemfixarna_checkbox span p {\n color: #474444;\n font-size: 14px;\n}\n:host .hemfixarna_checkbox p {\n text-align: left;\n}\n:host .hemfixarna_info {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 32px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n border-radius: 4px;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_info h2 {\n margin: 0;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_info {\n position: sticky;\n top: 0;\n }\n}\n:host .hemfixarna_infomodal {\n position: absolute;\n top: 40%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n max-width: 80%;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n padding: 32px;\n z-index: 99;\n border-radius: 4px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n:host .hemfixarna_infomodal p,\n:host .hemfixarna_infomodal h4 {\n margin: 0;\n}\n:host .hemfixarna_infomodal button {\n background: #ec6632;\n color: #fff;\n border-radius: 60px;\n font-size: 16px;\n padding: 8px 16px;\n}\n:host .hemfixarna_addressinfo {\n padding: 16px 16px 64px;\n border: 1px solid #fcd9c9;\n position: relative;\n margin-bottom: 32px;\n display: grid;\n grid-template-columns: 1fr;\n gap: 8px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_addressinfo {\n grid-template-columns: 1fr 1fr;\n }\n}\n:host .hemfixarna_addressinfo button {\n position: absolute;\n bottom: 16px;\n right: 16px;\n font-weight: 500;\n text-underline-offset: 2px;\n text-decoration: underline;\n}\n:host .hemfixarna_part {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: grid;\n padding: 16px;\n grid-template-columns: auto 75px;\n}\n:host .hemfixarna_counter {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_counter span {\n padding: 0 8px;\n}\n:host .hemfixarna_counter img {\n cursor: pointer;\n}\n:host .hemfixarna_counter img:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_description {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_description ul {\n list-style: disc;\n padding-right: 12px;\n transform: translateX(12px);\n}\n:host .hemfixarna_description--hidden {\n max-height: 140px;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n}\n:host .hemfixarna_description--hidden::after {\n content: "";\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 128px;\n background: linear-gradient(180deg, rgba(255, 253, 250, 0), rgba(255, 253, 250, 0.46) 50%, #fffaf2);\n}\n:host .hemfixarna_terms {\n font-size: 14px;\n}\n:host .hemfixarna_terms a {\n color: inherit;\n}\n:host .hemfixarna_logo {\n height: 64px;\n}\n:host .hemfixarna_box {\n padding: 16px;\n display: flex;\n align-items: center;\n width: 100%;\n box-sizing: border-box;\n border-radius: 4px;\n gap: 16px 8px;\n border-radius: 4px;\n gap: 16px 8px;\n}\n:host .hemfixarna_box p,\n:host .hemfixarna_box span {\n font-size: 15px;\n}\n:host .hemfixarna_box .underline {\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n:host .hemfixarna_box .pointer {\n cursor: pointer;\n}\n:host .hemfixarna_box .p-s {\n font-size: 12px;\n}\n:host .hemfixarna_box > div {\n display: grid;\n gap: 8px;\n}\n:host .hemfixarna_box--standard {\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_box--alternative, :host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n background: transparent;\n border: 1px solid #e3e3e3;\n}\n:host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n box-shadow: 0px 2px 16px 0px rgba(0, 0, 0, 0.0784313725);\n}\n:host .hemfixarna_box--alternative_3 {\n justify-content: center;\n}\n:host .hemfixarna_altbtn {\n display: flex !important;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n margin-left: auto;\n}\n:host .hemfixarna_btn {\n margin-left: auto;\n}\n:host .hemfixarna_btn, :host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n border: none;\n border-radius: 60px;\n font-weight: 600;\n letter-spacing: 0.5px;\n line-height: 20px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_btn:not(.disabled):hover, :host .hemfixarna_buy:not(.disabled):hover,\n:host .hemfixarna input[type=submit]:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna div:has(> input[type=submit]) {\n position: relative;\n}\n:host .hemfixarna div:has(> input[type=submit]) input {\n cursor: pointer;\n}\n:host .hemfixarna div:has(> input[type=submit]) img {\n display: none;\n}\n:host .hemfixarna .loading {\n cursor: default;\n opacity: 0.6;\n}\n:host .hemfixarna .loading > img {\n display: initial !important;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n:host .hemfixarna_btn {\n font-size: 14px;\n background: #c84e18;\n color: #fff;\n padding: 16px 24px;\n white-space: nowrap;\n position: relative;\n}\n:host .hemfixarna_btn span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -8px;\n right: -12px;\n}\n:host .hemfixarna_btn span {\n background: #25a710;\n color: #fff;\n right: 0 !important;\n}\n:host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n font-size: 21px;\n background: #25a710;\n color: #fff;\n padding: 16px 24px;\n}\n:host .hemfixarna .disabled {\n opacity: 0.5;\n cursor: default;\n}\n:host .hemfixarna_modal {\n position: fixed;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n border-radius: 4px;\n top: 50%;\n left: 50%;\n z-index: 1000;\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n transform: translate(-50%, -50%) scale(0.7);\n opacity: 0;\n height: 92%;\n width: 92%;\n max-width: 920px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n:host .hemfixarna_modal--open {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n}\n:host .hemfixarna_backdrop {\n z-index: 999;\n position: fixed;\n background: #474444;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n 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);\n}\n:host .hemfixarna_backdrop--open {\n opacity: 0.3;\n}\n:host .hemfixarna_order {\n position: absolute;\n top: -1px;\n left: -1px;\n right: -1px;\n bottom: -1px;\n background-repeat: no-repeat !important;\n background-size: cover !important;\n background-position: center !important;\n display: grid;\n grid-template-columns: 1fr 1fr;\n padding: 48px 32px 64px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_order {\n grid-template-columns: 1fr;\n grid-template-rows: 0 auto;\n }\n}\n:host .hemfixarna_order > div:last-of-type {\n background: #fffaf2;\n padding: 32px;\n display: flex;\n flex-direction: column;\n max-height: 100%;\n overflow: auto;\n}\n:host .hemfixarna_order img {\n cursor: pointer;\n}\n:host .hemfixarna_order button {\n margin: 16px 0;\n padding: 0;\n text-decoration: underline;\n text-underline-offset: 2px;\n font-size: 14px;\n font-weight: 600;\n}\n:host .hemfixarna_cart {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart {\n grid-template-columns: 1fr;\n gap: 0;\n }\n}\n:host .hemfixarna_cart--right h2, :host .hemfixarna_cart--left h2 {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_cart--right h2 img, :host .hemfixarna_cart--left h2 img {\n margin-top: 3.2px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_cart--left h2 button {\n display: none;\n }\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart--right h2 button {\n display: none;\n }\n}\n:host .hemfixarna_cart--startfee {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot div {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_cart--additional {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 16px;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--additional p {\n font-size: 14px;\n}\n:host .hemfixarna_cart--additional strong {\n text-decoration: underline;\n text-underline-offset: 2px;\n cursor: pointer;\n position: relative;\n}\n:host .hemfixarna_cart--additional strong img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: -24px;\n}\n:host .hemfixarna_cart--price {\n border-top: 1px solid #fcd9c9;\n padding: 16px;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--price h3 {\n margin: 0;\n}\n:host .hemfixarna_cart--item {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 16px 0;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--item span {\n font-size: 12px;\n}\n:host .hemfixarna_cart--item > div {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--item > div > div {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n:host .hemfixarna_cart--item > div button {\n color: #ec6632;\n}\n:host .hemfixarna_categories {\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n:host .hemfixarna_categories--wrapper {\n gap: 32px;\n display: grid;\n grid-template-columns: 1fr 1fr;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_categories--wrapper {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_categories li {\n position: relative;\n background: #fff;\n border-radius: 4px;\n min-height: 132px;\n padding: 24px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n align-items: center;\n gap: 24px;\n cursor: pointer;\n}\n:host .hemfixarna_categories li:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_categories li > button {\n height: 100%;\n width: 100%;\n}\n:host .hemfixarna_categories li .price {\n font-weight: 700;\n}\n:host .hemfixarna_content {\n height: 100%;\n overflow: auto;\n padding: 0 32px 64px;\n}\n:host .hemfixarna_content--5 {\n padding-top: 16px;\n}\n:host .hemfixarna_content--painting {\n padding: 0;\n overflow: initial;\n}\n:host .hemfixarna_crumbs {\n position: relative;\n padding: 16px 24px;\n border-bottom: 1px solid #fcd9c9;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_crumbs--back {\n padding: 16px 24px 8px;\n display: flex;\n align-items: center;\n gap: 8px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs--back:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_crumbs img {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .close {\n position: absolute;\n right: -16px;\n top: -16px;\n z-index: 9;\n}\n:host .hemfixarna_crumbs .cart {\n padding-left: 16px;\n position: relative;\n}\n:host .hemfixarna_crumbs .cart img {\n cursor: inherit;\n}\n:host .hemfixarna_crumbs .cart span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -8px;\n right: -12px;\n}\n:host .hemfixarna_crumbs .cart_active {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .cart_active span {\n background: #25a710;\n color: #fff;\n}\n:host .hemfixarna_crumbs--links {\n display: flex;\n align-items: center;\n gap: 16px;\n overflow: auto;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_crumbs--links {\n -ms-overflow-style: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar {\n display: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar-button {\n display: none;\n }\n}\n:host .hemfixarna_crumbs button {\n white-space: nowrap;\n background: #f1ded6;\n border-radius: 64px;\n padding: 12px 16px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.3px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs button:not(.active):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_crumbs .active {\n background: #fffaf2;\n cursor: default;\n}\n:host .hemfixarna_features {\n gap: 12px !important;\n}\n:host .hemfixarna_features li {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_address {\n margin-bottom: 16px;\n}\n:host .hemfixarna_product {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_product--link {\n font-weight: 700;\n color: #474444;\n text-underline-offset: 4px;\n}\n:host .hemfixarna_product--left {\n gap: 32px;\n}\n:host .hemfixarna_product--right {\n gap: 32px;\n}\n:host .hemfixarna_product--price {\n margin-top: 4px;\n font-weight: 700;\n}\n:host .hemfixarna_product--total {\n text-align: center;\n margin: -16px 0;\n font-size: 21px;\n line-height: 28px;\n}\n:host .hemfixarna_product--item {\n background: #fff;\n padding: 16px;\n display: grid;\n grid-template-columns: auto 75px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_product--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--grid {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_product--grid > div {\n display: flex;\n flex-direction: column;\n}\n:host .hemfixarna_product--grid ul {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n:host .hemfixarna_product p {\n margin: 0;\n}\n:host .hemfixarna_product--top {\n display: flex;\n gap: 32px;\n}\n:host .hemfixarna_product--top > div {\n width: 100%;\n}\n:host .hemfixarna_product--top > div h1 {\n max-width: 80%;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--top > div h1 {\n max-width: 100%;\n }\n}\n:host .hemfixarna_product--top h4 {\n margin-bottom: 8px;\n}\n:host h5,\n:host p {\n margin: 0;\n}\n:host input[type=submit] {\n cursor: pointer;\n}\n:host input[type=date] ~ label {\n left: 56px;\n}\n:host input[type=date] {\n border: 1px solid #fcd9c9;\n padding-left: 64px;\n}\n:host input[type=checkbox] {\n height: 18px;\n width: 18px;\n border: 1px solid #fcd9c9;\n}\n:host input[type=checkbox]:checked {\n background: red;\n}\n:host input[type=date]::-webkit-calendar-picker-indicator {\n background: transparent;\n bottom: 0;\n color: transparent;\n cursor: pointer;\n height: auto;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n width: auto;\n}\n:host button,\n:host a {\n cursor: pointer;\n background: none;\n border: none;\n}\n:host ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}';const sn=class{constructor(n){i(this,n);this.slugIsOldFormat=n=>{if(!n)return false;return["product","service","category"].some((t=>n.includes(t)))};this.triggerScrollTotop=()=>{const n=this.el.shadowRoot.querySelector(".hemfixarna_content");v(n)};this.modal=false;this.showModal=false;this.tree=null;this.product=null;this.proppedProduct=null;this.slug=undefined;this.id=undefined;this.business=undefined;this.topCategory=undefined;this.forceOldTree=false;this.loadFromQuery=false;this.isDemo=false;this.widgetStyle=undefined;this.nav=undefined;this.buttonColor=undefined;this.buttonBg=undefined}loadCategoryOrProduct(n){this.proppedProduct=null;if(n.startsWith("c-")){const t=[...x.customer.categories,...x.customer.categories.map((n=>{var t;return(t=n.sub_categories)!==null&&t!==void 0?t:[]}))].flat();const i=t.find((t=>t&&t.id===n.replace("c-","")));if(i){x.selectedCustomerCategory=i;x.step=2}}else{const t=x.customer.categories.map((n=>n.show_products?n.products:n.sub_categories?n.sub_categories.map((n=>n.products)):[])).flat().flat();const i=t.find((t=>t&&t.fields.ID===parseInt(n)));if(i){x.selectedProduct=i.fields;x.step=4;this.proppedProduct=i.fields}}}async watchSlugChange(n){if(this.slugIsOldFormat(n)){this.fetchNewTaxonomy(n)}else if(x.customer&&n){this.loadCategoryOrProduct(n)}}async watchIdChange(n){if(n&&x.customer){if(n==="maleri"){x.maleri=true;x.step=4}else{this.loadCategoryOrProduct(n)}}}async fetchNewTaxonomy(n){x.selectedCategory=null;x.selectedProduct=null;x.selectedService=null;x.maleri=null;const t=await H(n);if((t===null||t===void 0?void 0:t.code)==="not_found"||(t===null||t===void 0?void 0:t.code)==="rest_no_route"){console.log("taxonomy not found")}else if(t){this.setTaxonomy(t);if((t===null||t===void 0?void 0:t.post_type)==="ikea_product"){this.product=t}}}async componentWillLoad(){x.business=this.business;const n=window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);if(n){x.cart=JSON.parse(n)}const t=window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);if(t){x.user=JSON.parse(t)}const i=window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);if(i){x.creditSafeUser=JSON.parse(i)}const[e,s,a,r,o,l]=await Promise.all([this.topCategory?H(this.topCategory):null,this.slug?H(this.slug):Promise.resolve(null),W(),X(),G(),Y()]);if((!this.slug||!this.slugIsOldFormat(this.slug))&&!this.forceOldTree){try{const n=await E(this.business);if((n===null||n===void 0?void 0:n.code)==="not_found"){console.warn("customer not found")}else if(n){x.customer=n;if(this.id){if(this.id==="maleri"){x.maleri=true;x.step=4}else{this.loadCategoryOrProduct(this.id)}}else if(this.slug&&!this.slugIsOldFormat(this.slug)){this.loadCategoryOrProduct(this.slug)}}}catch(n){console.warn("customer not found")}}if((e===null||e===void 0?void 0:e.code)==="not_found");else if(e){this.tree=e}if((s===null||s===void 0?void 0:s.code)==="not_found"){console.log("taxonomy not found")}else if(s){this.setTaxonomy(s);if((s===null||s===void 0?void 0:s.post_type)==="ikea_product"){this.product=s}}if(this.loadFromQuery){const n=new URL(document.location.toString()).searchParams;this.id=n.get("id");if(!this.isDemo){this.openModal()}}x.rotOptions=o;x.rutOptions=r;x.greenOptions=l;x.options=a}setTaxonomy(n){if(n){if((n===null||n===void 0?void 0:n.taxonomy)==="service_cat"){x.selectedCategory=n;x.step=2}else if((n===null||n===void 0?void 0:n.post_type)==="service"){x.selectedService=n;x.selectedCategory=this.tree.sub_cats.find((t=>t.services.find((t=>t.ID===n.ID))));x.step=3}else if((n===null||n===void 0?void 0:n.post_type)==="ikea_product"){x.selectedProduct=n;x.selectedService=this.tree.sub_cats.map((n=>n.services)).flat().find((n=>n.products.find((n=>n.ID===x.selectedProduct.ID))));x.selectedCategory=this.tree.sub_cats.find((n=>n.services.find((n=>n.ID===x.selectedService.ID))));x.step=4}this.triggerScrollTotop()}}openModal(){this.modal=true;setTimeout((()=>{this.showModal=true}),50)}closeModal(){this.showModal=false;setTimeout((()=>{this.modal=false}),200)}handleClick(n){if(this.loadFromQuery&&!this.isDemo)return;if((n===null||n===void 0?void 0:n.composedPath()[0]).classList.contains("hemfixarna_backdrop")){this.closeModal()}const t=this.el.shadowRoot.querySelector(".hemfixarna_infomodal");if(t){const i=t.contains(n.composedPath()[0]);if(!i){x.modal=null}}}getCartLength(){return x.cart.reduce(((n,t)=>n+t.amount),0)}render(){var n,t,i,s,o,l,h,c,d,u,p,f,m,g,b,v;const _=r(`./assets/hemfixarna.svg`);const y=r(`./assets/pensel.svg`);const w=r(`./assets/montering.svg`);const k=((n=this.nav)===null||n===void 0?void 0:n.background)?r(this.nav.background):"";const C=((t=this.nav)===null||t===void 0?void 0:t.logo)?r(this.nav.logo):"";return e("div",{class:`hemfixarna ${this.loadFromQuery?"hemfixarna_standalone":""}`},this.loadFromQuery&&!this.isDemo&&this.nav?e("nav",{class:"hemfixarna_nav",style:{backgroundColor:(i=this.nav.backgroundColor)!==null&&i!==void 0?i:""}},e("div",null,e("div",{class:"hemfixarna_nav--logos"},e("a",{href:this.nav.url,target:"_blank"},e("img",{class:"hemfixarna_partnerlogo",src:C,alt:`${this.business} logo`})),e("a",{href:"https://hemfixarna.se/",target:"_blank"},e("p",{class:k||this.nav.backgroundColor?"with-bg":""},"I samarbete med:"),e("img",{src:_,alt:"hemfixarna_logo",width:104}))),e("div",{class:"hemfixarna_nav--links"},e("a",{href:this.nav.url,target:"_blank"},"Till ",this.business),e("a",{href:"https://www.hemfixarna.se/",target:"_blank"},"Till Hemfixarna")),k?e("img",{src:k,class:"nav_background",alt:"nav_background"}):null)):null,!this.loadFromQuery||this.isDemo?e("div",{class:`hemfixarna_box hemfixarna_box--${this.widgetStyle}`},[F.alternative_2,F.alternative_3].includes(this.widgetStyle)?e("img",{src:this.id==="maleri"?y:w,alt:"montering logo",width:32,height:32}):null,e("div",null,e("div",null,e("p",{onClick:()=>this.openModal(),class:`pointer ${[F.alternative_2,F.alternative_3].includes(this.widgetStyle)&&x.selectedProduct?"underline":""}`},this.id==="maleri"?e("span",null,"Beräkna fast pris på måleri & tapetsering här"):e(a,null,((s=this.product)===null||s===void 0?void 0:s.title)||((o=this.proppedProduct)===null||o===void 0?void 0:o.title)||e("span",null,"Montering",e("wbr",null),"/Installation ",(h=(l=x.selectedCustomerCategory)===null||l===void 0?void 0:l.name)!==null&&h!==void 0?h:"på plats"," - ",e("strong",{class:"underline"},"se priser här")),this.product&&((c=this.slug)===null||c===void 0?void 0:c.includes("product"))||this.proppedProduct&&!((d=this.product)===null||d===void 0?void 0:d.invoice)&&!((u=this.proppedProduct)===null||u===void 0?void 0:u.invoice)?e("span",null," från"," ",e("strong",null,$(this.proppedProduct||this.product),"kr")):null,((p=this.product)===null||p===void 0?void 0:p.invoice)||((f=this.proppedProduct)===null||f===void 0?void 0:f.invoice)?e("span",null," - ",e("strong",{class:"underling"},"se priser här")):null))),this.widgetStyle===F.standard?e("img",{src:_,width:104}):null,this.widgetStyle===F.alternative?e("span",{class:"p-s"},"Utförs av ",e("strong",null,"Hemfixarna")):null),[F.standard,F.alternative].includes(this.widgetStyle)?e("button",{onClick:()=>this.openModal(),class:"hemfixarna_btn",style:{color:((m=this.buttonColor)===null||m===void 0?void 0:m.startsWith("#"))||!((g=this.buttonColor)===null||g===void 0?void 0:g.length)?this.buttonColor:`#${this.buttonColor}`,backgroundColor:((b=this.buttonBg)===null||b===void 0?void 0:b.startsWith("#"))||!((v=this.buttonBg)===null||v===void 0?void 0:v.length)?this.buttonBg:`#${this.buttonBg}`}},"Beställ här",this.getCartLength()>0&&e("span",null,this.getCartLength())):null,F.alternative_2===this.widgetStyle?e("div",{class:"hemfixarna_altbtn"},e("strong",{class:"p-s"},"Utförs av"),e("img",{src:_,alt:"hemfixarna logo",width:98})):null):null,this.modal&&e("div",null,e("div",{class:`hemfixarna_modal ${this.showModal?"hemfixarna_modal--open":""}`},x.modal&&e("div",{class:"hemfixarna_infomodal"},x.modal.title&&e("h2",null,x.modal.title),x.modal.text.map((n=>e("p",{innerHTML:n}))),e("div",null,e("button",{onClick:()=>x.modal=null},"Stäng"))),(this.tree||x.customer)&&e("hemfixarna-breadcrumbs",{isDemo:this.isDemo,loadFromQuery:this.loadFromQuery,closeModal:()=>this.closeModal(),tree:this.tree}),!x.customer||this.slugIsOldFormat(this.slug)?e("div",{class:`hemfixarna_content hemfixarna_content--${x.step}`},x.step===1&&this.tree&&e("hemfixarna-start",{tree:this.tree}),x.step===2&&x.selectedCategory&&e("hemfixarna-category",null),x.step===3&&x.selectedService&&e("hemfixarna-service",null),x.step===4&&x.selectedProduct&&e("hemfixarna-product",null),x.step===5&&e("hemfixarna-cart",{tree:this.tree}),x.step===6&&e("hemfixarna-order",{tree:this.tree})):e("div",{class:`hemfixarna_content hemfixarna_content--${x.step} ${x.step===4&&x.maleri?"hemfixarna_content--painting":""}`},x.step<4&&e("hemfixarna-start",null),x.step===4&&e("hemfixarna-product",null),x.step===5&&e("hemfixarna-cart",{tree:this.tree}),x.step===6&&e("hemfixarna-order",{tree:this.tree}))),!this.isDemo?e("div",{class:`hemfixarna_backdrop ${this.showModal?"hemfixarna_backdrop--open":""}`}):null))}static get assetsDirs(){return["assets"]}get el(){return s(this)}static get watchers(){return{slug:["watchSlugChange"],id:["watchIdChange"]}}};sn.style=en;const an='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap"); :host{font-family:"Inter", sans-serif}:host .hemfixarna_widgetstyles label{cursor:pointer}:host .hemfixarna_widgetstyles>div{display:flex;gap:1rem}:host .hemfixarna_widgetstyles h5{margin:1rem 0}:host .hemfixarna_example{margin-bottom:16px;background:#000;padding:16px;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:-48px;font-size:16px;left:40%;color:white;padding:8px;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:8px;margin-top:16px}:host .hemfixarna_product--label{background:#e1e0f5}:host .hemfixarna_categories{max-height:100%;overflow:auto;position:relative}:host .hemfixarna_categories--label{display:flex;align-items:center;justify-content:space-between;padding:8px}:host .hemfixarna_categories--label button{background:#3f3a92;border:none;font-weight:600;padding:3.2px 9.6px;border-radius:10px;margin-right:8px;color:#ece8e8}:host .hemfixarna_categories--label button:active{transform:scale(0.95)}:host .hemfixarna_categories--label--big{font-weight:600;border-bottom:1px solid black}:host p{margin:0}:host span{color:darkolivegreen;font-size:10px}:host button{cursor:pointer}:host>div{display:grid;gap:32px;width:100%;grid-template-columns:1fr 1fr;height:100vh;place-items:center;overflow:hidden;padding:16px 32px;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{gap:1px;display:grid}:host>div ul li{padding-left:16px;background:#fff}';const rn=class{constructor(n){i(this,n);this.debounce=null;this.cdnLink='<script type="module" src="https://cdn.jsdelivr.net/npm//hemfixarna-web-components@latest/dist/hemfixarna-components/hemfixarna-components.esm.js"><\/script>';this.selectedSlug=undefined;this.selectedID=undefined;this.tooltipText="Kopiera till urklipp";this.tree=null;this.customer=null;this.widgetStyle=F.standard;this.buttonBg="";this.buttonColor="";this.partner=undefined;this.colorAccessibility=undefined}debouncedFunction(){if(this.debounce!==null){clearTimeout(this.debounce);this.debounce=null}this.debounce=window.setTimeout((()=>{this.checkColorAccessibility();this.debounce=null}),1500)}async checkColorAccessibility(){const n="#fff";const t="#c84e18";const i=this.buttonBg.length?this.buttonBg.startsWith("#")?this.buttonBg:`#${this.buttonBg}`:t;const e=this.buttonColor.length?this.buttonColor.startsWith("#")?this.buttonColor:`#${this.buttonColor}`:n;fetch("https://www.aremycolorsaccessible.com/api/are-they",{mode:"cors",method:"POST",body:JSON.stringify({colors:[i,e]})}).then((n=>n.json())).then((n=>{if(n&&n){this.colorAccessibility=n}}))}getTopLevelCategory(){switch("flyttsmart"){case I.byggmax:return M.byggmax;default:return""}}getColor(n){switch(n){case"AAA":return"green";case"AA":return"orange";case"A":return"yellow";case"Fail":return"red";default:return"black"}}async componentWillLoad(){var n;if(process.env.FORCE_OLD_TREE){const n=await H(this.getTopLevelCategory());if((n===null||n===void 0?void 0:n.code)==="not_found");else if(n){this.tree=n}}else{const t=window.location.pathname.replace("/","");this.partner=L(t)?t:(n="flyttsmart")!==null&&n!==void 0?n:I.kund;const i=await E(this.partner);if(i.code!=="not_found"&&i){this.customer=i}}}getExample(){return`<hemfixarna-${this.partner}${this.selectedSlug?` slug="${this.selectedSlug}" `:""}${this.selectedID?` id="${this.selectedID}" `:""} ${this.widgetStyle===F.standard?"":`widget-style="${this.widgetStyle}"`} ${this.buttonColor.length?`button-color="${this.buttonColor}"`:""} ${this.buttonBg.length?`button-bg="${this.buttonBg}"`:""}></hemfixarna-${this.partner}>`}copyExample(){navigator.clipboard.writeText(this.getExample());this.tooltipText="Snippet kopierad";setTimeout((()=>{this.tooltipText="Kopiera till urklipp"}),2e3)}copyCdn(){navigator.clipboard.writeText(this.cdnLink);this.tooltipText="Text kopierad";setTimeout((()=>{this.tooltipText="Kopiera till urklipp"}),2e3)}copyNpmInstall(){navigator.clipboard.writeText("npm i hemfixarna-web-components");this.tooltipText="Text kopierad";setTimeout((()=>{this.tooltipText="Kopiera till urklipp"}),2e3)}showMaleri(){var n;const t=(n=this.customer)===null||n===void 0?void 0:n.categories.map((n=>n.sub_categories?n.sub_categories:n)).flat();return t===null||t===void 0?void 0:t.some((n=>n.add_painting))}render(){const n=r(`./assets/copy.png`);return e("div",null,e("div",null,e("div",{onClick:()=>this.copyExample(),class:"hemfixarna_example"},e("p",null,this.getExample()),e("img",{src:n,height:20}),e("span",{class:"hemfixarna_example--tooltip"},this.tooltipText)),this.partner===I.byggmax&&e("hemfixarna-byggmax",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,forceOldTree:Boolean(process.env.FORCE_OLD_TREE),slug:this.selectedSlug,id:this.selectedID}),this.partner===I.skanska&&e("hemfixarna-skanska",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.sparfonster&&e("hemfixarna-sparfonster",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.string&&e("hemfixarna-string-furniture",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.hornbach&&e("hemfixarna-hornbach",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.zaptec&&e("hemfixarna-zaptec",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.tesla&&e("hemfixarna-tesla",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.forebygg&&e("hemfixarna-forebygg",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.doro&&e("hemfixarna-doro",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.elfa&&e("hemfixarna-elfa",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.kbygg&&e("hemfixarna-kbygg",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.fargvaruhuset&&e("hemfixarna-fargvaruhuset",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.norrgavel&&e("hemfixarna-norrgavel",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.klint&&e("hemfixarna-klint",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.flyttsmart&&e("hemfixarna-flyttsmart",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===I.kund&&e("hemfixarna-kund",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),e("div",{class:"hemfixarna_install"},e("div",{onClick:()=>this.copyCdn(),class:"hemfixarna_example"},e("p",null,this.cdnLink),e("span",{class:"hemfixarna_example--tooltip"},this.tooltipText),e("img",{src:n,height:20}))),e("div",{class:"hemfixarna_widgetstyles"},e("h5",null,"Widget styles"),e("div",null,Object.values(F).map((n=>e("label",{key:n},e("input",{type:"radio",value:n,checked:this.widgetStyle===n,onChange:()=>this.widgetStyle=n}),n)))),e("div",null,e("div",null,e("h5",null,"Button background color"),e("input",{type:"text",value:this.buttonBg,onInput:n=>this.buttonBg=n.target.value})),e("div",null,e("h5",null,"Button text color"),e("input",{type:"text",value:this.buttonColor,onInput:n=>this.buttonColor=n.target.value})))),e("span",null,"Write an hexa code no # needed"),this.colorAccessibility?e("div",null,e("h5",null,"Tillgänglighetsrapport"),e("div",null,e("strong",null,"Liten text:"),e("span",{style:{color:this.getColor(this.colorAccessibility.small)}},this.colorAccessibility.small),e("br",null),e("strong",null,"Fet text:"),e("span",{style:{color:this.getColor(this.colorAccessibility.bold)}},this.colorAccessibility.bold),e("br",null),e("strong",null,"Stor text:"),e("span",{style:{color:this.getColor(this.colorAccessibility.large)}},this.colorAccessibility.large),e("br",null),e("strong",null,"Kontrastförhållande:")," ",this.colorAccessibility.contrast)):null),e("ul",{class:"hemfixarna_categories"},this.customer?e("div",null,this.showMaleri()?e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_categories--label--big"},e("div",null,e("p",null,"Måleriverktyget"),e("span",null,"maleri")),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText("maleri")},"Kopiera slug"),e("button",{onClick:()=>this.selectedID="maleri"},"Ladda måleri")))):null,this.customer.categories.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_categories--label--big"},e("div",null,e("p",null,n.name),e("span",null,`c-${n.id}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`c-${n.id}`)},"Kopiera ID"),e("button",{onClick:()=>this.selectedID=`c-${n.id}`},"Ladda kategori"))),n.show_products&&n.products?e("ul",null,n.products.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_product--label"},e("div",null,e("p",null,n.fields.title),e("span",null,n.fields.ID)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(String(n.fields.ID))},"Kopiera ID"),e("button",{onClick:()=>this.selectedID=String(n.fields.ID)},"Ladda produkt"))))))):e("ul",null,n.sub_categories&&n.sub_categories.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label"},e("div",null,e("p",null,n.name),e("span",null,`c-${n.id}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`c-${n.id}`)},"Kopiera ID"),e("button",{onClick:()=>this.selectedID=`c-${n.id}`},"Ladda kategori"))),e("ul",null,n.products.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_product--label"},e("div",null,e("p",null,n.fields.title),e("span",null,n.fields.ID)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(String(n.fields.ID))},"Kopiera ID"),e("button",{onClick:()=>this.selectedID=String(n.fields.ID)},"Ladda produkt"))))))))))))))):this.tree?e("div",null,this.tree.sub_cats.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_categories--label--big"},e("div",null,e("p",null,n.name),e("span",null,`category/${n.slug}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`category/${n.slug}`)},"Kopiera slug"),e("button",{onClick:()=>this.selectedSlug=`category/${n.slug}`},"Ladda kategori"))),e("ul",null,n.services.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label"},e("div",null,e("p",null,n.post_title),e("span",null,`service/${n.post_name}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`service/${n.post_name}`)},"Kopiera slug"),e("button",{onClick:()=>this.selectedSlug=`service/${n.post_name}`},"Ladda kategori"))),e("ul",null,n.products.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label"},e("div",null,e("p",null,n.post_title),e("span",null,`product/${n.post_name}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`product/${n.post_name}`)},"Kopiera slug"),e("button",{onClick:()=>this.selectedSlug=`product/${n.post_name}`},"Ladda produkt"))))))))))))))):null))}static get watchers(){return{buttonBg:["debouncedFunction"],buttonColor:["debouncedFunction"]}}};rn.style=an;const on="";const ln=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.doro})}};ln.style=on;const hn="";const cn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://elfa.com",logo:"assets/elfa.png"},loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.elfa,isDemo:this.isDemo})}};cn.style=hn;const dn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.fargvaruhuset,isDemo:this.isDemo})}};const un=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.flyttsmart,isDemo:this.isDemo})}};const pn="";const fn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.forebygg})}};fn.style=pn;var mn=class extends Error{constructor(){super("Invalid swedish personal identity number")}};var xn=(n,t)=>{const i=n.getTime()-t.getTime();return i<0?-1:i>0?1:i};var gn=(n,t)=>{const i=xn(n,t);const e=Math.abs(n.getFullYear()-t.getFullYear());n.setFullYear(n.getFullYear()-i*e);const s=xn(n,t)===-i;const a=i*(e-+s);return a===0?0:a};var bn=n=>{let t=0;n+="";for(let i=0,e=n.length;i<e;i++){let e=parseInt(n[i]);e*=2-i%2;if(e>9){e-=9}t+=e}return Math.ceil(t/10)*10-t};var vn=(n,t,i)=>{t-=1;const e=new Date(n,t,i);return!(e.getFullYear()!==n||e.getMonth()!==t||e.getDate()!==i)};var _n=class{constructor(n,t){this._century="";this._fullYear="";this._year="";this._month="";this._day="";this._sep="";this._num="";this._check="";this.parse(n,{allowCoordinationNumber:true,allowInterimNumber:false,...t})}get century(){return this._century}get fullYear(){return this._fullYear}get year(){return this._year}get month(){return this._month}get day(){return this._day}get sep(){return this._sep}get num(){return this._num}get check(){return this._check}static parse(n,t){return new _n(n,t)}static valid(n,t){try{_n.parse(n,t);return true}catch(n){return false}}parse(n,t){if(n.length<10||n.length>13){throw new mn}const i=/^(\d{2}){0,1}(\d{2})(\d{2})(\d{2})([+-]?)((?!000)\d{3}|[TRSUWXJKLMN]\d{2})(\d)$/;const e=i.exec(n);if(!e){throw new mn}const s=e[1];const a=e[2];const r=e[3];const o=e[4];const l=e[5];const h=e[6];const c=e[7];if(typeof s==="undefined"||!s.length){const n=new Date;let t=0;if(l==="+"){this._sep="+";t=n.getFullYear()-100}else{this._sep="-";t=n.getFullYear()}this._century=(""+(t-(t-parseInt(a))%100)).substr(0,2)}else{this._century=s;if((new Date).getFullYear()-parseInt(s+a,10)<100){this._sep="-"}else{this._sep="+"}}this._year=a;this._fullYear=this._century+a;this._month=r;this._day=o;this._num=h;this._check=c;if(!this.valid()){throw new mn}if(!(t==null?void 0:t.allowCoordinationNumber)&&this.isCoordinationNumber()){throw new mn}if(!(t==null?void 0:t.allowInterimNumber)&&this.isInterimNumber()){throw new mn}}valid(){const n=bn(this.year+this.month+this.day+this.num.replace(/[TRSUWXJKLMN]/,"1"))===+this.check&&!!this.check;if(n&&vn(parseInt(this.century+this.year),+this.month,+this.day)){return n}return n&&vn(parseInt(this.century+this.year),+this.month,+this.day-60)}format(n=false){if(n){return`${this.century}${this.year}${this.month}${this.day}${this.num}${this.check}`}return`${this.year}${this.month}${this.day}${this.sep}${this.num}${this.check}`}getAge(){const n=this.getDate();return gn(new Date(Date.now()),n)}getDate(){let n=+this.day;if(this.isCoordinationNumber()){n-=60}const t=this.century+this.year+"-"+this.month+"-"+(n<10?"0"+n:n);return new Date(t)}isInterimNumber(){return/[TRSUWXJKLMN]/.test(this.num[0])}isCoordinationNumber(){return vn(parseInt(this.century+this.year),+this.month,+this.day-60)}isFemale(){return!this.isMale()}isMale(){const n=parseInt(this.num.substr(-1));return n%2===1}};var yn=_n;function wn(n,t,i){return i={path:t,exports:{},require:function(n,t){return kn()}},n(i,i.exports),i.exports}function kn(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Cn=wn((function(n,t){Object.defineProperty(t,"__esModule",{value:true});t.utf8=void 0;t.utf8={encode:i,decode:e};function i(n){n=n.replace(/\r\n/g,"\n");var t="";for(var i=0;i<n.length;i++){var e=n.charCodeAt(i);if(e<128){t+=String.fromCharCode(e)}else if(e>127&&e<2048){t+=String.fromCharCode(e>>6|192);t+=String.fromCharCode(e&63|128)}else{t+=String.fromCharCode(e>>12|224);t+=String.fromCharCode(e>>6&63|128);t+=String.fromCharCode(e&63|128)}}return t}function e(n){var t="";var i=0;var e=0;var s=0;var a=0;while(i<n.length){e=n.charCodeAt(i);if(e<128){t+=String.fromCharCode(e);i++}else if(e>191&&e<224){s=n.charCodeAt(i+1);t+=String.fromCharCode((e&31)<<6|s&63);i+=2}else{s=n.charCodeAt(i+1);a=n.charCodeAt(i+2);t+=String.fromCharCode((e&15)<<12|(s&63)<<6|a&63);i+=3}}return t}}));var $n=wn((function(n,t){Object.defineProperty(t,"__esModule",{value:true});t.generate=void 0;function i(n){var t=[];var i;var e;var a;var r;var o;var l;var m;var x;var g;var b=7;var v=12;var _=17;var y=22;var w=5;var k=9;var C=14;var $=20;var S=4;var z=11;var B=16;var T=23;var j=6;var O=10;var D=15;var I=21;var F=Cn.utf8.encode(n);t=p(F);l=1732584193;m=4023233417;x=2562383102;g=271733878;for(i=0;i<t.length;i+=16){e=l;a=m;r=x;o=g;l=h(l,m,x,g,t[i+0],b,3614090360);g=h(g,l,m,x,t[i+1],v,3905402710);x=h(x,g,l,m,t[i+2],_,606105819);m=h(m,x,g,l,t[i+3],y,3250441966);l=h(l,m,x,g,t[i+4],b,4118548399);g=h(g,l,m,x,t[i+5],v,1200080426);x=h(x,g,l,m,t[i+6],_,2821735955);m=h(m,x,g,l,t[i+7],y,4249261313);l=h(l,m,x,g,t[i+8],b,1770035416);g=h(g,l,m,x,t[i+9],v,2336552879);x=h(x,g,l,m,t[i+10],_,4294925233);m=h(m,x,g,l,t[i+11],y,2304563134);l=h(l,m,x,g,t[i+12],b,1804603682);g=h(g,l,m,x,t[i+13],v,4254626195);x=h(x,g,l,m,t[i+14],_,2792965006);m=h(m,x,g,l,t[i+15],y,1236535329);l=c(l,m,x,g,t[i+1],w,4129170786);g=c(g,l,m,x,t[i+6],k,3225465664);x=c(x,g,l,m,t[i+11],C,643717713);m=c(m,x,g,l,t[i+0],$,3921069994);l=c(l,m,x,g,t[i+5],w,3593408605);g=c(g,l,m,x,t[i+10],k,38016083);x=c(x,g,l,m,t[i+15],C,3634488961);m=c(m,x,g,l,t[i+4],$,3889429448);l=c(l,m,x,g,t[i+9],w,568446438);g=c(g,l,m,x,t[i+14],k,3275163606);x=c(x,g,l,m,t[i+3],C,4107603335);m=c(m,x,g,l,t[i+8],$,1163531501);l=c(l,m,x,g,t[i+13],w,2850285829);g=c(g,l,m,x,t[i+2],k,4243563512);x=c(x,g,l,m,t[i+7],C,1735328473);m=c(m,x,g,l,t[i+12],$,2368359562);l=d(l,m,x,g,t[i+5],S,4294588738);g=d(g,l,m,x,t[i+8],z,2272392833);x=d(x,g,l,m,t[i+11],B,1839030562);m=d(m,x,g,l,t[i+14],T,4259657740);l=d(l,m,x,g,t[i+1],S,2763975236);g=d(g,l,m,x,t[i+4],z,1272893353);x=d(x,g,l,m,t[i+7],B,4139469664);m=d(m,x,g,l,t[i+10],T,3200236656);l=d(l,m,x,g,t[i+13],S,681279174);g=d(g,l,m,x,t[i+0],z,3936430074);x=d(x,g,l,m,t[i+3],B,3572445317);m=d(m,x,g,l,t[i+6],T,76029189);l=d(l,m,x,g,t[i+9],S,3654602809);g=d(g,l,m,x,t[i+12],z,3873151461);x=d(x,g,l,m,t[i+15],B,530742520);m=d(m,x,g,l,t[i+2],T,3299628645);l=u(l,m,x,g,t[i+0],j,4096336452);g=u(g,l,m,x,t[i+7],O,1126891415);x=u(x,g,l,m,t[i+14],D,2878612391);m=u(m,x,g,l,t[i+5],I,4237533241);l=u(l,m,x,g,t[i+12],j,1700485571);g=u(g,l,m,x,t[i+3],O,2399980690);x=u(x,g,l,m,t[i+10],D,4293915773);m=u(m,x,g,l,t[i+1],I,2240044497);l=u(l,m,x,g,t[i+8],j,1873313359);g=u(g,l,m,x,t[i+15],O,4264355552);x=u(x,g,l,m,t[i+6],D,2734768916);m=u(m,x,g,l,t[i+13],I,1309151649);l=u(l,m,x,g,t[i+4],j,4149444226);g=u(g,l,m,x,t[i+11],O,3174756917);x=u(x,g,l,m,t[i+2],D,718787259);m=u(m,x,g,l,t[i+9],I,3951481745);l=s(l,e);m=s(m,a);x=s(x,r);g=s(g,o)}return f(l)+f(m)+f(x)+f(g)}t.generate=i;function e(n,t){return n<<t|n>>>32-t}function s(n,t){var i;var e;var s;var a;var r;s=n&2147483648;a=t&2147483648;i=n&1073741824;e=t&1073741824;r=(n&1073741823)+(t&1073741823);if(i&e){return r^2147483648^s^a}if(i|e){if(r&1073741824){return r^3221225472^s^a}else{return r^1073741824^s^a}}else{return r^s^a}}function a(n,t,i){return n&t|~n&i}function r(n,t,i){return n&i|t&~i}function o(n,t,i){return n^t^i}function l(n,t,i){return t^(n|~i)}function h(n,t,i,r,o,l,h){n=s(n,s(s(a(t,i,r),o),h));return s(e(n,l),t)}function c(n,t,i,a,o,l,h){n=s(n,s(s(r(t,i,a),o),h));return s(e(n,l),t)}function d(n,t,i,a,r,l,h){n=s(n,s(s(o(t,i,a),r),h));return s(e(n,l),t)}function u(n,t,i,a,r,o,h){n=s(n,s(s(l(t,i,a),r),h));return s(e(n,o),t)}function p(n){var t;var i=n.length;var e=i+8;var s=(e-e%64)/64;var a=(s+1)*16;var r=Array(a-1);var o=0;var l=0;while(l<i){t=(l-l%4)/4;o=l%4*8;r[t]=r[t]|n.charCodeAt(l)<<o;l++}t=(l-l%4)/4;o=l%4*8;r[t]=r[t]|128<<o;r[a-2]=i<<3;r[a-1]=i>>>29;return r}function f(n){var t="";var i="";var e;var s;for(s=0;s<=3;s++){e=n>>>s*8&255;i="0"+e.toString(16);t=t+i.substr(i.length-2,2)}return t}}));var Sn=wn((function(n,t){Object.defineProperty(t,"__esModule",{value:true});t.MD5=t.generate=void 0;var i=$n;Object.defineProperty(t,"generate",{enumerable:true,get:function(){return i.generate}});t.MD5={generate:$n.generate}}));const zn=async n=>{var t;const i=await fetch((t="https://hemfixare-lookup.vercel.app/api")!==null&&t!==void 0?t:"https://hemfixare-lookup.vercel.app/api",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n,hash:Sn.MD5.generate(String.fromCharCode(83,101,67,82,101,116)+n)})});const e=await i.json();return e};const Bn=class{constructor(n){i(this,n);this.handleChangeEmail=n=>{this.emailError=null;this.email=n.target.value};this.handleChangePhone=n=>{this.phoneError=null;this.phone=n.target.value};this.handleChangessn=n=>{this.ssnError=null;this.ssn=n.target.value};this.handleSubmit=async n=>{n.preventDefault();const t=new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);const i=t.test(this.email);if(!i){this.emailError="Ange en giltig e-postadress"}const e=/^[\d\s()+-]{6,}$/.test(this.phone);if(!e){this.phoneError="Ange ett giltigt telefonnummer"}const s=yn.valid(this.ssn);if(!s){this.ssnError="Ange ett giltigt personnummer"}else if(s){const n=yn.parse(this.ssn).format(true);this.ssn=[n.slice(0,8),"-",n.slice(8)].join("")}if(i&&e&&s){try{const n=await zn(this.ssn);if(n){x.creditSafeUser=n;x.checkoutStep=2;x.user=Object.assign(Object.assign({},n),{email:this.email,phone:this.phone,ssn:this.ssn})}else{this.ssnError="Vi kunde tyvärr inte hitta en address med ditt angivna personnummer"}}catch(n){this.ssnError="Vi kunde tyvärr inte hitta en address med ditt angivna personnummer";console.log(n)}finally{const n=this.el.closest(".hemfixarna_content");v(n)}}};this.render=()=>e("form",{class:"mb-2",onSubmit:n=>this.handleSubmit(n)},e("div",null,e("input",{class:`${this.email.length?"input_active":""}`,onChange:n=>this.handleChangeEmail(n),type:"email",name:"email",value:this.email}),e("label",{htmlFor:"email"},"E-post ")),this.emailError&&e("span",null,this.emailError),e("div",null,e("input",{class:`${this.phone.length?"input_active":""}`,onChange:n=>this.handleChangePhone(n),type:"tel",name:"phone",value:this.phone}),e("label",{htmlFor:"phone"},"Mobiltelefon ")),this.phoneError&&e("span",null,this.phoneError),e("div",null,e("input",{class:`${this.ssn.length?"input_active":""}`,onChange:n=>this.handleChangessn(n),type:"tel",name:"ssn",value:this.ssn}),e("label",{htmlFor:"phone"},"Personnummer*")),this.ssnError&&e("span",null,this.ssnError),e("input",{type:"submit",value:"Fortsätt*"}),e("p",null,"*Vi hämtar din adress"));this.email="";this.emailError=null;this.phone="";this.phoneError=null;this.ssn="";this.ssnError=null}componentWillLoad(){if(x.user){this.email=x.user.email;this.phone=x.user.phone;this.ssn=x.user.ssn}}get el(){return s(this)}};const Tn="";const jn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.isDemo=false;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://www.hornbach.se/",logo:"assets/hornbach/logo.svg",background:"./assets/hornbach/nav.jpg"},isDemo:this.isDemo,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.hornbach})}};jn.style=Tn;const On=class{constructor(n){i(this,n);this.logo=r(`./assets/hemfixarna.svg`);this.checkoutList=[{trust_badge:"Efter att du fyllt i formuläret blir du kontaktad av en Hemfixare för bokning av tid."},{trust_badge:"När jobbet är klart kommer du få en faktura med RUT/ROT/Grön teknik avdrag."}];this.list=null}getList(){return this.list?this.list:this.checkoutList}render(){const n=r(`./assets/checked.svg`);return e("div",{class:"hemfixarna_info"},x.step<5?e(a,null,e("h2",null,"Vilka är Hemfixarna?"),e("p",null,"Vi fixar allt från krångliga datorer till montering av möbler. Vi finns i hela Sverige och är alltid redo att rycka ut.")):e("h2",null,"Vad händer nu?"),e("ul",{class:"hemfixarna_features"},this.getList().map((t=>e("li",{key:t.trust_badge},e("img",{src:n,alt:"checked"}),e("p",null,t.trust_badge))))),e("img",{src:this.logo,width:200,alt:"hemfixarna"}),e("a",{class:"hemfixarna_product--link",target:"_blank",href:x.options.link.url},x.options.link.title))}};const Dn=':host .invoice{gap:16px;display:grid}:host .invoice form>span{text-align:center;padding:16px 0}:host .invoice img{right:unset;left:unset;position:initial;transform:none}:host .invoice label{cursor:pointer;font-size:14px;display:flex;align-items:flex-start;padding:16px 0}:host .invoice label input{margin:0 5px 0 0;accent-color:#ea662c}:host .invoice-preview{display:flex;gap:4px}:host .invoice-preview div{position:relative}:host .invoice-preview div button{position:absolute;top:0;right:0;padding:0}:host .invoice-preview div button img{width:24px;height:24px}:host .invoice-preview div>img{width:100px;height:80px;object-fit:cover}:host .invoice input[type=email],:host .invoice input[type=tel],:host .invoice textarea{padding:16px;border:1px solid #fcd9c9;font-size:16px}:host .invoice textarea{resize:none;height:200px;font-family:"Inter", sans-serif}:host .invoice div:has(>input[type=file]){display:flex;align-items:center;justify-content:center;cursor:pointer;background:#fff;border:1px solid #fcd9c9;padding:32px 16px;gap:16px}:host .invoice div:has(>input[type=file]) span{color:#000;font-size:12px}:host .invoice input[type=file]{display:none}';const In=`${"https://hemfixarna.se"}/wp-json/headless`;const Fn=class{constructor(n){i(this,n);this.formError=null;this.displayImages=[];this.formImages=[];this.formState="initial"}isValidEmail(n){const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return t.test(n)}componentDidRender(){const n=this.el.querySelector("form");if(n){n.addEventListener("input",(()=>{this.formError=null}))}}disconnectedCallback(){const n=this.el.querySelector("form");if(n){n.removeEventListener("input",(()=>{this.formError=null}))}}async submit(n){var t;n.preventDefault();this.formState="loading";this.formError=null;const i=n.currentTarget.elements;const e={description:i.descriptionInput.value.length?i.descriptionInput.value:null,email:i.emailInput.value.length?i.emailInput.value:null,tel:i.telInput.value.length?i.telInput.value:null,terms:(t=i.termsInput)===null||t===void 0?void 0:t.checked};if(!e.description){this.formError="Vänligen fyll i formulärtexten";this.formState="initial";return}if(!e.email||!this.isValidEmail(e.email)){this.formError="Vänligen ange en giltig e-postadress";this.formState="initial";return}if(!e.tel){this.formError="Vänligen ange ditt telefonnummer";this.formState="initial";return}if(x.selectedProduct.terms_show_checkbox&&!e.terms){this.formError="Vänligen acceptera villkoren";this.formState="initial";return}const s=new FormData;s.append("text",e.description);s.append("email",e.email);s.append("tel",e.tel);s.append("customer",x.business);this.formImages.forEach((n=>{s.append("images[]",n)}));s.append("product",JSON.stringify({title:x.selectedProduct.title,amount:1,has_rut:x.selectedProduct.rut,has_rot:x.selectedProduct.rot,has_green:x.selectedProduct.green,ID:x.selectedProduct.ID,parts:[]}));try{const n=await fetch(`${In}/saveinvoiceproduct`,{method:"POST",body:s});const{response:t}=await n.json();if(t.code===200){x.checkoutInvoice=true;x.step=6}else{this.formError="Vi kan inte ta emot din beställning just nu";this.formState="initial"}}catch(n){this.formError="Vi kan inte ta emot din beställning just nu";this.formState="initial"}}handleImageDrop(n){n.preventDefault();const t=n.dataTransfer.files;for(let n=0;n<t.length;n++){const i=t[n];if(i.type.startsWith("image/")){const n=new FileReader;n.onload=()=>{this.displayImages=[...this.displayImages,n.result];this.formImages=[...this.formImages,i]};n.readAsDataURL(i)}}}handleFileInputChange(n){n.preventDefault();const t=n.target.files;for(let n=0;n<t.length;n++){const i=t[n];if(i.type.startsWith("image/")){const n=new FileReader;n.onload=()=>{this.displayImages=[...this.displayImages,n.result];this.formImages=[...this.formImages,i]};n.readAsDataURL(i)}}}handleImageClick(){this.el.querySelector(".hemfixarna-file-upload").click()}preventDragOver(n){n.preventDefault()}removeImage(n){this.displayImages=this.displayImages.filter(((t,i)=>i!==n));this.formImages=this.formImages.filter(((t,i)=>i!==n))}render(){const n=r(`./assets/drag-drop.svg`);return e("div",{class:"invoice"},e("p",null,x.selectedProduct.invoice_description),e("form",{onSubmit:n=>this.submit(n)},e("textarea",{name:"descriptionInput",placeholder:"Beskriv ditt ärende"}),e("div",{role:"button","aria-label":"upload image",onDragOver:n=>this.preventDragOver(n),onDrop:n=>this.handleImageDrop(n),onClick:()=>this.handleImageClick()},e("img",{src:n,alt:"hemfixarna_logo",width:24}),e("div",null,e("p",null,"Bifoga ev bilder"),e("span",null,"(dra bilder hit)")),e("input",{onChange:n=>this.handleFileInputChange(n),class:"hemfixarna-file-upload",accept:"image/*",type:"file",multiple:true,name:"fileInput"})),e("div",{class:"invoice-preview"},this.displayImages.map(((n,t)=>e("div",{key:t},e("img",{src:n,alt:"uploaded image"}),e("button",{onClick:()=>this.removeImage(t)},e("img",{src:r(`./assets/close.svg`),alt:"close"})))))),e("input",{placeholder:"E-post",type:"email",name:"emailInput"}),e("input",{placeholder:"Telefonnummer",type:"tel",name:"telInput"}),x.selectedProduct.terms_show_checkbox?e("label",null,e("input",{type:"checkbox",name:"termsInput"}),x.selectedProduct.terms):null,this.formError?e("span",null,this.formError):null,e("input",{type:"submit",value:this.formState==="loading"?"Skickar":"Kontakta mig"})))}get el(){return s(this)}};Fn.style=Dn;const Mn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://k-bygg.se",logo:"assets/kbygg.svg",backgroundColor:"#651d32"},loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.kbygg,isDemo:this.isDemo})}};const Nn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.klint})}};const Ln=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.kund})}};const An=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://norrgavel.se",logo:"assets/norrgavel.svg"},loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.norrgavel,isDemo:this.isDemo})}};const Pn=class{constructor(n){i(this,n);this.render=()=>e("div",{style:{background:`url(${x.options.thank_you_image})`},class:"hemfixarna_order"},e("div",null),e("div",null,e("h2",null,x.checkoutInvoice?"Tack för din förfrågan":"Tack för din bokning"),x.checkoutInvoice?e("p",null,"Vi återkommer inom kort till dig på angivet telefonnummer eller epost"):null,x.checkoutInvoice?e("div",null):e("hemfixarna-orderrows",{tree:this.tree,cart:false}),e("span",{onClick:()=>this.resetShop()},e("button",null,"Gör en ny bokning")),e("hemfixarna-info",{list:[{trust_badge:"Du kommer bli kontaktad av en Hemfixare för bokning av tid."},{trust_badge:"När jobbet är klart kommer du få en faktura med RUT/ROT/Grön teknik-avdrag."}]})));this.tree=undefined}resetShop(){x.step=1;x.cart=[];x.selectedCategory=null;x.selectedService=null;x.selectedProduct=null;x.maleri=null;x.checkoutStep=1}disconnectedCallback(){this.resetShop()}};const Kn=class{constructor(n){i(this,n);this.cart=true;this.tree=undefined}goToProduct(n){if(x.customer){const t=x.customer.categories.map((n=>n.show_products?n.products:n.sub_categories?n.sub_categories.map((n=>n.products)):[])).flat().flat();const i=t.find((t=>t&&t.fields.ID===n));if(i){x.selectedProduct=i.fields;x.step=4}}else{const t=this.tree.sub_cats.map((n=>n.services)).flat();const i=t.map((n=>n.products)).flat();const e=i.find((t=>t.ID===n));const s=t.find((t=>t.products.find((t=>t.ID===n))));const a=this.tree.sub_cats.find((t=>t.services.find((t=>t.products.find((t=>t.ID===n))))));x.selectedCategory=a;x.selectedService=s;x.selectedProduct=e;x.step=4}}openRot(){x.modal={title:x.rotOptions.rot_start_fee_heading,text:[x.rotOptions.rot_start_fee_text,x.rotOptions.rot_start_fee_text_secondary]}}openRut(){x.modal={title:x.rutOptions.rut_start_fee_heading,text:[x.rutOptions.rut_start_fee_text,x.rutOptions.rut_start_fee_text_secondary]}}openGreen(){x.modal={title:x.greenOptions.green_start_fee_heading,text:[x.greenOptions.green_start_fee_text,x.greenOptions.green_start_fee_text_secondary]}}getDiscountedInfo(n){if(n.rut&&x.rut){return" (efter RUT-avdrag)"}else if(n.rot&&x.rot){return" (efter ROT-avdrag)"}else if(n.green&&x.green){return" (efter Grön teknik avdrag)"}else{return""}}render(){const n=r(`./assets/info.svg`);return e(a,null,e("ul",{class:"hemfixarna_cart--items"},x.cart.map((n=>{var t;return e("li",{class:"hemfixarna_cart--item"},e("div",null,e("div",null,n.icon&&e("img",{width:30,src:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,alt:n.name}),e("p",null,e("strong",null,n.amount,"x "),n.name)),this.cart&&e("button",{onClick:()=>this.goToProduct(n.id)},"Ändra")),e("p",null,e("strong",null,C(n,n.price,n.amount),"kr"),e("span",null,this.getDiscountedInfo(n))),n.parts.length>0&&e("ul",null,n.parts.map((t=>e("li",null,e("p",null,e("strong",null,t.amount,"x "),t.name),e("p",null,e("strong",null,S(t,n,t.amount),"kr")))))))}))),e("div",{class:"hemfixarna_cart--additional"},e("div",null,z().rot>0&&e("div",{class:"hemfixarna_cart--startfee"},e("p",null,e("strong",{onClick:()=>this.openRot()},x.rotOptions.rot_start_fee_heading,e("img",{height:16,src:n,alt:"info monteringsavgift"}))),e("p",null,z().rot,"kr")),z().rut>0&&e("div",{class:"hemfixarna_cart--startfee"},e("p",null,e("strong",{onClick:()=>this.openRut()},x.rutOptions.rut_start_fee_heading,e("img",{height:16,src:n,alt:"info monteringsavgift"}))),e("p",null,z().rut,"kr")),z().green>0&&e("div",{class:"hemfixarna_cart--startfee"},e("p",null,e("strong",{onClick:()=>this.openGreen()},x.greenOptions.green_start_fee_heading,e("img",{height:16,src:n,alt:"info monteringsavgift"}))),e("p",null,z().green,"kr"))),x.cart.find((n=>n.rot))&&e("div",{class:"hemfixarna_cart--rutrot"},e("div",null,this.cart&&e("label",{class:"switch"},e("input",{checked:x.rot,onChange:()=>x.rot=!x.rot,type:"checkbox"}),e("span",{class:"slider"})),e("p",null,"ROT-avdrag")),e("p",null,"(-",x.rot?T():0,"kr)")),x.cart.find((n=>n.rut))&&e("div",{class:"hemfixarna_cart--rutrot"},e("div",null,e("label",{class:"switch"},e("input",{onChange:()=>x.rut=!x.rut,checked:x.rut,type:"checkbox"}),e("span",{class:"slider"})),e("p",null,"RUT-avdrag")),e("p",null,"(-",x.rut?j():0,"kr)")),x.cart.find((n=>n.green))&&e("div",{class:"hemfixarna_cart--rutrot"},e("div",null,e("label",{class:"switch"},e("input",{onChange:()=>x.green=!x.green,checked:x.green,type:"checkbox"}),e("span",{class:"slider"})),e("p",null,"Grön teknik avdrag")),e("p",null,"(-",x.green?O():0,"kr)"))),e("div",{class:"hemfixarna_cart--price"},e("h2",null,"Totalbelopp: "),e("h2",null,D(),"kr")))}};const Rn="";const Qn=class{constructor(n){i(this,n);this.amount=0;this.hideDescription=true}addProduct(){const n=x.cart.find((n=>n.id===x.selectedProduct.ID));if(n){n.amount++;x.cart=[...x.cart]}else{x.cart=[...x.cart,{id:x.selectedProduct.ID,rut:x.selectedProduct.rut,rot:x.selectedProduct.rot,green:x.selectedProduct.green,amount:1,parts:[],price:x.selectedProduct.price,name:x.selectedProduct.title,start_fee:!x.selectedProduct.hide_start_fee,terms_checkout:x.selectedProduct.terms_checkout,icon:x.selectedProduct.icon}]}}removeProduct(){const n=x.cart.find((n=>n.id===x.selectedProduct.ID));if(n&&n.amount>1){n.amount--;x.cart=[...x.cart]}else{x.cart=x.cart.filter((n=>n.id!==x.selectedProduct.ID))}}addPart(n){var t;const i=x.cart.find((n=>n.id===x.selectedProduct.ID));if(i){const e=i.parts.find((t=>t.id===n.ID));if(e){e.amount++;i.parts=[...i.parts]}else{i.parts=[...i.parts,{id:n.ID,amount:1,price:n.price,name:(t=n.title)!==null&&t!==void 0?t:n.title}]}x.cart=[...x.cart.filter((n=>n.id!==i.id)),i]}}removePart(n){const t=x.cart.find((n=>n.id===x.selectedProduct.ID));if(t){const i=t.parts.find((t=>t.id===n.ID));if(i&&i.amount>1){i.amount--;t.parts=[...t.parts]}else{t.parts=t.parts.filter((t=>t.id!==n.ID))}x.cart=[...x.cart.filter((n=>n.id!==t.id)),t]}}goToCart(){const n=x.cart.find((n=>n.id===x.selectedProduct.ID));if(n){x.step=5;const n=this.el.closest(".hemfixarna_content");v(n)}}getAmount(){var n;return((n=x.cart.find((n=>n.id===x.selectedProduct.ID)))===null||n===void 0?void 0:n.amount)||0}getPartAmount(n){var t;const i=x.cart.find((n=>n.id===x.selectedProduct.ID));return((t=i===null||i===void 0?void 0:i.parts.find((t=>t.id===n)))===null||t===void 0?void 0:t.amount)||0}getTotalPrice(){let n=0;const t=x.cart.find((n=>n.id===x.selectedProduct.ID));if(t){const i=t.parts.reduce(((n,t)=>{const i=x.selectedProduct.parts.find((n=>n.ID===t.id));if(i){return n+i.price*t.amount}return n}),0);n=x.selectedProduct.price*t.amount+i}else{n=x.selectedProduct.price}return C(x.selectedProduct,n)}componentDidRender(){const n=document.createElement("link");n.setAttribute("rel","stylesheet");n.setAttribute("href","https://painting-frontend.vercel.app/static/css/main.css");const t=document.createElement("link");t.setAttribute("rel","stylesheet");t.setAttribute("href","https://painting-frontend.vercel.app/fonts.css");const i=()=>{const e=this.el.getElementsByTagName("hemfixare-calculator");if(e.length>0&&e[0].shadowRoot!==null){e[0].shadowRoot.appendChild(n);e[0].shadowRoot.appendChild(t)}else{setTimeout(i,1)}};i()}render(){var n,t,i;const s=r(`./assets/checked.svg`);const o=r(`./assets/plus.svg`);const l=r(`./assets/minus.svg`);if(x.maleri){return e("div",{class:"hemfixarna_painting"},e("script",{type:"text/javascript",src:["localhost","vercel"].some((n=>window.location.href.includes(n)))?"https://painting-dev.vercel.app/static/js/main.js":"https://painting-frontend.vercel.app/static/js/main.js",defer:true,async:true}),e("hemfixare-calculator",{title:x.options.maleri_title,subtitle:x.options.maleri_text,modal:"true",customer:x.business===I.string?"string":x.business}))}return x.selectedProduct?e("div",{class:"hemfixarna_product"},e("div",{class:"hemfixarna_product--top"},x.selectedProduct.icon&&e("img",{width:80,src:(n=x.selectedProduct.icon.url)!==null&&n!==void 0?n:x.selectedProduct.icon,alt:x.selectedProduct.title}),e("div",null,e("h1",null,x.selectedProduct.title),!x.selectedProduct.invoice?e("h2",null,C(x.selectedProduct)," kr/st"):e("h2",null,x.selectedProduct.invoice_price))),e("div",{class:"hemfixarna_product--grid"},e("div",{class:"hemfixarna_product--left"},((t=x.selectedProduct.list)===null||t===void 0?void 0:t.length)&&e("ul",{class:"hemfixarna_features"},x.selectedProduct.list.map((n=>e("li",{key:n.bullet},e("img",{src:s,alt:"checked"}),e("p",null,n.bullet))))),x.selectedProduct.description&&e("p",{onClick:()=>this.hideDescription=false,class:`hemfixarna_description ${this.hideDescription?"hemfixarna_description--hidden":""}`,innerHTML:x.selectedProduct.description})),e("div",{class:"hemfixarna_product--right"},x.selectedProduct.invoice?e("hemfixarna-invoice",null):e(a,null,e("ul",null,e("li",{class:"hemfixarna_product--item"},e("div",null,e("p",null,x.selectedProduct.title),e("p",{class:"hemfixarna_product--price"},C(x.selectedProduct),"kr/st")),e("div",{class:"hemfixarna_counter"},e("img",{class:`${this.getAmount()===0?"disabled":""}`,src:l,onClick:()=>this.removeProduct()}),e("span",null,this.getAmount()),e("img",{src:o,onClick:()=>this.addProduct()}))),((i=x.selectedProduct.parts)===null||i===void 0?void 0:i.length)&&x.selectedProduct.parts.map((n=>{var t;return e("li",{class:"hemfixarna_part"},e("div",null,e("p",null,(t=n.title)!==null&&t!==void 0?t:n.title),e("p",{class:"hemfixarna_product--price"},S(n,x.selectedProduct),"kr/st")),e("div",{class:"hemfixarna_counter"},e("img",{class:`${this.getPartAmount(n.ID)===0?"disabled":""}`,src:l,onClick:()=>this.removePart(n)}),e("span",null,this.getPartAmount(n.ID)),e("img",{class:`${this.getAmount()===0?"disabled":""}`,src:o,onClick:()=>this.addPart(n)})))}))),e("h4",{class:"hemfixarna_product--total"},"Totalt ",this.getTotalPrice()," kr"),e("button",{onClick:()=>this.goToCart(),class:`hemfixarna_buy ${this.getAmount()===0?"disabled":""}`},"Fortsätt")),!x.selectedProduct.hide_start_fee&&(x.selectedProduct.rot||x.selectedProduct.rut)&&x.rutOptions&&x.rotOptions&&e("p",{class:"hemfixarna_terms"},e("strong",null,x.selectedProduct.rot?x.rotOptions.rot_start_fee_heading:x.rutOptions.rut_start_fee_heading),e("br",null),e("span",{innerHTML:x.selectedProduct.rot?x.rotOptions.rot_start_fee_text:x.rutOptions.rut_start_fee_text})),x.options&&e("hemfixarna-info",{list:x.options.trust})))):null}get el(){return s(this)}};Qn.style=Rn;const Un=class{constructor(n){i(this,n)}render(){return e("div",null,e("h2",null,x.selectedService.post_title),e("div",{class:"hemfixarna_categories--wrapper"},e("div",null,e("ul",{class:"hemfixarna_categories"},x.selectedService.products.sort(((n,t)=>n.post_title<t.post_title?-1:1)).map((n=>{var t;return e("hemfixarna-box",{post:n,icon:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,postTitle:n.title})})))),e("hemfixarna-info",{list:x.options.trust})))}};const Vn="";const Jn=class{constructor(n){i(this,n);this.id=undefined;this.customer=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.skanska})}};Jn.style=Vn;const Hn=class{constructor(n){i(this,n);this.id=undefined;this.customer=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.sparfonster})}};const En=class{constructor(n){i(this,n);this.tree=undefined;this.slug=undefined}isMainCategory(n){return n.show_products!==undefined}handleMaleriClick(){x.step=4;x.maleri=true}render(){var n;const t=r("./assets/gubbe-pensel.svg");return x.customer?e("div",null,e("h2",null,x.selectedCustomerCategory?x.selectedCustomerCategory.name:"Alla tjänster"),e("div",{class:"hemfixarna_categories--wrapper"},e("ul",{class:"hemfixarna_categories"},((n=x.selectedCustomerCategory)===null||n===void 0?void 0:n.add_painting)?e("button",{onClick:()=>this.handleMaleriClick(),class:"hemfixarna_maleribox"},e("img",{height:64,src:t,alt:"Måleri Logotyp"}),e("p",null,"Beräkna fast pris på måleri & tapetsering här")):null,x.selectedCustomerCategory?this.isMainCategory(x.selectedCustomerCategory)&&x.selectedCustomerCategory.sub_categories&&!x.selectedCustomerCategory.show_products?x.selectedCustomerCategory.sub_categories.map((n=>e("hemfixarna-box",{category:n}))):x.selectedCustomerCategory.products?x.selectedCustomerCategory.products.map((n=>e("hemfixarna-box",{category:n.fields}))):null:x.customer.categories.map((n=>e("hemfixarna-box",{category:n})))),e("hemfixarna-info",{list:x.options.trust}))):e("div",null,e("h2",null,"Alla tjänster"),e("div",{class:"hemfixarna_categories--wrapper"},e("ul",{class:"hemfixarna_categories"},this.tree.sub_cats.sort(((n,t)=>n.name<t.name?-1:1)).map((n=>{var t;return e("hemfixarna-box",{post:n,icon:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,postTitle:n.name})}))),e("hemfixarna-info",{list:x.options.trust})))}};const Wn="";const Xn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.string})}};Xn.style=Wn;const Gn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.isDemo=false;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://www.tesla.com/sv_se/home-charging",logo:"assets/tesla.svg"},isDemo:this.isDemo,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.tesla})}};const Yn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.isDemo=false;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://www.zaptec.com/sv/laddningslosningar/zaptec-go",logo:"assets/zaptec.svg"},isDemo:this.isDemo,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:I.zaptec})}};export{_ as hemfixarna_address,A as hemfixarna_box,P as hemfixarna_breadcrumbs,R as hemfixarna_byggmax,Q as hemfixarna_cart,U as hemfixarna_category,tn as hemfixarna_checkout,sn as hemfixarna_component,rn as hemfixarna_demo,ln as hemfixarna_doro,cn as hemfixarna_elfa,dn as hemfixarna_fargvaruhuset,un as hemfixarna_flyttsmart,fn as hemfixarna_forebygg,Bn as hemfixarna_getuser,jn as hemfixarna_hornbach,On as hemfixarna_info,Fn as hemfixarna_invoice,Mn as hemfixarna_kbygg,Nn as hemfixarna_klint,Ln as hemfixarna_kund,An as hemfixarna_norrgavel,Pn as hemfixarna_order,Kn as hemfixarna_orderrows,Qn as hemfixarna_product,Un as hemfixarna_service,Jn as hemfixarna_skanska,Hn as hemfixarna_sparfonster,En as hemfixarna_start,Xn as hemfixarna_string_furniture,Gn as hemfixarna_tesla,Yn as hemfixarna_zaptec};
|
2
|
+
//# sourceMappingURL=p-3b2da615.entry.js.map
|
package/package.json
CHANGED
File without changes
|