"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[38],{74:(e,n,a)=>{a.d(n,{a:()=>c,b:()=>u,c:()=>d,d:()=>l,e:()=>i,f:()=>r,g:()=>s,h:()=>o});var t=a(75);function i(e){return new Set(e.flatMap((({key:e,values:n})=>n.filter((e=>e.selected)).map((n=>`${e}:${n.value}`)))))}function l(e,n){e.forEach((e=>{n.searchParams.delete(e.key),e.queryKeys.forEach((e=>{n.searchParams.delete(e)}))})),n.searchParams.has("page")&&n.searchParams.delete("page")}function u(e,n,a){e.forEach((e=>{const[t,i]=e.split(":"),l=n.get(t);l&&l.queryKeys.length>0&&a.searchParams.append(l.queryKeys[0],i)}))}function o(e){var n,a;if(e.include&&e.include.length>0)return e.include.map((n=>e.values.find((e=>e.value===n)))).filter((e=>Boolean(e)));let i=e.values;return e.exclude&&e.exclude.length>0&&(i=i.filter((n=>!e.exclude.includes(n.value)))),i=e.key.startsWith("product_option/")||e.baseOption?"Cup Size"===(null!==(a=null===(n=e.baseOption)||void 0===n?void 0:n.label)&&void 0!==a?a:e.key.slice(15))?(0,t.d)(i,(e=>e.value)):(0,t.e)(i,(e=>e.value)):[...i].sort(((e,n)=>e.value.localeCompare(n.value,void 0,{sensitivity:"base"}))),i}function r(e){return e.include&&e.include.length>0?e.values.some((n=>e.include.includes(n.value))):e.values.length>0}function s(e,n){return o(e).some((a=>n.has(`${e.key}:${a.value}`)))}function c(e,n){if("undefined"==typeof window||void 0===n)return;const a=new URL(window.location.href);l(n,a),u(e,new Map(n.map((e=>[e.key,e]))),a),window.location.href=a.toString()}function d(e){if("undefined"==typeof window||void 0===e)return;const n=new URL(window.location.href);l(e,n),window.location.href=n.toString()}}}]);