iBet uBet web content aggregator. Adding the entire web to your favor.
iBet uBet web content aggregator. Adding the entire web to your favor.



Link to original content: http://ecommercedb.com/_nuxt/Dxm_TqER.js
import{_ as Y}from"./wMmrnhvC.js";import{o as n,G as i,e as a,d as j,r as M,k as y,n as h,w as A,O as R,f as l,aC as T,ae as x,t as g,C as H,c as z,q as Q,V,W as q,v as B,az as D,as as J,bA as X,bC as Z,z as ee,R as te,a7 as le,a8 as se,a9 as oe}from"./llFuKhWI.js";import{F as ae,a as ne}from"./CaSFzJTk.js";import{b as re}from"./BvsEOdqE.js";import{t as ie}from"./DmTcqMXd.js";import{c as ce}from"./NioPq_Hi.js";import{I as de}from"./Ckcxxpii.js";import{I as ue}from"./CfS3AMEv.js";import{_ as pe}from"./BtJExACf.js";const _e={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},me=a("path",{fill:"currentColor","fill-rule":"evenodd",d:"M12.707 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L7 9.086l4.293-4.293a1 1 0 0 1 1.414 0","clip-rule":"evenodd"},null,-1),fe=[me];function ve(d,k){return n(),i("svg",_e,[...fe])}const he={render:ve},ge={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},we=a("path",{fill:"currentColor","fill-rule":"evenodd",d:"M2.5 3.5a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1zm2 1v7h7v-7z","clip-rule":"evenodd"},null,-1),be=[we];function ye(d,k){return n(),i("svg",ge,[...be])}const ke={render:ye},Se={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",class:"feather feather-trash-2",viewBox:"0 0 24 24"},$e=a("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"},null,-1),Ce=[$e];function xe(d,k){return n(),i("svg",Se,[...Ce])}const Be={render:xe},Me={class:"dropdownMultiSelect"},Ve={class:"dropdownMultiSelect__fieldset"},Ie={class:"pl-1"},Oe={class:"dropdownMultiSelect__options",role:"listbox"},De=["aria-selected","onClick","onKeydown"],Re=["aria-label","onClick","onKeydown"],pt=j({__name:"DropdownMultiSelect",props:{modelValue:{},options:{},defaultValue:{default:()=>[]},label:{default:""},disabled:{type:Boolean,default:!1},notDeselectable:{type:Boolean,default:!1},addReset:{type:Boolean,default:!1},sortSelectionToTop:{type:Boolean,default:!1},emptyLabel:{default:"All"},resetLabel:{default:"Clear filter"},filter:{type:Boolean,default:!1},selectAll:{type:Boolean,default:!1},tooltipText:{default:""},isDirty:{type:Boolean,default:!1},dataGtm:{default:void 0}},emits:["update:modelValue","change","closed"],setup(d,{emit:k}){const p=k,s=d,_=M(),c=M(""),w=M([]),r=M(),L=M(),S=y(()=>s.modelValue),I=y(()=>S.value.length),K=y(()=>I.value===0&&s.addReset?s.emptyLabel:m.value.map(e=>e.label)),m=y(()=>s.options.filter(e=>S.value.includes(e.value))),b=y(()=>{var t;let e=[...s.options];if(s.sortSelectionToTop&&!c.value&&w.value.length&&e.sort((v,o)=>w.value.includes(v.value)?w.value.includes(o.value)?v.label.localeCompare(o.label):-1:0),c.value){const v=(t=_.value)==null?void 0:t.search(c.value);v&&(e=v.map(o=>o.item))}return e}),f=y(()=>{var e;return s.notDeselectable?[(e=s.options[0])==null?void 0:e.value]:s.defaultValue}),$=e=>S.value.includes(e.value),u=e=>s.notDeselectable?!($(e)&&I.value===1):!0,C=e=>{D(()=>{p("update:modelValue",[e.value]),p("change",[e.value])}),E(!0)},O=e=>{if(!u(e))return;const t=ie(S.value,e.value);D(()=>{p("update:modelValue",t),p("change",t)})},F=(e=!1,t=!1)=>{D(()=>{p("update:modelValue",f.value),p("change",f.value)}),e&&E(t)},E=(e=!1)=>{D(()=>{var t;(t=L.value)==null||t.closeDropdown(e)})},U=(e=!1,t=!1)=>{D(()=>{const v=b.value.map(o=>o.value);p("update:modelValue",v),p("change",v)}),e&&E(t)},G=e=>`${$(e)?"Remove":"Add"} ${e.label}`,W=()=>{var e;w.value=[...S.value],s.filter&&((e=r.value)==null||e.focus())},P=()=>{c.value="",p("closed")};return s.filter&&(_.value=new ae(s.options,{includeScore:!0,threshold:.4,keys:["label"]})),(e,t)=>{const v=Y;return n(),i("div",Me,[a("fieldset",Ve,[h(re,{ref_key:"refDropdownContainer",ref:L,label:s.label,"selection-labels":l(K),"tooltip-text":s.tooltipText,disabled:s.disabled,"display-selection-count":s.options.length!==2,"content-classes":"dropdownMultiSelect__content","is-dirty":s.isDirty,"data-gtm":s.dataGtm,onOpened:t[5]||(t[5]=o=>W()),onClosed:t[6]||(t[6]=o=>P())},{default:A(()=>[s.addReset?(n(),i("button",{key:0,class:R(["button is-x-small dropdownMultiSelect__resetButton",{"dropdownMultiSelect__resetButton--selected":l(I)===0}]),type:"button","aria-label":"Reset Filter",onClick:t[0]||(t[0]=o=>F(!0)),onKeydown:t[1]||(t[1]=T(x(o=>F(!0,!0),["self"]),["enter","space"]))},[h(l(Be),{style:{position:"relative",top:"-1px"}}),a("span",Ie,g(s.resetLabel),1)],34)):H("",!0),s.filter?(n(),z(ne,{key:1,ref_key:"refFilterInput",ref:r,modelValue:l(c),"onUpdate:modelValue":t[2]||(t[2]=o=>Q(c)?c.value=o:null),class:"my-2",placeholder:"Search","button-classes":"rankingInput__button","show-clear-button":""},null,8,["modelValue"])):H("",!0),s.filter&&s.selectAll?(n(),z(v,{key:2,class:"my-2",size:"small",variant:"secondary",label:"Select All","is-fullwidth":"",onClick:t[3]||(t[3]=x(o=>U(!0),["self"])),onKeydown:t[4]||(t[4]=T(x(o=>U(!0,!0),["self"]),["enter","space"]))})):H("",!0),a("ul",Oe,[(n(!0),i(V,null,q(l(b),o=>(n(),i("li",{key:o.value,class:R(["dropdownMultiSelect__option",{"dropdownMultiSelect__option--selected":$(o),"dropdownMultiSelect__option--notDeselectable":!u(o)}]),role:"option","aria-selected":$(o),onClick:x(N=>C(o),["self"]),onKeydown:T(x(N=>C(o),["self"]),["enter","space"])},[B(g(o.label)+" ",1),a("button",{class:"dropdownMultiSelect__iconWrapper button has-no-border has-no-background m-0 p-0 is-x-small mr-4",type:"button","aria-label":G(o),onClick:x(N=>O(o),["stop"]),onKeydown:T(x(N=>O(o),["stop","prevent"]),["enter","space"])},[$(o)?(n(),z(l(he),{key:0,class:"dropdownMultiSelect__iconCheck",width:"20",height:"20",viewBox:"0 0 16 16"})):(n(),z(l(ke),{key:1,class:"dropdownMultiSelect__iconSquare",width:"20",height:"20",viewBox:"0 0 16 16"}))],40,Re)],42,De))),128))])]),_:1},8,["label","selection-labels","tooltip-text","disabled","display-selection-count","is-dirty","data-gtm"])])])}}}),Le={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},Te=a("path",{fill:"currentColor","fill-rule":"evenodd",d:"M6.585 4H2.5a.5.5 0 0 0 0 1h4.085a1.5 1.5 0 0 0 2.83 0H13.5a.5.5 0 0 0 0-1H9.415a1.5 1.5 0 0 0-2.83 0m.915.5a.5.5 0 1 1 1 0 .5.5 0 0 1-1 0M9.085 7.5H2.5a.5.5 0 0 0 0 1h6.585a1.5 1.5 0 0 0 2.83 0H13.5a.5.5 0 0 0 0-1h-1.585a1.5 1.5 0 0 0-2.83 0M10 8a.5.5 0 1 1 1 0 .5.5 0 0 1-1 0M5.085 11H2.5a.5.5 0 0 0 0 1h2.585a1.5 1.5 0 0 0 2.83 0H13.5a.5.5 0 0 0 0-1H7.915a1.5 1.5 0 0 0-2.83 0m.915.5a.5.5 0 1 1 1 0 .5.5 0 0 1-1 0","clip-rule":"evenodd"},null,-1),ze=[Te];function Ae(d,k){return n(),i("svg",Le,[...ze])}const _t={render:Ae},He={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Ke=a("path",{fill:"currentColor",d:"M11.146 4.146a.5.5 0 0 1 .708.708L8.707 8l3.147 3.146a.5.5 0 0 1-.708.708L8 8.707l-3.146 3.147a.5.5 0 0 1-.708-.708L7.293 8 4.146 4.854a.5.5 0 1 1 .708-.708L8 7.293z"},null,-1),Fe=[Ke];function Ee(d,k){return n(),i("svg",He,[...Fe])}const Ne={render:Ee},Ue=d=>(le("data-v-64cbe8ac"),d=d(),se(),d),Ye={class:"container is-max-widescreen"},je={class:"columns"},qe={class:"column"},Ge={class:"has-text-weight-bold mr-6"},We={class:"mt-1"},Pe={class:"is-translateY--1"},Qe=["onClick"],Je={class:"column is-narrow is-flex is-align-items-flex-end is-justify-content-end",style:{gap:"0.5rem"}},Xe={class:"is-translateY--1"},Ze=Ue(()=>a("p",{class:"has-text-centered"},[a("b",null,"Comparison maximum reached")],-1)),et={class:"mt-5"},tt={class:"has-text-centered mt-5"},lt=j({__name:"ComparisonBar",props:{entities:{}},setup(d){const k=J(),p=X(),s=Z(),_=d,c=M(!1),w=M(),r=y(()=>{switch(_.entities){default:case"stores":return k;case"marketplaces":return s;case"companies":return p}}),L=y(()=>r.value.selectedSlugs.value.length>=1&&r.value.selectedSlugs.value.length<=4),S=y(()=>r.value.selectedSlugs.value.length<2||r.value.selectedSlugs.value.length>4);function I(m){r.value.toggleSelection(m,!1)}function K(){r.value.resetSelection()}return ee(()=>r.value.selectedSlugs,(m,b)=>{var f;c.value=!1,m.value.length===5&&b.value.length===4&&((f=w.value)==null||f.openModal())}),(m,b)=>{var $;const f=Y;return n(),i(V,null,[a("div",{class:R(["comparisonBar py-4 px-3-tablet px-3-mobile",{"comparisonBar--hidden":!(($=l(w))!=null&&$.isOpen)&&(l(c)||!l(L))}])},[a("div",Ye,[a("div",je,[a("div",qe,[a("span",Ge,g(("capitalize"in m?m.capitalize:l(ce))(_.entities))+" selected",1),a("b",null,g(l(r).selectedSlugs.value.length>99?"∞":l(r).selectedSlugs.value.length),1),B(" / 4 "),a("div",We,[(n(!0),i(V,null,q(Object.values(l(r).selectedItems.value).slice(0,4),u=>{var C,O;return n(),i("div",{key:((C=u.name.store)==null?void 0:C.slug)??((O=u.name.marketplace)==null?void 0:O.slug)??u.name.company.slug,class:"my-1 mr-2 tag is-rounded has-background-bluegray-200"},[a("span",Pe,[_.entities==="stores"?(n(),i(V,{key:0},[B(g(u.name.store.slug),1)],64)):_.entities==="companies"?(n(),i(V,{key:1},[B(g(u.name.company.name),1)],64)):_.entities==="marketplaces"?(n(),i(V,{key:2},[B(g(u.name.marketplace.name),1)],64)):H("",!0)]),a("button",{class:"button has-no-border p-0 has-no-background ml-1",type:"button",onClick:F=>I(u)},[h(l(Ne))],8,Qe)])}),128))])]),a("div",Je,[h(f,{to:l(S)?void 0:("ROUTES"in m?m.ROUTES:l(te)).COMPARE({entities:_.entities},{s:l(r).selectedSlugs.value}),disabled:l(S),variant:"tertiary",target:"_blank","data-gtm":"companyRanking__filter--compare-selected"},{default:A(()=>[h(l(ue),{class:"mr-2 is-translateY-1"}),a("span",Xe,[B(" Compare selected ("),a("b",null,g(l(r).selectedSlugs.value.length>99?"∞":l(r).selectedSlugs.value.length),1),B("/4) ")])]),_:1},8,["to","disabled"]),h(f,{label:"Deselect all",variant:"secondary",onClick:K}),h(f,{variant:"secondary",class:R(["comparisonBar__collapseButton",{"comparisonBar__collapseButton--collapsed":l(c)}]),onClick:b[0]||(b[0]=u=>c.value=!l(c))},{default:A(()=>[h(l(de),{width:"20",height:"20",class:R(["comparisonBar__collapseButton__icon",{"comparisonBar__collapseButton__icon--rotated":l(c)}])},null,8,["class"])]),_:1},8,["class"])])])])],2),h(pe,{ref_key:"refModal",ref:w,"modal-name":"comparisonBarModal","no-close-button":"",classes:{modal:"modal__content--narrow"}},{default:A(()=>[Ze,a("p",et,"You can compare a maximum of 4 "+g(_.entities)+" at a time. Deselect some "+g(_.entities)+" to proceed with the comparison.",1),a("div",tt,[h(f,{label:"OK",variant:"tertiary",onClick:b[1]||(b[1]=u=>{var C;return(C=l(w))==null?void 0:C.closeModal()})})])]),_:1},512)],64)}}}),mt=oe(lt,[["__scopeId","data-v-64cbe8ac"]]);export{_t as I,pt as _,mt as a};