"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[41],{86:(e,n,a)=>{a.d(n,{a:()=>s,b:()=>l,c:()=>d,d:()=>i,e:()=>u,f:()=>r,g:()=>c,h:()=>o});var t=a(87);function u(e){return new Set(e.flatMap((({key:e,values:n})=>n.filter((e=>e.selected)).map((n=>`${e}:${n.value}`)))))}function i(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 l(e,n,a){e.forEach((e=>{const[t,u]=e.split(":"),i=n.get(t);i&&i.queryKeys.length>0&&a.searchParams.append(i.queryKeys[0],u)}))}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 u=e.values;return e.exclude&&e.exclude.length>0&&(u=u.filter((n=>!e.exclude.includes(n.value)))),(e.key.startsWith("product_option/")||e.baseOption)&&(u="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)(u,(e=>e.value)):(0,t.e)(u,(e=>e.value))),u}function r(e){return e.include&&e.include.length>0?e.values.some((n=>e.include.includes(n.value))):e.values.length>0}function c(e,n){return o(e).some((a=>n.has(`${e.key}:${a.value}`)))}function s(e,n){if("undefined"==typeof window||void 0===n)return;const a=new URL(window.location.href);i(n,a),l(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);i(e,n),window.location.href=n.toString()}}}]);