vviinn-widgets 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/highlight-box_22.cjs.entry.js +1 -1
- package/dist/cjs/{index-c493804d.js → index-363cfe0b.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{vviinn-carousel_5.cjs.entry.js → vviinn-carousel_3.cjs.entry.js} +4 -90
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +63 -0
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +44 -0
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-widgets.cjs.js +1 -1
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +4 -0
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +6 -3
- package/dist/collection/components/vviinn-icons/index.js +2 -2
- package/dist/collection/components/vviinn-product-card/stories/args.js +73 -0
- package/dist/collection/components/vviinn-product-card/stories/decorators.js +51 -0
- package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +105 -0
- package/dist/collection/components/vviinn-vpr-button/stories/args.js +207 -0
- package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +89 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +11 -4
- package/dist/collection/components/vviinn-vpr-widget/stories/args.js +190 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/decorators.js +29 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +212 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +1 -0
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +31 -0
- package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +33 -0
- package/dist/esm/highlight-box_22.entry.js +1 -1
- package/dist/esm/{index-8cb063df.js → index-9e125c6c.js} +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{vviinn-carousel_5.entry.js → vviinn-carousel_3.entry.js} +5 -89
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +59 -0
- package/dist/esm/vviinn-vpr-button.entry.js +40 -0
- package/dist/esm/vviinn-vps-button.entry.js +1 -1
- package/dist/esm/vviinn-widgets.js +1 -1
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +3 -0
- package/dist/types/components/vviinn-product-card/stories/args.d.ts +73 -0
- package/dist/types/components/vviinn-product-card/stories/decorators.d.ts +1 -0
- package/dist/types/components/vviinn-product-card/stories/vviinn-product-card.stories.d.ts +80 -0
- package/dist/types/components/vviinn-vpr-button/stories/args.d.ts +207 -0
- package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +214 -0
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +3 -0
- package/dist/types/components/vviinn-vpr-widget/stories/args.d.ts +198 -0
- package/dist/types/components/vviinn-vpr-widget/stories/decorators.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.d.ts +141 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +1 -0
- package/dist/types/components/vviinn-vps-button/stories/vviinn-vps-button.stories.d.ts +12 -0
- package/dist/types/components/{vviinn-vpr-button/stories/kek.stories.d.ts → vviinn-vps-widget/stories/vviinn-vps-widget.stories.d.ts} +5 -2
- package/dist/vviinn-widgets/{p-56fc949a.js → p-126775a2.js} +1 -1
- package/dist/vviinn-widgets/p-1f0c8cf6.entry.js +1 -0
- package/dist/vviinn-widgets/p-3734a3ef.entry.js +1 -0
- package/{www/build/p-d085199d.entry.js → dist/vviinn-widgets/p-71809bed.entry.js} +1 -1
- package/dist/vviinn-widgets/p-9ea96a69.entry.js +1 -0
- package/dist/vviinn-widgets/p-a95c00c9.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-56fc949a.js → p-126775a2.js} +1 -1
- package/www/build/p-1f0c8cf6.entry.js +1 -0
- package/www/build/p-3734a3ef.entry.js +1 -0
- package/www/build/p-4379b1c2.js +1 -0
- package/{dist/vviinn-widgets/p-d085199d.entry.js → www/build/p-71809bed.entry.js} +1 -1
- package/www/build/p-9ea96a69.entry.js +1 -0
- package/www/build/p-a95c00c9.entry.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +4 -74
- package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +0 -18
- package/dist/vviinn-widgets/p-04b06ea9.entry.js +0 -1
- package/dist/vviinn-widgets/p-400eb62f.entry.js +0 -1
- package/www/build/p-04b06ea9.entry.js +0 -1
- package/www/build/p-400eb62f.entry.js +0 -1
- package/www/build/p-7e4978d5.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,H as o,g as r}from"./p-e1ba8626.js";import{b as a}from"./p-126775a2.js";let n=class{constructor(e){t(this,e),this.modalClosed=i(this,"modalClosed",7),this.position="bottom",this.sourceImage=null,this.widgetScrollbar=!1,this.state="idle"}bodyClickListener(t){const{clientX:i,clientY:e}=t,o=this.getSidebarRectangle();o&&(i>=o.left&&i<=o.right&&e>=o.top&&e<=o.bottom||(this.state="closed"))}getClassMap(){return{[this.position]:!0,[this.state]:!0}}getSidebarRectangle(){var t;return null===(t=this.el.shadowRoot.querySelector("aside"))||void 0===t?void 0:t.getBoundingClientRect()}render(){return e(o,{class:this.getClassMap()},e("aside",{class:"sidebar",part:"body",onAnimationEnd:t=>this.handleAnimationEnd(t)},e("header",{class:{"contains-source-img":this.isSourceImageValid()},part:"sidebar-header"},this.isSourceImageValid()?this.renderSourceImage():null,e("span",{class:"title",part:"title"},this.sidebarTitle),e("button",{class:"close-sidebar",onClick:()=>this.state="closed"},e(a,null))),e("main",{part:"sidebar-content"},e("vviinn-vpr-widget",{exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title: product-title",token:this.token,productId:this.productId,imageWidth:300,blockTitle:"",mode:"bottom"===this.position?"continuity":"grid",useCarousel:"bottom"===this.position,onRecommendationsLoaded:()=>this.state="open",showScroll:this.widgetScrollbar}))))}renderSourceImage(){return e("img",{class:"source-image",part:"source-image",src:this.sourceImage})}isSourceImageValid(){var t;return(null===(t=this.sourceImage)||void 0===t?void 0:t.length)>0}handleAnimationEnd({animationName:t}){t.includes("slideOut")&&this.modalClosed.emit()}get el(){return r(this)}};n.style=":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";export{n as vviinn_recommendations_sidebar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as i}from"./p-e1ba8626.js";import{g as r}from"./p-78ccc9eb.js";(()=>{const i=import.meta.url,r={};return""!==i&&(r.resourcesUrl=new URL(".",i).href),e(r)})().then((e=>(r(),i([["p-f47e82b2",[[1,"cropper-handler",{handler:[16],disabled:[4]}]]],["p-fb14e3cc",[[1,"vviinn-error"]]],["p-9d24f51e",[[1,"vviinn-preloader"]]],["p-
|
|
1
|
+
import{p as e,b as i}from"./p-e1ba8626.js";import{g as r}from"./p-78ccc9eb.js";(()=>{const i=import.meta.url,r={};return""!==i&&(r.resourcesUrl=new URL(".",i).href),e(r)})().then((e=>(r(),i([["p-f47e82b2",[[1,"cropper-handler",{handler:[16],disabled:[4]}]]],["p-fb14e3cc",[[1,"vviinn-error"]]],["p-9d24f51e",[[1,"vviinn-preloader"]]],["p-1f0c8cf6",[[1,"vviinn-vpr-widget",{blockTitle:[1,"block-title"],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],productId:[1,"product-id"],token:[1],currencySign:[1,"currency-sign"],pricePrefix:[1,"price-prefix"],mode:[1],campaignType:[1,"campaign-type"],locale:[1],apiPath:[1,"api-path"],useCarousel:[4,"use-carousel"],showScroll:[4,"show-scroll"],cssUrl:[1,"css-url"],recommendations:[32],loaded:[32]},[[0,"productImageLoaded","lol"]]],[0,"vviinn-carousel",{mode:[1],imageWidth:[2,"image-width"],showScroll:[4,"show-scroll"],recommendations:[16],moveDirection:[32],contentGroups:[32],activeContentGroup:[32]}],[1,"vviinn-product-card",{brand:[1],currency:[1],deeplink:[1],image:[1],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],locale:[1],price:[2],pricePrefix:[1,"price-prefix"],productId:[1,"product-id"],productTitle:[1,"product-title"],productType:[1,"product-type"],salePrice:[2,"sale-price"],responsive:[4],dimmedBackground:[4,"dimmed-background"],imageLoaded:[32]}]]],["p-71809bed",[[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{active:[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{filter:[16],selectedCategoryId:[32],hideFilters:[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{disabled:[4],handleMove:[32]}],[1,"vviinn-example-image",{src:[1],width:[2],height:[2],selected:[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{detectedObject:[16],position:[32]}],[1,"vviinn-modal",{active:[1540],slider:[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{showBullets:[4,"show-bullets"],position:[514],showArrows:[4,"show-arrows"],elementsCount:[32],internalPosition:[32],swipeStartPosition:[32]}]]],["p-e38f4aa2",[[1,"vviinn-vps-widget",{token:[1],apiPath:[1,"api-path"],active:[1028],currencySign:[1,"currency-sign"],locale:[1],slidePosition:[32],width:[32],wrongImageFormat:[32]}]]],["p-9ea96a69",[[1,"vviinn-vps-button",{token:[1],currencySign:[1,"currency-sign"],locale:[1],apiPath:[1,"api-path"],pressed:[32]},[[0,"modalClosed","handleModalClosed"]]]]],["p-a95c00c9",[[1,"vviinn-recommendations-sidebar",{sidebarTitle:[1,"sidebar-title"],token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],widgetScrollbar:[4,"widget-scrollbar"],state:[32]},[[16,"click","bodyClickListener"]]]]],["p-3734a3ef",[[1,"vviinn-vpr-button",{token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],sidebarTitle:[1,"sidebar-title"],modalScrollbar:[4,"modal-scrollbar"]}]]]],e))));
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as a}from"./p-e1ba8626.js";const l=()=>a("svg",{width:"12",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z"})),h=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none"},a("defs",null),a("path",{fill:"#525252","fill-rule":"evenodd",d:"M9.771 3.89a.875.875 0 01.728-.39h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.25A2.625 2.625 0 012.625 21V8.75A2.625 2.625 0 015.25 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.25a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z","clip-rule":"evenodd"}),a("path",{fill:"#525252","fill-rule":"evenodd",d:"M14 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z","clip-rule":"evenodd"})),t=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{fill:"#393939",d:"M74.55 20a5.06 5.06 0 014.14 2l4.72 9.32.1.18.11.17A5.07 5.07 0 0087.93 34h13.87c5.07 0 9.2 3.59 9.2 8v50c0 4.41-4.13 8-9.2 8H18.2c-5.07 0-9.2-3.59-9.2-8V42c0-4.41 4.13-8 9.2-8h13.87a5.072 5.072 0 004.31-2.34l.11-.17.1-.18L41.31 22a5.06 5.06 0 014.14-2h29.1zm0-4h-29.1a9 9 0 00-7.6 4L33 29.5a1.13 1.13 0 01-1 .5H18.2C10.91 30 5 35.37 5 42v50c0 6.63 5.91 12 13.2 12h83.6c7.29 0 13.2-5.37 13.2-12V42c0-6.63-5.91-12-13.2-12H87.93a1.13 1.13 0 01-1-.5L82.15 20a9 9 0 00-7.6-4z"}),a("path",{fill:"#393939",d:"M96 46a4 4 0 110 8 4 4 0 010-8zm0-4a8 8 0 100 16.001A8 8 0 0096 42z"}),a("path",{class:"colored",d:"M60 42a24 24 0 100 48.001A24 24 0 0060 42zm12 26H62v10a2 2 0 01-4 0V68H48a2 2 0 010-4h10V54a2 2 0 014 0v10h10a2 2 0 110 4z"})),s=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{fill:"#393939",d:"M110.35 96.52l-24.8-22.66a6.22 6.22 0 00-8.14-.27l-.09.07-10.57 8.93-18.33-17.88a6.001 6.001 0 00-8.51-.35L8.69 91.49a2 2 0 002.62 3l31.3-27.2a2 2 0 012.233-.359 2 2 0 01.637.479l.1.1 45 43.9a2.005 2.005 0 002.83-.03 2.003 2.003 0 00-.03-2.83L69.63 85.39l10.22-8.63a2.3 2.3 0 013 .07l24.77 22.65c.377.343.871.529 1.38.52a2 2 0 001.35-3.48zM75 31a10 10 0 110 20 10 10 0 010-20zm0-4a14 14 0 100 28 14 14 0 000-28z"}),a("path",{class:"colored",d:"M12 36H8V20A12 12 0 0120 8h16v4H20a8 8 0 00-8 8v16zM112 36h-4V20a8.001 8.001 0 00-8-8H84V8h16a11.998 11.998 0 0112 12v16zM36 112H20a11.998 11.998 0 01-12-12V84h4v16a8 8 0 008 8h16v4zM100 112H84v-4h16a8 8 0 008-8V84h4v16c0 3.183-1.264 6.235-3.515 8.485A11.996 11.996 0 01100 112z"})),v=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{class:"colored",d:"M84.09 43.24a.53.53 0 00-.29-.48L60.28 29.4a.522.522 0 00-.27-.07.531.531 0 00-.28.07L36.2 42.76a.54.54 0 000 1l23.53 13.3a.54.54 0 00.55 0L83.8 43.72a.53.53 0 00.29-.48zM57.28 61.23L33.73 47.88a.569.569 0 00-.85.48V75a.54.54 0 00.29.48L56.72 88.8a.56.56 0 00.56 0 .53.53 0 00.28-.48V61.71a.56.56 0 00-.28-.48zM86.84 47.88a.63.63 0 00-.29-.08.55.55 0 00-.28.08L62.73 61.23a.56.56 0 00-.28.48v26.61a.53.53 0 00.28.48.56.56 0 00.56 0l23.54-13.29a.54.54 0 00.29-.48V48.36a.55.55 0 00-.28-.48z"}),a("path",{class:"colored",d:"M100 7.94H20a12 12 0 00-12 12v80a11.998 11.998 0 0012 12h80c3.183 0 6.235-1.264 8.485-3.515A11.996 11.996 0 00112 99.94v-80a11.998 11.998 0 00-12-12zm-8 69.24a1.69 1.69 0 01-.85 1.45l-30.31 17.1a1.77 1.77 0 01-1.67 0l-30.32-17.1a1.689 1.689 0 01-.85-1.45V42.82a1.66 1.66 0 01.85-1.45l30.32-17.21a1.71 1.71 0 011.67 0l30.31 17.21a1.67 1.67 0 01.85 1.45v34.36z"})),w=()=>a("svg",{width:"14",height:"11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M5 10.414 0 5.413 1.413 4 5 7.586 12.585 0 14 1.415l-9 8.999Z",fill:"var(--color-primary, var(--color-primary-system))"})),e=()=>a("svg",{width:"9",height:"16",
|
|
1
|
+
import{h as a}from"./p-e1ba8626.js";const l=()=>a("svg",{width:"12",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z"})),h=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none"},a("defs",null),a("path",{fill:"#525252","fill-rule":"evenodd",d:"M9.771 3.89a.875.875 0 01.728-.39h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.25A2.625 2.625 0 012.625 21V8.75A2.625 2.625 0 015.25 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.25a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z","clip-rule":"evenodd"}),a("path",{fill:"#525252","fill-rule":"evenodd",d:"M14 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z","clip-rule":"evenodd"})),t=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{fill:"#393939",d:"M74.55 20a5.06 5.06 0 014.14 2l4.72 9.32.1.18.11.17A5.07 5.07 0 0087.93 34h13.87c5.07 0 9.2 3.59 9.2 8v50c0 4.41-4.13 8-9.2 8H18.2c-5.07 0-9.2-3.59-9.2-8V42c0-4.41 4.13-8 9.2-8h13.87a5.072 5.072 0 004.31-2.34l.11-.17.1-.18L41.31 22a5.06 5.06 0 014.14-2h29.1zm0-4h-29.1a9 9 0 00-7.6 4L33 29.5a1.13 1.13 0 01-1 .5H18.2C10.91 30 5 35.37 5 42v50c0 6.63 5.91 12 13.2 12h83.6c7.29 0 13.2-5.37 13.2-12V42c0-6.63-5.91-12-13.2-12H87.93a1.13 1.13 0 01-1-.5L82.15 20a9 9 0 00-7.6-4z"}),a("path",{fill:"#393939",d:"M96 46a4 4 0 110 8 4 4 0 010-8zm0-4a8 8 0 100 16.001A8 8 0 0096 42z"}),a("path",{class:"colored",d:"M60 42a24 24 0 100 48.001A24 24 0 0060 42zm12 26H62v10a2 2 0 01-4 0V68H48a2 2 0 010-4h10V54a2 2 0 014 0v10h10a2 2 0 110 4z"})),s=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{fill:"#393939",d:"M110.35 96.52l-24.8-22.66a6.22 6.22 0 00-8.14-.27l-.09.07-10.57 8.93-18.33-17.88a6.001 6.001 0 00-8.51-.35L8.69 91.49a2 2 0 002.62 3l31.3-27.2a2 2 0 012.233-.359 2 2 0 01.637.479l.1.1 45 43.9a2.005 2.005 0 002.83-.03 2.003 2.003 0 00-.03-2.83L69.63 85.39l10.22-8.63a2.3 2.3 0 013 .07l24.77 22.65c.377.343.871.529 1.38.52a2 2 0 001.35-3.48zM75 31a10 10 0 110 20 10 10 0 010-20zm0-4a14 14 0 100 28 14 14 0 000-28z"}),a("path",{class:"colored",d:"M12 36H8V20A12 12 0 0120 8h16v4H20a8 8 0 00-8 8v16zM112 36h-4V20a8.001 8.001 0 00-8-8H84V8h16a11.998 11.998 0 0112 12v16zM36 112H20a11.998 11.998 0 01-12-12V84h4v16a8 8 0 008 8h16v4zM100 112H84v-4h16a8 8 0 008-8V84h4v16c0 3.183-1.264 6.235-3.515 8.485A11.996 11.996 0 01100 112z"})),v=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{class:"colored",d:"M84.09 43.24a.53.53 0 00-.29-.48L60.28 29.4a.522.522 0 00-.27-.07.531.531 0 00-.28.07L36.2 42.76a.54.54 0 000 1l23.53 13.3a.54.54 0 00.55 0L83.8 43.72a.53.53 0 00.29-.48zM57.28 61.23L33.73 47.88a.569.569 0 00-.85.48V75a.54.54 0 00.29.48L56.72 88.8a.56.56 0 00.56 0 .53.53 0 00.28-.48V61.71a.56.56 0 00-.28-.48zM86.84 47.88a.63.63 0 00-.29-.08.55.55 0 00-.28.08L62.73 61.23a.56.56 0 00-.28.48v26.61a.53.53 0 00.28.48.56.56 0 00.56 0l23.54-13.29a.54.54 0 00.29-.48V48.36a.55.55 0 00-.28-.48z"}),a("path",{class:"colored",d:"M100 7.94H20a12 12 0 00-12 12v80a11.998 11.998 0 0012 12h80c3.183 0 6.235-1.264 8.485-3.515A11.996 11.996 0 00112 99.94v-80a11.998 11.998 0 00-12-12zm-8 69.24a1.69 1.69 0 01-.85 1.45l-30.31 17.1a1.77 1.77 0 01-1.67 0l-30.32-17.1a1.689 1.689 0 01-.85-1.45V42.82a1.66 1.66 0 01.85-1.45l30.32-17.21a1.71 1.71 0 011.67 0l30.31 17.21a1.67 1.67 0 01.85 1.45v34.36z"})),w=()=>a("svg",{width:"14",height:"11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M5 10.414 0 5.413 1.413 4 5 7.586 12.585 0 14 1.415l-9 8.999Z",fill:"var(--color-primary, var(--color-primary-system))"})),e=()=>a("svg",{width:"9",height:"16",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z"})),d=()=>a("svg",{width:"22",height:"22",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M18 0h-3v2h3c1.103 0 2 .897 2 2v3h2V4c0-2.206-1.794-4-4-4Zm2 18c0 1.103-.897 2-2 2h-3v2h3c2.206 0 4-1.794 4-4v-3h-2v3ZM2 18v-3H0v3c0 2.206 1.794 4 4 4h3v-2H4c-1.103 0-2-.897-2-2ZM2 4c0-1.103.897-2 2-2h3V0H4C1.794 0 0 1.794 0 4v3h2V4Zm6 6.5C8 9.122 9.122 8 10.5 8S13 9.122 13 10.5 11.878 13 10.5 13A2.503 2.503 0 0 1 8 10.5Zm7.5 6.5a1.503 1.503 0 0 0 1.061-2.561l-2.012-2.011c.293-.6.448-1.26.451-1.928C15 8.019 12.981 6 10.5 6A4.505 4.505 0 0 0 6 10.5c0 2.481 2.019 4.5 4.5 4.5.693 0 1.341-.17 1.928-.451l2.011 2.012c.293.293.677.439 1.061.439Z"})),i=()=>a("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z",fill:"#161616"}));export{l as A,e as C,t as O,d as V,h as a,i as b,w as c,s as d,v as e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i,H as e,g as r,c as s}from"./p-e1ba8626.js";import{_ as n,O as o,S as a,a as c,E as h,i as l,s as d,c as u,m as p,f as v,g as m,b as g,d as f,A as b,e as w,T as y}from"./p-59edfbe2.js";import{C as x}from"./p-126775a2.js";import{p as k}from"./p-f582db5c.js";let C=class{constructor(i){t(this,i),this.moveDirection="right",this.contentGroups=[],this.activeContentGroup=0,this.mode="continuity",this.imageWidth=140,this.showScroll=!0,this.recommendations=[],this.columns=0,this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.mutationObserver=new MutationObserver((()=>this.cloneSlottedContent()))}connectedCallback(){this.setItemWidth()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.setWidth(),this.processScrollbarWidth(),this.columns=this.getColumnsNumber();const t=this.el.querySelector(".content");this.mutationObserver.observe(t,{subtree:!0,childList:!0}),this.resizeObserver.observe(this.getHostParent())}getItemWidthFromDocument(){return parseInt(getComputedStyle(document.body).getPropertyValue("--vviinn-carousel-image-width"))}setItemWidth(){const t=this.getItemWidthFromDocument(),i=isNaN(t)?this.imageWidth:t;this.el.style.setProperty("--vviinn-carousel-image-width",`${i}px`)}getContentClassMap(){return{content:!0,[this.moveDirection]:!0,[this.mode]:!0,"show-scrollbar":this.showScroll}}handleResize(){this.setWidth(),this.processScrollbarWidth(),this.setItemWidth();const t=this.getColumnsNumber();t!==this.columns&&(this.columns=t)}calculateMoveStep(){const t=this.getContent().map((t=>t.getBoundingClientRect().width));return t.reduce(((t,i)=>t+i),0)/t.length}getHostParent(){return this.el.parentNode.host.parentElement}setWidth(){const t=this.getHostParent();if(!t)return;const i=getComputedStyle(t),e=t.getBoundingClientRect().width-(parseInt(i["padding-right"])+parseInt(i["padding-left"]));this.el.style.setProperty("--vviinn-carousel-content-width",`${e}px`)}getParent(){return this.el.parentNode.host.parentElement}cloneSlottedContent(){this.setWidth()}getActiveGroupIndex(){var t,i;if(!(null===(i=null===(t=this.getContentNode())||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.left))return 0;const e=this.getContentGroups().map((t=>t.getBoundingClientRect().left)).map(((t,i)=>[t,i])).filter((t=>t[0]>=0));return e.length>0?e[0][1]:0}getContentNode(){return this.el.querySelector(".content")}getContent(){const t=this.getContentNode().children;return Array.from(t).map((t=>t))}getColumnsNumber(){const t=getComputedStyle(this.el).getPropertyValue("--vviinn-carousel-columns-internal");return parseInt(t)}getContentGroups(){return Array.from(this.el.querySelectorAll(".items-group"))}showNext(){this.moveDirection="right";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft+this.calculateMoveStep(),behavior:"smooth"})}))}showPrev(){this.moveDirection="left";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft-this.calculateMoveStep(),behavior:"smooth"})}))}scroll(t){const i=this.getContentNode();requestAnimationFrame((()=>{i.scrollTo({top:0,left:this.calculateMoveStep()*t,behavior:"smooth"})}))}processScrollbarWidth(){const t=this.getContentNode();this.el.style.setProperty("--vviinn-progressbar-width",t.clientWidth*((t.scrollLeft+t.clientWidth)/t.scrollWidth)+"px"),this.activeContentGroup=this.getActiveGroupIndex()}showBullets(){return"grid"===this.mode&&this.showScroll}showScrollbar(){return"continuity"===this.mode&&this.showScroll}getClassMap(){return{[this.mode]:!0,"show-scrollbar":this.showScrollbar()}}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:"continuity"===this.mode})}renderRecommendationGroup(t){return i("div",{class:"items-group"},t)}renderRecommendationGroups(t){return t.map((t=>this.renderRecommendationGroup(t)))}renderRecommendations(){return"grid"===this.mode?this.renderGrid():this.renderRecommendationsElements()}renderRecommendationsElements(){return this.recommendations.map((t=>this.renderRecommendation(t)))}renderGrid(){const t=this.renderRecommendationsElements(),i=n.chunksOf(this.getColumnsNumber())(t);return this.renderRecommendationGroups(i)}renderBullets(){const t=Math.ceil(this.recommendations.length/this.getColumnsNumber());return Array.from(Array(t).keys()).map((t=>i("div",{class:{bullet:!0,active:this.activeContentGroup===t},onClick:()=>this.scroll(t)})))}render(){return i(e,{class:this.getClassMap()},i("div",{class:Object.assign({body:!0},this.getClassMap())},i("button",{class:"prev",onClick:()=>this.showPrev(),part:"carousel-button"},i(x,null)),i("div",{class:this.getContentClassMap(),onScroll:()=>this.processScrollbarWidth()},this.renderRecommendations()),i("button",{class:"next",onClick:()=>this.showNext(),part:"carousel-button"},i(x,null))),this.showBullets()?i("div",{class:"bullets"},this.renderBullets()):"")}get el(){return r(this)}};C.style=":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";class _{sendImpression(t){var i,e,r;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}sendClick(t){var i,e,r;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}}class P{constructor(){ga("require","ec")}convertProduct(t){var i,e,r;return{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var i,e,r;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const R=o.getMonoid(a.first()).concat(c.pipe(o.fromNullable(window.gtag),o.map((()=>new _))),c.pipe(o.fromNullable(window.ga),o.map((()=>new P)))),S=/fit\/\d+\//,I=(t,i)=>c.pipe((t=>c.pipe(t.match(S),h.fromNullable(t),h.map((()=>t))))(t),h.map((t=>t.replace(S,`fit/${i}/`))),h.getOrElse((()=>t))),E=(t,e)=>t.deeplink?i("a",{class:t.part,part:t.part,href:t.deeplink},e):e,V=t=>{var e;const r=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),s=`${null!==(e=t.prefix)&&void 0!==e?e:""} ${r} ${t.currency}`;return i("span",{class:"price-amount",part:"price-amount"},s)},A=t=>{const e=i(V,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale});return i("span",{class:"price-container",part:"price-container"},t.salePrice?[i("span",{class:"price-sale",part:"price-sale"},i(V,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale})),i("span",{class:"price-outdated",part:"price-outdated"},e)]:i("span",{class:"price-regular",part:"price-regular"},e))};let z=class{constructor(i){t(this,i),this.recommendationLoad=s(this,"recommendationLoad",7),this.recommendationView=s(this,"recommendationView",7),this.recommendationClick=s(this,"recommendationClick",7),this.productImageLoaded=s(this,"productImageLoaded",7),this.currency=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.pricePrefix=void 0,this.responsive=!1,this.dimmedBackground=!1,this.imageLoaded=!1,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1})}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(c.pipe(R,o.map((t=>t.sendImpression(this.getProduct())))),this.recommendationView.emit(this.productId),this.intersectionObserver.disconnect())}componentDidLoad(){this.recommendationLoad.emit(this.productId),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("mousedown",(t=>{this.recommendationClick.emit(this.productId),window.ga&&t.preventDefault(),c.pipe(R,o.match((()=>null),(t=>t.sendClick(this.getProduct())))),window.ga&&ga("send","event","UX","click","Results",{hitCallback:function(){document.location.href=this.deeplink}})}))))}getProduct(){return l.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:I(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek())):((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:I(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek()))}kek(){this.productImageLoaded.emit(this.productId)}render(){var t,r,s;return i(e,{part:"product-card",class:{dimmed:this.dimmedBackground},exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title"},i(E,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),i(E,{deeplink:this.deeplink,part:"deeplink"},i("span",{class:"title",part:"title"},this.productTitle)),i("span",{class:"brand",part:"brand"},this.brand),i("span",{class:"type",part:"type"},this.productType),i(A,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:d.pricePrefix,currency:null!==(r=this.currency)&&void 0!==r?r:d.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(s=this.locale)&&void 0!==s?s:d.locale}))}get el(){return r(this)}};z.style=':host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:"";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}';const j=c.flow((t=>`Bearer ${t}`),(t=>new Headers({Authorization:t})),(t=>({headers:t}))),D=f(b),O=(t,i={})=>k(D(m(),g),v,u(p(t,i))),$=t=>i=>O(`product/${t}/similar-products`,i),T=t=>i=>O(`product/${t}/cross-selling-products`,i);function L(t){return"function"==typeof t}function M(t){const i=t((t=>{Error.call(t),t.stack=(new Error).stack}));return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}const N=M((t=>function(i){t(this),this.message=i?`${i.length} errors occurred during unsubscription:\n${i.map(((t,i)=>`${i+1}) ${t.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=i}));function W(t,i){if(t){const e=t.indexOf(i);0<=e&&t.splice(e,1)}}class F{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:i}=this;if(i)if(this._parentage=null,Array.isArray(i))for(const t of i)t.remove(this);else i.remove(this);const{initialTeardown:e}=this;if(L(e))try{e()}catch(i){t=i instanceof N?i.errors:[i]}const{_finalizers:r}=this;if(r){this._finalizers=null;for(const i of r)try{U(i)}catch(i){t=null!=t?t:[],i instanceof N?t=[...t,...i.errors]:t.push(i)}}if(t)throw new N(t)}}add(t){var i;if(t&&t!==this)if(this.closed)U(t);else{if(t instanceof F){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}}_hasParent(t){const{_parentage:i}=this;return i===t||Array.isArray(i)&&i.includes(t)}_addParent(t){const{_parentage:i}=this;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t}_removeParent(t){const{_parentage:i}=this;i===t?this._parentage=null:Array.isArray(i)&&W(i,t)}remove(t){const{_finalizers:i}=this;i&&W(i,t),t instanceof F&&t._removeParent(this)}}F.EMPTY=(()=>{const t=new F;return t.closed=!0,t})();const B=F.EMPTY;function G(t){return t instanceof F||t&&"closed"in t&&L(t.remove)&&L(t.add)&&L(t.unsubscribe)}function U(t){L(t)?t():t.unsubscribe()}const q={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},H={setTimeout(t,i,...e){const{delegate:r}=H;return(null==r?void 0:r.setTimeout)?r.setTimeout(t,i,...e):setTimeout(t,i,...e)},clearTimeout(t){const{delegate:i}=H;return((null==i?void 0:i.clearTimeout)||clearTimeout)(t)},delegate:void 0};function X(){}const J=K("C",void 0,void 0);function K(t,i,e){return{kind:t,value:i,error:e}}function Q(t){t()}class Y extends F{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,G(t)&&t.add(this)):this.destination=nt}static create(t,i,e){return new et(t,i,e)}next(t){this.isStopped?st(function(t){return K("N",t,void 0)}(t),this):this._next(t)}error(t){this.isStopped?st(K("E",void 0,t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?st(J,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Z=Function.prototype.bind;function tt(t,i){return Z.call(t,i)}class it{constructor(t){this.partialObserver=t}next(t){const{partialObserver:i}=this;if(i.next)try{i.next(t)}catch(t){rt(t)}}error(t){const{partialObserver:i}=this;if(i.error)try{i.error(t)}catch(t){rt(t)}else rt(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(t){rt(t)}}}class et extends Y{constructor(t,i,e){let r;if(super(),L(t)||!t)r={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=e?e:void 0};else{let i;this&&q.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),r={next:t.next&&tt(t.next,i),error:t.error&&tt(t.error,i),complete:t.complete&&tt(t.complete,i)}):r=t}this.destination=new it(r)}}function rt(t){var i;i=t,H.setTimeout((()=>{const{onUnhandledError:t}=q;if(!t)throw i;t(i)}))}function st(t,i){const{onStoppedNotification:e}=q;e&&H.setTimeout((()=>e(t,i)))}const nt={closed:!0,next:X,error:function(t){throw t},complete:X},ot="function"==typeof Symbol&&Symbol.observable||"@@observable";function at(t){return t}class ct{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new ct;return i.source=this,i.operator=t,i}subscribe(t,i,e){const r=(s=t)&&s instanceof Y||function(t){return t&&L(t.next)&&L(t.error)&&L(t.complete)}(s)&&G(s)?t:new et(t,i,e);var s;return Q((()=>{const{operator:t,source:i}=this;r.add(t?t.call(r,i):i?this._subscribe(r):this._trySubscribe(r))})),r}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=ht(i))(((i,e)=>{const r=new et({next:i=>{try{t(i)}catch(t){e(t),r.unsubscribe()}},error:e,complete:i});this.subscribe(r)}))}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[ot](){return this}pipe(...t){return(0===(i=t).length?at:1===i.length?i[0]:function(t){return i.reduce(((t,i)=>i(t)),t)})(this);var i}toPromise(t){return new(t=ht(t))(((t,i)=>{let e;this.subscribe((t=>e=t),(t=>i(t)),(()=>t(e)))}))}}function ht(t){var i;return null!==(i=null!=t?t:q.Promise)&&void 0!==i?i:Promise}ct.create=t=>new ct(t);const lt=M((t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class dt extends ct{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new ut(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new lt}next(t){Q((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}}))}error(t){Q((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}}))}complete(){Q((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:e,observers:r}=this;return i||e?B:(this.currentObservers=null,r.push(t),new F((()=>{this.currentObservers=null,W(r,t)})))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:e,isStopped:r}=this;i?t.error(e):r&&t.complete()}asObservable(){const t=new ct;return t.source=this,t}}dt.create=(t,i)=>new ut(t,i);class ut extends dt{constructor(t,i){super(),this.destination=t,this.source=i}next(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.next)||void 0===e||e.call(i,t)}error(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.error)||void 0===e||e.call(i,t)}complete(){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===i||i.call(t)}_subscribe(t){var i,e;return null!==(e=null===(i=this.source)||void 0===i?void 0:i.subscribe(t))&&void 0!==e?e:B}}let pt=class{constructor(i){t(this,i),this.recommendationsLoaded=s(this,"recommendationsLoaded",7),this.blockTitle="Recommended products",this.imageRatio=1,this.imageWidth=300,this.currencySign="€",this.mode="continuity",this.campaignType="VPR",this.locale="de-DE",this.apiPath="https://api.vviinn.com",this.useCarousel=!0,this.showScroll=!0,this.cssUrl=null,this.recommendations=[],this.loaded=!1,this.productImageLoadedSubject=new dt}handleProductIdChange(){this.getRecommendations()}handleCampaignTypeChange(){this.getRecommendations()}handleApiPathChange(t){w.apiPath=t,this.getRecommendations()}lol({detail:t}){this.productImageLoadedSubject.next(t)}connectedCallback(){w.apiPath=this.apiPath,w.currencySign=this.currencySign,w.locale=this.locale}async componentWillLoad(){w.pricePrefix=this.pricePrefix,w.currencySign=this.currencySign,this.getRecommendations()}async getRecommendations(){if(void 0===this.productId||void 0===this.token)return;const t=this.campaignType.length>0?this.campaignType:"VPR",i=j(this.token),e=c.pipe(y.of((t=>{return c.pipe("VPR"===t?{_tag:"VPR"}:{_tag:"VCS"},(i=()=>$,e=()=>T,t=>(t=>"VPR"===t._tag)(t)?i():e()));var i,e})(t)),y.ap(y.of(this.productId)),y.ap(y.of(i)),y.flatten),r=await e();c.pipe(r,h.fold((t=>this.handleError(t)),(t=>this.handleRecommendationsSucces(t))))}handleError(t){console.log("ERROR:",t)}handleRecommendationsSucces(t){var i;this.recommendations=null!==(i=null==t?void 0:t.extended)&&void 0!==i?i:t,l.results=this.recommendations,this.loaded=!0,this.productIds=this.recommendations.map((t=>t.productId)),this.productImageLoadedSubject.subscribe((t=>{this.productIds=this.productIds.filter((i=>i!==t)),0===this.productIds.length&&this.recommendationsLoaded.emit()}))}isExternalCSS(){return this.cssUrl&&this.cssUrl.length>0}renderExternalCSS(){return this.isExternalCSS()?i("link",{href:this.cssUrl,rel:"stylesheet"}):""}render(){return i(e,{class:{loaded:this.loaded,empty:0==this.recommendations.length,[this.mode]:!0},"aria-hidden":this.loaded?"false":"true"},this.renderExternalCSS(),i("style",null,w.fallbackStyles),i("h2",{part:"recommendations-title"},this.blockTitle),this.useCarousel?this.renderCarousel():this.renderResults())}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:this.useDimmedBackgroundInCard()})}useDimmedBackgroundInCard(){return"continuity"===this.mode||!this.useCarousel}renderResults(){return i("div",{class:"recommendations-grid",part:"recommendations-grid"},this.recommendations.map((t=>this.renderRecommendation(t))))}renderCarousel(){return i("vviinn-carousel",{mode:this.mode,imageWidth:this.imageWidth,showScroll:this.showScroll,recommendations:this.recommendations})}get el(){return r(this)}static get watchers(){return{productId:["handleProductIdChange"],campaignType:["handleCampaignTypeChange"],apiPath:["handleApiPathChange"]}}};pt.style=":host{display:grid;grid-gap:1rem;width:100%}:host(:not(.loaded)){position:absolute;visibility:hidden}:host(.grid) vviinn-product-card::part(image){border:1px solid #DDDDDD;width:100%}h2{margin:0}vviinn-product-card::part(price-container){align-self:flex-start;text-align:left;display:flex}.results{display:grid;grid-gap:1rem}.visually-hidden{position:absolute;top:0;left:0;z-index:-1;height:0;width:0}h2{margin:0}:host(.grid) h2{justify-content:center}:host(.grid) vviinn-product-card::part(image){min-width:100%}:host(.grid) vviinn-product-card::part(image-link){width:100%}:host(.grid) vviinn-product-card::part(title),:host(.grid) vviinn-product-card::part(brand),:host(.grid) vviinn-product-card::part(type){text-align:center}:host(.grid) vviinn-product-card::part(price-container){align-self:center}:host(.continuity) vviinn-product-card::part(title),:host(.continuity) vviinn-product-card::part(brand),:host(.continuity) vviinn-product-card::part(type),:host(.continuity) vviinn-product-card::part(deeplink){text-align:left;max-width:unset;align-self:start}";export{C as vviinn_carousel,z as vviinn_product_card,pt as vviinn_vpr_widget}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as o,H as s}from"./p-e1ba8626.js";import{V as i}from"./p-126775a2.js";let n=class{constructor(o){t(this,o),this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1,this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)}}render(){return o(s,null,o("button",{class:"open-button",part:"button",onClick:()=>this.handleClick()},o("slot",null,o(i,null))))}handleClick(){const t=document.createElement("vviinn-recommendations-sidebar");t.sidebarTitle=this.sidebarTitle,t.productId=this.productId,t.token=this.token,t.position=this.position,t.sourceImage=this.sourceImage,t.widgetScrollbar=this.modalScrollbar,this.sidebar=t,t.addEventListener("modalClosed",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar.removeEventListener("modalCLosed",this.sidebarCloseListener),document.body.removeChild(this.sidebar)}};n.style=":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";export{n as vviinn_vpr_button}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,b as i}from"./p-e1ba8626.js";import{g as r}from"./p-78ccc9eb.js";(()=>{const i=import.meta.url,r={};return""!==i&&(r.resourcesUrl=new URL(".",i).href),e(r)})().then((e=>(r(),i([["p-f47e82b2",[[1,"cropper-handler",{handler:[16],disabled:[4]}]]],["p-fb14e3cc",[[1,"vviinn-error"]]],["p-9d24f51e",[[1,"vviinn-preloader"]]],["p-1f0c8cf6",[[1,"vviinn-vpr-widget",{blockTitle:[1,"block-title"],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],productId:[1,"product-id"],token:[1],currencySign:[1,"currency-sign"],pricePrefix:[1,"price-prefix"],mode:[1],campaignType:[1,"campaign-type"],locale:[1],apiPath:[1,"api-path"],useCarousel:[4,"use-carousel"],showScroll:[4,"show-scroll"],cssUrl:[1,"css-url"],recommendations:[32],loaded:[32]},[[0,"productImageLoaded","lol"]]],[0,"vviinn-carousel",{mode:[1],imageWidth:[2,"image-width"],showScroll:[4,"show-scroll"],recommendations:[16],moveDirection:[32],contentGroups:[32],activeContentGroup:[32]}],[1,"vviinn-product-card",{brand:[1],currency:[1],deeplink:[1],image:[1],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],locale:[1],price:[2],pricePrefix:[1,"price-prefix"],productId:[1,"product-id"],productTitle:[1,"product-title"],productType:[1,"product-type"],salePrice:[2,"sale-price"],responsive:[4],dimmedBackground:[4,"dimmed-background"],imageLoaded:[32]}]]],["p-71809bed",[[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{active:[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{filter:[16],selectedCategoryId:[32],hideFilters:[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{disabled:[4],handleMove:[32]}],[1,"vviinn-example-image",{src:[1],width:[2],height:[2],selected:[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{detectedObject:[16],position:[32]}],[1,"vviinn-modal",{active:[1540],slider:[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{showBullets:[4,"show-bullets"],position:[514],showArrows:[4,"show-arrows"],elementsCount:[32],internalPosition:[32],swipeStartPosition:[32]}]]],["p-e38f4aa2",[[1,"vviinn-vps-widget",{token:[1],apiPath:[1,"api-path"],active:[1028],currencySign:[1,"currency-sign"],locale:[1],slidePosition:[32],width:[32],wrongImageFormat:[32]}]]],["p-9ea96a69",[[1,"vviinn-vps-button",{token:[1],currencySign:[1,"currency-sign"],locale:[1],apiPath:[1,"api-path"],pressed:[32]},[[0,"modalClosed","handleModalClosed"]]]]],["p-a95c00c9",[[1,"vviinn-recommendations-sidebar",{sidebarTitle:[1,"sidebar-title"],token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],widgetScrollbar:[4,"widget-scrollbar"],state:[32]},[[16,"click","bodyClickListener"]]]]],["p-3734a3ef",[[1,"vviinn-vpr-button",{token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],sidebarTitle:[1,"sidebar-title"],modalScrollbar:[4,"modal-scrollbar"]}]]]],e))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,g as n,c as r}from"./p-e1ba8626.js";import{O as s,h as o,i as a,a as l,t as d,j as c,k as h,l as p,n as m,o as u,p as g,q as v,r as x,u as f,E as b,v as w,w as y,x as k,y as z,N as C}from"./p-59edfbe2.js";import{p as L,m as _,o as F}from"./p-f582db5c.js";import{c as S,O as D,d as E,e as j,A as M}from"./p-56fc949a.js";import{s as W}from"./p-e67cae57.js";let A=class{constructor(e){t(this,e)}getInsetValue(){return L(o(a.searchArea,a.imageBounds),s.map((([t,e])=>{return`inset(${(i=t,n=e,r={top:`${i.y}px`,right:n.width-(i.x+i.width)+"px",bottom:n.height-(i.y+i.height)+"px",left:`${i.x}px`}).top} ${r.right} ${r.bottom} ${r.left})`;var i,n,r})),s.getOrElse((()=>"")))}renderImage(){return L(o(a.imageUrl,a.imageBounds),s.map((([t,i])=>e("img",{src:t,width:i.width,height:i.height,style:{"clip-path":`${this.getInsetValue()}`}}))),s.getOrElse((()=>"")))}render(){return e(i,null,this.renderImage())}};A.style=':host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:"";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}';let B=class{constructor(e){t(this,e),this.disabled=!1,this.handleMove=!1,this.mouseStartPoint=void 0,this.bounds=void 0}componentDidLoad(){this.bounds=this.el.getBoundingClientRect()}handleHandlerMove(t){t.preventDefault(),t.stopPropagation();const e=F(t),i={position:_.concat(e,this.mouseStartPoint),direction:this.handlerMoveDirection};l.pipe(a.searchArea,s.map((t=>{const n=d(t,i);n.width<40||n.height<40||n.x<0||n.y<0||this.bounds.height-(n.y+n.height)<0||this.bounds.width-(n.x+n.width)<0||(a.searchArea=s.some(n),this.mouseStartPoint=e,a.detectedObject=void 0)})))}handleCropperMove(t){t.preventDefault(),t.stopPropagation();const e=F(t),i=_.concat(e,this.mouseStartPoint);l.pipe(a.searchArea,s.map((t=>{const n=c(t,i);n.x<0||n.y<0||this.bounds.height-(n.y+n.height)<0||this.bounds.width-(n.x+n.width)<0||(a.detectedObject=void 0,a.searchArea=s.some(n),this.mouseStartPoint=e)})))}handlePointerDown(t){t.stopPropagation(),this.mouseStartPoint=F(t);const e=t.target;"cropper-handler"===e.localName?(this.handlerMoveDirection=e.handler.direction,this.pointerMoveListener=this.handleHandlerMove.bind(this)):this.pointerMoveListener=this.handleCropperMove.bind(this),this.pointerReleaseListener=this.handleSearchAreaRelease.bind(this),this.el.addEventListener("pointermove",this.pointerMoveListener),window.addEventListener("pointerup",this.pointerReleaseListener,{once:!0})}handleSearchAreaRelease(){this.el.removeEventListener("pointermove",this.pointerMoveListener),document.removeEventListener("pointerup",this.pointerReleaseListener),this.mouseStartPoint=void 0,h()}getStyleMap(){return l.pipe(a.searchArea,s.map((t=>({width:`${t.width}px`,height:`${t.height}px`,transform:`translate3d(${t.x}px, ${t.y}px, 0)`,cursor:this.handleMove?"move":"default"}))),s.getOrElse((()=>({}))))}render(){return e(i,{exportparts:"handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize"},e("div",{class:{"crop-area":!0,active:this.handleMove,disabled:this.disabled},draggable:!1,style:this.getStyleMap(),onContextMenu:()=>!1,onPointerDown:t=>this.handlePointerDown(t)},a.cropperHandlers.map((t=>e("cropper-handler",{disabled:this.disabled,handler:t,onPointerDown:t=>this.handlePointerDown(t)})))))}get el(){return n(this)}};B.style=":host{display:block;height:100%;left:0;position:absolute;top:0;width:100%}:host(.hidden){visibility:hidden}.crop-area{border:1px solid white;box-sizing:border-box;position:absolute;touch-action:none;transition-property:border-color, opacity;transition-duration:.25s;transition-timing-function:ease-in-out;z-index:2;position:relative;will-change:transform}.crop-area.active{border-color:whitesmoke}.crop-area.disabled{opacity:0.25}";const G=t=>t.href.split("/").reverse()[0];let I=class{constructor(e){t(this,e),this.filter=null,this.selectedCategoryId=null,this.hideFilters=!0}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter():this.selectFilter(t)}selectFilter(t){this.selectedCategoryId=G(t),a.activeIonLink=t}clearSelectedFilter(){this.selectedCategoryId=null,a.activeIonLink=void 0,this.findSelectedFilter().blur()}findSelectedFilter(){return this.el.shadowRoot.querySelector(".filter.active")}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,e){"Enter"===t.key&&this.handleFilterSelection(e)}isFilterSelected(t){return this.selectedCategoryId===G(t)}render(){return e(i,{exportparts:"filter, show-more-filters"},e("div",{class:"filters"},this.filter.filters.filter(((t,e)=>!this.hideFilters||e<5)).map(((t,i)=>e("div",{role:"button",tabindex:"0",part:this.isFilterSelected(t)?"filter active":"filter",class:{filter:!0,active:this.selectedCategoryId===G(t)},style:{"animation-delay":10*i+"ms"},onPointerUp:e=>{e.stopPropagation(),this.handleFilterSelection(t)},onKeyPress:e=>this.handleEnter(e,t)},this.isFilterSelected(t)?e(S,null):null,t.name))),e("div",{class:{filter:!0,"show-more":!0,hidden:this.filter.filters.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>this.toggleFilters(),onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"},this.hideFilters?"Zeige mehr":"Zeige weniger")))}get el(){return n(this)}};I.style=":host{display:grid;grid-gap:1rem}.filters{display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem}.filter{align-items:center;-webkit-animation-duration:0.25s;animation-duration:0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-name:scalein;animation-name:scalein;border:1px solid lightgray;cursor:pointer;display:flex;flex-direction:row;grid-gap:8px;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:0.1rem;transform:scale(0);transition-property:background;transition-duration:0.25s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:6px 16px}.filter.active{border:1px solid black;padding:6px 8px}.filter:hover{border:1px solid gray}.show-more{display:flex}.show-more.hidden{display:none}.show-more::after{content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;height:16px;margin-top:1px;margin-left:8px}.show-more.active::after{transform:rotateX(180deg)}@-webkit-keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@media (max-width: 415px){.show-more::after{transform:rotate(-90deg)}.show-more.active::after{transform:rotate(90deg)}}@media (max-width: 800px){.filters{flex-wrap:nowrap;overflow-x:scroll;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;grid-gap:unset}.filter{scroll-snap-align:end;margin-right:0.5rem}}";let $=class{constructor(e){t(this,e),this.position=["0","0"]}getObjectPosition(){return l.pipe(a.imageBounds,s.map((t=>{const e=p(m(this.detectedObject).rectangle),{x:i,y:n}=l.pipe(e,u(t),g);return[`${i}px`,`${n}px`]})),s.getOrElse((()=>["0","0"])))}selectDetectedObject(){l.pipe(a.imageBounds,s.map((t=>{const e=m(this.detectedObject).rectangle,i=p(e),n=u(t)(i);a.detectedObject=this.detectedObject,a.searchArea=s.some(n)}))),h()}isActive(){if(!this.detectedObject)return!1;if(!a.detectedObject)return!1;const t=m(this.detectedObject),e=m(a.detectedObject);return v.equals(t,e)}render(){return e(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};$.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.5);border-radius:50%;border:none;cursor:pointer;display:block;height:var(--size);position:absolute;transition:opacity 0.25s;width:var(--size);z-index:2;transform:translate(calc(var(--x-position) - (var(--size) * 0.5)), calc(var(--y-position) - (var(--size) * 0.5)));transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.75)}:host(.active){background:var(--color-primary, var(--color-primary-system))!important;border:2px solid white}:host::after{--size:32px;border-radius:50%;content:"";cursor:pointer;display:block;height:calc(var(--size) * 0.25);transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));width:calc(var(--size) * 0.25);background:white}';let P=class{constructor(e){t(this,e),this.actionClick=r(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),e("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),e("h4",{slot:"title"},"Leider nichts gefunden"),e("span",{slot:"text"},"Leider konnten wir keine passenden Produkte finden. Bitte versuche es mit einem anderen Bildausschnitt noch einmal.")))}};P.style=":host{display:grid}vviinn-error{justify-items:center}";let T=class{constructor(e){t(this,e),this.exampleImageSelected=r(this,"exampleImageSelected",7),this.exampleImageError=r(this,"exampleImageError",7),this.src="",this.width=0,this.height=0,this.selected=!1}async selectImage(t){this.selected=!0;const e=await x(this.src),i=await f(e);l.pipe(i,b.match((()=>this.exampleImageError.emit()),(()=>this.exampleImageSelected.emit()))),this.selected=!1}showPreloader(){return(a.objectDetectionInProgress||a.loading)&&this.selected}render(){return e(i,null,this.showPreloader()?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("img",{onClick:t=>this.selectImage(t),src:this.src,width:this.width,height:this.height}))}};T.style=":host{display:block;margin-bottom:8px;position:relative}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;pointer-events:none;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";let Y=class{constructor(e){t(this,e),this.imageSelected=r(this,"imageSelected",7),this.imageSelectedError=r(this,"imageSelectedError",7)}handleImageSelection(){this.imageSelected.emit()}handleImageSelectionError(){this.imageSelectedError.emit()}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-example-images-title"},e("h3",null,"Mit den Beispielbildern die Suche direkt ausprobieren")),e("div",{class:"images"},e("slot",{name:"vviinn-example-images-1"},e("vviinn-example-image",{width:240,height:320,src:"https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc="})),e("slot",{name:"vviinn-example-images-2"},e("vviinn-example-image",{width:240,height:240,src:"https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc="})),e("slot",{name:"vviinn-example-images-3"},e("vviinn-example-image",{width:240,height:240,src:"https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc="})),e("slot",{name:"vviinn-example-images-4"},e("vviinn-example-image",{width:240,height:320,src:"https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc="}))))}get el(){return n(this)}};Y.style="h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";let Z=class{constructor(e){t(this,e),this.imageSelected=r(this,"imageSelected",7),this.imageSelectedError=r(this,"imageSelectedError",7)}async handleInputChange(t){const e=t.target,i=await f(e.files[0]);l.pipe(i,w((()=>this.imageSelectedError.emit()),(()=>this.imageSelected.emit()))),e.value=null}isLoading(){return a.loading||a.objectDetectionInProgress}render(){return e(i,{exportparts:"button"},this.isLoading()?e("vviinn-preloader",null):null,this.isLoading()?null:e("label",{htmlFor:"fileInput",part:"button"},e("slot",{name:"upload-button-text"},"Upload image")),e("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image/*",onChange:t=>this.handleInputChange(t)}))}};Z.style=":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;padding:0.5rem;transition:background 0.1s ease-in-out}";let H=class{constructor(e){t(this,e)}handleInitialImageLoad(t){const e=y(t.target),{x:i,y:n}=c(e,{x:12,y:12}),r={x:i,y:n,width:e.width-24,height:e.height-24};a.imageBounds=s.some(e),a.searchArea=s.some(r)}renderDetectedObject(t){return e("vviinn-detected-object",{detectedObject:t})}renderImage(){return l.pipe(o(a.imageUrl,a.image),s.map((([t,i])=>{const[n,r]=(t=>{const e=k(t),i=z(288)(e).map((t=>t.size));return[i[0],i[1]]})(i);return e("img",{decoding:"async",width:n,height:r,src:t,onLoad:t=>this.handleInitialImageLoad(t),draggable:!1})})),s.getOrElse((()=>null)))}renderCropper(){return l.pipe(a.imageUrl,s.map((()=>e("image-cropper",null))),s.getOrElse((()=>null)))}render(){return e(i,null,a.loading||a.objectDetectionInProgress?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("highlight-box",null),this.renderImage(),this.renderCropper(),a.detectedObjects.map((t=>this.renderDetectedObject(t))))}};H.style=":host{display:grid;position:relative;justify-self:center}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";let K=class{constructor(e){t(this,e),this.modalClosed=r(this,"modalClosed",7),this.secondaryActionClicked=r(this,"secondaryActionClicked",7),this.active=!1,this.slider=!1}close(){this.active=!1,setTimeout((()=>{this.modalClosed.emit()}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return e(i,{exportparts:"secondary-action, title, close-button",class:{closed:!this.active},onAnimationEnd:t=>this.handleAnimationEnd(t)},e("div",{class:"head"},e("button",{part:"secondary-action",onClick:()=>this.secondaryActionClicked.emit()},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M20.25 12H3.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M10.5 5.25L3.75 12L10.5 18.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),e("div",{class:"title",part:"title"},"Bildsuche"),e("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z",fill:"#333333"})))),e("div",{class:"body"},e("slot",null)))}};K.style=":host{background:white;border-radius:4px;box-sizing:border-box;display:grid;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;max-width:960px}@media (max-width: 415px){:host{-webkit-animation-name:fade-in;animation-name:fade-in;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.closed){-webkit-animation-name:fade-out;animation-name:fade-out;-webkit-animation-fill-mode:none;animation-fill-mode:none}.body{overflow-y:auto}}@media (max-width: 640px) and (min-width: 415px){:host{max-width:80%}}.head{align-items:center;border-bottom:1px solid #F4F4F4;display:grid;grid-gap:16px;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;justify-items:center;padding:16px}.title{font-weight:600;font-size:18px;line-height:24px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:unset}@-webkit-keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";let O=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-onboarding-title"},e("h3",null,"So funktioniert es")),e("vviinn-slider",{showArrows:!0},e("vviinn-slide",null,e("vviinn-onboarding-card-1",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-2",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-3",null))))}get el(){return n(this)}};O.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}::host{display:block}h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}vviinn-slide{background:#f4f4f4;padding:24px}svg{padding:16px 0}.text{display:grid;grid-gap:8px}.text>h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}.text>p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}";let V=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-1-icon"},e(D,null)),e("slot",{name:"onboarding-card-1-text"},e("div",{class:"text"},e("h4",null,"Starte die Bildsuche"),e("p",null,"Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera."))))}get el(){return n(this)}};V.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let q=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-2-icon"},e(E,null)),e("slot",{name:"onboarding-card-2-text"},e("div",{class:"text"},e("h4",null,"Verfeiner deine Suche"),e("p",null,"Du kannst den Bildrahmen selber festlegen und so die Produkte genau auswählen."))))}get el(){return n(this)}};q.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let X=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-3-icon"},e(j,null)),e("slot",{name:"onboarding-card-3-text"},e("div",{class:"text"},e("h4",null,"Ohne Hintergrund"),e("p",null,"Die besten Ergebnisse erhältst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist."))))}get el(){return n(this)}};X.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let R=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};R.style=":host{-webkit-animation:fade-in 0.5s ease-in-out;animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@-webkit-keyframes fade-in{from{opacity:0.1}to{opacity:1}}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";let N=class{constructor(e){t(this,e),this.secondaryActionClicked=r(this,"secondaryActionClicked",7),this.modalClosed=r(this,"modalClosed",7),this.active=!1}render(){return e(i,{class:{active:this.active}},e("vviinn-overlay",null,e("vviinn-modal",{onSecondaryActionClicked:()=>this.secondaryActionClicked.emit(),active:this.active},e("slot",null,"CONTENT"))))}};N.style=":host{display:none}:host(.active){display:block}vviinn-overlay{align-items:center;display:grid;justify-items:center}@media (max-width: 415px){vviinn-modal{border-radius:4px 4px 0 0;height:100vh;margin-top:32px;transform:translateY(100%);width:100vw}vviinn-overlay{align-items:end;display:grid;justify-items:center}}";let U=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",null,e("div",{class:"content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},e("defs",null),e("path",{fill:"#525252",d:"M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z"}),e("path",{fill:"#525252",d:"M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z"})),e("slot",{name:"vviinn-privacy-badge-text"},e("p",null,"Wir gehen sorgfältig mit Deinen Daten um. Deine Bilder werden nur zum Zweck der Bildsuche gespeichert.")))))}get el(){return n(this)}};U.style=":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:-webkit-min-content auto;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";let Q=class{constructor(e){t(this,e),this.actionClick=r(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Keine Verbindung"),e("span",{slot:"text"},"Etwas hat leider nicht funktioniert. Bitte prüfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Erneut versuchen")))}};Q.style=":host{display:block}";let J=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};J.style=":host{display:grid;justify-items:center}";const tt=({kind:t,tabindex:i,disabled:n,onClick:r,onKeyDown:s})=>{return e("div",{class:(o={kind:t,disabled:n},{"arrow-wrapper":!0,[o.kind]:!0,disabled:o.disabled}),onClick:r,tabindex:i,onKeyDown:s},e(M,null));var o};let et=class{constructor(e){t(this,e),this.elementsCount=0,this.internalPosition=0,this.swipeStartPosition=s.none,this.showBullets=!0,this.position=0,this.showArrows=!1}positionWatchHandler(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}connectedCallback(){this.handleDomContentChanges()}handleDomContentChanges(){const t=this.el.querySelectorAll("vviinn-slide");this.elementsCount=t.length,this.el.style.setProperty("--num-items",`${this.elementsCount}`),this.setActiveCssClassToSlide(0)}setActiveCssClassToSlide(t){const e=this.el.querySelectorAll("vviinn-slide");e.forEach((t=>t.classList.remove("active"))),e[t].classList.add("active")}goToSlide(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}renderBullets(){return this.showBullets?e("div",{class:"controls"},C.range(0,this.elementsCount-1).map((t=>e("div",{class:{bullet:!0,active:t==this.internalPosition%this.elementsCount},onClick:()=>this.goToSlide(t)})))):null}nextSlide(){this.internalPosition++,this.renderSlidePosition()}prevSlide(){const t=this.internalPosition-1;this.internalPosition=t>-1?t:this.elementsCount-1,this.renderSlidePosition()}renderSlidePosition(){requestAnimationFrame((()=>{this.el.style.setProperty("--position",""+this.internalPosition%this.elementsCount)}))}handleKeyDown(t){if("Space"===t.key||"Enter"===t.key)switch(t.target.className.includes("prev")?"prev":"next"){case"prev":this.prevSlide();break;case"next":this.nextSlide()}}handleTouchStart(t){this.showBullets&&(this.swipeStartPosition=l.pipe(t.touches[0],s.fromNullable,s.map((t=>t.clientX))))}handleTouchEnd(t){if(!this.showBullets)return;const e=l.pipe(t.changedTouches[0],s.fromNullable,s.map((t=>t.clientX)));l.pipe(o(this.swipeStartPosition,e),s.map((([t,e])=>{return(i=t)<(n=e)?-1:i>n?1:0;var i,n})),s.map((t=>{switch(t){case 1:return this.nextSlide();case-1:return this.prevSlide()}})))}render(){return e(i,null,e("div",{class:"items-wrapper"},e("div",{class:"items",onTouchStart:t=>this.handleTouchStart(t),onTouchEnd:t=>this.handleTouchEnd(t)},e("slot",null))),this.showArrows?[e(tt,{kind:"prev",onClick:()=>this.prevSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:1,disabled:!1}),e(tt,{kind:"next",onClick:()=>this.nextSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:0,disabled:!1})]:null,this.renderBullets())}get el(){return n(this)}static get watchers(){return{position:["positionWatchHandler"]}}};et.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--num-items:0;--position:0;display:grid;grid-gap:20px;justify-items:center;position:relative}.items-wrapper{overflow:hidden;width:100%}.items{box-sizing:border-box;display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--num-items), 100%);transform:translateX(calc(-100% * var(--position)));transition:transform 0.33s ease-in-out}.controls{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--num-items), -webkit-min-content);grid-template-columns:repeat(var(--num-items), min-content)}.bullet{background:#E0E0E0;border-radius:50%;box-sizing:border-box;cursor:pointer;height:8px;width:8px;transition:background 0.1s ease-in-out}.bullet:hover{background:#C6C6C6}.bullet.active{background:var(--color-primary, var(--color-primary-system))}.bullet:active{background:transparent;border:2px solid var(--color-primary, var(--color-primary-system))}.arrow-wrapper{align-items:center;background:white;border:2px solid white;bottom:0;box-sizing:border-box;display:grid;height:calc(var(--spacer) * 6);justify-items:center;margin:auto;position:absolute;top:0;transform:translate3d(0, -50%, 0);transition:border 0.25ms ease-in-out;width:calc(var(--spacer) * 4)}.arrow-wrapper:active{border-color:var(--color-primary, var(--color-primary-system));opacity:0.75}.arrow-wrapper:focus{border-color:var(--color-primary, var(--color-primary-system));opacity:0.5;outline:none}.prev{left:0}.next{right:0}.next>svg{transform:rotate3d(0, 1, 0, 180deg)}.arrow-wrapper>svg{transition:fill 0.25ms ease-in-out;fill:#A8A8A8}.arrow-wrapper:hover>svg{fill:#8D8D8D}";let it=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",null,e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"none"},e("defs",null),e("path",{fill:"#C6C6C6",d:"M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z"}),e("path",{fill:"#C6C6C6",d:"M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z"})),e("span",{class:"vviinn-teaser-text"},e("slot",{name:"vviinn-teaser-text"},"Finde Produkte auf ",e("br",null)," einem Foto"))))}get el(){return n(this)}};it.style=":host{align-items:center;display:grid;justify-items:center;grid-gap:16px}.vviinn-teaser-text{font-size:28px;font-weight:600;line-height:40px;size:28px;text-align:center}";let nt=class{constructor(e){t(this,e),this.actionClick=r(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Dateityp wird nicht unterstützt"),e("span",{slot:"text"},"Leider unterstützen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Neues Bild hochladen")))}};nt.style=":host{display:block}";export{A as highlight_box,B as image_cropper,I as search_filters,$ as vviinn_detected_object,P as vviinn_empty_results,T as vviinn_example_image,Y as vviinn_example_images,Z as vviinn_image_selector,H as vviinn_image_view,K as vviinn_modal,O as vviinn_onboarding,V as vviinn_onboarding_card_1,q as vviinn_onboarding_card_2,X as vviinn_onboarding_card_3,R as vviinn_overlay,N as vviinn_overlayed_modal,U as vviinn_privacy_badge,Q as vviinn_server_error,J as vviinn_slide,et as vviinn_slider,it as vviinn_teaser,nt as vviinn_wrong_format}
|
|
1
|
+
import{r as t,h as e,H as i,g as n,c as r}from"./p-e1ba8626.js";import{O as s,h as o,i as a,a as l,t as d,j as c,k as h,l as p,n as m,o as u,p as g,q as v,r as x,u as f,E as b,v as w,w as y,x as k,y as z,N as C}from"./p-59edfbe2.js";import{p as L,m as _,o as F}from"./p-f582db5c.js";import{c as S,O as D,d as E,e as j,A as M}from"./p-126775a2.js";import{s as W}from"./p-e67cae57.js";let A=class{constructor(e){t(this,e)}getInsetValue(){return L(o(a.searchArea,a.imageBounds),s.map((([t,e])=>{return`inset(${(i=t,n=e,r={top:`${i.y}px`,right:n.width-(i.x+i.width)+"px",bottom:n.height-(i.y+i.height)+"px",left:`${i.x}px`}).top} ${r.right} ${r.bottom} ${r.left})`;var i,n,r})),s.getOrElse((()=>"")))}renderImage(){return L(o(a.imageUrl,a.imageBounds),s.map((([t,i])=>e("img",{src:t,width:i.width,height:i.height,style:{"clip-path":`${this.getInsetValue()}`}}))),s.getOrElse((()=>"")))}render(){return e(i,null,this.renderImage())}};A.style=':host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:"";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}';let B=class{constructor(e){t(this,e),this.disabled=!1,this.handleMove=!1,this.mouseStartPoint=void 0,this.bounds=void 0}componentDidLoad(){this.bounds=this.el.getBoundingClientRect()}handleHandlerMove(t){t.preventDefault(),t.stopPropagation();const e=F(t),i={position:_.concat(e,this.mouseStartPoint),direction:this.handlerMoveDirection};l.pipe(a.searchArea,s.map((t=>{const n=d(t,i);n.width<40||n.height<40||n.x<0||n.y<0||this.bounds.height-(n.y+n.height)<0||this.bounds.width-(n.x+n.width)<0||(a.searchArea=s.some(n),this.mouseStartPoint=e,a.detectedObject=void 0)})))}handleCropperMove(t){t.preventDefault(),t.stopPropagation();const e=F(t),i=_.concat(e,this.mouseStartPoint);l.pipe(a.searchArea,s.map((t=>{const n=c(t,i);n.x<0||n.y<0||this.bounds.height-(n.y+n.height)<0||this.bounds.width-(n.x+n.width)<0||(a.detectedObject=void 0,a.searchArea=s.some(n),this.mouseStartPoint=e)})))}handlePointerDown(t){t.stopPropagation(),this.mouseStartPoint=F(t);const e=t.target;"cropper-handler"===e.localName?(this.handlerMoveDirection=e.handler.direction,this.pointerMoveListener=this.handleHandlerMove.bind(this)):this.pointerMoveListener=this.handleCropperMove.bind(this),this.pointerReleaseListener=this.handleSearchAreaRelease.bind(this),this.el.addEventListener("pointermove",this.pointerMoveListener),window.addEventListener("pointerup",this.pointerReleaseListener,{once:!0})}handleSearchAreaRelease(){this.el.removeEventListener("pointermove",this.pointerMoveListener),document.removeEventListener("pointerup",this.pointerReleaseListener),this.mouseStartPoint=void 0,h()}getStyleMap(){return l.pipe(a.searchArea,s.map((t=>({width:`${t.width}px`,height:`${t.height}px`,transform:`translate3d(${t.x}px, ${t.y}px, 0)`,cursor:this.handleMove?"move":"default"}))),s.getOrElse((()=>({}))))}render(){return e(i,{exportparts:"handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize"},e("div",{class:{"crop-area":!0,active:this.handleMove,disabled:this.disabled},draggable:!1,style:this.getStyleMap(),onContextMenu:()=>!1,onPointerDown:t=>this.handlePointerDown(t)},a.cropperHandlers.map((t=>e("cropper-handler",{disabled:this.disabled,handler:t,onPointerDown:t=>this.handlePointerDown(t)})))))}get el(){return n(this)}};B.style=":host{display:block;height:100%;left:0;position:absolute;top:0;width:100%}:host(.hidden){visibility:hidden}.crop-area{border:1px solid white;box-sizing:border-box;position:absolute;touch-action:none;transition-property:border-color, opacity;transition-duration:.25s;transition-timing-function:ease-in-out;z-index:2;position:relative;will-change:transform}.crop-area.active{border-color:whitesmoke}.crop-area.disabled{opacity:0.25}";const G=t=>t.href.split("/").reverse()[0];let I=class{constructor(e){t(this,e),this.filter=null,this.selectedCategoryId=null,this.hideFilters=!0}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter():this.selectFilter(t)}selectFilter(t){this.selectedCategoryId=G(t),a.activeIonLink=t}clearSelectedFilter(){this.selectedCategoryId=null,a.activeIonLink=void 0,this.findSelectedFilter().blur()}findSelectedFilter(){return this.el.shadowRoot.querySelector(".filter.active")}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,e){"Enter"===t.key&&this.handleFilterSelection(e)}isFilterSelected(t){return this.selectedCategoryId===G(t)}render(){return e(i,{exportparts:"filter, show-more-filters"},e("div",{class:"filters"},this.filter.filters.filter(((t,e)=>!this.hideFilters||e<5)).map(((t,i)=>e("div",{role:"button",tabindex:"0",part:this.isFilterSelected(t)?"filter active":"filter",class:{filter:!0,active:this.selectedCategoryId===G(t)},style:{"animation-delay":10*i+"ms"},onPointerUp:e=>{e.stopPropagation(),this.handleFilterSelection(t)},onKeyPress:e=>this.handleEnter(e,t)},this.isFilterSelected(t)?e(S,null):null,t.name))),e("div",{class:{filter:!0,"show-more":!0,hidden:this.filter.filters.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>this.toggleFilters(),onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"},this.hideFilters?"Zeige mehr":"Zeige weniger")))}get el(){return n(this)}};I.style=":host{display:grid;grid-gap:1rem}.filters{display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem}.filter{align-items:center;-webkit-animation-duration:0.25s;animation-duration:0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-name:scalein;animation-name:scalein;border:1px solid lightgray;cursor:pointer;display:flex;flex-direction:row;grid-gap:8px;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:0.1rem;transform:scale(0);transition-property:background;transition-duration:0.25s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:6px 16px}.filter.active{border:1px solid black;padding:6px 8px}.filter:hover{border:1px solid gray}.show-more{display:flex}.show-more.hidden{display:none}.show-more::after{content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;height:16px;margin-top:1px;margin-left:8px}.show-more.active::after{transform:rotateX(180deg)}@-webkit-keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@media (max-width: 415px){.show-more::after{transform:rotate(-90deg)}.show-more.active::after{transform:rotate(90deg)}}@media (max-width: 800px){.filters{flex-wrap:nowrap;overflow-x:scroll;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;grid-gap:unset}.filter{scroll-snap-align:end;margin-right:0.5rem}}";let $=class{constructor(e){t(this,e),this.position=["0","0"]}getObjectPosition(){return l.pipe(a.imageBounds,s.map((t=>{const e=p(m(this.detectedObject).rectangle),{x:i,y:n}=l.pipe(e,u(t),g);return[`${i}px`,`${n}px`]})),s.getOrElse((()=>["0","0"])))}selectDetectedObject(){l.pipe(a.imageBounds,s.map((t=>{const e=m(this.detectedObject).rectangle,i=p(e),n=u(t)(i);a.detectedObject=this.detectedObject,a.searchArea=s.some(n)}))),h()}isActive(){if(!this.detectedObject)return!1;if(!a.detectedObject)return!1;const t=m(this.detectedObject),e=m(a.detectedObject);return v.equals(t,e)}render(){return e(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};$.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.5);border-radius:50%;border:none;cursor:pointer;display:block;height:var(--size);position:absolute;transition:opacity 0.25s;width:var(--size);z-index:2;transform:translate(calc(var(--x-position) - (var(--size) * 0.5)), calc(var(--y-position) - (var(--size) * 0.5)));transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.75)}:host(.active){background:var(--color-primary, var(--color-primary-system))!important;border:2px solid white}:host::after{--size:32px;border-radius:50%;content:"";cursor:pointer;display:block;height:calc(var(--size) * 0.25);transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));width:calc(var(--size) * 0.25);background:white}';let P=class{constructor(e){t(this,e),this.actionClick=r(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),e("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),e("h4",{slot:"title"},"Leider nichts gefunden"),e("span",{slot:"text"},"Leider konnten wir keine passenden Produkte finden. Bitte versuche es mit einem anderen Bildausschnitt noch einmal.")))}};P.style=":host{display:grid}vviinn-error{justify-items:center}";let T=class{constructor(e){t(this,e),this.exampleImageSelected=r(this,"exampleImageSelected",7),this.exampleImageError=r(this,"exampleImageError",7),this.src="",this.width=0,this.height=0,this.selected=!1}async selectImage(t){this.selected=!0;const e=await x(this.src),i=await f(e);l.pipe(i,b.match((()=>this.exampleImageError.emit()),(()=>this.exampleImageSelected.emit()))),this.selected=!1}showPreloader(){return(a.objectDetectionInProgress||a.loading)&&this.selected}render(){return e(i,null,this.showPreloader()?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("img",{onClick:t=>this.selectImage(t),src:this.src,width:this.width,height:this.height}))}};T.style=":host{display:block;margin-bottom:8px;position:relative}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;pointer-events:none;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";let Y=class{constructor(e){t(this,e),this.imageSelected=r(this,"imageSelected",7),this.imageSelectedError=r(this,"imageSelectedError",7)}handleImageSelection(){this.imageSelected.emit()}handleImageSelectionError(){this.imageSelectedError.emit()}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-example-images-title"},e("h3",null,"Mit den Beispielbildern die Suche direkt ausprobieren")),e("div",{class:"images"},e("slot",{name:"vviinn-example-images-1"},e("vviinn-example-image",{width:240,height:320,src:"https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc="})),e("slot",{name:"vviinn-example-images-2"},e("vviinn-example-image",{width:240,height:240,src:"https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc="})),e("slot",{name:"vviinn-example-images-3"},e("vviinn-example-image",{width:240,height:240,src:"https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc="})),e("slot",{name:"vviinn-example-images-4"},e("vviinn-example-image",{width:240,height:320,src:"https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc="}))))}get el(){return n(this)}};Y.style="h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";let Z=class{constructor(e){t(this,e),this.imageSelected=r(this,"imageSelected",7),this.imageSelectedError=r(this,"imageSelectedError",7)}async handleInputChange(t){const e=t.target,i=await f(e.files[0]);l.pipe(i,w((()=>this.imageSelectedError.emit()),(()=>this.imageSelected.emit()))),e.value=null}isLoading(){return a.loading||a.objectDetectionInProgress}render(){return e(i,{exportparts:"button"},this.isLoading()?e("vviinn-preloader",null):null,this.isLoading()?null:e("label",{htmlFor:"fileInput",part:"button"},e("slot",{name:"upload-button-text"},"Upload image")),e("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image/*",onChange:t=>this.handleInputChange(t)}))}};Z.style=":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;padding:0.5rem;transition:background 0.1s ease-in-out}";let H=class{constructor(e){t(this,e)}handleInitialImageLoad(t){const e=y(t.target),{x:i,y:n}=c(e,{x:12,y:12}),r={x:i,y:n,width:e.width-24,height:e.height-24};a.imageBounds=s.some(e),a.searchArea=s.some(r)}renderDetectedObject(t){return e("vviinn-detected-object",{detectedObject:t})}renderImage(){return l.pipe(o(a.imageUrl,a.image),s.map((([t,i])=>{const[n,r]=(t=>{const e=k(t),i=z(288)(e).map((t=>t.size));return[i[0],i[1]]})(i);return e("img",{decoding:"async",width:n,height:r,src:t,onLoad:t=>this.handleInitialImageLoad(t),draggable:!1})})),s.getOrElse((()=>null)))}renderCropper(){return l.pipe(a.imageUrl,s.map((()=>e("image-cropper",null))),s.getOrElse((()=>null)))}render(){return e(i,null,a.loading||a.objectDetectionInProgress?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("highlight-box",null),this.renderImage(),this.renderCropper(),a.detectedObjects.map((t=>this.renderDetectedObject(t))))}};H.style=":host{display:grid;position:relative;justify-self:center}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";let K=class{constructor(e){t(this,e),this.modalClosed=r(this,"modalClosed",7),this.secondaryActionClicked=r(this,"secondaryActionClicked",7),this.active=!1,this.slider=!1}close(){this.active=!1,setTimeout((()=>{this.modalClosed.emit()}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return e(i,{exportparts:"secondary-action, title, close-button",class:{closed:!this.active},onAnimationEnd:t=>this.handleAnimationEnd(t)},e("div",{class:"head"},e("button",{part:"secondary-action",onClick:()=>this.secondaryActionClicked.emit()},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M20.25 12H3.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M10.5 5.25L3.75 12L10.5 18.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),e("div",{class:"title",part:"title"},"Bildsuche"),e("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z",fill:"#333333"})))),e("div",{class:"body"},e("slot",null)))}};K.style=":host{background:white;border-radius:4px;box-sizing:border-box;display:grid;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;max-width:960px}@media (max-width: 415px){:host{-webkit-animation-name:fade-in;animation-name:fade-in;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.closed){-webkit-animation-name:fade-out;animation-name:fade-out;-webkit-animation-fill-mode:none;animation-fill-mode:none}.body{overflow-y:auto}}@media (max-width: 640px) and (min-width: 415px){:host{max-width:80%}}.head{align-items:center;border-bottom:1px solid #F4F4F4;display:grid;grid-gap:16px;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;justify-items:center;padding:16px}.title{font-weight:600;font-size:18px;line-height:24px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:unset}@-webkit-keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";let O=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-onboarding-title"},e("h3",null,"So funktioniert es")),e("vviinn-slider",{showArrows:!0},e("vviinn-slide",null,e("vviinn-onboarding-card-1",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-2",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-3",null))))}get el(){return n(this)}};O.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}::host{display:block}h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}vviinn-slide{background:#f4f4f4;padding:24px}svg{padding:16px 0}.text{display:grid;grid-gap:8px}.text>h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}.text>p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}";let V=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-1-icon"},e(D,null)),e("slot",{name:"onboarding-card-1-text"},e("div",{class:"text"},e("h4",null,"Starte die Bildsuche"),e("p",null,"Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera."))))}get el(){return n(this)}};V.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let q=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-2-icon"},e(E,null)),e("slot",{name:"onboarding-card-2-text"},e("div",{class:"text"},e("h4",null,"Verfeiner deine Suche"),e("p",null,"Du kannst den Bildrahmen selber festlegen und so die Produkte genau auswählen."))))}get el(){return n(this)}};q.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let X=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-3-icon"},e(j,null)),e("slot",{name:"onboarding-card-3-text"},e("div",{class:"text"},e("h4",null,"Ohne Hintergrund"),e("p",null,"Die besten Ergebnisse erhältst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist."))))}get el(){return n(this)}};X.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let R=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};R.style=":host{-webkit-animation:fade-in 0.5s ease-in-out;animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@-webkit-keyframes fade-in{from{opacity:0.1}to{opacity:1}}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";let N=class{constructor(e){t(this,e),this.secondaryActionClicked=r(this,"secondaryActionClicked",7),this.modalClosed=r(this,"modalClosed",7),this.active=!1}render(){return e(i,{class:{active:this.active}},e("vviinn-overlay",null,e("vviinn-modal",{onSecondaryActionClicked:()=>this.secondaryActionClicked.emit(),active:this.active},e("slot",null,"CONTENT"))))}};N.style=":host{display:none}:host(.active){display:block}vviinn-overlay{align-items:center;display:grid;justify-items:center}@media (max-width: 415px){vviinn-modal{border-radius:4px 4px 0 0;height:100vh;margin-top:32px;transform:translateY(100%);width:100vw}vviinn-overlay{align-items:end;display:grid;justify-items:center}}";let U=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",null,e("div",{class:"content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},e("defs",null),e("path",{fill:"#525252",d:"M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z"}),e("path",{fill:"#525252",d:"M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z"})),e("slot",{name:"vviinn-privacy-badge-text"},e("p",null,"Wir gehen sorgfältig mit Deinen Daten um. Deine Bilder werden nur zum Zweck der Bildsuche gespeichert.")))))}get el(){return n(this)}};U.style=":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:-webkit-min-content auto;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";let Q=class{constructor(e){t(this,e),this.actionClick=r(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Keine Verbindung"),e("span",{slot:"text"},"Etwas hat leider nicht funktioniert. Bitte prüfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Erneut versuchen")))}};Q.style=":host{display:block}";let J=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};J.style=":host{display:grid;justify-items:center}";const tt=({kind:t,tabindex:i,disabled:n,onClick:r,onKeyDown:s})=>{return e("div",{class:(o={kind:t,disabled:n},{"arrow-wrapper":!0,[o.kind]:!0,disabled:o.disabled}),onClick:r,tabindex:i,onKeyDown:s},e(M,null));var o};let et=class{constructor(e){t(this,e),this.elementsCount=0,this.internalPosition=0,this.swipeStartPosition=s.none,this.showBullets=!0,this.position=0,this.showArrows=!1}positionWatchHandler(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}connectedCallback(){this.handleDomContentChanges()}handleDomContentChanges(){const t=this.el.querySelectorAll("vviinn-slide");this.elementsCount=t.length,this.el.style.setProperty("--num-items",`${this.elementsCount}`),this.setActiveCssClassToSlide(0)}setActiveCssClassToSlide(t){const e=this.el.querySelectorAll("vviinn-slide");e.forEach((t=>t.classList.remove("active"))),e[t].classList.add("active")}goToSlide(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}renderBullets(){return this.showBullets?e("div",{class:"controls"},C.range(0,this.elementsCount-1).map((t=>e("div",{class:{bullet:!0,active:t==this.internalPosition%this.elementsCount},onClick:()=>this.goToSlide(t)})))):null}nextSlide(){this.internalPosition++,this.renderSlidePosition()}prevSlide(){const t=this.internalPosition-1;this.internalPosition=t>-1?t:this.elementsCount-1,this.renderSlidePosition()}renderSlidePosition(){requestAnimationFrame((()=>{this.el.style.setProperty("--position",""+this.internalPosition%this.elementsCount)}))}handleKeyDown(t){if("Space"===t.key||"Enter"===t.key)switch(t.target.className.includes("prev")?"prev":"next"){case"prev":this.prevSlide();break;case"next":this.nextSlide()}}handleTouchStart(t){this.showBullets&&(this.swipeStartPosition=l.pipe(t.touches[0],s.fromNullable,s.map((t=>t.clientX))))}handleTouchEnd(t){if(!this.showBullets)return;const e=l.pipe(t.changedTouches[0],s.fromNullable,s.map((t=>t.clientX)));l.pipe(o(this.swipeStartPosition,e),s.map((([t,e])=>{return(i=t)<(n=e)?-1:i>n?1:0;var i,n})),s.map((t=>{switch(t){case 1:return this.nextSlide();case-1:return this.prevSlide()}})))}render(){return e(i,null,e("div",{class:"items-wrapper"},e("div",{class:"items",onTouchStart:t=>this.handleTouchStart(t),onTouchEnd:t=>this.handleTouchEnd(t)},e("slot",null))),this.showArrows?[e(tt,{kind:"prev",onClick:()=>this.prevSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:1,disabled:!1}),e(tt,{kind:"next",onClick:()=>this.nextSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:0,disabled:!1})]:null,this.renderBullets())}get el(){return n(this)}static get watchers(){return{position:["positionWatchHandler"]}}};et.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--num-items:0;--position:0;display:grid;grid-gap:20px;justify-items:center;position:relative}.items-wrapper{overflow:hidden;width:100%}.items{box-sizing:border-box;display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--num-items), 100%);transform:translateX(calc(-100% * var(--position)));transition:transform 0.33s ease-in-out}.controls{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--num-items), -webkit-min-content);grid-template-columns:repeat(var(--num-items), min-content)}.bullet{background:#E0E0E0;border-radius:50%;box-sizing:border-box;cursor:pointer;height:8px;width:8px;transition:background 0.1s ease-in-out}.bullet:hover{background:#C6C6C6}.bullet.active{background:var(--color-primary, var(--color-primary-system))}.bullet:active{background:transparent;border:2px solid var(--color-primary, var(--color-primary-system))}.arrow-wrapper{align-items:center;background:white;border:2px solid white;bottom:0;box-sizing:border-box;display:grid;height:calc(var(--spacer) * 6);justify-items:center;margin:auto;position:absolute;top:0;transform:translate3d(0, -50%, 0);transition:border 0.25ms ease-in-out;width:calc(var(--spacer) * 4)}.arrow-wrapper:active{border-color:var(--color-primary, var(--color-primary-system));opacity:0.75}.arrow-wrapper:focus{border-color:var(--color-primary, var(--color-primary-system));opacity:0.5;outline:none}.prev{left:0}.next{right:0}.next>svg{transform:rotate3d(0, 1, 0, 180deg)}.arrow-wrapper>svg{transition:fill 0.25ms ease-in-out;fill:#A8A8A8}.arrow-wrapper:hover>svg{fill:#8D8D8D}";let it=class{constructor(e){t(this,e)}componentWillLoad(){W(this,this.el)}render(){return e(i,null,e("slot",null,e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"none"},e("defs",null),e("path",{fill:"#C6C6C6",d:"M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z"}),e("path",{fill:"#C6C6C6",d:"M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z"})),e("span",{class:"vviinn-teaser-text"},e("slot",{name:"vviinn-teaser-text"},"Finde Produkte auf ",e("br",null)," einem Foto"))))}get el(){return n(this)}};it.style=":host{align-items:center;display:grid;justify-items:center;grid-gap:16px}.vviinn-teaser-text{font-size:28px;font-weight:600;line-height:40px;size:28px;text-align:center}";let nt=class{constructor(e){t(this,e),this.actionClick=r(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Dateityp wird nicht unterstützt"),e("span",{slot:"text"},"Leider unterstützen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Neues Bild hochladen")))}};nt.style=":host{display:block}";export{A as highlight_box,B as image_cropper,I as search_filters,$ as vviinn_detected_object,P as vviinn_empty_results,T as vviinn_example_image,Y as vviinn_example_images,Z as vviinn_image_selector,H as vviinn_image_view,K as vviinn_modal,O as vviinn_onboarding,V as vviinn_onboarding_card_1,q as vviinn_onboarding_card_2,X as vviinn_onboarding_card_3,R as vviinn_overlay,N as vviinn_overlayed_modal,U as vviinn_privacy_badge,Q as vviinn_server_error,J as vviinn_slide,et as vviinn_slider,it as vviinn_teaser,nt as vviinn_wrong_format}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i,H as s,g as r}from"./p-e1ba8626.js";import{a}from"./p-126775a2.js";import{S as n}from"./p-e67cae57.js";let o=class{constructor(i){t(this,i),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.currencySign="€",this.locale="de-DE",this.pressed=!1}handleModalClosed(){this.pressed=!1}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(t))}handleKeyDown(t){"Enter"!==t.code&&"Space"!==t.code||(this.pressed=!0)}handleClick(){this.pressed=!0}render(){return i(s,{tabindex:"0",role:"button",pressed:this.pressed,onClick:()=>this.handleClick(),onKeyDown:t=>this.handleKeyDown(t)},i("slot",null,i(a,null)),i(n,null),i("vviinn-vps-widget",{active:this.pressed,"currency-sign":"€",token:this.token,locale:this.locale,apiPath:this.apiPath,exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title, product-card"}))}get el(){return r(this)}};o.style="";export{o as vviinn_vps_button}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,H as o,g as r}from"./p-e1ba8626.js";import{b as a}from"./p-126775a2.js";let n=class{constructor(e){t(this,e),this.modalClosed=i(this,"modalClosed",7),this.position="bottom",this.sourceImage=null,this.widgetScrollbar=!1,this.state="idle"}bodyClickListener(t){const{clientX:i,clientY:e}=t,o=this.getSidebarRectangle();o&&(i>=o.left&&i<=o.right&&e>=o.top&&e<=o.bottom||(this.state="closed"))}getClassMap(){return{[this.position]:!0,[this.state]:!0}}getSidebarRectangle(){var t;return null===(t=this.el.shadowRoot.querySelector("aside"))||void 0===t?void 0:t.getBoundingClientRect()}render(){return e(o,{class:this.getClassMap()},e("aside",{class:"sidebar",part:"body",onAnimationEnd:t=>this.handleAnimationEnd(t)},e("header",{class:{"contains-source-img":this.isSourceImageValid()},part:"sidebar-header"},this.isSourceImageValid()?this.renderSourceImage():null,e("span",{class:"title",part:"title"},this.sidebarTitle),e("button",{class:"close-sidebar",onClick:()=>this.state="closed"},e(a,null))),e("main",{part:"sidebar-content"},e("vviinn-vpr-widget",{exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title: product-title",token:this.token,productId:this.productId,imageWidth:300,blockTitle:"",mode:"bottom"===this.position?"continuity":"grid",useCarousel:"bottom"===this.position,onRecommendationsLoaded:()=>this.state="open",showScroll:this.widgetScrollbar}))))}renderSourceImage(){return e("img",{class:"source-image",part:"source-image",src:this.sourceImage})}isSourceImageValid(){var t;return(null===(t=this.sourceImage)||void 0===t?void 0:t.length)>0}handleAnimationEnd({animationName:t}){t.includes("slideOut")&&this.modalClosed.emit()}get el(){return r(this)}};n.style=":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";export{n as vviinn_recommendations_sidebar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as i}from"./p-e1ba8626.js";import{g as r}from"./p-78ccc9eb.js";(()=>{const i=import.meta.url,r={};return""!==i&&(r.resourcesUrl=new URL(".",i).href),e(r)})().then((e=>(r(),i([["p-f47e82b2",[[1,"cropper-handler",{handler:[16],disabled:[4]}]]],["p-fb14e3cc",[[1,"vviinn-error"]]],["p-9d24f51e",[[1,"vviinn-preloader"]]],["p-
|
|
1
|
+
import{p as e,b as i}from"./p-e1ba8626.js";import{g as r}from"./p-78ccc9eb.js";(()=>{const i=import.meta.url,r={};return""!==i&&(r.resourcesUrl=new URL(".",i).href),e(r)})().then((e=>(r(),i([["p-f47e82b2",[[1,"cropper-handler",{handler:[16],disabled:[4]}]]],["p-fb14e3cc",[[1,"vviinn-error"]]],["p-9d24f51e",[[1,"vviinn-preloader"]]],["p-1f0c8cf6",[[1,"vviinn-vpr-widget",{blockTitle:[1,"block-title"],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],productId:[1,"product-id"],token:[1],currencySign:[1,"currency-sign"],pricePrefix:[1,"price-prefix"],mode:[1],campaignType:[1,"campaign-type"],locale:[1],apiPath:[1,"api-path"],useCarousel:[4,"use-carousel"],showScroll:[4,"show-scroll"],cssUrl:[1,"css-url"],recommendations:[32],loaded:[32]},[[0,"productImageLoaded","lol"]]],[0,"vviinn-carousel",{mode:[1],imageWidth:[2,"image-width"],showScroll:[4,"show-scroll"],recommendations:[16],moveDirection:[32],contentGroups:[32],activeContentGroup:[32]}],[1,"vviinn-product-card",{brand:[1],currency:[1],deeplink:[1],image:[1],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],locale:[1],price:[2],pricePrefix:[1,"price-prefix"],productId:[1,"product-id"],productTitle:[1,"product-title"],productType:[1,"product-type"],salePrice:[2,"sale-price"],responsive:[4],dimmedBackground:[4,"dimmed-background"],imageLoaded:[32]}]]],["p-71809bed",[[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{active:[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{filter:[16],selectedCategoryId:[32],hideFilters:[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{disabled:[4],handleMove:[32]}],[1,"vviinn-example-image",{src:[1],width:[2],height:[2],selected:[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{detectedObject:[16],position:[32]}],[1,"vviinn-modal",{active:[1540],slider:[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{showBullets:[4,"show-bullets"],position:[514],showArrows:[4,"show-arrows"],elementsCount:[32],internalPosition:[32],swipeStartPosition:[32]}]]],["p-e38f4aa2",[[1,"vviinn-vps-widget",{token:[1],apiPath:[1,"api-path"],active:[1028],currencySign:[1,"currency-sign"],locale:[1],slidePosition:[32],width:[32],wrongImageFormat:[32]}]]],["p-9ea96a69",[[1,"vviinn-vps-button",{token:[1],currencySign:[1,"currency-sign"],locale:[1],apiPath:[1,"api-path"],pressed:[32]},[[0,"modalClosed","handleModalClosed"]]]]],["p-a95c00c9",[[1,"vviinn-recommendations-sidebar",{sidebarTitle:[1,"sidebar-title"],token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],widgetScrollbar:[4,"widget-scrollbar"],state:[32]},[[16,"click","bodyClickListener"]]]]],["p-3734a3ef",[[1,"vviinn-vpr-button",{token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],sidebarTitle:[1,"sidebar-title"],modalScrollbar:[4,"modal-scrollbar"]}]]]],e))));
|
package/www/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <link rel="preconnect" href="https://cdn.vviinn.com"> <link rel="preconnect" href="https://d1rgjmn2wmqeif.cloudfront.net"> <link rel="modulepreload" href="/build/p-
|
|
1
|
+
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <link rel="preconnect" href="https://cdn.vviinn.com"> <link rel="preconnect" href="https://d1rgjmn2wmqeif.cloudfront.net"> <link rel="modulepreload" href="/build/p-4379b1c2.js"><script type="module" src="/build/p-4379b1c2.js" data-stencil data-resources-url="/build/" data-stencil-namespace="vviinn-widgets"></script> <script nomodule="" src="/build/vviinn-widgets.js" data-stencil></script> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""> <link href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&display=swap" rel="stylesheet"> <!-- <style>
|
|
2
2
|
/* latin-ext */
|
|
3
3
|
@font-face {
|
|
4
4
|
font-family: 'Lato';
|
|
@@ -102,76 +102,6 @@
|
|
|
102
102
|
vviinn-vpr-widget::part(price-currency) {
|
|
103
103
|
font-weight:normal
|
|
104
104
|
}
|
|
105
|
-
</style> -->
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
currency-sign="€"
|
|
109
|
-
>
|
|
110
|
-
</vviinn-vps-button> --> <!-- <div class="wrapper">
|
|
111
|
-
<vviinn-vpr-widget token="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOjYzLCJqdGkiOiI1MTIxZTE5Zi1hNzU5LTRiNDMtYWY2MS0yZGExMTJkNTA0MmUiLCJzY29wZXMiOlsidnByIiwidnBzIiwidnBjIl19.MBMXwhQFbxysVVB01FxhXGx0I9JiaZnJL0ol_bmOopOfZYo8RxibDw1zK-PNdfkhi85SQUtug7V16wzAibhGOiMYEEHPV-zGDIaHSx7HCprqUeH0QmrinXllBtAy8E8vnS1c1Gt48BaCE2dsq7IIgmlJGU4gzod_NbdYytzIn1w" product-id="692526" api-path="https://api.vviinn.com" image-width="240" mode="classic"></vviinn-vpr-widget>
|
|
112
|
-
</div> --> <!-- <vviinn-carousel>
|
|
113
|
-
<vviinn-product-card
|
|
114
|
-
product-title="Fragments 2022"
|
|
115
|
-
image="https://d1rgjmn2wmqeif.cloudfront.net/r/b/250192-1.jpg"
|
|
116
|
-
price="32.00"
|
|
117
|
-
brand="Bonobo"
|
|
118
|
-
image-width="200"
|
|
119
|
-
responsive="true">
|
|
120
|
-
</vviinn-product-card>
|
|
121
|
-
<vviinn-product-card
|
|
122
|
-
product-title="Empathy Alpha"
|
|
123
|
-
image="https://d1rgjmn2wmqeif.cloudfront.net/r/b/266632.jpg"
|
|
124
|
-
price="20.99"
|
|
125
|
-
brand="clocolan"
|
|
126
|
-
image-width="200"
|
|
127
|
-
responsive="true">
|
|
128
|
-
</vviinn-product-card>
|
|
129
|
-
<vviinn-product-card
|
|
130
|
-
product-title="Season Of The Lost"
|
|
131
|
-
image="https://d1rgjmn2wmqeif.cloudfront.net/r/b/256969.png"
|
|
132
|
-
price="11.49"
|
|
133
|
-
brand="AshTreJinkins"
|
|
134
|
-
image-width="200"
|
|
135
|
-
responsive="true">
|
|
136
|
-
</vviinn-product-card>
|
|
137
|
-
<vviinn-product-card
|
|
138
|
-
product-title="Delay x Takuma"
|
|
139
|
-
image="https://d1rgjmn2wmqeif.cloudfront.net/r/b/265822.jpg"
|
|
140
|
-
price="32.5"
|
|
141
|
-
brand="Takuma Watanabe"
|
|
142
|
-
image-width="200"
|
|
143
|
-
responsive="true">
|
|
144
|
-
</vviinn-product-card>
|
|
145
|
-
<vviinn-product-card
|
|
146
|
-
product-title="Forse"
|
|
147
|
-
image="https://d1rgjmn2wmqeif.cloudfront.net/r/b/255273.jpg"
|
|
148
|
-
price="46.49"
|
|
149
|
-
brand="Alessandro Cortini"
|
|
150
|
-
image-width="200"
|
|
151
|
-
responsive="true">
|
|
152
|
-
</vviinn-product-card>
|
|
153
|
-
<vviinn-product-card
|
|
154
|
-
product-title="NOISEEM"
|
|
155
|
-
image="https://d1rgjmn2wmqeif.cloudfront.net/r/b/255055.jpg"
|
|
156
|
-
price="6.99"
|
|
157
|
-
brand="FUJI||||||||||TA"
|
|
158
|
-
image-width="200"
|
|
159
|
-
responsive="true">
|
|
160
|
-
</vviinn-product-card>
|
|
161
|
-
<vviinn-product-card
|
|
162
|
-
product-title="The Silver Threshold"
|
|
163
|
-
image="https://d1rgjmn2wmqeif.cloudfront.net/r/b/254976.jpg"
|
|
164
|
-
price="9.99"
|
|
165
|
-
brand="hackedepicciotto"
|
|
166
|
-
image-width="200"
|
|
167
|
-
responsive="true">
|
|
168
|
-
</vviinn-product-card>
|
|
169
|
-
<vviinn-product-card
|
|
170
|
-
product-title="Simulacrum"
|
|
171
|
-
image="https://d1rgjmn2wmqeif.cloudfront.net/r/b/249498-1.jpg"
|
|
172
|
-
price="21.99"
|
|
173
|
-
brand="Aho Ssan"
|
|
174
|
-
image-width="200"
|
|
175
|
-
responsive="true">
|
|
176
|
-
</vviinn-product-card>
|
|
177
|
-
</vviinn-carousel> --> </body></html>
|
|
105
|
+
</style> --> <style>vviinn-vpr-widget::part(carousel-button) {
|
|
106
|
+
background: red;
|
|
107
|
+
}</style> </head> <body> <vviinn-vpr-widget token="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOjgzLCJqdGkiOiI3ZTg2Y2I1YS00ZTFjLTRhYjctYjU2My1lN2FjMTYzZTYyZDIiLCJzY29wZXMiOlsidnByIiwidnBzIiwidnBjIl19.SbaQnBkvoXer3GPCWUthFQStFKLHZNMBfj4Qu44WHM8nzaIt48I74yVy4gVbX29vtd6jIkDPdakqEXRXmAxOCtv7_nsd4iBs1yMegfOWW5g8f10PKfZqmWJcfhwKIEElnUMFmP6rXpogntZ7iFfeTBbiRNzQPhkaa7jUjgQkCC4" product-id="4114460310" position="right"></vviinn-vpr-widget> </body></html>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { withDesign } from "storybook-addon-designs";
|
|
2
|
-
export default {
|
|
3
|
-
title: "Widgets/Visual Recommendation Button",
|
|
4
|
-
component: "vviinn-vpr-button",
|
|
5
|
-
decorators: [withDesign],
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => `<vviinn-vpr-button token="${args.token}" product-id="${args.productId}"></vviinn-vpr-button>`;
|
|
8
|
-
export const Default = Template.bind({});
|
|
9
|
-
Default.args = {
|
|
10
|
-
token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOjgzLCJqdGkiOiI3ZTg2Y2I1YS00ZTFjLTRhYjctYjU2My1lN2FjMTYzZTYyZDIiLCJzY29wZXMiOlsidnByIiwidnBzIiwidnBjIl19.SbaQnBkvoXer3GPCWUthFQStFKLHZNMBfj4Qu44WHM8nzaIt48I74yVy4gVbX29vtd6jIkDPdakqEXRXmAxOCtv7_nsd4iBs1yMegfOWW5g8f10PKfZqmWJcfhwKIEElnUMFmP6rXpogntZ7iFfeTBbiRNzQPhkaa7jUjgQkCC4",
|
|
11
|
-
productId: "4114460310",
|
|
12
|
-
};
|
|
13
|
-
Default.parameters = {
|
|
14
|
-
design: {
|
|
15
|
-
type: "figma",
|
|
16
|
-
url: "https://www.figma.com/file/YR5ZK1s4z9ZRUXytB8uVuj/Widgets?node-id=591%3A3859",
|
|
17
|
-
},
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as e,g as r,c as n}from"./p-e1ba8626.js";import{_ as s,O as o,S as a,a as l,E as c,i as h,s as d,c as u,m as p,f as m,g,b as v,d as b,A as f,e as w,T as x}from"./p-59edfbe2.js";import{C as y,a as k,V as C}from"./p-56fc949a.js";import{p as _}from"./p-f582db5c.js";let R=class{constructor(i){t(this,i),this.moveDirection="right",this.contentGroups=[],this.activeContentGroup=0,this.mode="continuity",this.imageWidth=140,this.showScroll=!0,this.recommendations=[],this.columns=0,this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.mutationObserver=new MutationObserver((()=>this.cloneSlottedContent()))}connectedCallback(){this.setItemWidth()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.setWidth(),this.processScrollbarWidth(),this.columns=this.getColumnsNumber();const t=this.el.querySelector(".content");this.mutationObserver.observe(t,{subtree:!0,childList:!0}),this.resizeObserver.observe(this.getHostParent())}getItemWidthFromDocument(){return parseInt(getComputedStyle(document.body).getPropertyValue("--vviinn-carousel-image-width"))}setItemWidth(){const t=this.getItemWidthFromDocument(),i=isNaN(t)?this.imageWidth:t;this.el.style.setProperty("--vviinn-carousel-image-width",`${i}px`)}getContentClassMap(){return{content:!0,[this.moveDirection]:!0,[this.mode]:!0,"show-scrollbar":this.showScroll}}handleResize(){this.setWidth(),this.processScrollbarWidth(),this.setItemWidth();const t=this.getColumnsNumber();t!==this.columns&&(this.columns=t)}calculateMoveStep(){const t=this.getContent().map((t=>t.getBoundingClientRect().width));return t.reduce(((t,i)=>t+i),0)/t.length}getHostParent(){return this.el.parentNode.host.parentElement}setWidth(){const t=this.getHostParent();if(!t)return;const i=getComputedStyle(t),e=t.getBoundingClientRect().width-(parseInt(i["padding-right"])+parseInt(i["padding-left"]));this.el.style.setProperty("--vviinn-carousel-content-width",`${e}px`)}getParent(){return this.el.parentNode.host.parentElement}cloneSlottedContent(){this.setWidth()}getActiveGroupIndex(){var t,i;if(!(null===(i=null===(t=this.getContentNode())||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.left))return 0;const e=this.getContentGroups().map((t=>t.getBoundingClientRect().left)).map(((t,i)=>[t,i])).filter((t=>t[0]>=0));return e.length>0?e[0][1]:0}getContentNode(){return this.el.querySelector(".content")}getContent(){const t=this.getContentNode().children;return Array.from(t).map((t=>t))}getColumnsNumber(){const t=getComputedStyle(this.el).getPropertyValue("--vviinn-carousel-columns-internal");return parseInt(t)}getContentGroups(){return Array.from(this.el.querySelectorAll(".items-group"))}showNext(){this.moveDirection="right";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft+this.calculateMoveStep(),behavior:"smooth"})}))}showPrev(){this.moveDirection="left";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft-this.calculateMoveStep(),behavior:"smooth"})}))}scroll(t){const i=this.getContentNode();requestAnimationFrame((()=>{i.scrollTo({top:0,left:this.calculateMoveStep()*t,behavior:"smooth"})}))}processScrollbarWidth(){const t=this.getContentNode();this.el.style.setProperty("--vviinn-progressbar-width",t.clientWidth*((t.scrollLeft+t.clientWidth)/t.scrollWidth)+"px"),this.activeContentGroup=this.getActiveGroupIndex()}showBullets(){return"grid"===this.mode&&this.showScroll}showScrollbar(){return"continuity"===this.mode&&this.showScroll}getClassMap(){return{[this.mode]:!0,"show-scrollbar":this.showScrollbar()}}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:"continuity"===this.mode})}renderRecommendationGroup(t){return i("div",{class:"items-group"},t)}renderRecommendationGroups(t){return t.map((t=>this.renderRecommendationGroup(t)))}renderRecommendations(){return"grid"===this.mode?this.renderGrid():this.renderRecommendationsElements()}renderRecommendationsElements(){return this.recommendations.map((t=>this.renderRecommendation(t)))}renderGrid(){const t=this.renderRecommendationsElements(),i=s.chunksOf(this.getColumnsNumber())(t);return this.renderRecommendationGroups(i)}renderBullets(){const t=Math.ceil(this.recommendations.length/this.getColumnsNumber());return Array.from(Array(t).keys()).map((t=>i("div",{class:{bullet:!0,active:this.activeContentGroup===t},onClick:()=>this.scroll(t)})))}render(){return i(e,{class:this.getClassMap()},i("div",{class:Object.assign({body:!0},this.getClassMap())},i("button",{class:"prev",onClick:()=>this.showPrev()},i(y,null)),i("div",{class:this.getContentClassMap(),onScroll:()=>this.processScrollbarWidth()},this.renderRecommendations()),i("button",{class:"next",onClick:()=>this.showNext()},i(y,null))),this.showBullets()?i("div",{class:"bullets"},this.renderBullets()):"")}get el(){return r(this)}};R.style=":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";class I{sendImpression(t){var i,e,r;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}sendClick(t){var i,e,r;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}}class S{constructor(){ga("require","ec")}convertProduct(t){var i,e,r;return{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var i,e,r;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const P=o.getMonoid(a.first()).concat(l.pipe(o.fromNullable(window.gtag),o.map((()=>new I))),l.pipe(o.fromNullable(window.ga),o.map((()=>new S)))),F=/fit\/\d+\//,E=(t,i)=>l.pipe((t=>l.pipe(t.match(F),c.fromNullable(t),c.map((()=>t))))(t),c.map((t=>t.replace(F,`fit/${i}/`))),c.getOrElse((()=>t))),O=(t,e)=>t.deeplink?i("a",{class:t.part,part:t.part,href:t.deeplink},e):e,V=t=>{var e;const r=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),n=`${null!==(e=t.prefix)&&void 0!==e?e:""} ${r} ${t.currency}`;return i("span",{class:"price-amount",part:"price-amount"},n)},z=t=>{const e=i(V,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale});return i("span",{class:"price-container",part:"price-container"},t.salePrice?[i("span",{class:"price-sale",part:"price-sale"},i(V,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale})),i("span",{class:"price-outdated",part:"price-outdated"},e)]:i("span",{class:"price-regular",part:"price-regular"},e))};let j=class{constructor(i){t(this,i),this.recommendationLoad=n(this,"recommendationLoad",7),this.recommendationView=n(this,"recommendationView",7),this.recommendationClick=n(this,"recommendationClick",7),this.productImageLoaded=n(this,"productImageLoaded",7),this.currency=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.pricePrefix=void 0,this.responsive=!1,this.dimmedBackground=!1,this.imageLoaded=!1,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1})}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(l.pipe(P,o.map((t=>t.sendImpression(this.getProduct())))),this.recommendationView.emit(this.productId),this.intersectionObserver.disconnect())}componentDidLoad(){this.recommendationLoad.emit(this.productId),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("mousedown",(t=>{this.recommendationClick.emit(this.productId),window.ga&&t.preventDefault(),l.pipe(P,o.match((()=>null),(t=>t.sendClick(this.getProduct())))),window.ga&&ga("send","event","UX","click","Results",{hitCallback:function(){document.location.href=this.deeplink}})}))))}getProduct(){return h.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:E(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek())):((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:E(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek()))}kek(){this.productImageLoaded.emit(this.productId)}render(){var t,r,n;return i(e,{part:"product-card",class:{dimmed:this.dimmedBackground},exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title"},i(O,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),i(O,{deeplink:this.deeplink,part:"deeplink"},i("span",{class:"title",part:"title"},this.productTitle)),i("span",{class:"brand",part:"brand"},this.brand),i("span",{class:"type",part:"type"},this.productType),i(z,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:d.pricePrefix,currency:null!==(r=this.currency)&&void 0!==r?r:d.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(n=this.locale)&&void 0!==n?n:d.locale}))}get el(){return r(this)}};j.style=':host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:"";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}';let A=class{constructor(i){t(this,i),this.modalClosed=n(this,"modalClosed",7),this.position="bottom",this.sourceImage=null,this.widgetScrollbar=!1,this.state="idle"}bodyClickListener(t){const{clientX:i,clientY:e}=t,r=this.getSidebarRectangle();r&&(i>=r.left&&i<=r.right&&e>=r.top&&e<=r.bottom||(this.state="closed"))}getClassMap(){return{[this.position]:!0,[this.state]:!0}}getSidebarRectangle(){var t;return null===(t=this.el.shadowRoot.querySelector("aside"))||void 0===t?void 0:t.getBoundingClientRect()}render(){return i(e,{class:this.getClassMap()},i("aside",{class:"sidebar",part:"body",onAnimationEnd:t=>this.handleAnimationEnd(t)},i("header",{class:{"contains-source-img":this.isSourceImageValid()},part:"sidebar-header"},this.isSourceImageValid()?this.renderSourceImage():null,i("span",{class:"title",part:"title"},this.sidebarTitle),i("button",{class:"close-sidebar",onClick:()=>this.state="closed"},i(k,null))),i("main",{part:"sidebar-content"},i("vviinn-vpr-widget",{exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title: product-title",token:this.token,productId:this.productId,imageWidth:300,blockTitle:"",mode:"bottom"===this.position?"continuity":"grid",useCarousel:"bottom"===this.position,onRecommendationsLoaded:()=>this.state="open",showScroll:this.widgetScrollbar}))))}renderSourceImage(){return i("img",{class:"source-image",part:"source-image",src:this.sourceImage})}isSourceImageValid(){var t;return(null===(t=this.sourceImage)||void 0===t?void 0:t.length)>0}handleAnimationEnd({animationName:t}){t.includes("slideOut")&&this.modalClosed.emit()}get el(){return r(this)}};A.style=":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";let B=class{constructor(i){t(this,i),this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1}render(){return i(e,null,i("button",{class:"open-button",part:"button",onClick:()=>this.handleClick()},i("slot",null,i(C,null))))}handleClick(){const t=document.createElement("vviinn-recommendations-sidebar");t.sidebarTitle=this.sidebarTitle,t.productId=this.productId,t.token=this.token,t.position=this.position,t.sourceImage=this.sourceImage,t.widgetScrollbar=this.modalScrollbar,t.addEventListener("modalClosed",(()=>{document.body.removeChild(t)})),document.body.append(t)}};B.style=":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";const D=l.flow((t=>`Bearer ${t}`),(t=>new Headers({Authorization:t})),(t=>({headers:t}))),$=b(f),T=(t,i={})=>_($(g(),v),m,u(p(t,i))),L=t=>i=>T(`product/${t}/similar-products`,i),X=t=>i=>T(`product/${t}/cross-selling-products`,i);function M(t){return"function"==typeof t}function N(t){const i=t((t=>{Error.call(t),t.stack=(new Error).stack}));return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}const Y=N((t=>function(i){t(this),this.message=i?`${i.length} errors occurred during unsubscription:\n${i.map(((t,i)=>`${i+1}) ${t.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=i}));function W(t,i){if(t){const e=t.indexOf(i);0<=e&&t.splice(e,1)}}class G{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:i}=this;if(i)if(this._parentage=null,Array.isArray(i))for(const t of i)t.remove(this);else i.remove(this);const{initialTeardown:e}=this;if(M(e))try{e()}catch(i){t=i instanceof Y?i.errors:[i]}const{_finalizers:r}=this;if(r){this._finalizers=null;for(const i of r)try{H(i)}catch(i){t=null!=t?t:[],i instanceof Y?t=[...t,...i.errors]:t.push(i)}}if(t)throw new Y(t)}}add(t){var i;if(t&&t!==this)if(this.closed)H(t);else{if(t instanceof G){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}}_hasParent(t){const{_parentage:i}=this;return i===t||Array.isArray(i)&&i.includes(t)}_addParent(t){const{_parentage:i}=this;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t}_removeParent(t){const{_parentage:i}=this;i===t?this._parentage=null:Array.isArray(i)&&W(i,t)}remove(t){const{_finalizers:i}=this;i&&W(i,t),t instanceof G&&t._removeParent(this)}}G.EMPTY=(()=>{const t=new G;return t.closed=!0,t})();const U=G.EMPTY;function q(t){return t instanceof G||t&&"closed"in t&&M(t.remove)&&M(t.add)&&M(t.unsubscribe)}function H(t){M(t)?t():t.unsubscribe()}const J={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},K={setTimeout(t,i,...e){const{delegate:r}=K;return(null==r?void 0:r.setTimeout)?r.setTimeout(t,i,...e):setTimeout(t,i,...e)},clearTimeout(t){const{delegate:i}=K;return((null==i?void 0:i.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Q(){}const Z=tt("C",void 0,void 0);function tt(t,i,e){return{kind:t,value:i,error:e}}function it(t){t()}class et extends G{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,q(t)&&t.add(this)):this.destination=ct}static create(t,i,e){return new ot(t,i,e)}next(t){this.isStopped?lt(function(t){return tt("N",t,void 0)}(t),this):this._next(t)}error(t){this.isStopped?lt(tt("E",void 0,t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?lt(Z,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const rt=Function.prototype.bind;function nt(t,i){return rt.call(t,i)}class st{constructor(t){this.partialObserver=t}next(t){const{partialObserver:i}=this;if(i.next)try{i.next(t)}catch(t){at(t)}}error(t){const{partialObserver:i}=this;if(i.error)try{i.error(t)}catch(t){at(t)}else at(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(t){at(t)}}}class ot extends et{constructor(t,i,e){let r;if(super(),M(t)||!t)r={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=e?e:void 0};else{let i;this&&J.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),r={next:t.next&&nt(t.next,i),error:t.error&&nt(t.error,i),complete:t.complete&&nt(t.complete,i)}):r=t}this.destination=new st(r)}}function at(t){var i;i=t,K.setTimeout((()=>{const{onUnhandledError:t}=J;if(!t)throw i;t(i)}))}function lt(t,i){const{onStoppedNotification:e}=J;e&&K.setTimeout((()=>e(t,i)))}const ct={closed:!0,next:Q,error:function(t){throw t},complete:Q},ht="function"==typeof Symbol&&Symbol.observable||"@@observable";function dt(t){return t}class ut{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new ut;return i.source=this,i.operator=t,i}subscribe(t,i,e){const r=(n=t)&&n instanceof et||function(t){return t&&M(t.next)&&M(t.error)&&M(t.complete)}(n)&&q(n)?t:new ot(t,i,e);var n;return it((()=>{const{operator:t,source:i}=this;r.add(t?t.call(r,i):i?this._subscribe(r):this._trySubscribe(r))})),r}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=pt(i))(((i,e)=>{const r=new ot({next:i=>{try{t(i)}catch(t){e(t),r.unsubscribe()}},error:e,complete:i});this.subscribe(r)}))}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[ht](){return this}pipe(...t){return(0===(i=t).length?dt:1===i.length?i[0]:function(t){return i.reduce(((t,i)=>i(t)),t)})(this);var i}toPromise(t){return new(t=pt(t))(((t,i)=>{let e;this.subscribe((t=>e=t),(t=>i(t)),(()=>t(e)))}))}}function pt(t){var i;return null!==(i=null!=t?t:J.Promise)&&void 0!==i?i:Promise}ut.create=t=>new ut(t);const mt=N((t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class gt extends ut{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new vt(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new mt}next(t){it((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}}))}error(t){it((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}}))}complete(){it((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:e,observers:r}=this;return i||e?U:(this.currentObservers=null,r.push(t),new G((()=>{this.currentObservers=null,W(r,t)})))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:e,isStopped:r}=this;i?t.error(e):r&&t.complete()}asObservable(){const t=new ut;return t.source=this,t}}gt.create=(t,i)=>new vt(t,i);class vt extends gt{constructor(t,i){super(),this.destination=t,this.source=i}next(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.next)||void 0===e||e.call(i,t)}error(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.error)||void 0===e||e.call(i,t)}complete(){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===i||i.call(t)}_subscribe(t){var i,e;return null!==(e=null===(i=this.source)||void 0===i?void 0:i.subscribe(t))&&void 0!==e?e:U}}let bt=class{constructor(i){t(this,i),this.recommendationsLoaded=n(this,"recommendationsLoaded",7),this.blockTitle="Recommended products",this.imageRatio=1,this.imageWidth=300,this.currencySign="€",this.mode="continuity",this.campaignType="VPR",this.locale="de-DE",this.apiPath="https://api.vviinn.com",this.useCarousel=!0,this.showScroll=!0,this.cssUrl=null,this.recommendations=[],this.loaded=!1,this.productImageLoadedSubject=new gt}handleProductIdChange(){this.getRecommendations()}handleCampaignTypeChange(){this.getRecommendations()}handleApiPathChange(t){w.apiPath=t,this.getRecommendations()}lol({detail:t}){this.productImageLoadedSubject.next(t)}connectedCallback(){w.apiPath=this.apiPath,w.currencySign=this.currencySign,w.locale=this.locale}async componentWillLoad(){w.pricePrefix=this.pricePrefix,w.currencySign=this.currencySign,this.getRecommendations()}async getRecommendations(){if(void 0===this.productId||void 0===this.token)return;const t=this.campaignType.length>0?this.campaignType:"VPR",i=D(this.token),e=l.pipe(x.of((t=>{return l.pipe("VPR"===t?{_tag:"VPR"}:{_tag:"VCS"},(i=()=>L,e=()=>X,t=>(t=>"VPR"===t._tag)(t)?i():e()));var i,e})(t)),x.ap(x.of(this.productId)),x.ap(x.of(i)),x.flatten),r=await e();l.pipe(r,c.fold((t=>this.handleError(t)),(t=>this.handleRecommendationsSucces(t))))}handleError(t){console.log("ERROR:",t)}handleRecommendationsSucces(t){var i;this.recommendations=null!==(i=null==t?void 0:t.extended)&&void 0!==i?i:t,h.results=this.recommendations,this.loaded=!0,this.productIds=this.recommendations.map((t=>t.productId)),this.productImageLoadedSubject.subscribe((t=>{this.productIds=this.productIds.filter((i=>i!==t)),0===this.productIds.length&&this.recommendationsLoaded.emit()}))}isExternalCSS(){return this.cssUrl&&this.cssUrl.length>0}renderExternalCSS(){return this.isExternalCSS()?i("link",{href:this.cssUrl,rel:"stylesheet"}):""}render(){return i(e,{class:{loaded:this.loaded,empty:0==this.recommendations.length,[this.mode]:!0},"aria-hidden":this.loaded?"false":"true"},this.renderExternalCSS(),i("style",null,w.fallbackStyles),i("h2",{part:"recommendations-title"},this.blockTitle),this.useCarousel?this.renderCarousel():this.renderResults())}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:this.useDimmedBackgroundInCard()})}useDimmedBackgroundInCard(){return"continuity"===this.mode||!this.useCarousel}renderResults(){return i("div",{class:"recommendations-grid",part:"recommendations-grid"},this.recommendations.map((t=>this.renderRecommendation(t))))}renderCarousel(){return i("vviinn-carousel",{mode:this.mode,imageWidth:this.imageWidth,showScroll:this.showScroll,recommendations:this.recommendations})}get el(){return r(this)}static get watchers(){return{productId:["handleProductIdChange"],campaignType:["handleCampaignTypeChange"],apiPath:["handleApiPathChange"]}}};bt.style=":host{display:grid;grid-gap:1rem;width:100%}:host(:not(.loaded)){position:absolute;visibility:hidden}:host(.grid) vviinn-product-card::part(image){border:1px solid #DDDDDD;width:100%}h2{margin:0}vviinn-product-card::part(price-container){align-self:flex-start;text-align:left;display:flex}.results{display:grid;grid-gap:1rem}.visually-hidden{position:absolute;top:0;left:0;z-index:-1;height:0;width:0}h2{margin:0}:host(.grid) h2{justify-content:center}:host(.grid) vviinn-product-card::part(image){min-width:100%}:host(.grid) vviinn-product-card::part(image-link){width:100%}:host(.grid) vviinn-product-card::part(title),:host(.grid) vviinn-product-card::part(brand),:host(.grid) vviinn-product-card::part(type){text-align:center}:host(.grid) vviinn-product-card::part(price-container){align-self:center}:host(.continuity) vviinn-product-card::part(title),:host(.continuity) vviinn-product-card::part(brand),:host(.continuity) vviinn-product-card::part(type),:host(.continuity) vviinn-product-card::part(deeplink){text-align:left;max-width:unset;align-self:start}";export{R as vviinn_carousel,j as vviinn_product_card,A as vviinn_recommendations_sidebar,B as vviinn_vpr_button,bt as vviinn_vpr_widget}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as s,g as r}from"./p-e1ba8626.js";import{b as n}from"./p-56fc949a.js";import{S as a}from"./p-e67cae57.js";let o=class{constructor(i){t(this,i),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.currencySign="€",this.locale="de-DE",this.pressed=!1}handleModalClosed(){this.pressed=!1}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(t))}handleKeyDown(t){"Enter"!==t.code&&"Space"!==t.code||(this.pressed=!0)}handleClick(){this.pressed=!0}render(){return i(s,{tabindex:"0",role:"button",pressed:this.pressed,onClick:()=>this.handleClick(),onKeyDown:t=>this.handleKeyDown(t)},i("slot",null,i(n,null)),i(a,null),i("vviinn-vps-widget",{active:this.pressed,"currency-sign":"€",token:this.token,locale:this.locale,apiPath:this.apiPath,exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title, product-card"}))}get el(){return r(this)}};o.style="";export{o as vviinn_vps_button}
|