@wayke-se/components-react 3.0.0-beta.3 → 3.0.0-beta.5
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/index.js +639 -972
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +547 -880
- package/dist/index.mjs.map +4 -4
- package/esbuild/common.js +4 -0
- package/esbuild/lib.js +1 -0
- package/package.json +3 -4
- package/src/components/Gallery/index.tsx +24 -31
- package/src/components/Lightbox/index.tsx +11 -11
- package/src/components/ProductCard/index.tsx +22 -19
package/dist/index.mjs
CHANGED
|
@@ -3651,6 +3651,7 @@ var Item5 = styled20.li`
|
|
|
3651
3651
|
|
|
3652
3652
|
// src/components/ProductCard/index.tsx
|
|
3653
3653
|
import React24, { useCallback as useCallback9, useMemo } from "react";
|
|
3654
|
+
import LazyLoad from "react-lazy-load";
|
|
3654
3655
|
|
|
3655
3656
|
// src/components/ProductCard/wrapper.tsx
|
|
3656
3657
|
import styled21 from "styled-components";
|
|
@@ -3936,7 +3937,7 @@ var ProductCard = ({
|
|
|
3936
3937
|
);
|
|
3937
3938
|
return /* @__PURE__ */ React24.createElement(Wrapper9, {
|
|
3938
3939
|
onClick: _onClick
|
|
3939
|
-
}, /* @__PURE__ */ React24.createElement(Image, null, image ? /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(Picture, null, /* @__PURE__ */ React24.createElement(Source, {
|
|
3940
|
+
}, /* @__PURE__ */ React24.createElement(Image, null, /* @__PURE__ */ React24.createElement(LazyLoad, null, image ? /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(Picture, null, /* @__PURE__ */ React24.createElement(Source, {
|
|
3940
3941
|
type: "image/webp",
|
|
3941
3942
|
srcSet: `${image}?spec=822x548&format=webp 822w, ${image}?spec=750x500&format=webp 750w, ${image}?spec=411x274&format=webp 411w`,
|
|
3942
3943
|
sizes: "(min-width: 600px) calc(((100vw - 48px) / 2) - 8px), (min-width: 900px) calc(((100vw - 48px) / 3) - 10.666px), (min-width: 1312px) 410px, calc(100vw - 32px)"
|
|
@@ -3947,7 +3948,7 @@ var ProductCard = ({
|
|
|
3947
3948
|
alt: title
|
|
3948
3949
|
}))) : /* @__PURE__ */ React24.createElement(Picture, null, /* @__PURE__ */ React24.createElement(Img, {
|
|
3949
3950
|
src: placeholderImage || DEFAULT_PLACEHOLDER_IMAGE
|
|
3950
|
-
}))), /* @__PURE__ */ React24.createElement(Content, null, /* @__PURE__ */ React24.createElement(ContentBody, null, /* @__PURE__ */ React24.createElement(Heading3, null, href ? /* @__PURE__ */ React24.createElement(Link, {
|
|
3951
|
+
})))), /* @__PURE__ */ React24.createElement(Content, null, /* @__PURE__ */ React24.createElement(ContentBody, null, /* @__PURE__ */ React24.createElement(Heading3, null, href ? /* @__PURE__ */ React24.createElement(Link, {
|
|
3951
3952
|
onClick: onHrefClick,
|
|
3952
3953
|
href,
|
|
3953
3954
|
title,
|
|
@@ -4521,7 +4522,7 @@ var WaykeSearch = ({
|
|
|
4521
4522
|
var search_default = WaykeSearch;
|
|
4522
4523
|
|
|
4523
4524
|
// src/layouts/searchItem/index.tsx
|
|
4524
|
-
import
|
|
4525
|
+
import React94, { useMemo as useMemo6, useRef as useRef4, useCallback as useCallback38, useEffect as useEffect18 } from "react";
|
|
4525
4526
|
import WaykeEcomWeb from "@wayke-se/ecom-web";
|
|
4526
4527
|
|
|
4527
4528
|
// src/components/PriceTable/index.tsx
|
|
@@ -4800,7 +4801,7 @@ var ExtendContent = ({ children, actionTitle, onClick }) => {
|
|
|
4800
4801
|
var ExtendContent_default = ExtendContent;
|
|
4801
4802
|
|
|
4802
4803
|
// src/components/Gallery/index.tsx
|
|
4803
|
-
import
|
|
4804
|
+
import React50, { useState as useState15, useCallback as useCallback18, useRef as useRef3, useMemo as useMemo3 } from "react";
|
|
4804
4805
|
import Slider3 from "react-slick";
|
|
4805
4806
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
4806
4807
|
|
|
@@ -5162,7 +5163,7 @@ var EnableNavigationButton = styled33.div`
|
|
|
5162
5163
|
`;
|
|
5163
5164
|
|
|
5164
5165
|
// src/components/Lightbox/index.tsx
|
|
5165
|
-
import
|
|
5166
|
+
import React45 from "react";
|
|
5166
5167
|
|
|
5167
5168
|
// src/components/Lightbox/wrapper.tsx
|
|
5168
5169
|
import styled34 from "styled-components";
|
|
@@ -5385,315 +5386,19 @@ var VideoPlayer = ({ url, autoplay = false, controls = true }) => {
|
|
|
5385
5386
|
};
|
|
5386
5387
|
var EmbeddedVideoLightbox_default = VideoPlayer;
|
|
5387
5388
|
|
|
5388
|
-
// src/components/Sphere/SphereLightbox.tsx
|
|
5389
|
-
import React43 from "react";
|
|
5390
|
-
|
|
5391
|
-
// src/components/Sphere/SphereViewer.tsx
|
|
5392
|
-
import React42, { lazy, useState as useState9, useEffect as useEffect7 } from "react";
|
|
5393
|
-
|
|
5394
|
-
// src/components/Sphere/wrapper.tsx
|
|
5395
|
-
import styled37 from "styled-components";
|
|
5396
|
-
var compassSize = size(4);
|
|
5397
|
-
var controlBtnSize = size(4);
|
|
5398
|
-
var Wrapper20 = styled37.div`
|
|
5399
|
-
position: relative;
|
|
5400
|
-
width: 100%;
|
|
5401
|
-
height: 0 !important;
|
|
5402
|
-
padding-bottom: 66.666% !important; // 3:2
|
|
5403
|
-
|
|
5404
|
-
.pnlm-container {
|
|
5405
|
-
position: absolute;
|
|
5406
|
-
height: 100% !important;
|
|
5407
|
-
background-image: none;
|
|
5408
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5409
|
-
}
|
|
5410
|
-
|
|
5411
|
-
// Compass
|
|
5412
|
-
|
|
5413
|
-
.pnlm-compass {
|
|
5414
|
-
width: ${compassSize};
|
|
5415
|
-
height: ${compassSize};
|
|
5416
|
-
border-radius: 50%;
|
|
5417
|
-
bottom: ${size(2)};
|
|
5418
|
-
left: ${size(2)};
|
|
5419
|
-
right: auto;
|
|
5420
|
-
margin-top: 0;
|
|
5421
|
-
border: 5px solid transparent;
|
|
5422
|
-
border-top-color: ${(props) => props.theme.color.textLight};
|
|
5423
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5424
|
-
background-image: none;
|
|
5425
|
-
backdrop-filter: blur(5px);
|
|
5426
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5427
|
-
box-sizing: border-box;
|
|
5428
|
-
|
|
5429
|
-
&:hover {
|
|
5430
|
-
background-color: red;
|
|
5431
|
-
}
|
|
5432
|
-
}
|
|
5433
|
-
|
|
5434
|
-
// Controls (zoom & fullscreen button)
|
|
5435
|
-
|
|
5436
|
-
.pnlm-grab,
|
|
5437
|
-
.pnlm-grabbing {
|
|
5438
|
-
.pnlm-controls-container {
|
|
5439
|
-
display: block;
|
|
5440
|
-
}
|
|
5441
|
-
}
|
|
5442
|
-
|
|
5443
|
-
.pnlm-controls-container {
|
|
5444
|
-
display: none;
|
|
5445
|
-
top: ${size(2)};
|
|
5446
|
-
left: ${size(2)};
|
|
5447
|
-
}
|
|
5448
|
-
|
|
5449
|
-
.pnlm-controls {
|
|
5450
|
-
margin-top: 0;
|
|
5451
|
-
|
|
5452
|
-
& + .pnlm-controls {
|
|
5453
|
-
margin-top: ${size(1)};
|
|
5454
|
-
}
|
|
5455
|
-
}
|
|
5456
|
-
|
|
5457
|
-
// Fullscreen button
|
|
5458
|
-
|
|
5459
|
-
.pnlm-fullscreen-toggle-button {
|
|
5460
|
-
display: none;
|
|
5461
|
-
position: relative;
|
|
5462
|
-
width: ${controlBtnSize};
|
|
5463
|
-
height: ${controlBtnSize};
|
|
5464
|
-
background-image: none;
|
|
5465
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5466
|
-
backdrop-filter: blur(5px);
|
|
5467
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5468
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5469
|
-
border: 0;
|
|
5470
|
-
border-radius: 50%;
|
|
5471
|
-
|
|
5472
|
-
&:hover {
|
|
5473
|
-
background-color: rgba(255, 255, 255, 0.6);
|
|
5474
|
-
}
|
|
5475
|
-
|
|
5476
|
-
&:before {
|
|
5477
|
-
position: absolute;
|
|
5478
|
-
top: 50%;
|
|
5479
|
-
left: 50%;
|
|
5480
|
-
transform: translate(-50%, -50%);
|
|
5481
|
-
font-size: 0.875rem;
|
|
5482
|
-
}
|
|
5483
|
-
}
|
|
5484
|
-
|
|
5485
|
-
.pnlm-fullscreen-toggle-button-inactive {
|
|
5486
|
-
&:before {
|
|
5487
|
-
content: '⤢';
|
|
5488
|
-
}
|
|
5489
|
-
|
|
5490
|
-
&.pnlm-fullscreen-toggle-button-active {
|
|
5491
|
-
&:before {
|
|
5492
|
-
content: '⤢';
|
|
5493
|
-
}
|
|
5494
|
-
}
|
|
5495
|
-
}
|
|
5496
|
-
|
|
5497
|
-
// Gyroscope (Orientation)
|
|
5498
|
-
|
|
5499
|
-
.pnlm-orientation-button {
|
|
5500
|
-
background-image: none;
|
|
5501
|
-
width: ${controlBtnSize};
|
|
5502
|
-
height: ${controlBtnSize};
|
|
5503
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5504
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5505
|
-
border: 0;
|
|
5506
|
-
border-radius: 999px;
|
|
5507
|
-
|
|
5508
|
-
&:hover {
|
|
5509
|
-
background-color: red;
|
|
5510
|
-
}
|
|
5511
|
-
|
|
5512
|
-
&:before {
|
|
5513
|
-
content: 'A';
|
|
5514
|
-
position: absolute;
|
|
5515
|
-
top: 50%;
|
|
5516
|
-
left: 50%;
|
|
5517
|
-
transform: translate(-50%, -50%);
|
|
5518
|
-
font-size: 0.875rem;
|
|
5519
|
-
}
|
|
5520
|
-
|
|
5521
|
-
&.pnlm-orientation-button-active {
|
|
5522
|
-
background-color: green;
|
|
5523
|
-
|
|
5524
|
-
&:hover {
|
|
5525
|
-
background-color: pink;
|
|
5526
|
-
}
|
|
5527
|
-
}
|
|
5528
|
-
}
|
|
5529
|
-
|
|
5530
|
-
// Zoom controls
|
|
5531
|
-
|
|
5532
|
-
.pnlm-zoom-controls {
|
|
5533
|
-
display: none;
|
|
5534
|
-
height: auto;
|
|
5535
|
-
width: auto;
|
|
5536
|
-
background-color: transparent;
|
|
5537
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5538
|
-
border: 0;
|
|
5539
|
-
border-radius: 999px;
|
|
5540
|
-
|
|
5541
|
-
> * {
|
|
5542
|
-
&:first-child {
|
|
5543
|
-
border-top-left-radius: 999px;
|
|
5544
|
-
border-top-right-radius: 999px;
|
|
5545
|
-
}
|
|
5546
|
-
|
|
5547
|
-
&:last-child {
|
|
5548
|
-
border-bottom-left-radius: 999px;
|
|
5549
|
-
border-bottom-right-radius: 999px;
|
|
5550
|
-
}
|
|
5551
|
-
}
|
|
5552
|
-
}
|
|
5553
|
-
|
|
5554
|
-
.pnlm-zoom-in,
|
|
5555
|
-
.pnlm-zoom-out {
|
|
5556
|
-
position: relative;
|
|
5557
|
-
display: block;
|
|
5558
|
-
width: ${controlBtnSize};
|
|
5559
|
-
height: ${controlBtnSize};
|
|
5560
|
-
background-image: none;
|
|
5561
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5562
|
-
backdrop-filter: blur(5px);
|
|
5563
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5564
|
-
border-radius: 0;
|
|
5565
|
-
|
|
5566
|
-
&:before {
|
|
5567
|
-
position: absolute;
|
|
5568
|
-
top: 50%;
|
|
5569
|
-
left: 50%;
|
|
5570
|
-
transform: translate(-50%, -50%);
|
|
5571
|
-
}
|
|
5572
|
-
|
|
5573
|
-
&:hover {
|
|
5574
|
-
background-color: rgba(255, 255, 255, 0.6);
|
|
5575
|
-
}
|
|
5576
|
-
}
|
|
5577
|
-
|
|
5578
|
-
.pnlm-zoom-in {
|
|
5579
|
-
top: auto;
|
|
5580
|
-
|
|
5581
|
-
&:before {
|
|
5582
|
-
content: '+';
|
|
5583
|
-
}
|
|
5584
|
-
}
|
|
5585
|
-
|
|
5586
|
-
.pnlm-zoom-out {
|
|
5587
|
-
bottom: auto;
|
|
5588
|
-
border-top: 1px solid ${(props) => props.theme.color.textDark};
|
|
5589
|
-
|
|
5590
|
-
&:before {
|
|
5591
|
-
content: '-';
|
|
5592
|
-
}
|
|
5593
|
-
}
|
|
5594
|
-
|
|
5595
|
-
// Load Button
|
|
5596
|
-
|
|
5597
|
-
.pnlm-load-button {
|
|
5598
|
-
top: auto;
|
|
5599
|
-
bottom: ${size(2)};
|
|
5600
|
-
transform: translateX(-50%);
|
|
5601
|
-
width: auto;
|
|
5602
|
-
height: auto;
|
|
5603
|
-
padding: ${size(1.75)} ${size(2)};
|
|
5604
|
-
border-radius: 3px;
|
|
5605
|
-
margin: 0;
|
|
5606
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5607
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5608
|
-
line-height: 1.1;
|
|
5609
|
-
user-select: none;
|
|
5610
|
-
|
|
5611
|
-
&:hover {
|
|
5612
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5613
|
-
}
|
|
5614
|
-
|
|
5615
|
-
p {
|
|
5616
|
-
margin: 0;
|
|
5617
|
-
font-size: 0.875rem;
|
|
5618
|
-
}
|
|
5619
|
-
}
|
|
5620
|
-
|
|
5621
|
-
// Load box
|
|
5622
|
-
|
|
5623
|
-
.pnlm-load-box {
|
|
5624
|
-
background-color: transparent;
|
|
5625
|
-
height: auto;
|
|
5626
|
-
margin: 0;
|
|
5627
|
-
width: 150px;
|
|
5628
|
-
transform: translate(-50%, -50%);
|
|
5629
|
-
|
|
5630
|
-
> p {
|
|
5631
|
-
display: none;
|
|
5632
|
-
}
|
|
5633
|
-
}
|
|
5634
|
-
|
|
5635
|
-
// Load bar
|
|
5636
|
-
|
|
5637
|
-
.pnlm-lbar {
|
|
5638
|
-
width: 100%;
|
|
5639
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5640
|
-
border: 0;
|
|
5641
|
-
}
|
|
5642
|
-
|
|
5643
|
-
.pnlm-lbar-fill {
|
|
5644
|
-
background-color: ${(props) => props.theme.color.textLight};
|
|
5645
|
-
}
|
|
5646
|
-
`;
|
|
5647
|
-
|
|
5648
|
-
// src/components/Sphere/SphereViewer.tsx
|
|
5649
|
-
var ReactPannellum = lazy(() => import("pannellum-react/es/elements/Pannellum"));
|
|
5650
|
-
var SphereViewer = ({ id, src, preview, autoLoad, onStart }) => {
|
|
5651
|
-
const [number] = useState9(Math.floor(1e8 + Math.random() * 9e8));
|
|
5652
|
-
useEffect7(() => {
|
|
5653
|
-
setTimeout(() => {
|
|
5654
|
-
if (onStart) {
|
|
5655
|
-
const startBtn = document.querySelector(".pnlm-load-button");
|
|
5656
|
-
if (startBtn)
|
|
5657
|
-
startBtn.addEventListener("click", onStart);
|
|
5658
|
-
}
|
|
5659
|
-
}, 100);
|
|
5660
|
-
}, []);
|
|
5661
|
-
return /* @__PURE__ */ React42.createElement(Wrapper20, null, /* @__PURE__ */ React42.createElement(React42.Suspense, {
|
|
5662
|
-
fallback: /* @__PURE__ */ React42.createElement(Loader_default, null)
|
|
5663
|
-
}, /* @__PURE__ */ React42.createElement(ReactPannellum, {
|
|
5664
|
-
id: `a-${id}-${number}`,
|
|
5665
|
-
image: src,
|
|
5666
|
-
hfov: 120,
|
|
5667
|
-
autoLoad,
|
|
5668
|
-
compass: true,
|
|
5669
|
-
width: "100%",
|
|
5670
|
-
preview
|
|
5671
|
-
})));
|
|
5672
|
-
};
|
|
5673
|
-
var SphereViewer_default = SphereViewer;
|
|
5674
|
-
|
|
5675
|
-
// src/components/Sphere/SphereLightbox.tsx
|
|
5676
|
-
var SphereLightbox = ({ url }) => /* @__PURE__ */ React43.createElement(SphereViewer_default, {
|
|
5677
|
-
id: url,
|
|
5678
|
-
src: url,
|
|
5679
|
-
preview: url,
|
|
5680
|
-
autoLoad: true
|
|
5681
|
-
});
|
|
5682
|
-
var SphereLightbox_default = SphereLightbox;
|
|
5683
|
-
|
|
5684
5389
|
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5685
|
-
import
|
|
5390
|
+
import React44, { useState as useState10, useCallback as useCallback14 } from "react";
|
|
5686
5391
|
|
|
5687
5392
|
// src/components/Gallery/MediaButton.tsx
|
|
5688
|
-
import
|
|
5689
|
-
var MediaButton = ({ text, onClick }) => /* @__PURE__ */
|
|
5393
|
+
import React42 from "react";
|
|
5394
|
+
var MediaButton = ({ text, onClick }) => /* @__PURE__ */ React42.createElement(MediaButtonWrapper, null, /* @__PURE__ */ React42.createElement(ButtonSecondary, {
|
|
5690
5395
|
onClick,
|
|
5691
5396
|
title: text
|
|
5692
|
-
}, /* @__PURE__ */
|
|
5397
|
+
}, /* @__PURE__ */ React42.createElement(ButtonContent, null, text)));
|
|
5693
5398
|
var MediaButton_default = MediaButton;
|
|
5694
5399
|
|
|
5695
5400
|
// src/components/ThreeSixty/Rotation.tsx
|
|
5696
|
-
import
|
|
5401
|
+
import React43, { useState as useState9, useEffect as useEffect7, useRef as useRef2, cloneElement, Children } from "react";
|
|
5697
5402
|
var calculateCurrentFrame = (startFrame, delta, length) => {
|
|
5698
5403
|
const frame = (startFrame + delta) % length;
|
|
5699
5404
|
if (frame < 0) {
|
|
@@ -5705,11 +5410,11 @@ var Rotation = ({ children }) => {
|
|
|
5705
5410
|
const startFrame = useRef2(0);
|
|
5706
5411
|
const pointerPosition = useRef2();
|
|
5707
5412
|
const max = useRef2(0);
|
|
5708
|
-
const [state, setState] =
|
|
5413
|
+
const [state, setState] = useState9({
|
|
5709
5414
|
current: 0,
|
|
5710
5415
|
outsideMouseMove: false
|
|
5711
5416
|
});
|
|
5712
|
-
|
|
5417
|
+
useEffect7(() => {
|
|
5713
5418
|
document.addEventListener("mouseup", touchEnd);
|
|
5714
5419
|
return () => {
|
|
5715
5420
|
window.document.removeEventListener("mouseup", touchEnd);
|
|
@@ -5780,7 +5485,7 @@ var Rotation = ({ children }) => {
|
|
|
5780
5485
|
const { offsetLeft } = event.currentTarget;
|
|
5781
5486
|
return clientX - offsetLeft;
|
|
5782
5487
|
};
|
|
5783
|
-
return /* @__PURE__ */
|
|
5488
|
+
return /* @__PURE__ */ React43.createElement("div", {
|
|
5784
5489
|
onTouchStart: touchStart,
|
|
5785
5490
|
onTouchMove: touchMove,
|
|
5786
5491
|
onTouchEnd: touchEnd,
|
|
@@ -5802,18 +5507,18 @@ var Rotation_default = Rotation;
|
|
|
5802
5507
|
|
|
5803
5508
|
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5804
5509
|
var ThreeSixtyLightbox = ({ urls }) => {
|
|
5805
|
-
const [started2, setStarted] =
|
|
5510
|
+
const [started2, setStarted] = useState10(false);
|
|
5806
5511
|
const onStart = useCallback14(() => setStarted(true), []);
|
|
5807
5512
|
if (!started2) {
|
|
5808
|
-
return /* @__PURE__ */
|
|
5513
|
+
return /* @__PURE__ */ React44.createElement(Item9, null, /* @__PURE__ */ React44.createElement(Img2, {
|
|
5809
5514
|
src: urls[0],
|
|
5810
5515
|
alt: "alt"
|
|
5811
|
-
}), /* @__PURE__ */
|
|
5516
|
+
}), /* @__PURE__ */ React44.createElement(MediaButton_default, {
|
|
5812
5517
|
text: "Starta 360\xB0 exteri\xF6rt",
|
|
5813
5518
|
onClick: onStart
|
|
5814
5519
|
}));
|
|
5815
5520
|
}
|
|
5816
|
-
return /* @__PURE__ */
|
|
5521
|
+
return /* @__PURE__ */ React44.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ React44.createElement(Img2, {
|
|
5817
5522
|
key: image,
|
|
5818
5523
|
src: image,
|
|
5819
5524
|
alt: `Bild ${i + 1}`
|
|
@@ -5835,46 +5540,44 @@ var Lightbox = ({ index: index2, media, onClose }) => {
|
|
|
5835
5540
|
onClose();
|
|
5836
5541
|
}
|
|
5837
5542
|
};
|
|
5838
|
-
return /* @__PURE__ */
|
|
5543
|
+
return /* @__PURE__ */ React45.createElement(Wrapper18, {
|
|
5839
5544
|
ref: (ref) => ref?.focus(),
|
|
5840
5545
|
onKeyDown,
|
|
5841
5546
|
tabIndex: 0
|
|
5842
|
-
}, /* @__PURE__ */
|
|
5547
|
+
}, /* @__PURE__ */ React45.createElement(UiBlock2, {
|
|
5843
5548
|
onClick: onClose,
|
|
5844
5549
|
"aria-hidden": true
|
|
5845
|
-
}), media.map((m, i) => /* @__PURE__ */
|
|
5550
|
+
}), media.filter((x) => x.type !== "sphere").map((m, i) => /* @__PURE__ */ React45.createElement(Item9, {
|
|
5846
5551
|
key: i,
|
|
5847
5552
|
ref: index2 === i ? onRef : void 0
|
|
5848
|
-
}, m.type === "image" && /* @__PURE__ */
|
|
5553
|
+
}, m.type === "image" && /* @__PURE__ */ React45.createElement(Img2, {
|
|
5849
5554
|
id: `lightbox-image-${i}`,
|
|
5850
5555
|
src: m.files[0].url,
|
|
5851
5556
|
alt: `Bild ${i + 1}`
|
|
5852
|
-
}), m.type === "threesixty" && /* @__PURE__ */
|
|
5557
|
+
}), m.type === "threesixty" && /* @__PURE__ */ React45.createElement(ThreeSixtLightbox_default, {
|
|
5853
5558
|
urls: m.files.map((x) => x.url)
|
|
5854
|
-
}), m.type === "
|
|
5855
|
-
url: m.files[0].url
|
|
5856
|
-
}), m.type === "embedded" && /* @__PURE__ */ React47.createElement(EmbeddedVideoLightbox_default, {
|
|
5559
|
+
}), m.type === "embedded" && /* @__PURE__ */ React45.createElement(EmbeddedVideoLightbox_default, {
|
|
5857
5560
|
url: m.files[0].url
|
|
5858
|
-
}))), /* @__PURE__ */
|
|
5561
|
+
}))), /* @__PURE__ */ React45.createElement(CloseBtn2, {
|
|
5859
5562
|
onClick: onClose,
|
|
5860
5563
|
title: "St\xE4ng"
|
|
5861
|
-
}, /* @__PURE__ */
|
|
5564
|
+
}, /* @__PURE__ */ React45.createElement(IconCancel, {
|
|
5862
5565
|
block: true
|
|
5863
5566
|
})));
|
|
5864
5567
|
};
|
|
5865
5568
|
var Lightbox_default = Lightbox;
|
|
5866
5569
|
|
|
5867
5570
|
// src/components/Video/EmbededVideo.tsx
|
|
5868
|
-
import
|
|
5571
|
+
import React47, { useState as useState14, useCallback as useCallback16 } from "react";
|
|
5869
5572
|
|
|
5870
5573
|
// src/components/Video/useThumbnail.ts
|
|
5871
|
-
import { useEffect as
|
|
5574
|
+
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
5872
5575
|
|
|
5873
5576
|
// src/hooks/useVimeoThumbnail.ts
|
|
5874
|
-
import { useEffect as
|
|
5577
|
+
import { useEffect as useEffect9, useState as useState12 } from "react";
|
|
5875
5578
|
|
|
5876
5579
|
// src/hooks/useFetch.ts
|
|
5877
|
-
import { useEffect as
|
|
5580
|
+
import { useEffect as useEffect8, useState as useState11, useCallback as useCallback15 } from "react";
|
|
5878
5581
|
var cache = {};
|
|
5879
5582
|
var getCachedResult = (key) => cache?.[key] || void 0;
|
|
5880
5583
|
var setCachedResult = (key, value) => {
|
|
@@ -5892,9 +5595,9 @@ var clearPendingPromise = (url) => {
|
|
|
5892
5595
|
delete pendingPromise[url];
|
|
5893
5596
|
};
|
|
5894
5597
|
var useFetch = (path, options, skip, promiseCache) => {
|
|
5895
|
-
const [data, setData] =
|
|
5896
|
-
const [loading, setLoading] =
|
|
5897
|
-
const [error, setError] =
|
|
5598
|
+
const [data, setData] = useState11();
|
|
5599
|
+
const [loading, setLoading] = useState11(false);
|
|
5600
|
+
const [error, setError] = useState11(false);
|
|
5898
5601
|
const doFetch = useCallback15(async () => {
|
|
5899
5602
|
const key = path.toString();
|
|
5900
5603
|
const cached = getCachedResult(key);
|
|
@@ -5924,7 +5627,7 @@ var useFetch = (path, options, skip, promiseCache) => {
|
|
|
5924
5627
|
}
|
|
5925
5628
|
return;
|
|
5926
5629
|
}, [path, options]);
|
|
5927
|
-
|
|
5630
|
+
useEffect8(() => {
|
|
5928
5631
|
if (!skip) {
|
|
5929
5632
|
doFetch();
|
|
5930
5633
|
}
|
|
@@ -5939,14 +5642,14 @@ var useFetch_default = useFetch;
|
|
|
5939
5642
|
|
|
5940
5643
|
// src/hooks/useVimeoThumbnail.ts
|
|
5941
5644
|
var useVimeoThumbnail = (id, small) => {
|
|
5942
|
-
const [thumbnail, setThumbnail] =
|
|
5645
|
+
const [thumbnail, setThumbnail] = useState12();
|
|
5943
5646
|
const { data } = useFetch_default(
|
|
5944
5647
|
`http://vimeo.com/api/v2/video/${id}.json`,
|
|
5945
5648
|
{},
|
|
5946
5649
|
!id || !!thumbnail,
|
|
5947
5650
|
true
|
|
5948
5651
|
);
|
|
5949
|
-
|
|
5652
|
+
useEffect9(() => {
|
|
5950
5653
|
if (data?.[0]) {
|
|
5951
5654
|
if (small && data[0].thumbnail_small) {
|
|
5952
5655
|
setThumbnail(data[0].thumbnail_small);
|
|
@@ -5963,10 +5666,10 @@ var useVimeoThumbnail_default = useVimeoThumbnail;
|
|
|
5963
5666
|
var useThumbnail = (url, small) => {
|
|
5964
5667
|
if (url?.toLowerCase().endsWith(".mp4"))
|
|
5965
5668
|
return;
|
|
5966
|
-
const [thumbnail, setThumbnail] =
|
|
5669
|
+
const [thumbnail, setThumbnail] = useState13();
|
|
5967
5670
|
const vimeoId = url ? getVimeoId(url) : void 0;
|
|
5968
5671
|
const vimeoThumbnail = useVimeoThumbnail_default(vimeoId, small);
|
|
5969
|
-
|
|
5672
|
+
useEffect10(() => {
|
|
5970
5673
|
if (url) {
|
|
5971
5674
|
const youtubeThumbnail = getYoutubeThumbnail(url);
|
|
5972
5675
|
if (youtubeThumbnail) {
|
|
@@ -5983,11 +5686,11 @@ var useThumbnail = (url, small) => {
|
|
|
5983
5686
|
var useThumbnail_default = useThumbnail;
|
|
5984
5687
|
|
|
5985
5688
|
// src/components/Modal/index.tsx
|
|
5986
|
-
import * as
|
|
5689
|
+
import * as React46 from "react";
|
|
5987
5690
|
|
|
5988
5691
|
// src/components/Modal/wrapper.tsx
|
|
5989
|
-
import
|
|
5990
|
-
var
|
|
5692
|
+
import styled37 from "styled-components";
|
|
5693
|
+
var Wrapper20 = styled37.div.attrs(() => ({
|
|
5991
5694
|
role: "dialog"
|
|
5992
5695
|
}))`
|
|
5993
5696
|
position: fixed;
|
|
@@ -6007,7 +5710,7 @@ var Wrapper21 = styled38.div.attrs(() => ({
|
|
|
6007
5710
|
padding: ${size(2)};
|
|
6008
5711
|
}
|
|
6009
5712
|
`;
|
|
6010
|
-
var UiBlock3 =
|
|
5713
|
+
var UiBlock3 = styled37.div.attrs(() => ({
|
|
6011
5714
|
"aria-hidden": "true",
|
|
6012
5715
|
role: "button"
|
|
6013
5716
|
}))`
|
|
@@ -6027,7 +5730,7 @@ var UiBlock3 = styled38.div.attrs(() => ({
|
|
|
6027
5730
|
animation: ${fadeIn} 400ms ease forwards;
|
|
6028
5731
|
}
|
|
6029
5732
|
`;
|
|
6030
|
-
var Dialog =
|
|
5733
|
+
var Dialog = styled37.article.attrs(() => ({
|
|
6031
5734
|
className: "wayke__theme wayke__font--regular"
|
|
6032
5735
|
}))`
|
|
6033
5736
|
display: flex;
|
|
@@ -6051,74 +5754,74 @@ var Dialog = styled38.article.attrs(() => ({
|
|
|
6051
5754
|
animation: ${fadeIn} 400ms ease, ${noTransform} 400ms ease forwards;
|
|
6052
5755
|
}
|
|
6053
5756
|
`;
|
|
6054
|
-
var Content4 =
|
|
5757
|
+
var Content4 = styled37.div`
|
|
6055
5758
|
flex: 1 1 auto;
|
|
6056
5759
|
overflow: auto;
|
|
6057
5760
|
-webkit-overflow-scrolling: touch;
|
|
6058
5761
|
`;
|
|
6059
|
-
var Header4 =
|
|
5762
|
+
var Header4 = styled37.header`
|
|
6060
5763
|
display: flex;
|
|
6061
5764
|
align-items: center;
|
|
6062
5765
|
min-height: 60px;
|
|
6063
5766
|
padding: ${size(3)};
|
|
6064
5767
|
padding-bottom: 0;
|
|
6065
5768
|
`;
|
|
6066
|
-
var Heading5 =
|
|
5769
|
+
var Heading5 = styled37.div`
|
|
6067
5770
|
flex: 1 1 auto;
|
|
6068
5771
|
|
|
6069
5772
|
${H1} {
|
|
6070
5773
|
font-size: 1.5rem;
|
|
6071
5774
|
}
|
|
6072
5775
|
`;
|
|
6073
|
-
var Close2 =
|
|
5776
|
+
var Close2 = styled37.div`
|
|
6074
5777
|
flex-shrink: 0;
|
|
6075
5778
|
margin: ${size(-2)};
|
|
6076
5779
|
padding-left: ${size(3)};
|
|
6077
5780
|
`;
|
|
6078
|
-
var CloseBtn3 =
|
|
5781
|
+
var CloseBtn3 = styled37(ButtonReset)`
|
|
6079
5782
|
display: block;
|
|
6080
5783
|
padding: ${size(2)};
|
|
6081
5784
|
`;
|
|
6082
|
-
var Body4 =
|
|
5785
|
+
var Body4 = styled37.div`
|
|
6083
5786
|
padding: ${size(3)};
|
|
6084
5787
|
`;
|
|
6085
|
-
var Image3 =
|
|
5788
|
+
var Image3 = styled37.img`
|
|
6086
5789
|
display: block;
|
|
6087
5790
|
width: calc(100% + ${size(6)});
|
|
6088
5791
|
margin-left: ${size(-3)};
|
|
6089
5792
|
margin-bottom: ${size(3)};
|
|
6090
5793
|
`;
|
|
6091
|
-
var ModalFoldout =
|
|
5794
|
+
var ModalFoldout = styled37.div`
|
|
6092
5795
|
background-color: ${(props) => props.theme.color.accent};
|
|
6093
5796
|
margin: ${size(-3)};
|
|
6094
5797
|
margin-top: ${size(3)};
|
|
6095
5798
|
padding: ${size(3)};
|
|
6096
5799
|
`;
|
|
6097
|
-
var ModalFoldoutBody =
|
|
5800
|
+
var ModalFoldoutBody = styled37.div``;
|
|
6098
5801
|
|
|
6099
5802
|
// src/components/Modal/index.tsx
|
|
6100
5803
|
var Modal = ({ id, title, onClose, children }) => {
|
|
6101
|
-
return /* @__PURE__ */
|
|
5804
|
+
return /* @__PURE__ */ React46.createElement(portal_default, {
|
|
6102
5805
|
id: id || portal_namespace_exports.DefaultPortal
|
|
6103
|
-
}, /* @__PURE__ */
|
|
5806
|
+
}, /* @__PURE__ */ React46.createElement(Wrapper20, {
|
|
6104
5807
|
onClick: (e) => e.stopPropagation()
|
|
6105
|
-
}, /* @__PURE__ */
|
|
5808
|
+
}, /* @__PURE__ */ React46.createElement(UiBlock3, {
|
|
6106
5809
|
onClick: onClose,
|
|
6107
5810
|
title: "St\xE4ng modal"
|
|
6108
|
-
}), /* @__PURE__ */
|
|
5811
|
+
}), /* @__PURE__ */ React46.createElement(Dialog, null, /* @__PURE__ */ React46.createElement(Content4, null, /* @__PURE__ */ React46.createElement(Header4, null, /* @__PURE__ */ React46.createElement(Heading5, null, /* @__PURE__ */ React46.createElement(H1, {
|
|
6109
5812
|
noMargin: true
|
|
6110
|
-
}, title)), /* @__PURE__ */
|
|
5813
|
+
}, title)), /* @__PURE__ */ React46.createElement(Close2, null, /* @__PURE__ */ React46.createElement(CloseBtn3, {
|
|
6111
5814
|
onClick: onClose,
|
|
6112
5815
|
title: "St\xE4ng modal"
|
|
6113
|
-
}, /* @__PURE__ */
|
|
5816
|
+
}, /* @__PURE__ */ React46.createElement(IconCancel, {
|
|
6114
5817
|
block: true
|
|
6115
|
-
})))), /* @__PURE__ */
|
|
5818
|
+
})))), /* @__PURE__ */ React46.createElement(Body4, null, children)))));
|
|
6116
5819
|
};
|
|
6117
5820
|
var Modal_default = Modal;
|
|
6118
5821
|
|
|
6119
5822
|
// src/components/Video/EmbededVideo.tsx
|
|
6120
5823
|
var GalleryEmbed = ({ src, index: index2 }) => {
|
|
6121
|
-
const [modal, setModal] =
|
|
5824
|
+
const [modal, setModal] = useState14();
|
|
6122
5825
|
const thumbnail = useThumbnail_default(src);
|
|
6123
5826
|
const onClick = (e) => {
|
|
6124
5827
|
e.stopPropagation();
|
|
@@ -6138,34 +5841,34 @@ var GalleryEmbed = ({ src, index: index2 }) => {
|
|
|
6138
5841
|
);
|
|
6139
5842
|
const customVideo = src.toLowerCase().endsWith(".mp4");
|
|
6140
5843
|
if (thumbnail?.length && !customVideo) {
|
|
6141
|
-
return /* @__PURE__ */
|
|
5844
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(ImageFull, {
|
|
6142
5845
|
onLoad,
|
|
6143
5846
|
src: thumbnail[0],
|
|
6144
5847
|
onError,
|
|
6145
5848
|
alt: `Bild ${index2 + 1}`
|
|
6146
|
-
}), /* @__PURE__ */
|
|
5849
|
+
}), /* @__PURE__ */ React47.createElement(MediaButton_default, {
|
|
6147
5850
|
text: "Spela video",
|
|
6148
5851
|
onClick
|
|
6149
|
-
}), modal && /* @__PURE__ */
|
|
5852
|
+
}), modal && /* @__PURE__ */ React47.createElement(Modal_default, {
|
|
6150
5853
|
title: "Video",
|
|
6151
5854
|
onClose: onCloseModal
|
|
6152
|
-
}, /* @__PURE__ */
|
|
5855
|
+
}, /* @__PURE__ */ React47.createElement(EmbeddedVideoLightbox_default, {
|
|
6153
5856
|
url: modal
|
|
6154
5857
|
})));
|
|
6155
5858
|
}
|
|
6156
5859
|
if (customVideo)
|
|
6157
|
-
return /* @__PURE__ */
|
|
5860
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(CustomPlayer_default, {
|
|
6158
5861
|
ratio: "66.66%",
|
|
6159
5862
|
isPreview: true,
|
|
6160
5863
|
controls: false,
|
|
6161
5864
|
url: src
|
|
6162
|
-
}), /* @__PURE__ */
|
|
5865
|
+
}), /* @__PURE__ */ React47.createElement(MediaButton_default, {
|
|
6163
5866
|
text: "Spela video",
|
|
6164
5867
|
onClick
|
|
6165
|
-
}), modal && /* @__PURE__ */
|
|
5868
|
+
}), modal && /* @__PURE__ */ React47.createElement(Modal_default, {
|
|
6166
5869
|
title: "Video",
|
|
6167
5870
|
onClose: onCloseModal
|
|
6168
|
-
}, /* @__PURE__ */
|
|
5871
|
+
}, /* @__PURE__ */ React47.createElement(EmbeddedVideoLightbox_default, {
|
|
6169
5872
|
url: modal
|
|
6170
5873
|
})));
|
|
6171
5874
|
return null;
|
|
@@ -6173,7 +5876,7 @@ var GalleryEmbed = ({ src, index: index2 }) => {
|
|
|
6173
5876
|
var EmbededVideo_default = GalleryEmbed;
|
|
6174
5877
|
|
|
6175
5878
|
// src/components/Video/QuickNavEmbeded.tsx
|
|
6176
|
-
import
|
|
5879
|
+
import React48, { useCallback as useCallback17 } from "react";
|
|
6177
5880
|
var QuickNavEmbeded = ({ src, index: index2 }) => {
|
|
6178
5881
|
const thumbnail = useThumbnail_default(src);
|
|
6179
5882
|
const onError = useCallback17(
|
|
@@ -6186,14 +5889,14 @@ var QuickNavEmbeded = ({ src, index: index2 }) => {
|
|
|
6186
5889
|
);
|
|
6187
5890
|
const customVideo = src?.toLowerCase().endsWith(".mp4");
|
|
6188
5891
|
if (thumbnail?.length && !customVideo)
|
|
6189
|
-
return /* @__PURE__ */
|
|
5892
|
+
return /* @__PURE__ */ React48.createElement(QuickNavImg, {
|
|
6190
5893
|
onLoad,
|
|
6191
5894
|
src: thumbnail[0],
|
|
6192
5895
|
onError,
|
|
6193
5896
|
alt: `Bild ${index2 + 1}`
|
|
6194
5897
|
});
|
|
6195
5898
|
if (customVideo)
|
|
6196
|
-
return /* @__PURE__ */
|
|
5899
|
+
return /* @__PURE__ */ React48.createElement(CustomPlayer_default, {
|
|
6197
5900
|
key: index2,
|
|
6198
5901
|
url: src,
|
|
6199
5902
|
ratio: "66.66%"
|
|
@@ -6202,60 +5905,30 @@ var QuickNavEmbeded = ({ src, index: index2 }) => {
|
|
|
6202
5905
|
};
|
|
6203
5906
|
var QuickNavEmbeded_default = QuickNavEmbeded;
|
|
6204
5907
|
|
|
6205
|
-
// src/components/Sphere/Sphere.tsx
|
|
6206
|
-
import React51 from "react";
|
|
6207
|
-
var onMediaClick = (e, func) => {
|
|
6208
|
-
e.stopPropagation();
|
|
6209
|
-
e.preventDefault();
|
|
6210
|
-
func();
|
|
6211
|
-
};
|
|
6212
|
-
var Sphere = ({ url, preview, visible, onDisableNavigation, navigationDisabled }) => {
|
|
6213
|
-
if (!visible || !navigationDisabled && visible) {
|
|
6214
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(ImageFull, {
|
|
6215
|
-
src: preview,
|
|
6216
|
-
alt: "alt"
|
|
6217
|
-
}), /* @__PURE__ */ React51.createElement(MediaButton_default, {
|
|
6218
|
-
text: "Starta 360\xB0 interi\xF6rt",
|
|
6219
|
-
onClick: (e) => onMediaClick(e, onDisableNavigation)
|
|
6220
|
-
}));
|
|
6221
|
-
}
|
|
6222
|
-
if (navigationDisabled && visible) {
|
|
6223
|
-
return /* @__PURE__ */ React51.createElement(SphereViewer_default, {
|
|
6224
|
-
id: url,
|
|
6225
|
-
preview: url,
|
|
6226
|
-
src: url,
|
|
6227
|
-
autoLoad: true,
|
|
6228
|
-
onStart: onDisableNavigation
|
|
6229
|
-
});
|
|
6230
|
-
}
|
|
6231
|
-
return null;
|
|
6232
|
-
};
|
|
6233
|
-
var Sphere_default = Sphere;
|
|
6234
|
-
|
|
6235
5908
|
// src/components/ThreeSixty/ThreeSixty.tsx
|
|
6236
|
-
import
|
|
6237
|
-
var
|
|
5909
|
+
import React49 from "react";
|
|
5910
|
+
var onMediaClick = (e, func) => {
|
|
6238
5911
|
e.stopPropagation();
|
|
6239
5912
|
e.preventDefault();
|
|
6240
5913
|
func();
|
|
6241
5914
|
};
|
|
6242
5915
|
var ThreeSixty = ({ urls, visible, onDisableNavigation, navigationDisabled }) => {
|
|
6243
5916
|
if (!visible || !navigationDisabled && visible) {
|
|
6244
|
-
return /* @__PURE__ */
|
|
5917
|
+
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Image2, {
|
|
6245
5918
|
src: urls[0],
|
|
6246
5919
|
alt: "alt"
|
|
6247
|
-
}), /* @__PURE__ */
|
|
5920
|
+
}), /* @__PURE__ */ React49.createElement(MediaButton_default, {
|
|
6248
5921
|
text: "Starta 360\xB0 exteri\xF6rt",
|
|
6249
|
-
onClick: (e) =>
|
|
5922
|
+
onClick: (e) => onMediaClick(e, onDisableNavigation)
|
|
6250
5923
|
}));
|
|
6251
5924
|
}
|
|
6252
5925
|
if (navigationDisabled && visible) {
|
|
6253
|
-
return /* @__PURE__ */
|
|
5926
|
+
return /* @__PURE__ */ React49.createElement("div", {
|
|
6254
5927
|
onClick: (e) => {
|
|
6255
5928
|
e.stopPropagation();
|
|
6256
5929
|
e.preventDefault();
|
|
6257
5930
|
}
|
|
6258
|
-
}, /* @__PURE__ */
|
|
5931
|
+
}, /* @__PURE__ */ React49.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ React49.createElement(Image2, {
|
|
6259
5932
|
key: image,
|
|
6260
5933
|
src: image,
|
|
6261
5934
|
alt: `Bild ${i + 1}`
|
|
@@ -6278,9 +5951,9 @@ var Gallery = ({ media, placeholderImage }) => {
|
|
|
6278
5951
|
const slider = useRef3(null);
|
|
6279
5952
|
const quickNavRef = useRef3(null);
|
|
6280
5953
|
const isDragging = useRef3(false);
|
|
6281
|
-
const [index2, setIndex] =
|
|
6282
|
-
const [lightbox, setLightbox] =
|
|
6283
|
-
const [navigationDisabled, setNavigationDisabled] =
|
|
5954
|
+
const [index2, setIndex] = useState15(0);
|
|
5955
|
+
const [lightbox, setLightbox] = useState15(false);
|
|
5956
|
+
const [navigationDisabled, setNavigationDisabled] = useState15(false);
|
|
6284
5957
|
const beforeChange = useCallback18((_, newIndex) => {
|
|
6285
5958
|
const element = quickNavRef.current?.querySelectorAll("li")?.[newIndex];
|
|
6286
5959
|
if (element) {
|
|
@@ -6340,87 +6013,81 @@ var Gallery = ({ media, placeholderImage }) => {
|
|
|
6340
6013
|
() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE,
|
|
6341
6014
|
[placeholderImage]
|
|
6342
6015
|
);
|
|
6343
|
-
return /* @__PURE__ */
|
|
6016
|
+
return /* @__PURE__ */ React50.createElement(React50.Fragment, null, /* @__PURE__ */ React50.createElement(Wrapper17, null, /* @__PURE__ */ React50.createElement(Main, null, /* @__PURE__ */ React50.createElement(SliderWrapper, {
|
|
6344
6017
|
onMouseDown,
|
|
6345
6018
|
onMouseMove,
|
|
6346
6019
|
onClick
|
|
6347
|
-
}, /* @__PURE__ */
|
|
6020
|
+
}, /* @__PURE__ */ React50.createElement(Slider3, {
|
|
6348
6021
|
...sliderSettings,
|
|
6349
6022
|
swipe: !navigationDisabled,
|
|
6350
6023
|
touchMove: !navigationDisabled,
|
|
6351
6024
|
swipeToSlide: !navigationDisabled,
|
|
6352
6025
|
ref: slider,
|
|
6353
6026
|
beforeChange
|
|
6354
|
-
}, !!media?.length ? media.map((m, i) => /* @__PURE__ */
|
|
6027
|
+
}, !!media?.length ? media.filter((x) => x.type !== "sphere").map((m, i) => /* @__PURE__ */ React50.createElement(Item8, {
|
|
6355
6028
|
key: m.files[0].url || i
|
|
6356
|
-
}, m.type === "image" && /* @__PURE__ */
|
|
6029
|
+
}, m.type === "image" && /* @__PURE__ */ React50.createElement(Image2, {
|
|
6357
6030
|
src: m.files[0].formats.filter(notEmpty).find((x) => x.format === "1170x")?.url,
|
|
6358
6031
|
alt: `Bild ${i + 1}`
|
|
6359
|
-
}), m.type === "threesixty" && /* @__PURE__ */
|
|
6032
|
+
}), m.type === "threesixty" && /* @__PURE__ */ React50.createElement(ThreeSixty_default, {
|
|
6360
6033
|
urls: m.files.map((x) => x.url),
|
|
6361
6034
|
visible: i === index2,
|
|
6362
6035
|
onDisableNavigation,
|
|
6363
6036
|
navigationDisabled
|
|
6364
|
-
}), m.type === "embedded" && /* @__PURE__ */
|
|
6037
|
+
}), m.type === "embedded" && /* @__PURE__ */ React50.createElement(EmbededVideo_default, {
|
|
6365
6038
|
src: m.files[0].url,
|
|
6366
6039
|
index: i + 1
|
|
6367
|
-
})
|
|
6368
|
-
visible: i === index2,
|
|
6369
|
-
url: m.files[0].url,
|
|
6370
|
-
preview: m.files[0].url,
|
|
6371
|
-
onDisableNavigation,
|
|
6372
|
-
navigationDisabled
|
|
6373
|
-
}))) : /* @__PURE__ */ React53.createElement(Item8, {
|
|
6040
|
+
}))) : /* @__PURE__ */ React50.createElement(Item8, {
|
|
6374
6041
|
key: placeholder
|
|
6375
|
-
}, /* @__PURE__ */
|
|
6042
|
+
}, /* @__PURE__ */ React50.createElement(Image2, {
|
|
6376
6043
|
src: placeholder,
|
|
6377
6044
|
alt: `Bild 1`
|
|
6378
|
-
}))), navigationDisabled && mediaLength > 1 && /* @__PURE__ */
|
|
6045
|
+
}))), navigationDisabled && mediaLength > 1 && /* @__PURE__ */ React50.createElement(EnableNavigationButton, null, /* @__PURE__ */ React50.createElement(ButtonSecondary, {
|
|
6379
6046
|
onClick: onEnableNavigation,
|
|
6380
6047
|
title: "St\xE4ng"
|
|
6381
|
-
}, /* @__PURE__ */
|
|
6048
|
+
}, /* @__PURE__ */ React50.createElement(ButtonContent, null, "St\xE4ng")))), !navigationDisabled && mediaLength > 1 && /* @__PURE__ */ React50.createElement(React50.Fragment, null, /* @__PURE__ */ React50.createElement(ArrowLeft, {
|
|
6382
6049
|
onClick: prevImage,
|
|
6383
6050
|
title: "F\xF6reg\xE5ende bild"
|
|
6384
|
-
}, /* @__PURE__ */
|
|
6051
|
+
}, /* @__PURE__ */ React50.createElement(IconChevronLeft, {
|
|
6385
6052
|
block: true
|
|
6386
|
-
})), /* @__PURE__ */
|
|
6053
|
+
})), /* @__PURE__ */ React50.createElement(ArrowRight, {
|
|
6387
6054
|
onClick: nextImage,
|
|
6388
6055
|
title: "N\xE4sta bild"
|
|
6389
|
-
}, /* @__PURE__ */
|
|
6056
|
+
}, /* @__PURE__ */ React50.createElement(IconChevronRight, {
|
|
6390
6057
|
block: true
|
|
6391
|
-
})))), /* @__PURE__ */
|
|
6058
|
+
})))), /* @__PURE__ */ React50.createElement(Alt, null, /* @__PURE__ */ React50.createElement(QuickNav, {
|
|
6392
6059
|
ref: quickNavRef
|
|
6393
6060
|
}, !!media?.length ? media.map((m, i) => {
|
|
6394
6061
|
const src = m.files[0].formats.filter(notEmpty).find((x) => x.format === "225x150")?.url || m.files[0].url;
|
|
6395
|
-
return /* @__PURE__ */
|
|
6062
|
+
return /* @__PURE__ */ React50.createElement(QuickNavItem, {
|
|
6396
6063
|
key: src || i,
|
|
6397
6064
|
active: index2 === i
|
|
6398
|
-
}, /* @__PURE__ */
|
|
6065
|
+
}, /* @__PURE__ */ React50.createElement(QuickNavBtn, {
|
|
6399
6066
|
onClick: () => goTo(i),
|
|
6400
6067
|
title: `G\xE5 till bild ${i + 1}`
|
|
6401
|
-
}, m.type === "image" && /* @__PURE__ */
|
|
6068
|
+
}, m.type === "image" && /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6402
6069
|
src,
|
|
6403
6070
|
alt: `Bild ${i + 1}`
|
|
6404
|
-
}), m.type === "threesixty" && /* @__PURE__ */
|
|
6071
|
+
}), m.type === "threesixty" && /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6405
6072
|
src,
|
|
6406
6073
|
alt: `Bild ${i + 1}`
|
|
6407
|
-
}), m.type === "embedded" && /* @__PURE__ */
|
|
6074
|
+
}), m.type === "embedded" && /* @__PURE__ */ React50.createElement(QuickNavEmbeded_default, {
|
|
6408
6075
|
src,
|
|
6409
6076
|
index: i
|
|
6410
|
-
}), m.type === "sphere" && /* @__PURE__ */
|
|
6077
|
+
}), m.type === "sphere" && /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6411
6078
|
src: m.files[0].url,
|
|
6412
6079
|
alt: `Bild ${i + 1}`
|
|
6413
6080
|
})));
|
|
6414
|
-
}) : /* @__PURE__ */
|
|
6081
|
+
}) : /* @__PURE__ */ React50.createElement(QuickNavItem, {
|
|
6415
6082
|
key: placeholder,
|
|
6416
6083
|
active: true
|
|
6417
|
-
}, /* @__PURE__ */
|
|
6084
|
+
}, /* @__PURE__ */ React50.createElement(QuickNavBtn, {
|
|
6418
6085
|
onClick: () => goTo(0),
|
|
6419
6086
|
title: `G\xE5 till bild 0`
|
|
6420
|
-
}, /* @__PURE__ */
|
|
6087
|
+
}, /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6421
6088
|
src: placeholder,
|
|
6422
6089
|
alt: `Bild 1`
|
|
6423
|
-
})))))), lightbox && !!media?.length && /* @__PURE__ */
|
|
6090
|
+
})))))), lightbox && !!media?.length && /* @__PURE__ */ React50.createElement(Lightbox_default, {
|
|
6424
6091
|
media,
|
|
6425
6092
|
index: index2,
|
|
6426
6093
|
onClose: onToggleLightbox
|
|
@@ -6429,8 +6096,8 @@ var Gallery = ({ media, placeholderImage }) => {
|
|
|
6429
6096
|
var Gallery_default = Gallery;
|
|
6430
6097
|
|
|
6431
6098
|
// src/components/ProductPage/index.tsx
|
|
6432
|
-
import
|
|
6433
|
-
var ProductPage =
|
|
6099
|
+
import styled38 from "styled-components";
|
|
6100
|
+
var ProductPage = styled38.div`
|
|
6434
6101
|
display: flex;
|
|
6435
6102
|
flex-direction: column;
|
|
6436
6103
|
|
|
@@ -6438,7 +6105,7 @@ var ProductPage = styled39.div`
|
|
|
6438
6105
|
flex-direction: row;
|
|
6439
6106
|
}
|
|
6440
6107
|
`;
|
|
6441
|
-
var ProductPageAside =
|
|
6108
|
+
var ProductPageAside = styled38.div`
|
|
6442
6109
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
6443
6110
|
display: contents;
|
|
6444
6111
|
}
|
|
@@ -6449,7 +6116,7 @@ var ProductPageAside = styled39.div`
|
|
|
6449
6116
|
padding-right: ${size(2)};
|
|
6450
6117
|
}
|
|
6451
6118
|
`;
|
|
6452
|
-
var ProductPageMain =
|
|
6119
|
+
var ProductPageMain = styled38.div`
|
|
6453
6120
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
6454
6121
|
display: contents;
|
|
6455
6122
|
}
|
|
@@ -6460,7 +6127,7 @@ var ProductPageMain = styled39.div`
|
|
|
6460
6127
|
padding-left: ${size(2)};
|
|
6461
6128
|
}
|
|
6462
6129
|
`;
|
|
6463
|
-
var ProductPageAsideSection =
|
|
6130
|
+
var ProductPageAsideSection = styled38.div`
|
|
6464
6131
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
6465
6132
|
order: ${(props) => props.mobileOrder};
|
|
6466
6133
|
|
|
@@ -6487,7 +6154,7 @@ var ProductPageAsideSection = styled39.div`
|
|
|
6487
6154
|
}
|
|
6488
6155
|
}
|
|
6489
6156
|
`;
|
|
6490
|
-
var ProductPageMainSection =
|
|
6157
|
+
var ProductPageMainSection = styled38.div`
|
|
6491
6158
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
6492
6159
|
order: 99;
|
|
6493
6160
|
padding: ${size(4)} 0;
|
|
@@ -6509,7 +6176,7 @@ var ProductPageMainSection = styled39.div`
|
|
|
6509
6176
|
}
|
|
6510
6177
|
}
|
|
6511
6178
|
`;
|
|
6512
|
-
var ProductPageContentLimit =
|
|
6179
|
+
var ProductPageContentLimit = styled38.div`
|
|
6513
6180
|
max-width: 420px;
|
|
6514
6181
|
`;
|
|
6515
6182
|
|
|
@@ -6759,17 +6426,17 @@ var useSearchItem = (id) => useQuery(SEARCH_ITEM_QUERY_default, {
|
|
|
6759
6426
|
var useSearchItem_default = useSearchItem;
|
|
6760
6427
|
|
|
6761
6428
|
// src/components/FinancialOptions/index.tsx
|
|
6762
|
-
import
|
|
6429
|
+
import React59, { Fragment } from "react";
|
|
6763
6430
|
|
|
6764
6431
|
// src/components/FinancialOptions/leasing.tsx
|
|
6765
|
-
import
|
|
6432
|
+
import React53, { useState as useState16, useCallback as useCallback19 } from "react";
|
|
6766
6433
|
|
|
6767
6434
|
// src/components/OptionBox/index.tsx
|
|
6768
|
-
import * as
|
|
6435
|
+
import * as React51 from "react";
|
|
6769
6436
|
|
|
6770
6437
|
// src/components/OptionBox/wrapper.tsx
|
|
6771
|
-
import
|
|
6772
|
-
var
|
|
6438
|
+
import styled39 from "styled-components";
|
|
6439
|
+
var Wrapper21 = styled39.div`
|
|
6773
6440
|
display: flex;
|
|
6774
6441
|
align-items: center;
|
|
6775
6442
|
padding: ${size(1)};
|
|
@@ -6780,14 +6447,14 @@ var Wrapper22 = styled40.div`
|
|
|
6780
6447
|
margin-top: ${size(1)};
|
|
6781
6448
|
}
|
|
6782
6449
|
`;
|
|
6783
|
-
var Logo2 =
|
|
6450
|
+
var Logo2 = styled39.div`
|
|
6784
6451
|
position: relative;
|
|
6785
6452
|
flex-shrink: 0;
|
|
6786
6453
|
margin-right: ${size(1)};
|
|
6787
6454
|
width: ${size(9.5)};
|
|
6788
6455
|
height: ${size(6)};
|
|
6789
6456
|
`;
|
|
6790
|
-
var LogoImg =
|
|
6457
|
+
var LogoImg = styled39.img`
|
|
6791
6458
|
display: block;
|
|
6792
6459
|
position: absolute;
|
|
6793
6460
|
left: 0;
|
|
@@ -6798,17 +6465,17 @@ var LogoImg = styled40.img`
|
|
|
6798
6465
|
max-width: 100%;
|
|
6799
6466
|
max-height: 100%;
|
|
6800
6467
|
`;
|
|
6801
|
-
var Content5 =
|
|
6468
|
+
var Content5 = styled39.div`
|
|
6802
6469
|
flex: 1 1 auto;
|
|
6803
6470
|
text-align: right;
|
|
6804
6471
|
line-height: 1.4;
|
|
6805
6472
|
`;
|
|
6806
|
-
var OptionBoxHeading =
|
|
6473
|
+
var OptionBoxHeading = styled39.div.attrs(() => ({
|
|
6807
6474
|
className: "wayke__theme wayke__font--bold"
|
|
6808
6475
|
}))`
|
|
6809
6476
|
font-size: 1rem;
|
|
6810
6477
|
`;
|
|
6811
|
-
var OptionBoxContent =
|
|
6478
|
+
var OptionBoxContent = styled39.div`
|
|
6812
6479
|
margin-top: ${size(0.5)};
|
|
6813
6480
|
font-size: 0.875rem;
|
|
6814
6481
|
|
|
@@ -6818,24 +6485,24 @@ var OptionBoxContent = styled40.div`
|
|
|
6818
6485
|
`;
|
|
6819
6486
|
|
|
6820
6487
|
// src/components/OptionBox/index.tsx
|
|
6821
|
-
var OptionBox = ({ logo, logo2x, logoAlt, children }) => /* @__PURE__ */
|
|
6488
|
+
var OptionBox = ({ logo, logo2x, logoAlt, children }) => /* @__PURE__ */ React51.createElement(Wrapper21, null, logo && /* @__PURE__ */ React51.createElement(Logo2, null, /* @__PURE__ */ React51.createElement(LogoImg, {
|
|
6822
6489
|
src: logo,
|
|
6823
6490
|
srcSet: logo2x,
|
|
6824
6491
|
alt: logoAlt
|
|
6825
|
-
})), /* @__PURE__ */
|
|
6492
|
+
})), /* @__PURE__ */ React51.createElement(Content5, null, children));
|
|
6826
6493
|
var OptionBox_default = OptionBox;
|
|
6827
6494
|
|
|
6828
6495
|
// src/components/DataList/index.tsx
|
|
6829
|
-
import
|
|
6496
|
+
import React52 from "react";
|
|
6830
6497
|
|
|
6831
6498
|
// src/components/DataList/wrapper.tsx
|
|
6832
|
-
import
|
|
6833
|
-
var List8 =
|
|
6499
|
+
import styled40 from "styled-components";
|
|
6500
|
+
var List8 = styled40.ul`
|
|
6834
6501
|
list-style: none;
|
|
6835
6502
|
padding: 0;
|
|
6836
6503
|
margin: 0;
|
|
6837
6504
|
`;
|
|
6838
|
-
var Item10 =
|
|
6505
|
+
var Item10 = styled40.li`
|
|
6839
6506
|
display: flex;
|
|
6840
6507
|
align-items: flex-start;
|
|
6841
6508
|
|
|
@@ -6843,10 +6510,10 @@ var Item10 = styled41.li`
|
|
|
6843
6510
|
margin-top: ${size(1)};
|
|
6844
6511
|
}
|
|
6845
6512
|
`;
|
|
6846
|
-
var Label7 =
|
|
6513
|
+
var Label7 = styled40.div`
|
|
6847
6514
|
flex: 1 1 auto;
|
|
6848
6515
|
`;
|
|
6849
|
-
var Value2 =
|
|
6516
|
+
var Value2 = styled40.div.attrs(() => ({
|
|
6850
6517
|
className: "wayke__theme wayke__font--bold"
|
|
6851
6518
|
}))`
|
|
6852
6519
|
flex-shrink: 0;
|
|
@@ -6854,25 +6521,25 @@ var Value2 = styled41.div.attrs(() => ({
|
|
|
6854
6521
|
`;
|
|
6855
6522
|
|
|
6856
6523
|
// src/components/DataList/index.tsx
|
|
6857
|
-
var DataList = ({ items }) => /* @__PURE__ */
|
|
6524
|
+
var DataList = ({ items }) => /* @__PURE__ */ React52.createElement(List8, null, items.map((item) => /* @__PURE__ */ React52.createElement(Item10, {
|
|
6858
6525
|
key: item.label
|
|
6859
|
-
}, /* @__PURE__ */
|
|
6526
|
+
}, /* @__PURE__ */ React52.createElement(Label7, null, item.label), /* @__PURE__ */ React52.createElement(Value2, null, item.value))));
|
|
6860
6527
|
var DataList_default = DataList;
|
|
6861
6528
|
|
|
6862
6529
|
// src/components/FinancialOptions/leasing.tsx
|
|
6863
6530
|
var Leasing = ({ financialOption }) => {
|
|
6864
|
-
const [modal, setModal] =
|
|
6531
|
+
const [modal, setModal] = useState16(false);
|
|
6865
6532
|
const toggleModal = useCallback19(() => setModal(!modal), [modal]);
|
|
6866
6533
|
const { image, description, monthlyCost, duration, mileage } = financialOption;
|
|
6867
|
-
return /* @__PURE__ */
|
|
6534
|
+
return /* @__PURE__ */ React53.createElement(React53.Fragment, null, modal && /* @__PURE__ */ React53.createElement(Modal_default, {
|
|
6868
6535
|
title: "Privatleasing",
|
|
6869
6536
|
onClose: toggleModal
|
|
6870
|
-
}, image && /* @__PURE__ */
|
|
6537
|
+
}, image && /* @__PURE__ */ React53.createElement(Image3, {
|
|
6871
6538
|
src: image,
|
|
6872
6539
|
alt: "Privatleasing"
|
|
6873
|
-
}), description && /* @__PURE__ */
|
|
6540
|
+
}), description && /* @__PURE__ */ React53.createElement(Content_default, {
|
|
6874
6541
|
dangerouslySetInnerHTML: { __html: description }
|
|
6875
|
-
}), /* @__PURE__ */
|
|
6542
|
+
}), /* @__PURE__ */ React53.createElement(ModalFoldout, null, /* @__PURE__ */ React53.createElement(ModalFoldoutBody, null, /* @__PURE__ */ React53.createElement(DataList_default, {
|
|
6876
6543
|
items: [
|
|
6877
6544
|
{
|
|
6878
6545
|
label: "M\xE5nadskostnad",
|
|
@@ -6887,14 +6554,14 @@ var Leasing = ({ financialOption }) => {
|
|
|
6887
6554
|
value: `${numberSeparator(mileage?.current || 0)} mil/\xE5r`
|
|
6888
6555
|
}
|
|
6889
6556
|
]
|
|
6890
|
-
})))), /* @__PURE__ */
|
|
6557
|
+
})))), /* @__PURE__ */ React53.createElement(OptionBox_default, null, /* @__PURE__ */ React53.createElement(React53.Fragment, null, monthlyCost !== null && monthlyCost !== void 0 && /* @__PURE__ */ React53.createElement(OptionBoxHeading, null, `ca ${numberSeparator(monthlyCost)} kr/m\xE5n`)), /* @__PURE__ */ React53.createElement(OptionBoxContent, null, /* @__PURE__ */ React53.createElement("p", null, "Privatleasing", " ", mileage?.current && duration?.current && /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement(UtilityTextPrimary, null, numberSeparator(mileage?.current), " mil/\xE5r"), " ", "i ", /* @__PURE__ */ React53.createElement(UtilityTextPrimary, null, duration?.current, " m\xE5n"), ".", " ")), /* @__PURE__ */ React53.createElement("p", null, /* @__PURE__ */ React53.createElement(ButtonInline, {
|
|
6891
6558
|
onClick: toggleModal
|
|
6892
6559
|
}, "L\xE4s mer")))));
|
|
6893
6560
|
};
|
|
6894
6561
|
var leasing_default = Leasing;
|
|
6895
6562
|
|
|
6896
6563
|
// src/components/FinancialOptions/loan.tsx
|
|
6897
|
-
import
|
|
6564
|
+
import React58, { useState as useState19, useCallback as useCallback22 } from "react";
|
|
6898
6565
|
|
|
6899
6566
|
// src/hooks/useLoan.ts
|
|
6900
6567
|
import { useQuery as useQuery2 } from "@apollo/client";
|
|
@@ -6950,22 +6617,22 @@ var useLoanCalculation = (id, duration, downPayment, residual) => useQuery2(LOAN
|
|
|
6950
6617
|
var useLoan_default = useLoanCalculation;
|
|
6951
6618
|
|
|
6952
6619
|
// src/components/FinancialOptions/LoanModal.tsx
|
|
6953
|
-
import
|
|
6620
|
+
import React57, { useState as useState18, useCallback as useCallback21, useEffect as useEffect12 } from "react";
|
|
6954
6621
|
|
|
6955
6622
|
// src/components/ContentLogo/index.tsx
|
|
6956
|
-
import
|
|
6957
|
-
var ContentLogo =
|
|
6623
|
+
import styled41 from "styled-components";
|
|
6624
|
+
var ContentLogo = styled41.div`
|
|
6958
6625
|
${(props) => props.theme.breakpoint.Sm} {
|
|
6959
6626
|
display: flex;
|
|
6960
6627
|
align-items: flex-start;
|
|
6961
6628
|
}
|
|
6962
6629
|
`;
|
|
6963
|
-
var ContentLogoText =
|
|
6630
|
+
var ContentLogoText = styled41.div`
|
|
6964
6631
|
${(props) => props.theme.breakpoint.Sm} {
|
|
6965
6632
|
flex: 1 1 auto;
|
|
6966
6633
|
}
|
|
6967
6634
|
`;
|
|
6968
|
-
var ContentLogoMedia =
|
|
6635
|
+
var ContentLogoMedia = styled41.div`
|
|
6969
6636
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
6970
6637
|
margin-top: ${size(2)};
|
|
6971
6638
|
}
|
|
@@ -6977,23 +6644,23 @@ var ContentLogoMedia = styled42.div`
|
|
|
6977
6644
|
`;
|
|
6978
6645
|
|
|
6979
6646
|
// src/components/RangeSlider/SliderWithLabel.tsx
|
|
6980
|
-
import
|
|
6647
|
+
import React56, { useCallback as useCallback20, useEffect as useEffect11, useState as useState17 } from "react";
|
|
6981
6648
|
|
|
6982
6649
|
// src/components/RangeSliderLabel/index.tsx
|
|
6983
|
-
import
|
|
6650
|
+
import React54 from "react";
|
|
6984
6651
|
|
|
6985
6652
|
// src/components/RangeSliderLabel/wrapper.tsx
|
|
6986
|
-
import
|
|
6987
|
-
var
|
|
6653
|
+
import styled42, { css as css13 } from "styled-components";
|
|
6654
|
+
var Wrapper22 = styled42.div`
|
|
6988
6655
|
display: flex;
|
|
6989
6656
|
align-items: flex-end;
|
|
6990
6657
|
`;
|
|
6991
|
-
var Label8 =
|
|
6658
|
+
var Label8 = styled42.div.attrs(() => ({
|
|
6992
6659
|
className: "wayke__theme wayke__font--bold"
|
|
6993
6660
|
}))`
|
|
6994
6661
|
flex: 1 1 auto;
|
|
6995
6662
|
`;
|
|
6996
|
-
var Value3 =
|
|
6663
|
+
var Value3 = styled42.div.attrs(() => ({
|
|
6997
6664
|
className: "wayke__theme wayke__font--bold wayke__color--primary-text"
|
|
6998
6665
|
}))`
|
|
6999
6666
|
flex-shrink: 0;
|
|
@@ -7007,13 +6674,13 @@ var Value3 = styled43.div.attrs(() => ({
|
|
|
7007
6674
|
`;
|
|
7008
6675
|
|
|
7009
6676
|
// src/components/RangeSliderLabel/index.tsx
|
|
7010
|
-
var RangeSliderLabel = ({ label, value, highlight }) => /* @__PURE__ */
|
|
6677
|
+
var RangeSliderLabel = ({ label, value, highlight }) => /* @__PURE__ */ React54.createElement(Wrapper22, null, /* @__PURE__ */ React54.createElement(Label8, null, label), value && /* @__PURE__ */ React54.createElement(Value3, {
|
|
7011
6678
|
isHighlighted: highlight
|
|
7012
6679
|
}, value));
|
|
7013
6680
|
var RangeSliderLabel_default = RangeSliderLabel;
|
|
7014
6681
|
|
|
7015
6682
|
// src/components/RangeSlider/RangeSliderSimple.tsx
|
|
7016
|
-
import
|
|
6683
|
+
import React55 from "react";
|
|
7017
6684
|
import { Slider as Slider4, Rail as Rail2, Handles as Handles2, Tracks as Tracks2 } from "react-compound-slider";
|
|
7018
6685
|
var RangeSliderSimple = ({
|
|
7019
6686
|
loading,
|
|
@@ -7033,7 +6700,7 @@ var RangeSliderSimple = ({
|
|
|
7033
6700
|
if (steps.length < 2) {
|
|
7034
6701
|
return null;
|
|
7035
6702
|
}
|
|
7036
|
-
return /* @__PURE__ */
|
|
6703
|
+
return /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Slider, null, /* @__PURE__ */ React55.createElement(Slider4, {
|
|
7037
6704
|
disabled: loading,
|
|
7038
6705
|
mode: 1,
|
|
7039
6706
|
step,
|
|
@@ -7042,20 +6709,20 @@ var RangeSliderSimple = ({
|
|
|
7042
6709
|
onUpdate,
|
|
7043
6710
|
values,
|
|
7044
6711
|
rootStyle: { position: "relative" }
|
|
7045
|
-
}, /* @__PURE__ */
|
|
6712
|
+
}, /* @__PURE__ */ React55.createElement(Rail2, null, ({ getRailProps }) => /* @__PURE__ */ React55.createElement(Bar2, {
|
|
7046
6713
|
...getRailProps()
|
|
7047
|
-
})), /* @__PURE__ */
|
|
6714
|
+
})), /* @__PURE__ */ React55.createElement(Handles2, null, ({ handles, getHandleProps }) => /* @__PURE__ */ React55.createElement("div", {
|
|
7048
6715
|
className: "slider-handles"
|
|
7049
|
-
}, handles.map((handle) => /* @__PURE__ */
|
|
6716
|
+
}, handles.map((handle) => /* @__PURE__ */ React55.createElement(Handle2, {
|
|
7050
6717
|
key: handle.id,
|
|
7051
6718
|
handle,
|
|
7052
6719
|
domain,
|
|
7053
6720
|
getHandleProps
|
|
7054
|
-
})))), /* @__PURE__ */
|
|
6721
|
+
})))), /* @__PURE__ */ React55.createElement(Tracks2, {
|
|
7055
6722
|
right: false
|
|
7056
|
-
}, ({ tracks, getTrackProps }) => /* @__PURE__ */
|
|
6723
|
+
}, ({ tracks, getTrackProps }) => /* @__PURE__ */ React55.createElement("div", {
|
|
7057
6724
|
className: "slider-tracks"
|
|
7058
|
-
}, tracks.map(({ id, source, target }) => /* @__PURE__ */
|
|
6725
|
+
}, tracks.map(({ id, source, target }) => /* @__PURE__ */ React55.createElement(Track2, {
|
|
7059
6726
|
key: id,
|
|
7060
6727
|
source,
|
|
7061
6728
|
target,
|
|
@@ -7075,18 +6742,18 @@ var SliderWithLabel = ({
|
|
|
7075
6742
|
formatValues,
|
|
7076
6743
|
onChange
|
|
7077
6744
|
}) => {
|
|
7078
|
-
const [local, setLocal] =
|
|
6745
|
+
const [local, setLocal] = useState17(steps);
|
|
7079
6746
|
const onUpdate = useCallback20((nextValues) => {
|
|
7080
6747
|
setLocal([...nextValues]);
|
|
7081
6748
|
}, []);
|
|
7082
|
-
|
|
6749
|
+
useEffect11(() => {
|
|
7083
6750
|
if (!loading)
|
|
7084
6751
|
setLocal(void 0);
|
|
7085
6752
|
}, [loading]);
|
|
7086
|
-
return /* @__PURE__ */
|
|
6753
|
+
return /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(RangeSliderLabel_default, {
|
|
7087
6754
|
label,
|
|
7088
6755
|
value: `${numberSeparator(local?.[0] || values[0])}${unit ? ` ${unit}` : ""}`
|
|
7089
|
-
})), /* @__PURE__ */
|
|
6756
|
+
})), /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(RangeSliderSimple_default, {
|
|
7090
6757
|
loading,
|
|
7091
6758
|
values,
|
|
7092
6759
|
domain,
|
|
@@ -7111,22 +6778,22 @@ var stepGenerator = (step, max, steps = [], current) => {
|
|
|
7111
6778
|
return stepGenerator(step, max, steps, nextCurrent);
|
|
7112
6779
|
};
|
|
7113
6780
|
var LoanModal = ({ id, financialOption, onClose }) => {
|
|
7114
|
-
const [tmp, setTmp] =
|
|
7115
|
-
const [extend, setExtend] =
|
|
7116
|
-
const onToggleExtend =
|
|
6781
|
+
const [tmp, setTmp] = useState18();
|
|
6782
|
+
const [extend, setExtend] = React57.useState(false);
|
|
6783
|
+
const onToggleExtend = React57.useCallback(() => {
|
|
7117
6784
|
if (!extend) {
|
|
7118
6785
|
pubsub_default.publish("FinanceInterest");
|
|
7119
6786
|
}
|
|
7120
6787
|
setExtend(!extend);
|
|
7121
6788
|
}, [extend]);
|
|
7122
|
-
const [variables, setVariables] =
|
|
6789
|
+
const [variables, setVariables] = useState18({
|
|
7123
6790
|
duration: financialOption.duration?.current,
|
|
7124
6791
|
downPayment: financialOption.downPayment?.current,
|
|
7125
6792
|
residual: financialOption.residual?.current
|
|
7126
6793
|
});
|
|
7127
6794
|
const { duration, downPayment, residual } = variables;
|
|
7128
6795
|
const { loading, data } = useLoan_default(id, duration, downPayment, residual);
|
|
7129
|
-
|
|
6796
|
+
useEffect12(() => {
|
|
7130
6797
|
if (data) {
|
|
7131
6798
|
setTmp(data);
|
|
7132
6799
|
setVariables({
|
|
@@ -7175,14 +6842,14 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7175
6842
|
);
|
|
7176
6843
|
const interestText = ((loan?.interest || 0) * 100).toFixed(2);
|
|
7177
6844
|
const effectiveInterestText = ((loan?.effectiveInterest || 0) * 100).toFixed(2);
|
|
7178
|
-
return /* @__PURE__ */
|
|
6845
|
+
return /* @__PURE__ */ React57.createElement(Modal_default, {
|
|
7179
6846
|
title: "L\xE5nealternativ",
|
|
7180
6847
|
onClose
|
|
7181
|
-
}, /* @__PURE__ */
|
|
6848
|
+
}, /* @__PURE__ */ React57.createElement(Repeat, null, /* @__PURE__ */ React57.createElement(ContentLogo, null, financialOption?.description && /* @__PURE__ */ React57.createElement(ContentLogoText, null, /* @__PURE__ */ React57.createElement(Content_default, null, /* @__PURE__ */ React57.createElement("p", null, financialOption.description))), financialOption?.image && /* @__PURE__ */ React57.createElement(ContentLogoMedia, null, /* @__PURE__ */ React57.createElement(LogoBox_default, {
|
|
7182
6849
|
logo: financialOption.image,
|
|
7183
6850
|
alt: financialOption.name || "Logotyp",
|
|
7184
6851
|
wide: true
|
|
7185
|
-
})))), /* @__PURE__ */
|
|
6852
|
+
})))), /* @__PURE__ */ React57.createElement(Repeat, null, /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(SliderWithLabel_default, {
|
|
7186
6853
|
label: "Kontantinsatts",
|
|
7187
6854
|
values: [downPaymentCurrent],
|
|
7188
6855
|
domain: [downPaymentMin, downPaymentMax],
|
|
@@ -7191,7 +6858,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7191
6858
|
formatValues: true,
|
|
7192
6859
|
loading,
|
|
7193
6860
|
onChange: onDownPaymentChange
|
|
7194
|
-
})), /* @__PURE__ */
|
|
6861
|
+
})), /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(SliderWithLabel_default, {
|
|
7195
6862
|
label: "Avbetalning",
|
|
7196
6863
|
values: [durationCurrent],
|
|
7197
6864
|
domain: [durationMin, durationMax],
|
|
@@ -7199,7 +6866,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7199
6866
|
unit: "m\xE5n",
|
|
7200
6867
|
loading,
|
|
7201
6868
|
onChange: onDurationChange
|
|
7202
|
-
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */
|
|
6869
|
+
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(SliderWithLabel_default, {
|
|
7203
6870
|
label: "Restskuld",
|
|
7204
6871
|
values: [residualCurrent],
|
|
7205
6872
|
domain: [residualMin, residualMax],
|
|
@@ -7207,12 +6874,12 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7207
6874
|
unit: "%",
|
|
7208
6875
|
loading,
|
|
7209
6876
|
onChange: onResidualChange
|
|
7210
|
-
})), /* @__PURE__ */
|
|
6877
|
+
})), /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(RepeatTiny, null, /* @__PURE__ */ React57.createElement(Content_default, {
|
|
7211
6878
|
small: true
|
|
7212
|
-
}, /* @__PURE__ */
|
|
6879
|
+
}, /* @__PURE__ */ React57.createElement("p", null, `*Ber\xE4knat p\xE5 ${interestText} % r\xE4nta (effektivt ${effectiveInterestText} %)${loan?.mileage !== null ? `och en \xE5rlig k\xF6rstr\xE4cka om ${loan?.mileage} mil.` : ""}`)))), /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(ButtonClear, {
|
|
7213
6880
|
onClick: onToggleExtend,
|
|
7214
6881
|
title: extend ? "Visa mindre information" : "Visa mer information"
|
|
7215
|
-
}, /* @__PURE__ */
|
|
6882
|
+
}, /* @__PURE__ */ React57.createElement(ButtonContent, null, extend ? "Mindre information" : "Mer information"))), /* @__PURE__ */ React57.createElement(React57.Fragment, null, extend && /* @__PURE__ */ React57.createElement(ModalFoldout, null, /* @__PURE__ */ React57.createElement(ModalFoldoutBody, null, /* @__PURE__ */ React57.createElement(DataList_default, {
|
|
7216
6883
|
items: [
|
|
7217
6884
|
{
|
|
7218
6885
|
label: "R\xE4nta",
|
|
@@ -7241,7 +6908,7 @@ var LoanModal_default = LoanModal;
|
|
|
7241
6908
|
|
|
7242
6909
|
// src/components/FinancialOptions/loan.tsx
|
|
7243
6910
|
var Loan = ({ id, financialOption }) => {
|
|
7244
|
-
const [modal, setModal] =
|
|
6911
|
+
const [modal, setModal] = useState19(false);
|
|
7245
6912
|
const toggleModal = useCallback22(() => setModal(!modal), [modal]);
|
|
7246
6913
|
const { data } = useLoan_default(
|
|
7247
6914
|
id,
|
|
@@ -7254,100 +6921,100 @@ var Loan = ({ id, financialOption }) => {
|
|
|
7254
6921
|
const monthlyCost = data?.loan?.monthlyCost;
|
|
7255
6922
|
const logo = financialOption?.logotype || "https://placehold.it/67x10";
|
|
7256
6923
|
if (financialOption.loanAmount === void 0 || financialOption.loanAmount === null || interest === void 0 || duration === void 0 || monthlyCost === void 0 || interest === null || duration === null || monthlyCost === null) {
|
|
7257
|
-
return /* @__PURE__ */
|
|
6924
|
+
return /* @__PURE__ */ React58.createElement(OptionBox_default, {
|
|
7258
6925
|
logo,
|
|
7259
6926
|
logoAlt: "Logotyp"
|
|
7260
|
-
}, /* @__PURE__ */
|
|
6927
|
+
}, /* @__PURE__ */ React58.createElement(OptionBoxHeading, null, "Laddar..."), /* @__PURE__ */ React58.createElement(OptionBoxContent, null, /* @__PURE__ */ React58.createElement("p", null, "Laddar...")));
|
|
7261
6928
|
}
|
|
7262
|
-
return /* @__PURE__ */
|
|
6929
|
+
return /* @__PURE__ */ React58.createElement(React58.Fragment, null, modal && /* @__PURE__ */ React58.createElement(LoanModal_default, {
|
|
7263
6930
|
id,
|
|
7264
6931
|
financialOption,
|
|
7265
6932
|
onClose: toggleModal
|
|
7266
|
-
}), /* @__PURE__ */
|
|
6933
|
+
}), /* @__PURE__ */ React58.createElement(OptionBox_default, {
|
|
7267
6934
|
logo,
|
|
7268
6935
|
logoAlt: "Logotyp"
|
|
7269
|
-
}, /* @__PURE__ */
|
|
6936
|
+
}, /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(OptionBoxHeading, null, `${numberSeparator(monthlyCost)} kr/m\xE5n*`), /* @__PURE__ */ React58.createElement(OptionBoxContent, null, /* @__PURE__ */ React58.createElement("p", null, "Delbetala", " ", financialOption.loanAmount && duration && /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(UtilityTextPrimary, null, numberSeparator(financialOption.loanAmount), " kr"), " ", "i ", /* @__PURE__ */ React58.createElement(UtilityTextPrimary, null, duration, " m\xE5n"), ".")), /* @__PURE__ */ React58.createElement("p", null, `*Ber\xE4knat p\xE5 ${(interest * 100).toFixed(2)}% r\xE4nta. `, /* @__PURE__ */ React58.createElement(ButtonInline, {
|
|
7270
6937
|
onClick: toggleModal
|
|
7271
6938
|
}, "L\xE4s mer"))))));
|
|
7272
6939
|
};
|
|
7273
6940
|
var loan_default = Loan;
|
|
7274
6941
|
|
|
7275
6942
|
// src/components/FinancialOptions/index.tsx
|
|
7276
|
-
var FinancialOptions = ({ id, financialOptions }) => /* @__PURE__ */
|
|
6943
|
+
var FinancialOptions = ({ id, financialOptions }) => /* @__PURE__ */ React59.createElement(Repeat, null, /* @__PURE__ */ React59.createElement(RepeatTiny, null, /* @__PURE__ */ React59.createElement(VisualHeading, null, "Andra finansieringsalternativ")), /* @__PURE__ */ React59.createElement(RepeatTiny, null, financialOptions.map((financialOption, index2) => /* @__PURE__ */ React59.createElement(Fragment, {
|
|
7277
6944
|
key: index2
|
|
7278
|
-
}, financialOption.type === "leasing" && /* @__PURE__ */
|
|
6945
|
+
}, financialOption.type === "leasing" && /* @__PURE__ */ React59.createElement(leasing_default, {
|
|
7279
6946
|
financialOption
|
|
7280
|
-
}), financialOption.type === "loan" && /* @__PURE__ */
|
|
6947
|
+
}), financialOption.type === "loan" && /* @__PURE__ */ React59.createElement(loan_default, {
|
|
7281
6948
|
id,
|
|
7282
6949
|
financialOption
|
|
7283
6950
|
})))));
|
|
7284
6951
|
var FinancialOptions_default = FinancialOptions;
|
|
7285
6952
|
|
|
7286
6953
|
// src/components/InsuranceOptions/index.tsx
|
|
7287
|
-
import
|
|
6954
|
+
import React71 from "react";
|
|
7288
6955
|
|
|
7289
6956
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
7290
|
-
import
|
|
6957
|
+
import React68, { useState as useState22, useCallback as useCallback25 } from "react";
|
|
7291
6958
|
|
|
7292
6959
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
7293
|
-
import
|
|
6960
|
+
import React67, { useState as useState21, useCallback as useCallback24 } from "react";
|
|
7294
6961
|
|
|
7295
6962
|
// src/components/DetailBox/index.tsx
|
|
7296
|
-
import
|
|
6963
|
+
import React60 from "react";
|
|
7297
6964
|
|
|
7298
6965
|
// src/components/DetailBox/wrapper.tsx
|
|
7299
|
-
import
|
|
7300
|
-
var
|
|
6966
|
+
import styled43 from "styled-components";
|
|
6967
|
+
var Wrapper23 = styled43.article`
|
|
7301
6968
|
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
|
|
7302
6969
|
border-radius: 3px;
|
|
7303
6970
|
overflow: hidden;
|
|
7304
6971
|
`;
|
|
7305
|
-
var Main2 =
|
|
6972
|
+
var Main2 = styled43.div`
|
|
7306
6973
|
padding: ${size(2.5)};
|
|
7307
6974
|
`;
|
|
7308
|
-
var Heading6 =
|
|
6975
|
+
var Heading6 = styled43(H2).attrs(() => ({
|
|
7309
6976
|
as: "h1"
|
|
7310
6977
|
}))`
|
|
7311
6978
|
margin-bottom: 0;
|
|
7312
6979
|
`;
|
|
7313
|
-
var Description3 =
|
|
6980
|
+
var Description3 = styled43.div`
|
|
7314
6981
|
margin-top: ${size(1)};
|
|
7315
6982
|
`;
|
|
7316
|
-
var Footer3 =
|
|
6983
|
+
var Footer3 = styled43.div`
|
|
7317
6984
|
margin-top: ${size(1)};
|
|
7318
6985
|
color: red;
|
|
7319
6986
|
`;
|
|
7320
|
-
var Foldout =
|
|
6987
|
+
var Foldout = styled43.div`
|
|
7321
6988
|
background-color: ${(props) => props.theme.color.accent};
|
|
7322
6989
|
padding: ${size(2.5)};
|
|
7323
6990
|
`;
|
|
7324
6991
|
|
|
7325
6992
|
// src/components/DetailBox/index.tsx
|
|
7326
6993
|
var DetailBox = ({ heading, description, children }) => {
|
|
7327
|
-
const [extend, setExtend] =
|
|
7328
|
-
const onToggleExtend =
|
|
6994
|
+
const [extend, setExtend] = React60.useState(false);
|
|
6995
|
+
const onToggleExtend = React60.useCallback(() => setExtend(!extend), [extend]);
|
|
7329
6996
|
const extendBtnText = extend ? "Mindre information" : "Mer information";
|
|
7330
|
-
return /* @__PURE__ */
|
|
6997
|
+
return /* @__PURE__ */ React60.createElement(Wrapper23, null, /* @__PURE__ */ React60.createElement(Main2, null, /* @__PURE__ */ React60.createElement(Heading6, null, heading), description && /* @__PURE__ */ React60.createElement(Description3, null, description), /* @__PURE__ */ React60.createElement(Footer3, null, /* @__PURE__ */ React60.createElement(ButtonClear, {
|
|
7331
6998
|
onClick: onToggleExtend
|
|
7332
|
-
}, /* @__PURE__ */
|
|
6999
|
+
}, /* @__PURE__ */ React60.createElement(ButtonContent, null, extendBtnText)))), extend && /* @__PURE__ */ React60.createElement(Foldout, null, children));
|
|
7333
7000
|
};
|
|
7334
7001
|
var DetailBox_default = DetailBox;
|
|
7335
7002
|
|
|
7336
7003
|
// src/components/ExtendInfo/index.tsx
|
|
7337
|
-
import
|
|
7004
|
+
import React61, { useState as useState20, useCallback as useCallback23 } from "react";
|
|
7338
7005
|
|
|
7339
7006
|
// src/components/ExtendInfo/wrapper.tsx
|
|
7340
|
-
import
|
|
7341
|
-
var
|
|
7342
|
-
var Header5 =
|
|
7007
|
+
import styled44 from "styled-components";
|
|
7008
|
+
var Wrapper24 = styled44.div``;
|
|
7009
|
+
var Header5 = styled44.div`
|
|
7343
7010
|
display: flex;
|
|
7344
7011
|
align-items: center;
|
|
7345
7012
|
`;
|
|
7346
|
-
var Title =
|
|
7347
|
-
var Info2 =
|
|
7013
|
+
var Title = styled44.div``;
|
|
7014
|
+
var Info2 = styled44.div`
|
|
7348
7015
|
margin-left: ${size(1)};
|
|
7349
7016
|
`;
|
|
7350
|
-
var InfoBtn =
|
|
7017
|
+
var InfoBtn = styled44(ButtonReset).attrs(() => ({
|
|
7351
7018
|
className: "wayke__theme wayke__color--primary-text"
|
|
7352
7019
|
}))`
|
|
7353
7020
|
position: relative;
|
|
@@ -7385,7 +7052,7 @@ var InfoBtn = styled45(ButtonReset).attrs(() => ({
|
|
|
7385
7052
|
transform: scale(0.95);
|
|
7386
7053
|
}
|
|
7387
7054
|
`;
|
|
7388
|
-
var Extend2 =
|
|
7055
|
+
var Extend2 = styled44.div`
|
|
7389
7056
|
padding-top: ${size(1)};
|
|
7390
7057
|
margin-top: ${size(1)};
|
|
7391
7058
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
@@ -7394,23 +7061,23 @@ var Extend2 = styled45.div`
|
|
|
7394
7061
|
|
|
7395
7062
|
// src/components/ExtendInfo/index.tsx
|
|
7396
7063
|
var ExtendInfo = ({ title, children }) => {
|
|
7397
|
-
const [extend, setExtend] =
|
|
7064
|
+
const [extend, setExtend] = useState20(false);
|
|
7398
7065
|
const onToggleExtend = useCallback23(() => setExtend(!extend), [extend]);
|
|
7399
|
-
return /* @__PURE__ */
|
|
7066
|
+
return /* @__PURE__ */ React61.createElement(Wrapper24, null, /* @__PURE__ */ React61.createElement(Header5, null, /* @__PURE__ */ React61.createElement(Title, null, title), children && /* @__PURE__ */ React61.createElement(Info2, null, /* @__PURE__ */ React61.createElement(InfoBtn, {
|
|
7400
7067
|
onClick: onToggleExtend,
|
|
7401
7068
|
title: "Mer information"
|
|
7402
|
-
}, /* @__PURE__ */
|
|
7069
|
+
}, /* @__PURE__ */ React61.createElement(IconInfo, {
|
|
7403
7070
|
block: true
|
|
7404
|
-
})))), extend && /* @__PURE__ */
|
|
7071
|
+
})))), extend && /* @__PURE__ */ React61.createElement(Extend2, null, children));
|
|
7405
7072
|
};
|
|
7406
7073
|
var ExtendInfo_default = ExtendInfo;
|
|
7407
7074
|
|
|
7408
7075
|
// src/components/InputLabel/index.tsx
|
|
7409
|
-
import
|
|
7076
|
+
import React62 from "react";
|
|
7410
7077
|
|
|
7411
7078
|
// src/components/InputLabel/wrapper.tsx
|
|
7412
|
-
import
|
|
7413
|
-
var
|
|
7079
|
+
import styled45 from "styled-components";
|
|
7080
|
+
var Wrapper25 = styled45.label.attrs(() => ({
|
|
7414
7081
|
className: "wayke__theme wayke__font--bold"
|
|
7415
7082
|
}))`
|
|
7416
7083
|
margin-bottom: ${size(0.5)};
|
|
@@ -7418,24 +7085,24 @@ var Wrapper26 = styled46.label.attrs(() => ({
|
|
|
7418
7085
|
`;
|
|
7419
7086
|
|
|
7420
7087
|
// src/components/InputLabel/index.tsx
|
|
7421
|
-
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */
|
|
7088
|
+
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */ React62.createElement(Wrapper25, {
|
|
7422
7089
|
htmlFor
|
|
7423
7090
|
}, children);
|
|
7424
7091
|
var InputLabel_default = InputLabel;
|
|
7425
7092
|
|
|
7426
7093
|
// src/components/InputText/index.tsx
|
|
7427
|
-
import
|
|
7094
|
+
import React63 from "react";
|
|
7428
7095
|
|
|
7429
7096
|
// src/components/InputText/wrapper.tsx
|
|
7430
|
-
import
|
|
7431
|
-
var
|
|
7097
|
+
import styled46 from "styled-components";
|
|
7098
|
+
var Wrapper26 = styled46.div`
|
|
7432
7099
|
position: relative;
|
|
7433
7100
|
display: flex;
|
|
7434
7101
|
align-items: stretch;
|
|
7435
7102
|
background-color: ${(props) => props.theme.color.accent};
|
|
7436
7103
|
border-radius: 3px;
|
|
7437
7104
|
`;
|
|
7438
|
-
var Input2 =
|
|
7105
|
+
var Input2 = styled46.input.attrs(() => ({
|
|
7439
7106
|
type: "text",
|
|
7440
7107
|
className: "wayke__theme wayke__font--regular"
|
|
7441
7108
|
}))`
|
|
@@ -7482,7 +7149,7 @@ var Input2 = styled47.input.attrs(() => ({
|
|
|
7482
7149
|
`;
|
|
7483
7150
|
|
|
7484
7151
|
// src/components/InputText/index.tsx
|
|
7485
|
-
var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @__PURE__ */
|
|
7152
|
+
var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @__PURE__ */ React63.createElement(Wrapper26, null, /* @__PURE__ */ React63.createElement(Input2, {
|
|
7486
7153
|
placeholder,
|
|
7487
7154
|
value,
|
|
7488
7155
|
id,
|
|
@@ -7493,12 +7160,12 @@ var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @
|
|
|
7493
7160
|
var InputText_default = InputText;
|
|
7494
7161
|
|
|
7495
7162
|
// src/components/InputCheckbox/index.tsx
|
|
7496
|
-
import * as
|
|
7163
|
+
import * as React65 from "react";
|
|
7497
7164
|
|
|
7498
7165
|
// src/components/InputCheckbox/wrapper.tsx
|
|
7499
|
-
import * as
|
|
7500
|
-
import
|
|
7501
|
-
var Label9 =
|
|
7166
|
+
import * as React64 from "react";
|
|
7167
|
+
import styled47, { css as css14 } from "styled-components";
|
|
7168
|
+
var Label9 = styled47.label.attrs(() => ({
|
|
7502
7169
|
className: "wayke__theme wayke__color--primary-text"
|
|
7503
7170
|
}))`
|
|
7504
7171
|
position: relative;
|
|
@@ -7528,7 +7195,7 @@ var Label9 = styled48.label.attrs(() => ({
|
|
|
7528
7195
|
margin-top: -2px;
|
|
7529
7196
|
}
|
|
7530
7197
|
`;
|
|
7531
|
-
var
|
|
7198
|
+
var Wrapper27 = styled47((props) => /* @__PURE__ */ React64.createElement("div", {
|
|
7532
7199
|
...props
|
|
7533
7200
|
})).attrs(({ type, checked }) => ({
|
|
7534
7201
|
role: type || "checkbox",
|
|
@@ -7544,7 +7211,7 @@ var Wrapper28 = styled48((props) => /* @__PURE__ */ React67.createElement("div",
|
|
|
7544
7211
|
}
|
|
7545
7212
|
`}
|
|
7546
7213
|
`;
|
|
7547
|
-
var Input3 =
|
|
7214
|
+
var Input3 = styled47((props) => /* @__PURE__ */ React64.createElement("input", {
|
|
7548
7215
|
...props,
|
|
7549
7216
|
className: `${props.checked ? "checked" : void 0} ${props.className}`
|
|
7550
7217
|
})).attrs(({ type, checked }) => ({
|
|
@@ -7575,23 +7242,23 @@ var Input3 = styled48((props) => /* @__PURE__ */ React67.createElement("input",
|
|
|
7575
7242
|
}
|
|
7576
7243
|
}
|
|
7577
7244
|
`;
|
|
7578
|
-
var LabelText =
|
|
7245
|
+
var LabelText = styled47.div`
|
|
7579
7246
|
color: ${(props) => props.theme.color.textDark};
|
|
7580
7247
|
`;
|
|
7581
7248
|
|
|
7582
7249
|
// src/components/InputSelect/index.tsx
|
|
7583
|
-
import
|
|
7250
|
+
import React66 from "react";
|
|
7584
7251
|
|
|
7585
7252
|
// src/components/InputSelect/wrapper.tsx
|
|
7586
|
-
import
|
|
7253
|
+
import styled48 from "styled-components";
|
|
7587
7254
|
var iconSize2 = "0.875rem";
|
|
7588
7255
|
var selectPadding = size(2);
|
|
7589
|
-
var
|
|
7256
|
+
var Wrapper28 = styled48.div`
|
|
7590
7257
|
position: relative;
|
|
7591
7258
|
background-color: ${(props) => props.theme.color.accent};
|
|
7592
7259
|
border-radius: 3px;
|
|
7593
7260
|
`;
|
|
7594
|
-
var Select2 =
|
|
7261
|
+
var Select2 = styled48.select.attrs(() => ({
|
|
7595
7262
|
className: "wayke__theme wayke__font--regular"
|
|
7596
7263
|
}))`
|
|
7597
7264
|
position: relative;
|
|
@@ -7625,10 +7292,10 @@ var Select2 = styled49.select.attrs(() => ({
|
|
|
7625
7292
|
border: 0;
|
|
7626
7293
|
}
|
|
7627
7294
|
`;
|
|
7628
|
-
var Option2 =
|
|
7295
|
+
var Option2 = styled48.option`
|
|
7629
7296
|
color: ${(props) => props.theme.color.textDark};
|
|
7630
7297
|
`;
|
|
7631
|
-
var Icon5 =
|
|
7298
|
+
var Icon5 = styled48.div`
|
|
7632
7299
|
position: absolute;
|
|
7633
7300
|
top: 50%;
|
|
7634
7301
|
right: ${selectPadding};
|
|
@@ -7637,29 +7304,29 @@ var Icon5 = styled49.div`
|
|
|
7637
7304
|
`;
|
|
7638
7305
|
|
|
7639
7306
|
// src/components/InputSelect/index.tsx
|
|
7640
|
-
var InputSelect = ({ value, options, onChange, unit, title }) => /* @__PURE__ */
|
|
7307
|
+
var InputSelect = ({ value, options, onChange, unit, title }) => /* @__PURE__ */ React66.createElement(Wrapper28, null, /* @__PURE__ */ React66.createElement(Select2, {
|
|
7641
7308
|
value,
|
|
7642
7309
|
onChange,
|
|
7643
7310
|
title,
|
|
7644
7311
|
"aria-label": title
|
|
7645
|
-
}, options?.map((option) => /* @__PURE__ */
|
|
7312
|
+
}, options?.map((option) => /* @__PURE__ */ React66.createElement(Option2, {
|
|
7646
7313
|
key: option.value,
|
|
7647
7314
|
value: option.value
|
|
7648
|
-
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */
|
|
7315
|
+
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */ React66.createElement(Icon5, null, /* @__PURE__ */ React66.createElement(IconChevronDown, {
|
|
7649
7316
|
block: true
|
|
7650
7317
|
})));
|
|
7651
7318
|
var InputSelect_default = InputSelect;
|
|
7652
7319
|
|
|
7653
7320
|
// src/components/InputGroup/index.tsx
|
|
7654
|
-
import
|
|
7655
|
-
var InputGroup =
|
|
7321
|
+
import styled49 from "styled-components";
|
|
7322
|
+
var InputGroup = styled49.div`
|
|
7656
7323
|
${(props) => props.theme.breakpoint.Sm} {
|
|
7657
7324
|
display: flex;
|
|
7658
7325
|
align-items: flex-start;
|
|
7659
7326
|
margin: ${size(-0.5)};
|
|
7660
7327
|
}
|
|
7661
7328
|
`;
|
|
7662
|
-
var InputGroupColumn =
|
|
7329
|
+
var InputGroupColumn = styled49.div`
|
|
7663
7330
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
7664
7331
|
& + & {
|
|
7665
7332
|
margin-top: ${size(1)};
|
|
@@ -7673,12 +7340,12 @@ var InputGroupColumn = styled50.div`
|
|
|
7673
7340
|
`;
|
|
7674
7341
|
|
|
7675
7342
|
// src/components/ColumnRow/index.tsx
|
|
7676
|
-
import
|
|
7677
|
-
var ColumnRow =
|
|
7343
|
+
import styled50 from "styled-components";
|
|
7344
|
+
var ColumnRow = styled50.div`
|
|
7678
7345
|
display: flex;
|
|
7679
7346
|
align-items: flex-start;
|
|
7680
7347
|
`;
|
|
7681
|
-
var ColumnRowItem =
|
|
7348
|
+
var ColumnRowItem = styled50.div`
|
|
7682
7349
|
flex: 1 1 auto;
|
|
7683
7350
|
|
|
7684
7351
|
:last-child:not(:only-child) {
|
|
@@ -7753,11 +7420,11 @@ var ssnIsValid = (s) => s ? /^\d{2,4}\d{2}\d{2}\-?\d{4}$/.test(s) : false;
|
|
|
7753
7420
|
|
|
7754
7421
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
7755
7422
|
var InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
|
|
7756
|
-
const [form, setForm] =
|
|
7423
|
+
const [form, setForm] = useState21({
|
|
7757
7424
|
ssn: "",
|
|
7758
7425
|
drivingDistance: "BETWEEN0AND1000" /* Between0And1000 */
|
|
7759
7426
|
});
|
|
7760
|
-
const [payload, setPayload] =
|
|
7427
|
+
const [payload, setPayload] = useState21();
|
|
7761
7428
|
const { loading, data, error } = useInsurance_default(
|
|
7762
7429
|
id,
|
|
7763
7430
|
branch?.id ? branch?.id : void 0,
|
|
@@ -7791,105 +7458,105 @@ var InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
|
|
|
7791
7458
|
{ value: "BETWEEN2000AND2500" /* Between2000And2500 */, displayName: "2000 - 2500" },
|
|
7792
7459
|
{ value: "OVER2500" /* Over2500 */, displayName: "2500+" }
|
|
7793
7460
|
];
|
|
7794
|
-
return /* @__PURE__ */
|
|
7461
|
+
return /* @__PURE__ */ React67.createElement(Modal_default, {
|
|
7795
7462
|
title: "F\xF6rs\xE4kring",
|
|
7796
7463
|
onClose
|
|
7797
|
-
}, (insuranceOptions?.description || insuranceOptions?.logotype) && /* @__PURE__ */
|
|
7464
|
+
}, (insuranceOptions?.description || insuranceOptions?.logotype) && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(ContentLogo, null, insuranceOptions.description && /* @__PURE__ */ React67.createElement(ContentLogoText, null, /* @__PURE__ */ React67.createElement(Content_default, null, /* @__PURE__ */ React67.createElement("p", null, insuranceOptions.description))), insuranceOptions.logotype && /* @__PURE__ */ React67.createElement(ContentLogoMedia, null, /* @__PURE__ */ React67.createElement(LogoBox_default, {
|
|
7798
7465
|
logo: insuranceOptions.logotype,
|
|
7799
7466
|
alt: insuranceOptions.name || "Logotyp",
|
|
7800
7467
|
wide: true
|
|
7801
|
-
})))), /* @__PURE__ */
|
|
7468
|
+
})))), /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(RepeatSmall, null, /* @__PURE__ */ React67.createElement(RepeatTiny, null, /* @__PURE__ */ React67.createElement(InputGroup, null, /* @__PURE__ */ React67.createElement(InputGroupColumn, null, /* @__PURE__ */ React67.createElement(InputLabel_default, {
|
|
7802
7469
|
htmlFor: "input-insurance-personalnumber"
|
|
7803
|
-
}, "Personnummer"), /* @__PURE__ */
|
|
7470
|
+
}, "Personnummer"), /* @__PURE__ */ React67.createElement(InputText_default, {
|
|
7804
7471
|
placeholder: "\xC5\xC5\xC5\xC5MMDD-XXXX",
|
|
7805
7472
|
label: "Personnummer",
|
|
7806
7473
|
value: form.ssn,
|
|
7807
7474
|
onChange: onChangeSsn,
|
|
7808
7475
|
onKeyDown,
|
|
7809
7476
|
id: "input-insurance-personalnumber"
|
|
7810
|
-
})), /* @__PURE__ */
|
|
7477
|
+
})), /* @__PURE__ */ React67.createElement(InputGroupColumn, null, /* @__PURE__ */ React67.createElement(InputLabel_default, {
|
|
7811
7478
|
htmlFor: "input-insurance-mileage"
|
|
7812
|
-
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */
|
|
7479
|
+
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */ React67.createElement(InputSelect_default, {
|
|
7813
7480
|
value: form.drivingDistance,
|
|
7814
7481
|
onChange: onChangeDrivingDistance,
|
|
7815
7482
|
options,
|
|
7816
7483
|
unit: "mil",
|
|
7817
7484
|
title: "Uppskattad k\xF6rstr\xE4cka per \xE5r"
|
|
7818
|
-
})))), /* @__PURE__ */
|
|
7485
|
+
})))), /* @__PURE__ */ React67.createElement(RepeatTiny, null, /* @__PURE__ */ React67.createElement(ButtonPrimary, {
|
|
7819
7486
|
fullWidth: true,
|
|
7820
7487
|
disabled: !ssnIsValid(form.ssn) || loading,
|
|
7821
7488
|
onClick: onShowInsurances
|
|
7822
|
-
}, /* @__PURE__ */
|
|
7489
|
+
}, /* @__PURE__ */ React67.createElement(ButtonContent, null, "Visa f\xF6rs\xE4kringar")))), false, /* @__PURE__ */ React67.createElement(RepeatSmall, null, /* @__PURE__ */ React67.createElement(Content_default, {
|
|
7823
7490
|
small: true
|
|
7824
|
-
}, /* @__PURE__ */
|
|
7491
|
+
}, /* @__PURE__ */ React67.createElement("p", null, "Spara personnummer p\xE5 denna dator f\xF6r att direkt visa f\xF6rs\xE4kringskostnaderna i Wayke. Personnumret lagras inte hos Wayke utan finns bara sparad i din webbl\xE4sare.")))), loading && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(Loader_default, null)), error && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(Snackbar_default, {
|
|
7825
7492
|
severity: "error",
|
|
7826
7493
|
icon: true,
|
|
7827
7494
|
heading: "Ett fel har intr\xE4ffat"
|
|
7828
|
-
}, "Kunde inte h\xE4mta f\xF6rs\xE4kringar. V\xE4nligen f\xF6rs\xF6k igen.")), /* @__PURE__ */
|
|
7495
|
+
}, "Kunde inte h\xE4mta f\xF6rs\xE4kringar. V\xE4nligen f\xF6rs\xF6k igen.")), /* @__PURE__ */ React67.createElement(React67.Fragment, null, data?.insurances && /* @__PURE__ */ React67.createElement(Repeat, null, data?.insurances.map((insurance) => /* @__PURE__ */ React67.createElement(Repeat, {
|
|
7829
7496
|
key: insurance.name
|
|
7830
|
-
}, /* @__PURE__ */
|
|
7497
|
+
}, /* @__PURE__ */ React67.createElement(DetailBox_default, {
|
|
7831
7498
|
heading: `${numberSeparator(insurance.price)} ${insurance.unit}`,
|
|
7832
7499
|
description: insurance.name
|
|
7833
|
-
}, /* @__PURE__ */
|
|
7500
|
+
}, /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(React67.Fragment, null, insurance.description && /* @__PURE__ */ React67.createElement(RepeatTiny, null, /* @__PURE__ */ React67.createElement(Content_default, null, /* @__PURE__ */ React67.createElement("p", null, insurance.description)))), /* @__PURE__ */ React67.createElement(React67.Fragment, null, insurance.url && /* @__PURE__ */ React67.createElement(RepeatTiny, null, /* @__PURE__ */ React67.createElement(ButtonInline, {
|
|
7834
7501
|
as: "a",
|
|
7835
7502
|
href: insurance.url || "",
|
|
7836
7503
|
target: "_blank",
|
|
7837
7504
|
rel: "noopener noreferrer nofollow"
|
|
7838
|
-
}, "F\xF6rk\xF6psinformation och villkor (\xF6ppnas i ny flik)")))), insurance.items && insurance.items.length > 0 && /* @__PURE__ */
|
|
7505
|
+
}, "F\xF6rk\xF6psinformation och villkor (\xF6ppnas i ny flik)")))), insurance.items && insurance.items.length > 0 && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(H4, null, "F\xF6rs\xE4kringen inneh\xE5ller"), insurance.items.map((item) => /* @__PURE__ */ React67.createElement(RepeatSmall, {
|
|
7839
7506
|
key: item.name || ""
|
|
7840
|
-
}, /* @__PURE__ */
|
|
7507
|
+
}, /* @__PURE__ */ React67.createElement(ExtendInfo_default, {
|
|
7841
7508
|
title: item.name || ""
|
|
7842
|
-
}, item.description)))), insurance.addons && insurance.addons.length > 0 && /* @__PURE__ */
|
|
7509
|
+
}, item.description)))), insurance.addons && insurance.addons.length > 0 && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(H4, null, "V\xE4lj till"), insurance.addons.map((addon) => /* @__PURE__ */ React67.createElement(RepeatSmall, {
|
|
7843
7510
|
key: addon.title || ""
|
|
7844
|
-
}, /* @__PURE__ */
|
|
7511
|
+
}, /* @__PURE__ */ React67.createElement(ColumnRow, null, /* @__PURE__ */ React67.createElement(ColumnRowItem, null, /* @__PURE__ */ React67.createElement(ExtendInfo_default, {
|
|
7845
7512
|
title: addon.title || ""
|
|
7846
|
-
}, addon.description)), /* @__PURE__ */
|
|
7513
|
+
}, addon.description)), /* @__PURE__ */ React67.createElement(ColumnRowItem, null, /* @__PURE__ */ React67.createElement(UtilityTextBold, null, "+", addon.price, " ", addon.unit))))))))))));
|
|
7847
7514
|
};
|
|
7848
7515
|
var InsuranceModal_default = InsuranceModal;
|
|
7849
7516
|
|
|
7850
7517
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
7851
7518
|
var Insurance = ({ id, branch, insuranceOptions }) => {
|
|
7852
|
-
const [modal, setModal] =
|
|
7519
|
+
const [modal, setModal] = useState22(false);
|
|
7853
7520
|
const toggleModal = useCallback25(() => setModal(!modal), [modal]);
|
|
7854
7521
|
if (!insuranceOptions.length) {
|
|
7855
7522
|
return null;
|
|
7856
7523
|
}
|
|
7857
|
-
return /* @__PURE__ */
|
|
7524
|
+
return /* @__PURE__ */ React68.createElement(React68.Fragment, null, modal && /* @__PURE__ */ React68.createElement(InsuranceModal_default, {
|
|
7858
7525
|
id,
|
|
7859
7526
|
branch,
|
|
7860
7527
|
onClose: toggleModal,
|
|
7861
7528
|
insuranceOptions: insuranceOptions[0]
|
|
7862
|
-
}), /* @__PURE__ */
|
|
7529
|
+
}), /* @__PURE__ */ React68.createElement(Repeat, null, /* @__PURE__ */ React68.createElement(RepeatTiny, null, /* @__PURE__ */ React68.createElement(VisualHeading, null, "V\xE4lj till f\xF6rs\xE4kring")), /* @__PURE__ */ React68.createElement(RepeatTiny, null, /* @__PURE__ */ React68.createElement(React68.Fragment, null, insuranceOptions.map((insuranceOption, index2) => /* @__PURE__ */ React68.createElement(OptionBox_default, {
|
|
7863
7530
|
key: `${insuranceOption.url}-${index2}`,
|
|
7864
7531
|
logo: insuranceOption.logotype || void 0,
|
|
7865
7532
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
7866
|
-
}, /* @__PURE__ */
|
|
7533
|
+
}, /* @__PURE__ */ React68.createElement(OptionBoxHeading, null, "F\xE5 prisf\xF6rslag"), /* @__PURE__ */ React68.createElement(OptionBoxContent, null, /* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(ButtonInline, {
|
|
7867
7534
|
onClick: toggleModal
|
|
7868
7535
|
}, "Mer information")))))))));
|
|
7869
7536
|
};
|
|
7870
7537
|
var Insurance_default = Insurance;
|
|
7871
7538
|
|
|
7872
7539
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
7873
|
-
import
|
|
7540
|
+
import React70, { useState as useState23, useCallback as useCallback26 } from "react";
|
|
7874
7541
|
import { marked as marked2 } from "marked";
|
|
7875
7542
|
|
|
7876
7543
|
// src/components/InsuranceOptions/InsuranceFreeModal.tsx
|
|
7877
|
-
import
|
|
7544
|
+
import React69 from "react";
|
|
7878
7545
|
import { marked } from "marked";
|
|
7879
7546
|
var InsuranceFreeModal = ({ onClose, insuranceOptions }) => {
|
|
7880
|
-
return /* @__PURE__ */
|
|
7547
|
+
return /* @__PURE__ */ React69.createElement(Modal_default, {
|
|
7881
7548
|
title: insuranceOptions?.insuranceHeader ?? "F\xF6rs\xE4kring",
|
|
7882
7549
|
onClose
|
|
7883
|
-
}, insuranceOptions?.longDescription && /* @__PURE__ */
|
|
7550
|
+
}, insuranceOptions?.longDescription && /* @__PURE__ */ React69.createElement(Repeat, null, /* @__PURE__ */ React69.createElement(Content_default, {
|
|
7884
7551
|
dangerouslySetInnerHTML: {
|
|
7885
7552
|
__html: marked(insuranceOptions.longDescription)
|
|
7886
7553
|
}
|
|
7887
|
-
})), insuranceOptions?.url && /* @__PURE__ */
|
|
7554
|
+
})), insuranceOptions?.url && /* @__PURE__ */ React69.createElement(Repeat, null, /* @__PURE__ */ React69.createElement(ButtonInline, {
|
|
7888
7555
|
as: "a",
|
|
7889
7556
|
href: insuranceOptions.url,
|
|
7890
7557
|
target: "_blank",
|
|
7891
7558
|
rel: "noopener noreferrer"
|
|
7892
|
-
}, "L\xE4s mer om f\xF6rs\xE4kringen (\xD6ppnas i ett nytt f\xF6nster)")), insuranceOptions?.logotype && /* @__PURE__ */
|
|
7559
|
+
}, "L\xE4s mer om f\xF6rs\xE4kringen (\xD6ppnas i ett nytt f\xF6nster)")), insuranceOptions?.logotype && /* @__PURE__ */ React69.createElement(Repeat, null, /* @__PURE__ */ React69.createElement(LogoBox_default, {
|
|
7893
7560
|
logo: insuranceOptions.logotype,
|
|
7894
7561
|
alt: insuranceOptions.name || "Logotyp",
|
|
7895
7562
|
wide: true
|
|
@@ -7899,23 +7566,23 @@ var InsuranceFreeModal_default = InsuranceFreeModal;
|
|
|
7899
7566
|
|
|
7900
7567
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
7901
7568
|
var Insurance2 = ({ insuranceOptions }) => {
|
|
7902
|
-
const [modal, setModal] =
|
|
7569
|
+
const [modal, setModal] = useState23(false);
|
|
7903
7570
|
const toggleModal = useCallback26(() => setModal(!modal), [modal]);
|
|
7904
7571
|
if (!insuranceOptions.length) {
|
|
7905
7572
|
return null;
|
|
7906
7573
|
}
|
|
7907
|
-
return /* @__PURE__ */
|
|
7574
|
+
return /* @__PURE__ */ React70.createElement(React70.Fragment, null, modal && /* @__PURE__ */ React70.createElement(InsuranceFreeModal_default, {
|
|
7908
7575
|
onClose: toggleModal,
|
|
7909
7576
|
insuranceOptions: insuranceOptions[0]
|
|
7910
|
-
}), /* @__PURE__ */
|
|
7577
|
+
}), /* @__PURE__ */ React70.createElement(Repeat, null, /* @__PURE__ */ React70.createElement(RepeatTiny, null, /* @__PURE__ */ React70.createElement(VisualHeading, null, insuranceOptions[0]?.insuranceHeader ?? "F\xF6rs\xE4kring")), /* @__PURE__ */ React70.createElement(RepeatTiny, null, /* @__PURE__ */ React70.createElement(React70.Fragment, null, insuranceOptions.map((insuranceOption, index2) => /* @__PURE__ */ React70.createElement(OptionBox_default, {
|
|
7911
7578
|
key: `${insuranceOption.url}-${index2}`,
|
|
7912
7579
|
logo: insuranceOption.logotype || void 0,
|
|
7913
7580
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
7914
|
-
}, insuranceOption.description && /* @__PURE__ */
|
|
7581
|
+
}, insuranceOption.description && /* @__PURE__ */ React70.createElement(Content_default, {
|
|
7915
7582
|
dangerouslySetInnerHTML: {
|
|
7916
7583
|
__html: marked2(insuranceOption.description)
|
|
7917
7584
|
}
|
|
7918
|
-
}), /* @__PURE__ */
|
|
7585
|
+
}), /* @__PURE__ */ React70.createElement(OptionBoxContent, null, /* @__PURE__ */ React70.createElement("p", null, /* @__PURE__ */ React70.createElement(ButtonInline, {
|
|
7919
7586
|
onClick: toggleModal
|
|
7920
7587
|
}, "Mer information")))))))));
|
|
7921
7588
|
};
|
|
@@ -7928,12 +7595,12 @@ var InsuranceOptions = ({ id, branch, insuranceOptions }) => {
|
|
|
7928
7595
|
}
|
|
7929
7596
|
if (insuranceOptions.length > 0) {
|
|
7930
7597
|
if (insuranceOptions[0].requiresDistance && insuranceOptions[0].requiresPersonalNumber)
|
|
7931
|
-
return /* @__PURE__ */
|
|
7598
|
+
return /* @__PURE__ */ React71.createElement(Insurance_default, {
|
|
7932
7599
|
id,
|
|
7933
7600
|
branch,
|
|
7934
7601
|
insuranceOptions
|
|
7935
7602
|
});
|
|
7936
|
-
return /* @__PURE__ */
|
|
7603
|
+
return /* @__PURE__ */ React71.createElement(InsuranceFree_default, {
|
|
7937
7604
|
insuranceOptions
|
|
7938
7605
|
});
|
|
7939
7606
|
}
|
|
@@ -7942,22 +7609,22 @@ var InsuranceOptions = ({ id, branch, insuranceOptions }) => {
|
|
|
7942
7609
|
var InsuranceOptions_default = InsuranceOptions;
|
|
7943
7610
|
|
|
7944
7611
|
// src/layouts/searchItem/ManufacturerPackagesOption.tsx
|
|
7945
|
-
import
|
|
7612
|
+
import React72 from "react";
|
|
7946
7613
|
import { marked as marked3 } from "marked";
|
|
7947
7614
|
var ManufacturerPackageOption = ({ packageOption }) => {
|
|
7948
7615
|
if (!packageOption) {
|
|
7949
7616
|
return null;
|
|
7950
7617
|
}
|
|
7951
|
-
return /* @__PURE__ */
|
|
7618
|
+
return /* @__PURE__ */ React72.createElement(ProductPageMainSection, null, /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(H2, {
|
|
7952
7619
|
noMargin: true
|
|
7953
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
7620
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(Content_default, {
|
|
7954
7621
|
dangerouslySetInnerHTML: { __html: marked3(packageOption.description) }
|
|
7955
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
7622
|
+
})), packageOption.link?.url && /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(ButtonInline, {
|
|
7956
7623
|
as: "a",
|
|
7957
7624
|
href: packageOption.link.url,
|
|
7958
7625
|
target: "_blank",
|
|
7959
7626
|
rel: "noopener noreferrer"
|
|
7960
|
-
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */
|
|
7627
|
+
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(LogoBox_default, {
|
|
7961
7628
|
logo: packageOption.image,
|
|
7962
7629
|
alt: "Logotyp",
|
|
7963
7630
|
wide: true
|
|
@@ -7966,17 +7633,17 @@ var ManufacturerPackageOption = ({ packageOption }) => {
|
|
|
7966
7633
|
var ManufacturerPackagesOption_default = ManufacturerPackageOption;
|
|
7967
7634
|
|
|
7968
7635
|
// src/layouts/searchItem/CheckList.tsx
|
|
7969
|
-
import
|
|
7636
|
+
import React79, { useState as useState27, useCallback as useCallback31, useEffect as useEffect13 } from "react";
|
|
7970
7637
|
|
|
7971
7638
|
// src/components/ActionList/index.tsx
|
|
7972
|
-
import
|
|
7639
|
+
import React74, { useCallback as useCallback28 } from "react";
|
|
7973
7640
|
|
|
7974
7641
|
// src/components/ActionList/toggle-item.tsx
|
|
7975
|
-
import
|
|
7642
|
+
import React73, { useState as useState24, useCallback as useCallback27 } from "react";
|
|
7976
7643
|
var initialValue = {};
|
|
7977
7644
|
var getInitialValue = (title) => title && !!initialValue[title];
|
|
7978
7645
|
var ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
7979
|
-
const [visible, setVisible] =
|
|
7646
|
+
const [visible, setVisible] = useState24(() => getInitialValue(type));
|
|
7980
7647
|
const _onClickValue = useCallback27(() => {
|
|
7981
7648
|
if (onClickValue) {
|
|
7982
7649
|
onClickValue();
|
|
@@ -7992,17 +7659,17 @@ var ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
|
7992
7659
|
}
|
|
7993
7660
|
}, [visible]);
|
|
7994
7661
|
const visibleTitle = type === "tel" ? "Ring" : type === "mailto" ? "Skicka ett mail till" : "";
|
|
7995
|
-
return /* @__PURE__ */
|
|
7662
|
+
return /* @__PURE__ */ React73.createElement(RepeatTiny, null, visible ? /* @__PURE__ */ React73.createElement(ButtonSecondary, {
|
|
7996
7663
|
onClick: _onClickValue,
|
|
7997
7664
|
as: "a",
|
|
7998
7665
|
href: `${type}:${value}`,
|
|
7999
7666
|
title: `${visibleTitle} ${value}`,
|
|
8000
7667
|
fullWidth: true
|
|
8001
|
-
}, /* @__PURE__ */
|
|
7668
|
+
}, /* @__PURE__ */ React73.createElement(ButtonContent, null, value)) : /* @__PURE__ */ React73.createElement(ButtonSecondary, {
|
|
8002
7669
|
onClick,
|
|
8003
7670
|
title,
|
|
8004
7671
|
fullWidth: true
|
|
8005
|
-
}, /* @__PURE__ */
|
|
7672
|
+
}, /* @__PURE__ */ React73.createElement(ButtonContent, null, title)));
|
|
8006
7673
|
};
|
|
8007
7674
|
var toggle_item_default = ToggleItem;
|
|
8008
7675
|
|
|
@@ -8121,12 +7788,12 @@ var ActionList = ({ contact, branch }) => {
|
|
|
8121
7788
|
if (!email && !phonenumber) {
|
|
8122
7789
|
return null;
|
|
8123
7790
|
}
|
|
8124
|
-
return /* @__PURE__ */
|
|
7791
|
+
return /* @__PURE__ */ React74.createElement(React74.Fragment, null, email && /* @__PURE__ */ React74.createElement(toggle_item_default, {
|
|
8125
7792
|
onClickVisible: onClickMailVisible,
|
|
8126
7793
|
title: "Visa mailadress",
|
|
8127
7794
|
value: email,
|
|
8128
7795
|
type: "mailto"
|
|
8129
|
-
}), phonenumber && /* @__PURE__ */
|
|
7796
|
+
}), phonenumber && /* @__PURE__ */ React74.createElement(toggle_item_default, {
|
|
8130
7797
|
title: "Visa telefonnummer",
|
|
8131
7798
|
value: formatPhonenumber(phonenumber),
|
|
8132
7799
|
type: "tel",
|
|
@@ -8137,16 +7804,16 @@ var ActionList = ({ contact, branch }) => {
|
|
|
8137
7804
|
var ActionList_default = ActionList;
|
|
8138
7805
|
|
|
8139
7806
|
// src/components/CheckMarkList/index.tsx
|
|
8140
|
-
import
|
|
7807
|
+
import React75 from "react";
|
|
8141
7808
|
|
|
8142
7809
|
// src/components/CheckMarkList/wrapper.tsx
|
|
8143
|
-
import
|
|
8144
|
-
var List9 =
|
|
7810
|
+
import styled51 from "styled-components";
|
|
7811
|
+
var List9 = styled51.ul`
|
|
8145
7812
|
list-style: none;
|
|
8146
7813
|
padding: 0;
|
|
8147
7814
|
margin: 0;
|
|
8148
7815
|
`;
|
|
8149
|
-
var Item11 =
|
|
7816
|
+
var Item11 = styled51.li`
|
|
8150
7817
|
position: relative;
|
|
8151
7818
|
font-size: 0.875rem;
|
|
8152
7819
|
|
|
@@ -8154,7 +7821,7 @@ var Item11 = styled52.li`
|
|
|
8154
7821
|
margin-top: ${size(0.5)};
|
|
8155
7822
|
}
|
|
8156
7823
|
`;
|
|
8157
|
-
var Icon6 =
|
|
7824
|
+
var Icon6 = styled51.div.attrs(() => ({
|
|
8158
7825
|
className: "wayke__theme wayke__color--primary-text"
|
|
8159
7826
|
}))`
|
|
8160
7827
|
position: absolute;
|
|
@@ -8162,52 +7829,52 @@ var Icon6 = styled52.div.attrs(() => ({
|
|
|
8162
7829
|
top: 4px; // Magic number
|
|
8163
7830
|
font-size: 0.875em;
|
|
8164
7831
|
`;
|
|
8165
|
-
var Label10 =
|
|
7832
|
+
var Label10 = styled51.div`
|
|
8166
7833
|
padding-left: calc(1em + ${size(1)});
|
|
8167
7834
|
`;
|
|
8168
7835
|
|
|
8169
7836
|
// src/components/CheckMarkList/index.tsx
|
|
8170
|
-
var CheckMarkListItem = ({ children }) => /* @__PURE__ */
|
|
7837
|
+
var CheckMarkListItem = ({ children }) => /* @__PURE__ */ React75.createElement(Item11, null, /* @__PURE__ */ React75.createElement(Icon6, null, /* @__PURE__ */ React75.createElement(IconCheck, {
|
|
8171
7838
|
block: true
|
|
8172
|
-
})), /* @__PURE__ */
|
|
8173
|
-
var CheckMarkList = ({ children }) => /* @__PURE__ */
|
|
7839
|
+
})), /* @__PURE__ */ React75.createElement(Label10, null, children));
|
|
7840
|
+
var CheckMarkList = ({ children }) => /* @__PURE__ */ React75.createElement(List9, null, children);
|
|
8174
7841
|
var CheckMarkList_default = CheckMarkList;
|
|
8175
7842
|
|
|
8176
7843
|
// src/components/SwitchBar/index.tsx
|
|
8177
|
-
import
|
|
7844
|
+
import React76, { useState as useState25, useCallback as useCallback29 } from "react";
|
|
8178
7845
|
|
|
8179
7846
|
// src/components/SwitchBar/wrapper.tsx
|
|
8180
|
-
import
|
|
8181
|
-
var
|
|
7847
|
+
import styled52 from "styled-components";
|
|
7848
|
+
var Wrapper29 = styled52.div`
|
|
8182
7849
|
padding: ${size(1.5)} ${size(2)};
|
|
8183
7850
|
background-color: ${(props) => props.theme.color.accentDark};
|
|
8184
7851
|
border-radius: 3px;
|
|
8185
7852
|
font-size: 0.875rem;
|
|
8186
7853
|
`;
|
|
8187
|
-
var Header6 =
|
|
7854
|
+
var Header6 = styled52.div`
|
|
8188
7855
|
display: flex;
|
|
8189
7856
|
align-items: center;
|
|
8190
7857
|
`;
|
|
8191
|
-
var Body5 =
|
|
7858
|
+
var Body5 = styled52.div`
|
|
8192
7859
|
font-size: 0.875rem;
|
|
8193
7860
|
margin-top: ${size(1)};
|
|
8194
7861
|
`;
|
|
8195
|
-
var Info3 =
|
|
7862
|
+
var Info3 = styled52.div`
|
|
8196
7863
|
flex: 1 1 auto;
|
|
8197
7864
|
display: flex;
|
|
8198
7865
|
align-items: center;
|
|
8199
7866
|
`;
|
|
8200
|
-
var Action7 =
|
|
7867
|
+
var Action7 = styled52.div`
|
|
8201
7868
|
flex-shrink: 0;
|
|
8202
7869
|
padding-left: ${size(1.5)};
|
|
8203
7870
|
font-size: 0.875rem;
|
|
8204
7871
|
`;
|
|
8205
|
-
var InfoContent =
|
|
7872
|
+
var InfoContent = styled52.div`
|
|
8206
7873
|
& + & {
|
|
8207
7874
|
margin-left: ${size(0.75)};
|
|
8208
7875
|
}
|
|
8209
7876
|
`;
|
|
8210
|
-
var InfoBtn2 =
|
|
7877
|
+
var InfoBtn2 = styled52(ButtonReset).attrs(() => ({
|
|
8211
7878
|
className: "wayke__theme wayke__color--primary-text"
|
|
8212
7879
|
}))`
|
|
8213
7880
|
position: relative;
|
|
@@ -8241,7 +7908,7 @@ var InfoBtn2 = styled53(ButtonReset).attrs(() => ({
|
|
|
8241
7908
|
transform: scale(0.95);
|
|
8242
7909
|
}
|
|
8243
7910
|
`;
|
|
8244
|
-
var Title2 =
|
|
7911
|
+
var Title2 = styled52.div.attrs(() => ({
|
|
8245
7912
|
className: "wayke__theme wayke__font--bold"
|
|
8246
7913
|
}))`
|
|
8247
7914
|
font-size: 1rem;
|
|
@@ -8249,17 +7916,17 @@ var Title2 = styled53.div.attrs(() => ({
|
|
|
8249
7916
|
|
|
8250
7917
|
// src/components/SwitchBar/index.tsx
|
|
8251
7918
|
var SwitchBar = ({ title, body, actionTitle, children, onClick }) => {
|
|
8252
|
-
const [info, setInfo] =
|
|
7919
|
+
const [info, setInfo] = useState25(false);
|
|
8253
7920
|
const onToggleInfo = useCallback29(() => setInfo(!info), [info]);
|
|
8254
|
-
return /* @__PURE__ */
|
|
7921
|
+
return /* @__PURE__ */ React76.createElement(React76.Fragment, null, /* @__PURE__ */ React76.createElement(Wrapper29, null, /* @__PURE__ */ React76.createElement(Header6, null, /* @__PURE__ */ React76.createElement(Info3, null, /* @__PURE__ */ React76.createElement(InfoContent, null, /* @__PURE__ */ React76.createElement(Title2, null, title)), children && /* @__PURE__ */ React76.createElement(InfoContent, null, /* @__PURE__ */ React76.createElement(InfoBtn2, {
|
|
8255
7922
|
onClick: onToggleInfo,
|
|
8256
7923
|
title: "Mer information"
|
|
8257
|
-
}, /* @__PURE__ */
|
|
7924
|
+
}, /* @__PURE__ */ React76.createElement(IconInfo, {
|
|
8258
7925
|
block: true
|
|
8259
|
-
})))), actionTitle && /* @__PURE__ */
|
|
7926
|
+
})))), actionTitle && /* @__PURE__ */ React76.createElement(Action7, null, /* @__PURE__ */ React76.createElement(ButtonInline, {
|
|
8260
7927
|
onClick,
|
|
8261
7928
|
title: actionTitle
|
|
8262
|
-
}, actionTitle))), body && /* @__PURE__ */
|
|
7929
|
+
}, actionTitle))), body && /* @__PURE__ */ React76.createElement(Body5, null, body)), info && /* @__PURE__ */ React76.createElement(Modal_default, {
|
|
8263
7930
|
title,
|
|
8264
7931
|
onClose: onToggleInfo
|
|
8265
7932
|
}, children));
|
|
@@ -8267,7 +7934,7 @@ var SwitchBar = ({ title, body, actionTitle, children, onClick }) => {
|
|
|
8267
7934
|
var SwitchBar_default = SwitchBar;
|
|
8268
7935
|
|
|
8269
7936
|
// src/layouts/searchItem/BranchModal.tsx
|
|
8270
|
-
import
|
|
7937
|
+
import React77, { useState as useState26, useCallback as useCallback30, useContext as useContext3 } from "react";
|
|
8271
7938
|
|
|
8272
7939
|
// src/State/CentralStorage/CentralStorageContext.ts
|
|
8273
7940
|
import { createContext as createContext3 } from "react";
|
|
@@ -8279,7 +7946,7 @@ var CentralStorageContext = createContext3({
|
|
|
8279
7946
|
// src/layouts/searchItem/BranchModal.tsx
|
|
8280
7947
|
var BranchModal = ({ loading, connections, onClose }) => {
|
|
8281
7948
|
const { centralStorageId, setCentralStorageId } = useContext3(CentralStorageContext);
|
|
8282
|
-
const [localValue, setLocalValue] =
|
|
7949
|
+
const [localValue, setLocalValue] = useState26(centralStorageId);
|
|
8283
7950
|
const onConfirm = useCallback30((id) => {
|
|
8284
7951
|
if (id) {
|
|
8285
7952
|
setCentralStorageId(id);
|
|
@@ -8292,10 +7959,10 @@ var BranchModal = ({ loading, connections, onClose }) => {
|
|
|
8292
7959
|
if (!localValue) {
|
|
8293
7960
|
return null;
|
|
8294
7961
|
}
|
|
8295
|
-
return /* @__PURE__ */
|
|
7962
|
+
return /* @__PURE__ */ React77.createElement(Modal_default, {
|
|
8296
7963
|
title: "Byt anl\xE4ggning",
|
|
8297
7964
|
onClose
|
|
8298
|
-
}, /* @__PURE__ */
|
|
7965
|
+
}, /* @__PURE__ */ React77.createElement(Repeat, null, /* @__PURE__ */ React77.createElement(RepeatTiny, null, /* @__PURE__ */ React77.createElement(Content_default, null, /* @__PURE__ */ React77.createElement("p", null, "V\xE4lj den anl\xE4ggning du vill visa kontaktuppgifter f\xF6r."))), /* @__PURE__ */ React77.createElement(RepeatTiny, null, /* @__PURE__ */ React77.createElement(InputLabel_default, null, "V\xE4lj anl\xE4ggning"), /* @__PURE__ */ React77.createElement(InputSelect_default, {
|
|
8299
7966
|
value: localValue,
|
|
8300
7967
|
onChange,
|
|
8301
7968
|
options: connections?.map((x) => ({
|
|
@@ -8303,27 +7970,27 @@ var BranchModal = ({ loading, connections, onClose }) => {
|
|
|
8303
7970
|
displayName: x.name
|
|
8304
7971
|
})),
|
|
8305
7972
|
title: "V\xE4lj anl\xE4ggning"
|
|
8306
|
-
}))), /* @__PURE__ */
|
|
7973
|
+
}))), /* @__PURE__ */ React77.createElement(Repeat, null, /* @__PURE__ */ React77.createElement(ButtonPrimary, {
|
|
8307
7974
|
disabled: loading,
|
|
8308
7975
|
fullWidth: true,
|
|
8309
7976
|
onClick: () => onConfirm(localValue)
|
|
8310
|
-
}, /* @__PURE__ */
|
|
7977
|
+
}, /* @__PURE__ */ React77.createElement(ButtonContent, null, "V\xE4lj"))));
|
|
8311
7978
|
};
|
|
8312
7979
|
var BranchModal_default = BranchModal;
|
|
8313
7980
|
|
|
8314
7981
|
// src/layouts/searchItem/PackageOptionModal.tsx
|
|
8315
|
-
import
|
|
7982
|
+
import React78 from "react";
|
|
8316
7983
|
import { marked as marked4 } from "marked";
|
|
8317
|
-
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */
|
|
7984
|
+
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */ React78.createElement(Modal_default, {
|
|
8318
7985
|
title: packageOption.title || "",
|
|
8319
7986
|
onClose
|
|
8320
|
-
}, packageOption.image && /* @__PURE__ */
|
|
7987
|
+
}, packageOption.image && /* @__PURE__ */ React78.createElement(Repeat, null, /* @__PURE__ */ React78.createElement(LogoBox_default, {
|
|
8321
7988
|
logo: packageOption.image,
|
|
8322
7989
|
alt: packageOption.title || void 0,
|
|
8323
7990
|
wide: true
|
|
8324
|
-
})), packageOption.description && /* @__PURE__ */
|
|
7991
|
+
})), packageOption.description && /* @__PURE__ */ React78.createElement(Repeat, null, /* @__PURE__ */ React78.createElement(Content_default, {
|
|
8325
7992
|
dangerouslySetInnerHTML: { __html: marked4(packageOption.description) }
|
|
8326
|
-
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */
|
|
7993
|
+
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */ React78.createElement(Repeat, null, /* @__PURE__ */ React78.createElement(ButtonInline, {
|
|
8327
7994
|
as: "a",
|
|
8328
7995
|
href: packageOption.link.href,
|
|
8329
7996
|
target: "_blank",
|
|
@@ -8341,90 +8008,90 @@ var CheckList = ({
|
|
|
8341
8008
|
toggleEcomModal,
|
|
8342
8009
|
loadingCentralStorageVehicle
|
|
8343
8010
|
}) => {
|
|
8344
|
-
const [modalBranch, setModalBranch] =
|
|
8011
|
+
const [modalBranch, setModalBranch] = useState27(false);
|
|
8345
8012
|
const openModalBranch = useCallback31(() => setModalBranch(true), []);
|
|
8346
8013
|
const closeModalBranch = useCallback31(() => setModalBranch(false), []);
|
|
8347
|
-
const [modal, setModal] =
|
|
8014
|
+
const [modal, setModal] = useState27();
|
|
8348
8015
|
const onOpen = useCallback31((nextModal) => setModal(nextModal), []);
|
|
8349
8016
|
const onClose = useCallback31(() => setModal(void 0), []);
|
|
8350
|
-
|
|
8017
|
+
useEffect13(() => {
|
|
8351
8018
|
if ((branch || contact) && modalBranch) {
|
|
8352
8019
|
setModalBranch(false);
|
|
8353
8020
|
}
|
|
8354
8021
|
}, [branch, contact]);
|
|
8355
8022
|
const packageOption = manufacturer?.packageOption;
|
|
8356
|
-
return /* @__PURE__ */
|
|
8023
|
+
return /* @__PURE__ */ React79.createElement(React79.Fragment, null, modalBranch && /* @__PURE__ */ React79.createElement(BranchModal_default, {
|
|
8357
8024
|
loading: loadingCentralStorageVehicle,
|
|
8358
8025
|
connections: branch?.connections,
|
|
8359
8026
|
onClose: closeModalBranch
|
|
8360
|
-
}), modal && /* @__PURE__ */
|
|
8027
|
+
}), modal && /* @__PURE__ */ React79.createElement(PackageOptionModal_default, {
|
|
8361
8028
|
packageOption: modal,
|
|
8362
8029
|
onClose
|
|
8363
|
-
}), /* @__PURE__ */
|
|
8030
|
+
}), /* @__PURE__ */ React79.createElement(Repeat, null, /* @__PURE__ */ React79.createElement(CheckMarkList_default, null, packageOption?.title && /* @__PURE__ */ React79.createElement(CheckMarkListItem, null, /* @__PURE__ */ React79.createElement(React79.Fragment, null, "Inkl.", " ", /* @__PURE__ */ React79.createElement(ButtonInline, {
|
|
8364
8031
|
onClick: () => onOpen({
|
|
8365
8032
|
title: packageOption?.title,
|
|
8366
8033
|
image: packageOption?.image,
|
|
8367
8034
|
description: packageOption?.description,
|
|
8368
8035
|
link: packageOption?.link
|
|
8369
8036
|
})
|
|
8370
|
-
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */
|
|
8037
|
+
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */ React79.createElement(CheckMarkListItem, {
|
|
8371
8038
|
key: packageOption2.title || index2
|
|
8372
|
-
}, /* @__PURE__ */
|
|
8039
|
+
}, /* @__PURE__ */ React79.createElement(React79.Fragment, null, "Inkl.", " ", /* @__PURE__ */ React79.createElement(ButtonInline, {
|
|
8373
8040
|
onClick: () => onOpen({
|
|
8374
8041
|
title: packageOption2?.title,
|
|
8375
8042
|
image: packageOption2?.image,
|
|
8376
8043
|
description: packageOption2?.description,
|
|
8377
8044
|
link: packageOption2?.link
|
|
8378
8045
|
})
|
|
8379
|
-
}, packageOption2.title)))), ecommerce?.withHomeDelivery && /* @__PURE__ */
|
|
8046
|
+
}, packageOption2.title)))), ecommerce?.withHomeDelivery && /* @__PURE__ */ React79.createElement(CheckMarkListItem, null, "Hemleverans"))), /* @__PURE__ */ React79.createElement(Repeat, null, ecommerce && ecommerce.enabled && /* @__PURE__ */ React79.createElement(RepeatTiny, null, /* @__PURE__ */ React79.createElement(ButtonPrimary, {
|
|
8380
8047
|
disabled: !!ecommerce.reserved,
|
|
8381
8048
|
fullWidth: true,
|
|
8382
8049
|
onClick: toggleEcomModal
|
|
8383
|
-
}, /* @__PURE__ */
|
|
8050
|
+
}, /* @__PURE__ */ React79.createElement(ButtonContent, null, "K\xF6p bilen online"))), ecommerce?.reserved && /* @__PURE__ */ React79.createElement(RepeatTiny, null, /* @__PURE__ */ React79.createElement(SwitchBar_default, {
|
|
8384
8051
|
title: "Bilen \xE4r reserverad",
|
|
8385
8052
|
body: "Denna bil \xE4r reserverad av en annan k\xF6pare."
|
|
8386
|
-
}, /* @__PURE__ */
|
|
8053
|
+
}, /* @__PURE__ */ React79.createElement(Content_default, null, /* @__PURE__ */ React79.createElement("p", null, "Denna bil \xE4r reserverad av en annan k\xF6pare.")))), /* @__PURE__ */ React79.createElement(ActionList_default, {
|
|
8387
8054
|
branch,
|
|
8388
8055
|
contact
|
|
8389
|
-
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */
|
|
8056
|
+
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */ React79.createElement(Repeat, null, /* @__PURE__ */ React79.createElement(SwitchBar_default, {
|
|
8390
8057
|
title: "Centrallagerbil",
|
|
8391
8058
|
actionTitle: "Byt anl\xE4ggning",
|
|
8392
8059
|
onClick: openModalBranch
|
|
8393
|
-
}, /* @__PURE__ */
|
|
8060
|
+
}, /* @__PURE__ */ React79.createElement(Content_default, null, /* @__PURE__ */ React79.createElement("p", null, "Denna bil tillh\xF6r ett centrallager och g\xE5r att k\xF6pa genom flera anl\xE4ggningar. Byt anl\xE4ggning f\xF6r att visa kontaktuppgifter till just den anl\xE4ggningen.")))));
|
|
8394
8061
|
};
|
|
8395
8062
|
var CheckList_default = CheckList;
|
|
8396
8063
|
|
|
8397
8064
|
// src/layouts/searchItem/Related.tsx
|
|
8398
|
-
import
|
|
8065
|
+
import React81, { useCallback as useCallback32 } from "react";
|
|
8399
8066
|
|
|
8400
8067
|
// src/components/SectionHeader/index.tsx
|
|
8401
|
-
import
|
|
8068
|
+
import React80 from "react";
|
|
8402
8069
|
|
|
8403
8070
|
// src/components/SectionHeader/wrapper.tsx
|
|
8404
|
-
import
|
|
8405
|
-
var
|
|
8071
|
+
import styled53 from "styled-components";
|
|
8072
|
+
var Wrapper30 = styled53.div`
|
|
8406
8073
|
display: flex;
|
|
8407
8074
|
align-items: center;
|
|
8408
8075
|
`;
|
|
8409
|
-
var Heading7 =
|
|
8076
|
+
var Heading7 = styled53.div`
|
|
8410
8077
|
flex: 1 1 auto;
|
|
8411
8078
|
`;
|
|
8412
|
-
var Action8 =
|
|
8079
|
+
var Action8 = styled53.div`
|
|
8413
8080
|
flex-shrink: 0;
|
|
8414
8081
|
padding-left: ${size(2)};
|
|
8415
8082
|
`;
|
|
8416
8083
|
|
|
8417
8084
|
// src/components/SectionHeader/index.tsx
|
|
8418
|
-
var SectionHeader = ({ children, onClick, actionTitle }) => /* @__PURE__ */
|
|
8085
|
+
var SectionHeader = ({ children, onClick, actionTitle }) => /* @__PURE__ */ React80.createElement(Wrapper30, null, /* @__PURE__ */ React80.createElement(Heading7, null, children), onClick && actionTitle && /* @__PURE__ */ React80.createElement(Action8, null, /* @__PURE__ */ React80.createElement(ButtonClear, {
|
|
8419
8086
|
as: "a",
|
|
8420
8087
|
href: "#",
|
|
8421
8088
|
onClick
|
|
8422
|
-
}, /* @__PURE__ */
|
|
8089
|
+
}, /* @__PURE__ */ React80.createElement(ButtonContent, null, actionTitle))));
|
|
8423
8090
|
var SectionHeader_default = SectionHeader;
|
|
8424
8091
|
|
|
8425
8092
|
// src/components/OverflowGrid/index.tsx
|
|
8426
|
-
import
|
|
8427
|
-
var OverflowGrid =
|
|
8093
|
+
import styled54 from "styled-components";
|
|
8094
|
+
var OverflowGrid = styled54.div`
|
|
8428
8095
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
8429
8096
|
${Wrapper} & {
|
|
8430
8097
|
margin-left: ${size(-3)};
|
|
@@ -8439,7 +8106,7 @@ var OverflowGrid = styled55.div`
|
|
|
8439
8106
|
}
|
|
8440
8107
|
}
|
|
8441
8108
|
`;
|
|
8442
|
-
var OverflowGridList =
|
|
8109
|
+
var OverflowGridList = styled54.ul`
|
|
8443
8110
|
display: flex;
|
|
8444
8111
|
align-items: flex-start;
|
|
8445
8112
|
list-style: none;
|
|
@@ -8471,7 +8138,7 @@ var OverflowGridList = styled55.ul`
|
|
|
8471
8138
|
}
|
|
8472
8139
|
}
|
|
8473
8140
|
`;
|
|
8474
|
-
var OverflowGridItem =
|
|
8141
|
+
var OverflowGridItem = styled54.li`
|
|
8475
8142
|
flex: 1 0 auto;
|
|
8476
8143
|
width: calc(100% - ${size(2)});
|
|
8477
8144
|
max-width: calc(100% - ${size(2)});
|
|
@@ -8489,7 +8156,7 @@ var OverflowGridItem = styled55.li`
|
|
|
8489
8156
|
`;
|
|
8490
8157
|
|
|
8491
8158
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
8492
|
-
import { useContext as useContext4, useEffect as
|
|
8159
|
+
import { useContext as useContext4, useEffect as useEffect14 } from "react";
|
|
8493
8160
|
|
|
8494
8161
|
// src/State/RelatedSearch/RelatedSearchContext.ts
|
|
8495
8162
|
import { createContext as createContext4 } from "react";
|
|
@@ -8505,7 +8172,7 @@ var RelatedSearchContext = createContext4({
|
|
|
8505
8172
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
8506
8173
|
var useRelatedSearch = (id) => {
|
|
8507
8174
|
const data = useContext4(RelatedSearchContext);
|
|
8508
|
-
|
|
8175
|
+
useEffect14(() => {
|
|
8509
8176
|
const searchParams = new URLSearchParams();
|
|
8510
8177
|
searchParams.set("hits", "3");
|
|
8511
8178
|
if (data.moreLikeThisUrl && id) {
|
|
@@ -8541,30 +8208,30 @@ var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
8541
8208
|
return null;
|
|
8542
8209
|
}
|
|
8543
8210
|
if (loading) {
|
|
8544
|
-
return /* @__PURE__ */
|
|
8211
|
+
return /* @__PURE__ */ React81.createElement(Loader_default, null);
|
|
8545
8212
|
}
|
|
8546
|
-
return /* @__PURE__ */
|
|
8213
|
+
return /* @__PURE__ */ React81.createElement(PageSection, {
|
|
8547
8214
|
accent: true,
|
|
8548
8215
|
large: true,
|
|
8549
8216
|
className: "wayke__theme wayke__color--accent-bg"
|
|
8550
|
-
}, /* @__PURE__ */
|
|
8217
|
+
}, /* @__PURE__ */ React81.createElement(Container_default, null, moreLikeThisUrl ? /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(SectionHeader_default, {
|
|
8551
8218
|
onClick: () => {
|
|
8552
8219
|
}
|
|
8553
|
-
}, /* @__PURE__ */
|
|
8220
|
+
}, /* @__PURE__ */ React81.createElement(H2, {
|
|
8554
8221
|
noMargin: true
|
|
8555
|
-
}, "Relaterade fordon"))) : /* @__PURE__ */
|
|
8222
|
+
}, "Relaterade fordon"))) : /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(SectionHeader_default, {
|
|
8556
8223
|
onClick: () => {
|
|
8557
8224
|
},
|
|
8558
8225
|
actionTitle: "Visa alla"
|
|
8559
|
-
}, /* @__PURE__ */
|
|
8226
|
+
}, /* @__PURE__ */ React81.createElement(H2, {
|
|
8560
8227
|
noMargin: true
|
|
8561
|
-
}, "Senast inkomna"))), /* @__PURE__ */
|
|
8228
|
+
}, "Senast inkomna"))), /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(OverflowGrid, null, /* @__PURE__ */ React81.createElement(OverflowGridList, null, response?.documentList.documents.map((document2) => {
|
|
8562
8229
|
const prefix = pathRoute ? `/${pathRoute}` : "/";
|
|
8563
8230
|
const r = regexPathGuid(pathRoute);
|
|
8564
8231
|
const pathRouteUrl = window.location.pathname === "/" ? `${prefix}${document2._id}` : r.test(`${pathRoute}${id}`) ? window.location.pathname.replace(r, `${pathRoute}${document2._id}`) : `${window.location.pathname}${prefix}${document2._id}`;
|
|
8565
|
-
return /* @__PURE__ */
|
|
8232
|
+
return /* @__PURE__ */ React81.createElement(OverflowGridItem, {
|
|
8566
8233
|
key: document2._id
|
|
8567
|
-
}, /* @__PURE__ */
|
|
8234
|
+
}, /* @__PURE__ */ React81.createElement(ProductCard_default, {
|
|
8568
8235
|
id: document2._id,
|
|
8569
8236
|
onClick: onItemClicked,
|
|
8570
8237
|
title: document2.title,
|
|
@@ -8594,24 +8261,24 @@ var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
8594
8261
|
var Related_default = Related;
|
|
8595
8262
|
|
|
8596
8263
|
// src/layouts/searchItem/PackageOptions.tsx
|
|
8597
|
-
import
|
|
8264
|
+
import React82 from "react";
|
|
8598
8265
|
import { marked as marked5 } from "marked";
|
|
8599
8266
|
var PackageOptions = ({ packageOptions }) => {
|
|
8600
8267
|
if (!packageOptions) {
|
|
8601
8268
|
return null;
|
|
8602
8269
|
}
|
|
8603
|
-
return /* @__PURE__ */
|
|
8270
|
+
return /* @__PURE__ */ React82.createElement(React82.Fragment, null, packageOptions.map((packageOption, index2) => /* @__PURE__ */ React82.createElement(ProductPageMainSection, {
|
|
8604
8271
|
key: packageOption.title || index2
|
|
8605
|
-
}, /* @__PURE__ */
|
|
8272
|
+
}, /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(H2, {
|
|
8606
8273
|
noMargin: true
|
|
8607
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
8274
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(Content_default, {
|
|
8608
8275
|
dangerouslySetInnerHTML: { __html: marked5(packageOption.description) }
|
|
8609
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
8276
|
+
})), packageOption.link?.url && /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(ButtonInline, {
|
|
8610
8277
|
as: "a",
|
|
8611
8278
|
href: packageOption.link.url,
|
|
8612
8279
|
target: "_blank",
|
|
8613
8280
|
rel: "noopener noreferrer"
|
|
8614
|
-
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */
|
|
8281
|
+
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(LogoBox_default, {
|
|
8615
8282
|
logo: packageOption.image,
|
|
8616
8283
|
alt: "Logotyp",
|
|
8617
8284
|
wide: true
|
|
@@ -8620,31 +8287,31 @@ var PackageOptions = ({ packageOptions }) => {
|
|
|
8620
8287
|
var PackageOptions_default = PackageOptions;
|
|
8621
8288
|
|
|
8622
8289
|
// src/layouts/searchItem/Branch.tsx
|
|
8623
|
-
import
|
|
8290
|
+
import React87, { useState as useState30, useCallback as useCallback35, useEffect as useEffect15 } from "react";
|
|
8624
8291
|
|
|
8625
8292
|
// src/components/TableColumn/index.tsx
|
|
8626
|
-
import
|
|
8627
|
-
var TableColumn =
|
|
8293
|
+
import styled55 from "styled-components";
|
|
8294
|
+
var TableColumn = styled55.div`
|
|
8628
8295
|
line-height: 1.2;
|
|
8629
8296
|
`;
|
|
8630
|
-
var TableColumnRow =
|
|
8297
|
+
var TableColumnRow = styled55.div`
|
|
8631
8298
|
display: flex;
|
|
8632
8299
|
align-items: flex-start;
|
|
8633
8300
|
margin: ${size(-1)};
|
|
8634
8301
|
`;
|
|
8635
|
-
var TableColumnCell =
|
|
8302
|
+
var TableColumnCell = styled55.div`
|
|
8636
8303
|
flex: 1 0 50%;
|
|
8637
8304
|
padding: ${size(1)};
|
|
8638
8305
|
`;
|
|
8639
8306
|
|
|
8640
8307
|
// src/components/OpeningHours/index.tsx
|
|
8641
|
-
import
|
|
8308
|
+
import React84, { useMemo as useMemo4 } from "react";
|
|
8642
8309
|
|
|
8643
8310
|
// src/components/Badge/index.tsx
|
|
8644
|
-
import
|
|
8311
|
+
import React83 from "react";
|
|
8645
8312
|
|
|
8646
8313
|
// src/components/Badge/wrapper.tsx
|
|
8647
|
-
import
|
|
8314
|
+
import styled56 from "styled-components";
|
|
8648
8315
|
var getBg = (severity) => {
|
|
8649
8316
|
let bg = theme_default.color.textDark;
|
|
8650
8317
|
if (severity === "positive") {
|
|
@@ -8654,7 +8321,7 @@ var getBg = (severity) => {
|
|
|
8654
8321
|
}
|
|
8655
8322
|
return bg;
|
|
8656
8323
|
};
|
|
8657
|
-
var
|
|
8324
|
+
var Wrapper31 = styled56.div.attrs(() => ({
|
|
8658
8325
|
className: "wayke__theme wayke__font--bold"
|
|
8659
8326
|
}))`
|
|
8660
8327
|
display: inline-block;
|
|
@@ -8667,7 +8334,7 @@ var Wrapper32 = styled57.div.attrs(() => ({
|
|
|
8667
8334
|
`;
|
|
8668
8335
|
|
|
8669
8336
|
// src/components/Badge/index.tsx
|
|
8670
|
-
var Badge = ({ label, severity }) => /* @__PURE__ */
|
|
8337
|
+
var Badge = ({ label, severity }) => /* @__PURE__ */ React83.createElement(Wrapper31, {
|
|
8671
8338
|
severity
|
|
8672
8339
|
}, label);
|
|
8673
8340
|
var Badge_default = Badge;
|
|
@@ -8751,33 +8418,33 @@ var OpeningHours = ({ openingHours }) => {
|
|
|
8751
8418
|
if (!oh) {
|
|
8752
8419
|
return null;
|
|
8753
8420
|
}
|
|
8754
|
-
return /* @__PURE__ */
|
|
8421
|
+
return /* @__PURE__ */ React84.createElement(React84.Fragment, null, /* @__PURE__ */ React84.createElement(RepeatSmall, null, /* @__PURE__ */ React84.createElement(Badge_default, {
|
|
8755
8422
|
label: currentlyOpen ? "\xD6ppet" : "St\xE4ngt",
|
|
8756
8423
|
severity: currentlyOpen ? "positive" : "negative"
|
|
8757
|
-
})), /* @__PURE__ */
|
|
8424
|
+
})), /* @__PURE__ */ React84.createElement(RepeatSmall, null, /* @__PURE__ */ React84.createElement(TableColumn, null, /* @__PURE__ */ React84.createElement(TableColumnRow, null, /* @__PURE__ */ React84.createElement(TableColumnCell, null, /* @__PURE__ */ React84.createElement(UtilityTextBold, null, today?.title)), /* @__PURE__ */ React84.createElement(TableColumnCell, null, /* @__PURE__ */ React84.createElement(UtilityTextBold, null, today?.from ? `${today.from}-${today.until}` : "St\xE4ngt"))), oh.map((o) => /* @__PURE__ */ React84.createElement(TableColumnRow, {
|
|
8758
8425
|
key: o.titleFrom
|
|
8759
|
-
}, /* @__PURE__ */
|
|
8426
|
+
}, /* @__PURE__ */ React84.createElement(TableColumnCell, null, o.titleTo ? `${o.titleFrom}-${o.titleTo}` : o.titleFrom), /* @__PURE__ */ React84.createElement(TableColumnCell, null, o.from ? `${o.from}-${o.until}` : "St\xE4ngt"))))));
|
|
8760
8427
|
};
|
|
8761
8428
|
var OpeningHours_default = OpeningHours;
|
|
8762
8429
|
|
|
8763
8430
|
// src/components/PhoneNumber/index.tsx
|
|
8764
|
-
import
|
|
8431
|
+
import React85, { useState as useState28, useCallback as useCallback33 } from "react";
|
|
8765
8432
|
var PhoneNumber = ({ phoneNumber }) => {
|
|
8766
|
-
const [visible, setVisible] =
|
|
8433
|
+
const [visible, setVisible] = useState28(false);
|
|
8767
8434
|
const onClick = useCallback33(() => !visible && setVisible(true), [visible]);
|
|
8768
|
-
return /* @__PURE__ */
|
|
8435
|
+
return /* @__PURE__ */ React85.createElement(TableColumnRow, null, /* @__PURE__ */ React85.createElement(TableColumnCell, null, "Telefonnummer"), /* @__PURE__ */ React85.createElement(TableColumnCell, null, visible ? /* @__PURE__ */ React85.createElement(ButtonInlineBold, {
|
|
8769
8436
|
as: "a",
|
|
8770
8437
|
href: `tel:${phoneNumber}`,
|
|
8771
8438
|
title: `Ring ${phoneNumber}`
|
|
8772
|
-
}, /* @__PURE__ */
|
|
8439
|
+
}, /* @__PURE__ */ React85.createElement(ButtonContent, null, phoneNumber)) : /* @__PURE__ */ React85.createElement(ButtonInlineBold, {
|
|
8773
8440
|
onClick,
|
|
8774
8441
|
title: "Visa telefonnummer"
|
|
8775
|
-
}, /* @__PURE__ */
|
|
8442
|
+
}, /* @__PURE__ */ React85.createElement(ButtonContent, null, "Visa telefonnummer"))));
|
|
8776
8443
|
};
|
|
8777
8444
|
var PhoneNumber_default = PhoneNumber;
|
|
8778
8445
|
|
|
8779
8446
|
// src/components/Map/index.tsx
|
|
8780
|
-
import
|
|
8447
|
+
import React86, { useState as useState29, useCallback as useCallback34 } from "react";
|
|
8781
8448
|
|
|
8782
8449
|
// src/State/Settings/useSettings.ts
|
|
8783
8450
|
import { useContext as useContext5 } from "react";
|
|
@@ -8791,16 +8458,16 @@ var useSettings = () => useContext5(SettingsContext);
|
|
|
8791
8458
|
var useSettings_default = useSettings;
|
|
8792
8459
|
|
|
8793
8460
|
// src/components/Map/wrapper.tsx
|
|
8794
|
-
import
|
|
8795
|
-
var
|
|
8461
|
+
import styled57 from "styled-components";
|
|
8462
|
+
var Wrapper32 = styled57.a`
|
|
8796
8463
|
display: block;
|
|
8797
8464
|
`;
|
|
8798
|
-
var Image4 =
|
|
8465
|
+
var Image4 = styled57.img`
|
|
8799
8466
|
display: block;
|
|
8800
8467
|
width: 100%;
|
|
8801
8468
|
border-radius: 3px;
|
|
8802
8469
|
`;
|
|
8803
|
-
var Placeholder =
|
|
8470
|
+
var Placeholder = styled57.a`
|
|
8804
8471
|
display: block;
|
|
8805
8472
|
position: relative;
|
|
8806
8473
|
width: 100%;
|
|
@@ -8810,7 +8477,7 @@ var Placeholder = styled58.a`
|
|
|
8810
8477
|
border-radius: 3px;
|
|
8811
8478
|
color: ${(props) => props.theme.color.textDark};
|
|
8812
8479
|
`;
|
|
8813
|
-
var PlaceholderAction =
|
|
8480
|
+
var PlaceholderAction = styled57.div`
|
|
8814
8481
|
position: absolute;
|
|
8815
8482
|
top: 50%;
|
|
8816
8483
|
left: 50%;
|
|
@@ -8820,7 +8487,7 @@ var PlaceholderAction = styled58.div`
|
|
|
8820
8487
|
// src/components/Map/index.tsx
|
|
8821
8488
|
var StaticMap = ({ position }) => {
|
|
8822
8489
|
const { googleMapsApiKey, googleMapsMarker } = useSettings_default();
|
|
8823
|
-
const [visible, setVisible] =
|
|
8490
|
+
const [visible, setVisible] = useState29(false);
|
|
8824
8491
|
const onShowMap = useCallback34((e) => {
|
|
8825
8492
|
if (googleMapsApiKey) {
|
|
8826
8493
|
e.preventDefault();
|
|
@@ -8832,33 +8499,33 @@ var StaticMap = ({ position }) => {
|
|
|
8832
8499
|
}
|
|
8833
8500
|
const { latitude, longitude } = position;
|
|
8834
8501
|
if (visible && googleMapsApiKey) {
|
|
8835
|
-
return /* @__PURE__ */
|
|
8502
|
+
return /* @__PURE__ */ React86.createElement(Wrapper32, {
|
|
8836
8503
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
8837
8504
|
title: "Visa p\xE5 Google Maps",
|
|
8838
8505
|
target: "_blank",
|
|
8839
8506
|
rel: "nofollow noopener noreferrer"
|
|
8840
|
-
}, /* @__PURE__ */
|
|
8507
|
+
}, /* @__PURE__ */ React86.createElement(Image4, {
|
|
8841
8508
|
src: `https://maps.googleapis.com/maps/api/staticmap?center=${latitude},${longitude}&zoom=10&size=640x280&maptype=roadmap&markers=${googleMapsMarker ? `icon:${encodeURIComponent(googleMapsMarker)}` : ""}%7C${latitude},${longitude}&key=${googleMapsApiKey}`,
|
|
8842
8509
|
alt: "Karta"
|
|
8843
8510
|
}));
|
|
8844
8511
|
}
|
|
8845
|
-
return /* @__PURE__ */
|
|
8512
|
+
return /* @__PURE__ */ React86.createElement(Placeholder, {
|
|
8846
8513
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
8847
8514
|
target: "_blank",
|
|
8848
8515
|
rel: "noopener noreferrer nofollow",
|
|
8849
8516
|
onClick: onShowMap
|
|
8850
|
-
}, /* @__PURE__ */
|
|
8517
|
+
}, /* @__PURE__ */ React86.createElement(PlaceholderAction, null, /* @__PURE__ */ React86.createElement(ButtonSecondary, {
|
|
8851
8518
|
as: "div"
|
|
8852
|
-
}, /* @__PURE__ */
|
|
8519
|
+
}, /* @__PURE__ */ React86.createElement(ButtonContent, null, "Visa karta"))));
|
|
8853
8520
|
};
|
|
8854
8521
|
var Map_default = StaticMap;
|
|
8855
8522
|
|
|
8856
8523
|
// src/layouts/searchItem/Branch.tsx
|
|
8857
8524
|
var Branch2 = ({ branch, loading }) => {
|
|
8858
|
-
const [modal, setModal] =
|
|
8525
|
+
const [modal, setModal] = useState30(false);
|
|
8859
8526
|
const openModal = useCallback35(() => setModal(true), []);
|
|
8860
8527
|
const closeModal = useCallback35(() => setModal(false), []);
|
|
8861
|
-
|
|
8528
|
+
useEffect15(() => {
|
|
8862
8529
|
if (branch && modal) {
|
|
8863
8530
|
setModal(false);
|
|
8864
8531
|
}
|
|
@@ -8866,29 +8533,29 @@ var Branch2 = ({ branch, loading }) => {
|
|
|
8866
8533
|
if (!branch) {
|
|
8867
8534
|
return null;
|
|
8868
8535
|
}
|
|
8869
|
-
return /* @__PURE__ */
|
|
8536
|
+
return /* @__PURE__ */ React87.createElement(React87.Fragment, null, modal && /* @__PURE__ */ React87.createElement(BranchModal_default, {
|
|
8870
8537
|
loading,
|
|
8871
8538
|
connections: branch?.connections,
|
|
8872
8539
|
onClose: closeModal
|
|
8873
|
-
}), /* @__PURE__ */
|
|
8540
|
+
}), /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(H2, {
|
|
8874
8541
|
noMargin: true
|
|
8875
|
-
}, branch?.location?.city ? `Den h\xE4r bilen finns p\xE5 v\xE5r anl\xE4ggning i ${branch?.location?.city}` : "Kontakt")), /* @__PURE__ */
|
|
8542
|
+
}, branch?.location?.city ? `Den h\xE4r bilen finns p\xE5 v\xE5r anl\xE4ggning i ${branch?.location?.city}` : "Kontakt")), /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(Map_default, {
|
|
8876
8543
|
position: branch?.location?.position
|
|
8877
|
-
})), (branch?.connections?.length || 0) > 1 && /* @__PURE__ */
|
|
8544
|
+
})), (branch?.connections?.length || 0) > 1 && /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(Content_default, null, /* @__PURE__ */ React87.createElement("p", null, "Denna bil tillh\xF6r ett centrallager och g\xE5r att k\xF6pa genom flera anl\xE4ggningar.", " ", /* @__PURE__ */ React87.createElement(ButtonInline, {
|
|
8878
8545
|
as: "span",
|
|
8879
8546
|
role: "button",
|
|
8880
8547
|
onClick: openModal,
|
|
8881
8548
|
inline: true
|
|
8882
|
-
}, "Klicka h\xE4r f\xF6r att visa kontaktuppgifter till en annan anl\xE4ggning"), "."))), /* @__PURE__ */
|
|
8549
|
+
}, "Klicka h\xE4r f\xF6r att visa kontaktuppgifter till en annan anl\xE4ggning"), "."))), /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(ProductPageContentLimit, null, /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(TableColumn, null, branch?.location?.streetAddress && branch?.location?.city && /* @__PURE__ */ React87.createElement(TableColumnRow, null, /* @__PURE__ */ React87.createElement(TableColumnCell, null, "Adress"), /* @__PURE__ */ React87.createElement(TableColumnCell, null, /* @__PURE__ */ React87.createElement(ButtonInlineBold, null, /* @__PURE__ */ React87.createElement(ButtonContent, null, `${branch?.location?.streetAddress}, ${branch?.location?.city}`)))), branch?.contact?.phonenumber && /* @__PURE__ */ React87.createElement(PhoneNumber_default, {
|
|
8883
8550
|
phoneNumber: formatPhonenumber(branch.contact.phonenumber)
|
|
8884
|
-
}))), branch?.openingHours && /* @__PURE__ */
|
|
8551
|
+
}))), branch?.openingHours && /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(OpeningHours_default, {
|
|
8885
8552
|
openingHours: branch.openingHours
|
|
8886
8553
|
})))));
|
|
8887
8554
|
};
|
|
8888
8555
|
var Branch_default = Branch2;
|
|
8889
8556
|
|
|
8890
8557
|
// src/State/CentralStorage/useCentralStorage.ts
|
|
8891
|
-
import { useContext as useContext6, useEffect as
|
|
8558
|
+
import { useContext as useContext6, useEffect as useEffect16 } from "react";
|
|
8892
8559
|
|
|
8893
8560
|
// src/hooks/useSearchItemBranch.ts
|
|
8894
8561
|
import { useQuery as useQuery4 } from "@apollo/client";
|
|
@@ -9025,7 +8692,7 @@ var useCentralStorage = (vehicle) => {
|
|
|
9025
8692
|
const connections = vehicle?.branch?.connections;
|
|
9026
8693
|
const branchId = centralStorageId ? connections?.find((x) => x.id === centralStorageId)?.id : void 0;
|
|
9027
8694
|
const { data, loading } = useSearchItemBranch_default(vehicle?.id, branchId);
|
|
9028
|
-
|
|
8695
|
+
useEffect16(() => {
|
|
9029
8696
|
if ((connections?.length || 0) > 0) {
|
|
9030
8697
|
const match = centralStorageId ? connections?.find((x) => x.id === centralStorageId) : void 0;
|
|
9031
8698
|
if (!match) {
|
|
@@ -9044,23 +8711,23 @@ var useCentralStorage = (vehicle) => {
|
|
|
9044
8711
|
var useCentralStorage_default = useCentralStorage;
|
|
9045
8712
|
|
|
9046
8713
|
// src/layouts/searchItem/Page404.tsx
|
|
9047
|
-
import
|
|
9048
|
-
var Page404 = () => /* @__PURE__ */
|
|
8714
|
+
import React88 from "react";
|
|
8715
|
+
var Page404 = () => /* @__PURE__ */ React88.createElement(Page, null, /* @__PURE__ */ React88.createElement(PageSection, {
|
|
9049
8716
|
large: true
|
|
9050
|
-
}, /* @__PURE__ */
|
|
8717
|
+
}, /* @__PURE__ */ React88.createElement(Container_default, null, /* @__PURE__ */ React88.createElement(H1, {
|
|
9051
8718
|
noMargin: true
|
|
9052
8719
|
}, "404"))));
|
|
9053
8720
|
var Page404_default = Page404;
|
|
9054
8721
|
|
|
9055
8722
|
// src/layouts/searchItem/PageLoading.tsx
|
|
9056
|
-
import
|
|
9057
|
-
var PageLoading = () => /* @__PURE__ */
|
|
8723
|
+
import React89 from "react";
|
|
8724
|
+
var PageLoading = () => /* @__PURE__ */ React89.createElement(Page, null, /* @__PURE__ */ React89.createElement(PageSection, {
|
|
9058
8725
|
large: true
|
|
9059
|
-
}, /* @__PURE__ */
|
|
8726
|
+
}, /* @__PURE__ */ React89.createElement(Container_default, null, /* @__PURE__ */ React89.createElement(Loader_default, null))));
|
|
9060
8727
|
var PageLoading_default = PageLoading;
|
|
9061
8728
|
|
|
9062
8729
|
// src/layouts/searchItem/Property.tsx
|
|
9063
|
-
import
|
|
8730
|
+
import React92, { useCallback as useCallback37, useEffect as useEffect17, useMemo as useMemo5, useState as useState32 } from "react";
|
|
9064
8731
|
|
|
9065
8732
|
// src/utils/vehicle-properties/property-tree-creator.ts
|
|
9066
8733
|
var _PropertyTreeCreator = class {
|
|
@@ -9553,11 +9220,11 @@ var property_remover_default = (properties) => {
|
|
|
9553
9220
|
};
|
|
9554
9221
|
|
|
9555
9222
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
9556
|
-
import
|
|
9223
|
+
import React90, { useState as useState31, useCallback as useCallback36 } from "react";
|
|
9557
9224
|
|
|
9558
9225
|
// src/components/TableList/index.tsx
|
|
9559
|
-
import
|
|
9560
|
-
var TableList =
|
|
9226
|
+
import styled58 from "styled-components";
|
|
9227
|
+
var TableList = styled58.ul`
|
|
9561
9228
|
list-style: none;
|
|
9562
9229
|
padding: 0;
|
|
9563
9230
|
margin: 0;
|
|
@@ -9565,7 +9232,7 @@ var TableList = styled59.ul`
|
|
|
9565
9232
|
border-bottom: 1px solid ${(props) => props.theme.color.border};
|
|
9566
9233
|
font-size: 0.875rem;
|
|
9567
9234
|
`;
|
|
9568
|
-
var TableListItem =
|
|
9235
|
+
var TableListItem = styled58.li`
|
|
9569
9236
|
display: flex;
|
|
9570
9237
|
align-items: center;
|
|
9571
9238
|
padding: ${size(1)} 0;
|
|
@@ -9574,30 +9241,30 @@ var TableListItem = styled59.li`
|
|
|
9574
9241
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
9575
9242
|
}
|
|
9576
9243
|
`;
|
|
9577
|
-
var TableListKey =
|
|
9244
|
+
var TableListKey = styled58.div`
|
|
9578
9245
|
flex: 1 1 auto;
|
|
9579
9246
|
`;
|
|
9580
|
-
var TableListValue =
|
|
9247
|
+
var TableListValue = styled58.div`
|
|
9581
9248
|
flex-shrink: 0;
|
|
9582
9249
|
padding-left: ${size(1)};
|
|
9583
9250
|
`;
|
|
9584
|
-
var TableListBooleanPos =
|
|
9251
|
+
var TableListBooleanPos = styled58.div`
|
|
9585
9252
|
color: ${(props) => props.theme.color.ui.positive};
|
|
9586
9253
|
`;
|
|
9587
|
-
var TableListBooleanNeg =
|
|
9254
|
+
var TableListBooleanNeg = styled58.div`
|
|
9588
9255
|
color: ${(props) => props.theme.color.ui.negative};
|
|
9589
9256
|
`;
|
|
9590
9257
|
|
|
9591
9258
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
9592
9259
|
var formatValue = (value, unit) => {
|
|
9593
9260
|
if (typeof value === "boolean") {
|
|
9594
|
-
return value ? /* @__PURE__ */
|
|
9261
|
+
return value ? /* @__PURE__ */ React90.createElement(TableListBooleanPos, {
|
|
9595
9262
|
title: "Ja"
|
|
9596
|
-
}, /* @__PURE__ */
|
|
9263
|
+
}, /* @__PURE__ */ React90.createElement(SrOnly, null, "Ja"), /* @__PURE__ */ React90.createElement(IconCheck, {
|
|
9597
9264
|
block: true
|
|
9598
|
-
})) : /* @__PURE__ */
|
|
9265
|
+
})) : /* @__PURE__ */ React90.createElement(TableListBooleanNeg, {
|
|
9599
9266
|
title: "Nej"
|
|
9600
|
-
}, /* @__PURE__ */
|
|
9267
|
+
}, /* @__PURE__ */ React90.createElement(SrOnly, null, "Nej"), /* @__PURE__ */ React90.createElement(IconCancel, {
|
|
9601
9268
|
block: true
|
|
9602
9269
|
}));
|
|
9603
9270
|
}
|
|
@@ -9610,27 +9277,27 @@ var formatValue = (value, unit) => {
|
|
|
9610
9277
|
return value;
|
|
9611
9278
|
};
|
|
9612
9279
|
var MetadataItem = ({ name, hint, value, unit }) => {
|
|
9613
|
-
const [foldout, setFoldout] =
|
|
9280
|
+
const [foldout, setFoldout] = useState31(false);
|
|
9614
9281
|
const onToggleFoldout = useCallback36(() => setFoldout(!foldout), [foldout]);
|
|
9615
9282
|
const presentedValue = formatValue(value, unit);
|
|
9616
|
-
return /* @__PURE__ */
|
|
9283
|
+
return /* @__PURE__ */ React90.createElement(TableListItem, null, /* @__PURE__ */ React90.createElement(TableListKey, null, hint ? /* @__PURE__ */ React90.createElement(ButtonInline, {
|
|
9617
9284
|
onClick: onToggleFoldout,
|
|
9618
9285
|
title: `Mer information om ${name}`
|
|
9619
|
-
}, name) : name), /* @__PURE__ */
|
|
9286
|
+
}, name) : name), /* @__PURE__ */ React90.createElement(TableListValue, null, value !== void 0 ? presentedValue : "Uppgift saknas"), hint && foldout && /* @__PURE__ */ React90.createElement(Modal_default, {
|
|
9620
9287
|
title: name,
|
|
9621
9288
|
onClose: onToggleFoldout
|
|
9622
|
-
}, /* @__PURE__ */
|
|
9289
|
+
}, /* @__PURE__ */ React90.createElement(Content_default, {
|
|
9623
9290
|
dangerouslySetInnerHTML: { __html: hint }
|
|
9624
9291
|
})));
|
|
9625
9292
|
};
|
|
9626
9293
|
var MetadataItem_default = MetadataItem;
|
|
9627
9294
|
|
|
9628
9295
|
// src/components/Tabs/index.tsx
|
|
9629
|
-
import * as
|
|
9296
|
+
import * as React91 from "react";
|
|
9630
9297
|
|
|
9631
9298
|
// src/components/Tabs/wrapper.tsx
|
|
9632
|
-
import
|
|
9633
|
-
var
|
|
9299
|
+
import styled59, { css as css15 } from "styled-components";
|
|
9300
|
+
var Wrapper33 = styled59.div`
|
|
9634
9301
|
overflow: hidden;
|
|
9635
9302
|
margin-top: ${size(-1)};
|
|
9636
9303
|
margin-left: ${size(-1)};
|
|
@@ -9641,7 +9308,7 @@ var Wrapper34 = styled60.div`
|
|
|
9641
9308
|
margin-right: ${size(-2)};
|
|
9642
9309
|
}
|
|
9643
9310
|
`;
|
|
9644
|
-
var List10 =
|
|
9311
|
+
var List10 = styled59.ul`
|
|
9645
9312
|
list-style: none;
|
|
9646
9313
|
padding: 0;
|
|
9647
9314
|
margin: 0;
|
|
@@ -9655,12 +9322,12 @@ var List10 = styled60.ul`
|
|
|
9655
9322
|
padding-right: ${size(1)};
|
|
9656
9323
|
}
|
|
9657
9324
|
`;
|
|
9658
|
-
var Item12 =
|
|
9325
|
+
var Item12 = styled59.li`
|
|
9659
9326
|
display: inline-block;
|
|
9660
9327
|
vertical-align: bottom;
|
|
9661
9328
|
font-size: 1rem;
|
|
9662
9329
|
`;
|
|
9663
|
-
var Action9 =
|
|
9330
|
+
var Action9 = styled59(ButtonReset).attrs(() => ({
|
|
9664
9331
|
role: "tab",
|
|
9665
9332
|
className: "wayke__theme wayke__font--bold"
|
|
9666
9333
|
}))`
|
|
@@ -9696,9 +9363,9 @@ var Action9 = styled60(ButtonReset).attrs(() => ({
|
|
|
9696
9363
|
`;
|
|
9697
9364
|
|
|
9698
9365
|
// src/components/Tabs/index.tsx
|
|
9699
|
-
var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */
|
|
9366
|
+
var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */ React91.createElement(Wrapper33, null, /* @__PURE__ */ React91.createElement(List10, null, tabs.map((tab) => /* @__PURE__ */ React91.createElement(Item12, {
|
|
9700
9367
|
key: tab.name
|
|
9701
|
-
}, /* @__PURE__ */
|
|
9368
|
+
}, /* @__PURE__ */ React91.createElement(Action9, {
|
|
9702
9369
|
title: tab.displayName,
|
|
9703
9370
|
onClick: onClick ? () => onClick(tab.name) : void 0,
|
|
9704
9371
|
active: tab.name === active ? "true" : void 0
|
|
@@ -9706,30 +9373,30 @@ var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */ React94.createElement(
|
|
|
9706
9373
|
var Tabs_default = Tabs;
|
|
9707
9374
|
|
|
9708
9375
|
// src/layouts/searchItem/Property.tsx
|
|
9709
|
-
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */
|
|
9376
|
+
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(H5, {
|
|
9710
9377
|
as: "h3"
|
|
9711
|
-
}, name), /* @__PURE__ */
|
|
9378
|
+
}, name), /* @__PURE__ */ React92.createElement(TableList, null, !!properties.length && properties.map((property, index2) => /* @__PURE__ */ React92.createElement(MetadataItem_default, {
|
|
9712
9379
|
name: property.name,
|
|
9713
9380
|
hint: property.hint,
|
|
9714
9381
|
value: property.value,
|
|
9715
9382
|
unit: property.unit,
|
|
9716
9383
|
key: `${property.name}-${index2}`
|
|
9717
9384
|
}))));
|
|
9718
|
-
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */
|
|
9385
|
+
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */ React92.createElement("div", {
|
|
9719
9386
|
className: "tab-section"
|
|
9720
|
-
}, !!properties.length && /* @__PURE__ */
|
|
9387
|
+
}, !!properties.length && /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(TableList, null, properties.map((property, index2) => /* @__PURE__ */ React92.createElement(MetadataItem_default, {
|
|
9721
9388
|
name: property.name,
|
|
9722
9389
|
hint: property.hint,
|
|
9723
9390
|
value: property.value,
|
|
9724
9391
|
unit: property.unit,
|
|
9725
9392
|
key: `${property.name}-${index2}`
|
|
9726
|
-
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */
|
|
9393
|
+
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */ React92.createElement(MetadataSubCategory, {
|
|
9727
9394
|
name: subCategory.name,
|
|
9728
9395
|
properties: subCategory.properties,
|
|
9729
9396
|
key: `${subCategory.name}-${index2}`
|
|
9730
9397
|
})));
|
|
9731
9398
|
var PropertySet = ({ propertySet, vehicleData }) => {
|
|
9732
|
-
const [activeCategoryId, setActiveCategoryId] =
|
|
9399
|
+
const [activeCategoryId, setActiveCategoryId] = useState32(-1);
|
|
9733
9400
|
const mappedProperties = useMemo5(() => {
|
|
9734
9401
|
if (!propertySet) {
|
|
9735
9402
|
return void 0;
|
|
@@ -9741,7 +9408,7 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
9741
9408
|
property_tree_sorter_default(tree);
|
|
9742
9409
|
return tree;
|
|
9743
9410
|
}, [propertySet]);
|
|
9744
|
-
|
|
9411
|
+
useEffect17(() => {
|
|
9745
9412
|
const categories = mappedProperties?.categories?.length !== void 0 ? mappedProperties?.categories : void 0;
|
|
9746
9413
|
if (activeCategoryId < 0 && categories !== void 0 && categories.length > 0) {
|
|
9747
9414
|
setActiveCategoryId(categories[0].id);
|
|
@@ -9751,14 +9418,14 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
9751
9418
|
const activeCategory = mappedProperties?.categories?.find(
|
|
9752
9419
|
(category) => category.id === activeCategoryId
|
|
9753
9420
|
);
|
|
9754
|
-
return /* @__PURE__ */
|
|
9421
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(Tabs_default, {
|
|
9755
9422
|
tabs: mappedProperties?.categories?.map((category) => ({
|
|
9756
9423
|
name: `${category.id}`,
|
|
9757
9424
|
displayName: category.name
|
|
9758
9425
|
})) || [],
|
|
9759
9426
|
active: `${activeCategoryId}`,
|
|
9760
9427
|
onClick: onTab
|
|
9761
|
-
})), activeCategory && /* @__PURE__ */
|
|
9428
|
+
})), activeCategory && /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(MetadataCategory, {
|
|
9762
9429
|
properties: activeCategory.properties,
|
|
9763
9430
|
subCategories: activeCategory.subCategories
|
|
9764
9431
|
})));
|
|
@@ -9766,11 +9433,11 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
9766
9433
|
var Property_default = PropertySet;
|
|
9767
9434
|
|
|
9768
9435
|
// src/components/Pdf/index.tsx
|
|
9769
|
-
import
|
|
9436
|
+
import React93 from "react";
|
|
9770
9437
|
|
|
9771
9438
|
// src/components/Pdf/wrapper.tsx
|
|
9772
|
-
import
|
|
9773
|
-
var PdfListItem =
|
|
9439
|
+
import styled60 from "styled-components";
|
|
9440
|
+
var PdfListItem = styled60.li.attrs(() => ({
|
|
9774
9441
|
className: "wayke__theme wayke__color--primary-text"
|
|
9775
9442
|
}))`
|
|
9776
9443
|
flex: 0 0 50%;
|
|
@@ -9780,14 +9447,14 @@ var PdfListItem = styled61.li.attrs(() => ({
|
|
|
9780
9447
|
flex: 0 0 100%;
|
|
9781
9448
|
}
|
|
9782
9449
|
`;
|
|
9783
|
-
var PdfContainer =
|
|
9450
|
+
var PdfContainer = styled60.ul`
|
|
9784
9451
|
list-style: none;
|
|
9785
9452
|
padding: 0;
|
|
9786
9453
|
display: flex;
|
|
9787
9454
|
flex-wrap: wrap;
|
|
9788
9455
|
margin: ${size(-1)};
|
|
9789
9456
|
`;
|
|
9790
|
-
var PdfLink =
|
|
9457
|
+
var PdfLink = styled60.a.attrs(() => ({
|
|
9791
9458
|
className: "wayke__theme wayke__color--primary-text wayke__font--bold"
|
|
9792
9459
|
}))`
|
|
9793
9460
|
text-decoration: none;
|
|
@@ -9801,19 +9468,19 @@ var PdfLink = styled61.a.attrs(() => ({
|
|
|
9801
9468
|
height: 100%;
|
|
9802
9469
|
}
|
|
9803
9470
|
`;
|
|
9804
|
-
var PdfTitle =
|
|
9471
|
+
var PdfTitle = styled60.div`
|
|
9805
9472
|
color: ${(props) => props.theme.color.textDark};
|
|
9806
9473
|
`;
|
|
9807
|
-
var PdfSubtitle =
|
|
9474
|
+
var PdfSubtitle = styled60.div`
|
|
9808
9475
|
color: ${(props) => props.theme.color.textDarkLighten};
|
|
9809
9476
|
`;
|
|
9810
|
-
var PdfColumn =
|
|
9477
|
+
var PdfColumn = styled60.div`
|
|
9811
9478
|
flex 0 0 auto;
|
|
9812
9479
|
&:first-child {
|
|
9813
9480
|
flex: 1 1 auto;
|
|
9814
9481
|
}
|
|
9815
9482
|
`;
|
|
9816
|
-
var PdfListInner =
|
|
9483
|
+
var PdfListInner = styled60.div`
|
|
9817
9484
|
position: relative;
|
|
9818
9485
|
border: 1px solid ${(props) => props.theme.color.border};
|
|
9819
9486
|
padding: ${size(1.5)};
|
|
@@ -9825,12 +9492,12 @@ var PdfListInner = styled61.div`
|
|
|
9825
9492
|
`;
|
|
9826
9493
|
|
|
9827
9494
|
// src/components/Pdf/index.tsx
|
|
9828
|
-
var PdfDownloadItem = ({ document: document2 }) => /* @__PURE__ */
|
|
9495
|
+
var PdfDownloadItem = ({ document: document2 }) => /* @__PURE__ */ React93.createElement(PdfListItem, null, /* @__PURE__ */ React93.createElement(PdfListInner, null, /* @__PURE__ */ React93.createElement(PdfColumn, null, /* @__PURE__ */ React93.createElement(PdfTitle, null, document2.name), /* @__PURE__ */ React93.createElement(PdfSubtitle, null, document2.contentType)), /* @__PURE__ */ React93.createElement(PdfColumn, null, /* @__PURE__ */ React93.createElement(PdfLink, {
|
|
9829
9496
|
href: document2.url,
|
|
9830
9497
|
rel: "noopener noreferrer nofollow",
|
|
9831
9498
|
target: "_blank"
|
|
9832
9499
|
}, "\xD6ppna"))));
|
|
9833
|
-
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */
|
|
9500
|
+
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */ React93.createElement(PdfContainer, null, documents.map((document2, i) => /* @__PURE__ */ React93.createElement(PdfDownloadItem, {
|
|
9834
9501
|
key: `${document2.url}-${i}`,
|
|
9835
9502
|
document: document2
|
|
9836
9503
|
})));
|
|
@@ -9850,7 +9517,7 @@ var WaykeSearchItem = ({
|
|
|
9850
9517
|
const ecomContext = useRef4();
|
|
9851
9518
|
const { loading, data: result } = useSearchItem_default(id);
|
|
9852
9519
|
const { vehicle: centralStorageVehicle, loading: loadingCentralStorageVehicle } = useCentralStorage_default(result?.vehicle);
|
|
9853
|
-
|
|
9520
|
+
useEffect18(() => {
|
|
9854
9521
|
if (ecomSettings) {
|
|
9855
9522
|
ecomContext.current = new WaykeEcomWeb({
|
|
9856
9523
|
id,
|
|
@@ -9872,12 +9539,12 @@ var WaykeSearchItem = ({
|
|
|
9872
9539
|
}
|
|
9873
9540
|
};
|
|
9874
9541
|
}, []);
|
|
9875
|
-
|
|
9542
|
+
useEffect18(() => {
|
|
9876
9543
|
if (!disableResetScrollOnInit) {
|
|
9877
9544
|
window.scrollTo(0, 0);
|
|
9878
9545
|
}
|
|
9879
9546
|
}, []);
|
|
9880
|
-
|
|
9547
|
+
useEffect18(() => {
|
|
9881
9548
|
if (result?.vehicle?.data && modifyDocumentTitleItem) {
|
|
9882
9549
|
const { vehicle: vehicle2 } = result;
|
|
9883
9550
|
const { registrationNumber } = vehicle2.data;
|
|
@@ -9890,10 +9557,10 @@ var WaykeSearchItem = ({
|
|
|
9890
9557
|
);
|
|
9891
9558
|
const onShowMoreOptionsClick = useCallback38(() => pubsub_default.publish("OptionsClick"), []);
|
|
9892
9559
|
if (loading) {
|
|
9893
|
-
return /* @__PURE__ */
|
|
9560
|
+
return /* @__PURE__ */ React94.createElement(PageLoading_default, null);
|
|
9894
9561
|
}
|
|
9895
9562
|
if (!result?.vehicle?.data) {
|
|
9896
|
-
return /* @__PURE__ */
|
|
9563
|
+
return /* @__PURE__ */ React94.createElement(Page404_default, null);
|
|
9897
9564
|
}
|
|
9898
9565
|
const { vehicle } = result;
|
|
9899
9566
|
const contact = centralStorageVehicle?.contact;
|
|
@@ -9927,40 +9594,40 @@ var WaykeSearchItem = ({
|
|
|
9927
9594
|
if (fuelType) {
|
|
9928
9595
|
uspList.push({ title: fuelType });
|
|
9929
9596
|
}
|
|
9930
|
-
return /* @__PURE__ */
|
|
9597
|
+
return /* @__PURE__ */ React94.createElement(React94.Fragment, null, /* @__PURE__ */ React94.createElement(Page, null, /* @__PURE__ */ React94.createElement(PageSection, {
|
|
9931
9598
|
large: true
|
|
9932
|
-
}, /* @__PURE__ */
|
|
9599
|
+
}, /* @__PURE__ */ React94.createElement(Container_default, null, /* @__PURE__ */ React94.createElement(ProductPage, null, /* @__PURE__ */ React94.createElement(ProductPageAside, null, /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9933
9600
|
mobileOrder: 1
|
|
9934
|
-
}, !pathRoute && hashRoute ? /* @__PURE__ */
|
|
9601
|
+
}, !pathRoute && hashRoute ? /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(UtilityFontSizeSmall, null, /* @__PURE__ */ React94.createElement(ButtonInlineLight, {
|
|
9935
9602
|
as: "a",
|
|
9936
9603
|
href: "#",
|
|
9937
9604
|
title: "Tillbaka till bils\xF6k"
|
|
9938
|
-
}, /* @__PURE__ */
|
|
9605
|
+
}, /* @__PURE__ */ React94.createElement(ButtonContent, null, /* @__PURE__ */ React94.createElement(IconChevronLeft, {
|
|
9939
9606
|
block: true
|
|
9940
|
-
})), /* @__PURE__ */
|
|
9607
|
+
})), /* @__PURE__ */ React94.createElement(ButtonContent, null, "Tillbaka till bils\xF6k")))) : null, manufacturer?.logotype && /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(LogoBox_default, {
|
|
9941
9608
|
logo: manufacturer.logotype,
|
|
9942
9609
|
alt: manufacturer.name
|
|
9943
|
-
})), /* @__PURE__ */
|
|
9610
|
+
})), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(RepeatSmall, null, /* @__PURE__ */ React94.createElement(H1, {
|
|
9944
9611
|
noMargin: true
|
|
9945
|
-
}, title)), shortDescription && /* @__PURE__ */
|
|
9612
|
+
}, title)), shortDescription && /* @__PURE__ */ React94.createElement(RepeatSmall, null, /* @__PURE__ */ React94.createElement("div", null, shortDescription)), /* @__PURE__ */ React94.createElement(RepeatSmall, null, /* @__PURE__ */ React94.createElement(UspList_default, {
|
|
9946
9613
|
small: true,
|
|
9947
9614
|
items: uspList
|
|
9948
|
-
})))), /* @__PURE__ */
|
|
9615
|
+
})))), /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9949
9616
|
mobileOrder: 2
|
|
9950
|
-
}, /* @__PURE__ */
|
|
9617
|
+
}, /* @__PURE__ */ React94.createElement(PriceTable_default, {
|
|
9951
9618
|
price
|
|
9952
|
-
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */
|
|
9619
|
+
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9953
9620
|
mobileOrder: 4
|
|
9954
|
-
}, financialOptions.length > 0 && /* @__PURE__ */
|
|
9621
|
+
}, financialOptions.length > 0 && /* @__PURE__ */ React94.createElement(FinancialOptions_default, {
|
|
9955
9622
|
id,
|
|
9956
9623
|
financialOptions
|
|
9957
|
-
}), insuranceOptions.length > 0 && /* @__PURE__ */
|
|
9624
|
+
}), insuranceOptions.length > 0 && /* @__PURE__ */ React94.createElement(InsuranceOptions_default, {
|
|
9958
9625
|
id,
|
|
9959
9626
|
branch: centralStorageVehicle?.branch,
|
|
9960
9627
|
insuranceOptions
|
|
9961
|
-
})), /* @__PURE__ */
|
|
9628
|
+
})), /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9962
9629
|
mobileOrder: 5
|
|
9963
|
-
}, /* @__PURE__ */
|
|
9630
|
+
}, /* @__PURE__ */ React94.createElement(CheckList_default, {
|
|
9964
9631
|
manufacturer,
|
|
9965
9632
|
packageOptions,
|
|
9966
9633
|
ecommerce,
|
|
@@ -9968,77 +9635,77 @@ var WaykeSearchItem = ({
|
|
|
9968
9635
|
contact: centralStorageVehicle?.contact,
|
|
9969
9636
|
loadingCentralStorageVehicle,
|
|
9970
9637
|
toggleEcomModal: () => ecomContext.current?.start()
|
|
9971
|
-
}))), /* @__PURE__ */
|
|
9638
|
+
}))), /* @__PURE__ */ React94.createElement(ProductPageMain, null, /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9972
9639
|
mobileOrder: 3
|
|
9973
|
-
}, /* @__PURE__ */
|
|
9640
|
+
}, /* @__PURE__ */ React94.createElement(Gallery_default, {
|
|
9974
9641
|
media,
|
|
9975
9642
|
placeholderImage
|
|
9976
|
-
})), /* @__PURE__ */
|
|
9643
|
+
})), /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(H2, {
|
|
9977
9644
|
noMargin: true
|
|
9978
|
-
}, "Biluppgifter")), /* @__PURE__ */
|
|
9645
|
+
}, "Biluppgifter")), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Content_default, null, /* @__PURE__ */ React94.createElement("p", null, "Information direkt fr\xE5n Transportstyrelsen och tillverkaren."))), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Property_default, {
|
|
9979
9646
|
propertySet,
|
|
9980
9647
|
vehicleData: vehicle.data
|
|
9981
|
-
}))), description && /* @__PURE__ */
|
|
9648
|
+
}))), description && /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Blockquote_default, {
|
|
9982
9649
|
author: contact && contact.name ? contact.name : null,
|
|
9983
9650
|
date: publishedAt ? dateTimeFormat.format(publishedAt, dateTimeFormat.DayMonth) : void 0,
|
|
9984
9651
|
avatar: contact?.avatar || void 0
|
|
9985
|
-
}, !!description && /* @__PURE__ */
|
|
9652
|
+
}, !!description && /* @__PURE__ */ React94.createElement("p", null, description))), (options?.length || 0) > 0 && /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(H2, {
|
|
9986
9653
|
noMargin: true
|
|
9987
|
-
}, "Utrustning")), /* @__PURE__ */
|
|
9654
|
+
}, "Utrustning")), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Content_default, null, /* @__PURE__ */ React94.createElement("p", null, "Kompletterande uppgifter om bilen."))), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(ExtendContent_default, {
|
|
9988
9655
|
actionTitle: "Visa mer",
|
|
9989
9656
|
onClick: onShowMoreOptionsClick
|
|
9990
|
-
}, /* @__PURE__ */
|
|
9657
|
+
}, /* @__PURE__ */ React94.createElement(UspList_default, {
|
|
9991
9658
|
items: options
|
|
9992
|
-
})))), (documents.length || 0) > 0 && /* @__PURE__ */
|
|
9659
|
+
})))), (documents.length || 0) > 0 && /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(H2, {
|
|
9993
9660
|
noMargin: true
|
|
9994
|
-
}, "Dokument")), /* @__PURE__ */
|
|
9661
|
+
}, "Dokument")), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Content_default, null, /* @__PURE__ */ React94.createElement("p", null, "Tillh\xF6rande dokument f\xF6r bilen."))), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Pdf_default, {
|
|
9995
9662
|
documents
|
|
9996
|
-
}))), /* @__PURE__ */
|
|
9663
|
+
}))), /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Branch_default, {
|
|
9997
9664
|
branch,
|
|
9998
9665
|
loading: loadingCentralStorageVehicle
|
|
9999
|
-
}), ecommerce && ecommerce.enabled && /* @__PURE__ */
|
|
9666
|
+
}), ecommerce && ecommerce.enabled && /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(ButtonPrimary, {
|
|
10000
9667
|
disabled: !!ecommerce.reserved,
|
|
10001
9668
|
title: "K\xF6p bilen online",
|
|
10002
9669
|
onClick: () => ecomContext.current?.start()
|
|
10003
|
-
}, "K\xF6p bilen online"))), /* @__PURE__ */
|
|
9670
|
+
}, "K\xF6p bilen online"))), /* @__PURE__ */ React94.createElement(PackageOptions_default, {
|
|
10004
9671
|
packageOptions
|
|
10005
|
-
}), /* @__PURE__ */
|
|
9672
|
+
}), /* @__PURE__ */ React94.createElement(ManufacturerPackagesOption_default, {
|
|
10006
9673
|
packageOption: manufacturer?.packageOption
|
|
10007
|
-
}))))), /* @__PURE__ */
|
|
9674
|
+
}))))), /* @__PURE__ */ React94.createElement(Related_default, {
|
|
10008
9675
|
id,
|
|
10009
9676
|
hashRoute,
|
|
10010
9677
|
pathRoute,
|
|
10011
9678
|
onClickSearchItem
|
|
10012
|
-
})), false, /* @__PURE__ */
|
|
9679
|
+
})), false, /* @__PURE__ */ React94.createElement(portal_element_default, {
|
|
10013
9680
|
id: portal_namespace_exports.DefaultPortal
|
|
10014
9681
|
}));
|
|
10015
9682
|
};
|
|
10016
9683
|
var searchItem_default = WaykeSearchItem;
|
|
10017
9684
|
|
|
10018
9685
|
// src/providers/WaykeProvider.tsx
|
|
10019
|
-
import
|
|
9686
|
+
import React102 from "react";
|
|
10020
9687
|
|
|
10021
9688
|
// src/providers/graphqlProvider.tsx
|
|
10022
|
-
import
|
|
9689
|
+
import React95 from "react";
|
|
10023
9690
|
import { ApolloProvider as ApolloProviderBase, ApolloClient, InMemoryCache } from "@apollo/client";
|
|
10024
9691
|
var GraphqlProvider = ({ uri, children }) => {
|
|
10025
9692
|
const client = new ApolloClient({ uri, cache: new InMemoryCache() });
|
|
10026
|
-
return /* @__PURE__ */
|
|
9693
|
+
return /* @__PURE__ */ React95.createElement(ApolloProviderBase, {
|
|
10027
9694
|
client
|
|
10028
9695
|
}, children);
|
|
10029
9696
|
};
|
|
10030
9697
|
var graphqlProvider_default = GraphqlProvider;
|
|
10031
9698
|
|
|
10032
9699
|
// src/providers/themeProvider.tsx
|
|
10033
|
-
import
|
|
9700
|
+
import React96 from "react";
|
|
10034
9701
|
import { ThemeProvider as ThemeProviderBase } from "styled-components";
|
|
10035
|
-
var ThemeProvider = ({ children }) => /* @__PURE__ */
|
|
9702
|
+
var ThemeProvider = ({ children }) => /* @__PURE__ */ React96.createElement(ThemeProviderBase, {
|
|
10036
9703
|
theme: theme_default
|
|
10037
9704
|
}, children);
|
|
10038
9705
|
var themeProvider_default = ThemeProvider;
|
|
10039
9706
|
|
|
10040
9707
|
// src/State/Search/SearchProvider.tsx
|
|
10041
|
-
import
|
|
9708
|
+
import React97, { useState as useState33, useEffect as useEffect19, useCallback as useCallback39 } from "react";
|
|
10042
9709
|
|
|
10043
9710
|
// src/utils/url.ts
|
|
10044
9711
|
var getUrlSearchParamsFromUrl = () => new URLSearchParams(window.location.search);
|
|
@@ -10055,12 +9722,12 @@ var SearchProvider = ({
|
|
|
10055
9722
|
children
|
|
10056
9723
|
}) => {
|
|
10057
9724
|
const { replaceState, pushState } = usePath_default();
|
|
10058
|
-
const [queryFilter, setQueryFilter] =
|
|
9725
|
+
const [queryFilter, setQueryFilter] = useState33({
|
|
10059
9726
|
searchParams: initialSearchParams
|
|
10060
9727
|
});
|
|
10061
|
-
const [initialFacets, setInitialFacets] =
|
|
10062
|
-
const [documents, setDocuments] =
|
|
10063
|
-
const [initialize, setInitialize] =
|
|
9728
|
+
const [initialFacets, setInitialFacets] = useState33();
|
|
9729
|
+
const [documents, setDocuments] = useState33();
|
|
9730
|
+
const [initialize, setInitialize] = useState33(false);
|
|
10064
9731
|
const { data: initialDataRepsonse } = useFetch_default(
|
|
10065
9732
|
`${url}?hits=0`,
|
|
10066
9733
|
{
|
|
@@ -10096,7 +9763,7 @@ var SearchProvider = ({
|
|
|
10096
9763
|
});
|
|
10097
9764
|
}
|
|
10098
9765
|
};
|
|
10099
|
-
|
|
9766
|
+
useEffect19(() => {
|
|
10100
9767
|
if (useQueryParamsFromUrl) {
|
|
10101
9768
|
window.addEventListener("popstate", popStateEvent);
|
|
10102
9769
|
}
|
|
@@ -10110,12 +9777,12 @@ var SearchProvider = ({
|
|
|
10110
9777
|
pubsub_default.unsubscribeAction(onFilterUpdateEvent);
|
|
10111
9778
|
};
|
|
10112
9779
|
}, []);
|
|
10113
|
-
|
|
9780
|
+
useEffect19(() => {
|
|
10114
9781
|
if (initialDataRepsonse) {
|
|
10115
9782
|
setInitialFacets(initialDataRepsonse.facets);
|
|
10116
9783
|
}
|
|
10117
9784
|
}, [initialDataRepsonse]);
|
|
10118
|
-
|
|
9785
|
+
useEffect19(() => {
|
|
10119
9786
|
if (useQueryParamsFromUrl) {
|
|
10120
9787
|
const nextSearchParams = new URLSearchParams(queryFilter.searchParams);
|
|
10121
9788
|
nextSearchParams.delete("hits");
|
|
@@ -10138,7 +9805,7 @@ var SearchProvider = ({
|
|
|
10138
9805
|
}
|
|
10139
9806
|
}
|
|
10140
9807
|
}, [queryFilter, initialize, useQueryParamsFromUrl]);
|
|
10141
|
-
|
|
9808
|
+
useEffect19(() => {
|
|
10142
9809
|
if (response) {
|
|
10143
9810
|
if (!initialFacets && !useQueryParamsFromUrl) {
|
|
10144
9811
|
setInitialFacets(response.facets);
|
|
@@ -10228,15 +9895,15 @@ var SearchProvider = ({
|
|
|
10228
9895
|
onLoadMore,
|
|
10229
9896
|
onInitialize
|
|
10230
9897
|
};
|
|
10231
|
-
return /* @__PURE__ */
|
|
9898
|
+
return /* @__PURE__ */ React97.createElement(SearchContext.Provider, {
|
|
10232
9899
|
value
|
|
10233
9900
|
}, children);
|
|
10234
9901
|
};
|
|
10235
9902
|
var SearchProvider_default = SearchProvider;
|
|
10236
9903
|
|
|
10237
9904
|
// src/components/Root/index.tsx
|
|
10238
|
-
import
|
|
10239
|
-
var Root =
|
|
9905
|
+
import styled61 from "styled-components";
|
|
9906
|
+
var Root = styled61.div.attrs(() => ({
|
|
10240
9907
|
className: "wayke__theme wayke__font--regular"
|
|
10241
9908
|
}))`
|
|
10242
9909
|
background-color: ${(props) => props.theme.color.bg};
|
|
@@ -10278,21 +9945,21 @@ var useEcom = (ecomSettings) => {
|
|
|
10278
9945
|
var useEcom_default = useEcom;
|
|
10279
9946
|
|
|
10280
9947
|
// src/State/Settings/SettingsProvider.tsx
|
|
10281
|
-
import
|
|
9948
|
+
import React98 from "react";
|
|
10282
9949
|
var SettingsProvider = ({
|
|
10283
9950
|
googleMapsApiKey,
|
|
10284
9951
|
googleMapsMarker,
|
|
10285
9952
|
ecomSettings,
|
|
10286
9953
|
children
|
|
10287
|
-
}) => /* @__PURE__ */
|
|
9954
|
+
}) => /* @__PURE__ */ React98.createElement(SettingsContext.Provider, {
|
|
10288
9955
|
value: { ecomSettings, googleMapsApiKey, googleMapsMarker }
|
|
10289
9956
|
}, children);
|
|
10290
9957
|
var SettingsProvider_default = SettingsProvider;
|
|
10291
9958
|
|
|
10292
9959
|
// src/State/RelatedSearch/RelatedSearchProvider.tsx
|
|
10293
|
-
import
|
|
9960
|
+
import React99, { useState as useState34, useCallback as useCallback40 } from "react";
|
|
10294
9961
|
var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
10295
|
-
const [queryFilter, setQueryFilter] =
|
|
9962
|
+
const [queryFilter, setQueryFilter] = useState34();
|
|
10296
9963
|
const query = queryFilter?.searchParams.toString();
|
|
10297
9964
|
const {
|
|
10298
9965
|
loading,
|
|
@@ -10321,19 +9988,19 @@ var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
|
10321
9988
|
queryFilter,
|
|
10322
9989
|
fetchRelated
|
|
10323
9990
|
};
|
|
10324
|
-
return /* @__PURE__ */
|
|
9991
|
+
return /* @__PURE__ */ React99.createElement(RelatedSearchContext.Provider, {
|
|
10325
9992
|
value
|
|
10326
9993
|
}, children);
|
|
10327
9994
|
};
|
|
10328
9995
|
var RelatedSearchProvider_default = RelatedSearchProvider;
|
|
10329
9996
|
|
|
10330
9997
|
// src/State/CentralStorage/CentralStorageProvider.tsx
|
|
10331
|
-
import
|
|
9998
|
+
import React100, { useCallback as useCallback42 } from "react";
|
|
10332
9999
|
|
|
10333
10000
|
// src/hooks/useSessionStorage.ts
|
|
10334
|
-
import { useState as
|
|
10001
|
+
import { useState as useState35, useCallback as useCallback41 } from "react";
|
|
10335
10002
|
var useSessionStorage = (key) => {
|
|
10336
|
-
const [value, setValue] =
|
|
10003
|
+
const [value, setValue] = useState35(sessionStorage.getItem(key));
|
|
10337
10004
|
const set = useCallback41(
|
|
10338
10005
|
(v) => {
|
|
10339
10006
|
sessionStorage.setItem(key, v);
|
|
@@ -10362,20 +10029,20 @@ var useSessionStorage_default = useSessionStorage;
|
|
|
10362
10029
|
var CentralStorageProvider = ({ children }) => {
|
|
10363
10030
|
const { value, set, remove } = useSessionStorage_default("centralStorage");
|
|
10364
10031
|
const setCentralStorageId = useCallback42((id) => id ? set(id) : remove(), []);
|
|
10365
|
-
return /* @__PURE__ */
|
|
10032
|
+
return /* @__PURE__ */ React100.createElement(CentralStorageContext.Provider, {
|
|
10366
10033
|
value: { centralStorageId: value, setCentralStorageId }
|
|
10367
10034
|
}, children);
|
|
10368
10035
|
};
|
|
10369
10036
|
var CentralStorageProvider_default = CentralStorageProvider;
|
|
10370
10037
|
|
|
10371
10038
|
// src/State/Path/PathProvider.tsx
|
|
10372
|
-
import
|
|
10039
|
+
import React101, { useCallback as useCallback43, useEffect as useEffect21, useMemo as useMemo7, useReducer } from "react";
|
|
10373
10040
|
|
|
10374
10041
|
// src/hooks/usePrevious.ts
|
|
10375
|
-
import { useRef as useRef5, useEffect as
|
|
10042
|
+
import { useRef as useRef5, useEffect as useEffect20 } from "react";
|
|
10376
10043
|
var usePrevious = (value) => {
|
|
10377
10044
|
const ref = useRef5();
|
|
10378
|
-
|
|
10045
|
+
useEffect20(() => {
|
|
10379
10046
|
ref.current = value;
|
|
10380
10047
|
});
|
|
10381
10048
|
return ref.current;
|
|
@@ -10405,7 +10072,7 @@ var POP_STATE = "popstate";
|
|
|
10405
10072
|
var PathProvider = ({ children }) => {
|
|
10406
10073
|
const [state, dispatch] = useReducer(reducer_default, initialState);
|
|
10407
10074
|
const previousPath = usePrevious_default(state.path);
|
|
10408
|
-
|
|
10075
|
+
useEffect21(() => {
|
|
10409
10076
|
const onPopState = () => {
|
|
10410
10077
|
dispatch({ type: SET_PATH, path: window.location.pathname });
|
|
10411
10078
|
};
|
|
@@ -10443,7 +10110,7 @@ var PathProvider = ({ children }) => {
|
|
|
10443
10110
|
}),
|
|
10444
10111
|
[state]
|
|
10445
10112
|
);
|
|
10446
|
-
return /* @__PURE__ */
|
|
10113
|
+
return /* @__PURE__ */ React101.createElement(PathContext.Provider, {
|
|
10447
10114
|
value
|
|
10448
10115
|
}, children);
|
|
10449
10116
|
};
|
|
@@ -10463,33 +10130,33 @@ var WaykeProvider = ({
|
|
|
10463
10130
|
children
|
|
10464
10131
|
}) => {
|
|
10465
10132
|
useEcom_default(ecomSettings);
|
|
10466
|
-
return /* @__PURE__ */
|
|
10133
|
+
return /* @__PURE__ */ React102.createElement(PathProvider_default, null, /* @__PURE__ */ React102.createElement(SettingsProvider_default, {
|
|
10467
10134
|
googleMapsApiKey,
|
|
10468
10135
|
googleMapsMarker,
|
|
10469
10136
|
ecomSettings
|
|
10470
|
-
}, /* @__PURE__ */
|
|
10137
|
+
}, /* @__PURE__ */ React102.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ React102.createElement(graphqlProvider_default, {
|
|
10471
10138
|
uri: graphQlUrl
|
|
10472
|
-
}, /* @__PURE__ */
|
|
10139
|
+
}, /* @__PURE__ */ React102.createElement(SearchProvider_default, {
|
|
10473
10140
|
url,
|
|
10474
10141
|
apiKey,
|
|
10475
10142
|
useQueryParamsFromUrl,
|
|
10476
10143
|
pathRoute
|
|
10477
|
-
}, /* @__PURE__ */
|
|
10144
|
+
}, /* @__PURE__ */ React102.createElement(RelatedSearchProvider_default, {
|
|
10478
10145
|
url,
|
|
10479
10146
|
urlMlt,
|
|
10480
10147
|
apiKey
|
|
10481
|
-
}, /* @__PURE__ */
|
|
10148
|
+
}, /* @__PURE__ */ React102.createElement(themeProvider_default, null, /* @__PURE__ */ React102.createElement(Root_default, null, children))))))));
|
|
10482
10149
|
};
|
|
10483
10150
|
var WaykeProvider_default = WaykeProvider;
|
|
10484
10151
|
|
|
10485
10152
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
10486
|
-
import
|
|
10153
|
+
import React104 from "react";
|
|
10487
10154
|
|
|
10488
10155
|
// src/layouts/WaykeComposite.tsx
|
|
10489
|
-
import
|
|
10156
|
+
import React103, { useEffect as useEffect23 } from "react";
|
|
10490
10157
|
|
|
10491
10158
|
// src/hooks/useHashGuid.ts
|
|
10492
|
-
import { useState as
|
|
10159
|
+
import { useState as useState36, useEffect as useEffect22 } from "react";
|
|
10493
10160
|
var regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
10494
10161
|
var HASH_CHANGE = "hashchange";
|
|
10495
10162
|
var getGuid = () => {
|
|
@@ -10497,7 +10164,7 @@ var getGuid = () => {
|
|
|
10497
10164
|
return regexGuid.test(guid) || !guid ? guid : void 0;
|
|
10498
10165
|
};
|
|
10499
10166
|
var useHashGuid = () => {
|
|
10500
|
-
const [id, setId] =
|
|
10167
|
+
const [id, setId] = useState36(() => getGuid());
|
|
10501
10168
|
const onHashChange = () => {
|
|
10502
10169
|
const guid = window.location.hash.substr(1, window.location.hash.length);
|
|
10503
10170
|
if (regexGuid.test(guid) || !guid) {
|
|
@@ -10506,7 +10173,7 @@ var useHashGuid = () => {
|
|
|
10506
10173
|
throw "Invalid Guid";
|
|
10507
10174
|
}
|
|
10508
10175
|
};
|
|
10509
|
-
|
|
10176
|
+
useEffect22(() => {
|
|
10510
10177
|
onHashChange();
|
|
10511
10178
|
window.addEventListener(HASH_CHANGE, onHashChange);
|
|
10512
10179
|
return () => {
|
|
@@ -10531,7 +10198,7 @@ var WaykeComposite = ({
|
|
|
10531
10198
|
}) => {
|
|
10532
10199
|
const hashId = useHashGuid_default();
|
|
10533
10200
|
const { id: pathId } = usePath_default();
|
|
10534
|
-
|
|
10201
|
+
useEffect23(() => {
|
|
10535
10202
|
if (!pathRoute) {
|
|
10536
10203
|
if (hashId) {
|
|
10537
10204
|
pubsub_default.publish("HashRouteChange", hashId);
|
|
@@ -10541,14 +10208,14 @@ var WaykeComposite = ({
|
|
|
10541
10208
|
}
|
|
10542
10209
|
}, [hashId]);
|
|
10543
10210
|
const id = pathId || hashId;
|
|
10544
|
-
return /* @__PURE__ */
|
|
10211
|
+
return /* @__PURE__ */ React103.createElement(React103.Fragment, null, id ? /* @__PURE__ */ React103.createElement(searchItem_default, {
|
|
10545
10212
|
id,
|
|
10546
10213
|
hashRoute: !pathRoute,
|
|
10547
10214
|
disableResetScrollOnInit,
|
|
10548
10215
|
placeholderImage,
|
|
10549
10216
|
pathRoute,
|
|
10550
10217
|
modifyDocumentTitleItem
|
|
10551
|
-
}) : /* @__PURE__ */
|
|
10218
|
+
}) : /* @__PURE__ */ React103.createElement(search_default, {
|
|
10552
10219
|
filterList,
|
|
10553
10220
|
initialQueryParams,
|
|
10554
10221
|
removeSearchBar,
|
|
@@ -10562,15 +10229,15 @@ var WaykeComposite = ({
|
|
|
10562
10229
|
var WaykeComposite_default = WaykeComposite;
|
|
10563
10230
|
|
|
10564
10231
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
10565
|
-
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */
|
|
10232
|
+
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */ React104.createElement(WaykeProvider_default, {
|
|
10566
10233
|
...provider
|
|
10567
|
-
}, /* @__PURE__ */
|
|
10234
|
+
}, /* @__PURE__ */ React104.createElement(WaykeComposite_default, {
|
|
10568
10235
|
...composite
|
|
10569
10236
|
}));
|
|
10570
10237
|
var WaykeCompositeWithProvider_default = WaykeCompositeWithProvider;
|
|
10571
10238
|
|
|
10572
10239
|
// src/providers/WaykeItemProvidet.tsx
|
|
10573
|
-
import
|
|
10240
|
+
import React105 from "react";
|
|
10574
10241
|
var WaykeItemProvider = ({
|
|
10575
10242
|
url,
|
|
10576
10243
|
urlMlt,
|
|
@@ -10582,17 +10249,17 @@ var WaykeItemProvider = ({
|
|
|
10582
10249
|
children
|
|
10583
10250
|
}) => {
|
|
10584
10251
|
useEcom_default(ecomSettings);
|
|
10585
|
-
return /* @__PURE__ */
|
|
10252
|
+
return /* @__PURE__ */ React105.createElement(PathProvider_default, null, /* @__PURE__ */ React105.createElement(SettingsProvider_default, {
|
|
10586
10253
|
googleMapsApiKey,
|
|
10587
10254
|
googleMapsMarker,
|
|
10588
10255
|
ecomSettings
|
|
10589
|
-
}, /* @__PURE__ */
|
|
10256
|
+
}, /* @__PURE__ */ React105.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ React105.createElement(graphqlProvider_default, {
|
|
10590
10257
|
uri: graphQlUrl
|
|
10591
|
-
}, /* @__PURE__ */
|
|
10258
|
+
}, /* @__PURE__ */ React105.createElement(RelatedSearchProvider_default, {
|
|
10592
10259
|
url,
|
|
10593
10260
|
urlMlt,
|
|
10594
10261
|
apiKey
|
|
10595
|
-
}, /* @__PURE__ */
|
|
10262
|
+
}, /* @__PURE__ */ React105.createElement(themeProvider_default, null, /* @__PURE__ */ React105.createElement(Root_default, null, children)))))));
|
|
10596
10263
|
};
|
|
10597
10264
|
var WaykeItemProvidet_default = WaykeItemProvider;
|
|
10598
10265
|
|