if (!Object.hasOwn) { Object.defineProperty(Object, 'hasOwn', { value: function (obj, prop) { if (obj == null) { throw new TypeError('Cannot convert undefined or null to object'); } return Object.prototype.hasOwnProperty.call(obj, prop); }, writable: true, configurable: true, enumerable: false }); } var StyliticsComposer=function(){"use strict";function z(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function W(t){return function e(r){return arguments.length===0||z(r)?e:t.apply(this,arguments)}}function M(t){return function e(r,s){switch(arguments.length){case 0:return e;case 1:return z(r)?e:W(function(i){return t(r,i)});default:return z(r)&&z(s)?e:z(r)?W(function(i){return t(i,s)}):z(s)?W(function(i){return t(r,i)}):t(r,s)}}}function $s(t,e){t=t||[],e=e||[];var r,s=t.length,i=e.length,a=[];for(r=0;r=arguments.length)?l=e[o]:(l=arguments[i],i+=1),s[o]=l,z(l)?c=!0:a-=1,o+=1}return!c&&a<=0?r.apply(this,s):mt(Math.max(0,a),dr(t,s,r))}}var ce=M(function(e,r){return e===1?W(r):mt(e,dr(e,[],r))});function be(t){return function e(r,s,i){switch(arguments.length){case 0:return e;case 1:return z(r)?e:M(function(a,o){return t(r,a,o)});case 2:return z(r)&&z(s)?e:z(r)?M(function(a,o){return t(a,s,o)}):z(s)?M(function(a,o){return t(r,a,o)}):W(function(a){return t(r,s,a)});default:return z(r)&&z(s)&&z(i)?e:z(r)&&z(s)?M(function(a,o){return t(a,o,i)}):z(r)&&z(i)?M(function(a,o){return t(a,s,o)}):z(s)&&z(i)?M(function(a,o){return t(r,a,o)}):z(r)?W(function(a){return t(a,s,i)}):z(s)?W(function(a){return t(r,a,i)}):z(i)?W(function(a){return t(r,s,a)}):t(r,s,i)}}}const Rt=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function Xa(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function Ke(t,e,r){return function(){if(arguments.length===0)return r();var s=arguments[arguments.length-1];if(!Rt(s)){for(var i=0;i=0;)r=Ws[s],Ae(r,e)&&!no(i,r)&&(i[i.length]=r),s-=1;return i}),Me=W(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function Gs(t,e,r,s){var i=qs(t),a=qs(e);function o(c,l){return fr(c,l,r.slice(),s.slice())}return!Bs(function(c,l){return!Bs(o,l,c)},a,i)}function fr(t,e,r,s){if(ft(t,e))return!0;var i=Me(t);if(i!==Me(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&to(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&ft(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!ft(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var a=r.length-1;a>=0;){if(r[a]===t)return s[a]===e;a-=1}switch(i){case"Map":return t.size!==e.size?!1:Gs(t.entries(),e.entries(),r.concat([t]),s.concat([e]));case"Set":return t.size!==e.size?!1:Gs(t.values(),e.values(),r.concat([t]),s.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var o=st(t);if(o.length!==st(e).length)return!1;var c=r.concat([t]),l=s.concat([e]);for(a=o.length-1;a>=0;){var m=o[a];if(!(Ae(m,e)&&fr(e[m],t[m],c,l)))return!1;a-=1}return!0}var qe=M(function(e,r){return fr(e,r,[],[])});function io(t,e,r){var s,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(s=1/e;r=0}function Mt(t,e){for(var r=0,s=e.length,i=Array(s);r":Vs(o,c)},s=function(a,o){return Mt(function(c){return pr(c)+": "+r(a[c])},o.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+Mt(r,t).join(", ")+"))";case"[object Array]":return"["+Mt(r,t).concat(s(t,po(function(a){return/^\d+$/.test(a)},st(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):pr(ao(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":pr(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+s(t,st(t)).join(", ")+"}"}}var Ks=W(function(e){return Vs(e,[])}),Qs=M(function(e,r){if(e===r)return r;function s(l,m){if(l>m!=m>l)return m>l?m:l}var i=s(e,r);if(i!==void 0)return i;var a=s(typeof e,typeof r);if(a!==void 0)return a===typeof e?e:r;var o=Ks(e),c=s(o,Ks(r));return c!==void 0&&c===o?e:r}),go=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Pe.init,t.prototype["@@transducer/result"]=Pe.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),yo=function(e){return function(r){return new go(e,r)}},gr=M(Ke(["fantasy-land/map","map"],yo,function(e,r){switch(Object.prototype.toString.call(r)){case"[object Function]":return ce(r.length,function(){return e.call(this,r.apply(this,arguments))});case"[object Object]":return jt(function(s,i){return s[i]=e(r[i]),s},{},st(r));default:return Mt(e,r)}}));const Js=Number.isInteger||function(e){return e<<0===e};function Xs(t,e){var r=t<0?e.length+t:t;return e[r]}function vo(t,e){if(e!=null)return Js(t)?Xs(t,e):e[t]}var Le=M(vo),Ut=M(function(e,r){return gr(Le(e),r)});function Zs(t){return Object.prototype.toString.call(t)==="[object String]"}var bo=W(function(e){return Rt(e)?!0:!e||typeof e!="object"||Zs(e)?!1:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),Ys=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function en(t,e,r){return function(i,a,o){if(bo(o))return t(i,a,o);if(o==null)return a;if(typeof o["fantasy-land/reduce"]=="function")return e(i,a,o,"fantasy-land/reduce");if(o[Ys]!=null)return r(i,a,o[Ys]());if(typeof o.next=="function")return r(i,a,o);if(typeof o.reduce=="function")return e(i,a,o,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function So(t,e,r){for(var s=0,i=r.length;sr)throw new Error("min must not be greater than max in clamp(min, max, value)");return sr?r:s});function Mo(t){return new RegExp(t.source,t.flags?t.flags:(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":"")+(t.dotAll?"s":""))}function $t(t,e,r){if(r||(r=new Fo),jo(t))return t;var s=function(a){var o=r.get(t);if(o)return o;r.set(t,a);for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&(a[c]=e?$t(t[c],!0,r):t[c]);return a};switch(Me(t)){case"Object":return s(Object.create(Object.getPrototypeOf(t)));case"Array":return s(Array(t.length));case"Date":return new Date(t.valueOf());case"RegExp":return Mo(t);case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return t.slice();default:return t}}function jo(t){var e=typeof t;return t==null||e!="object"&&e!="function"}var Fo=function(){function t(){this.map={},this.length=0}return t.prototype.set=function(e,r){var s=this.hash(e),i=this.map[s];i||(this.map[s]=i=[]),i.push([e,r]),this.length+=1},t.prototype.hash=function(e){var r=[];for(var s in e)r.push(Object.prototype.toString.call(e[s]));return r.join()},t.prototype.get=function(e){if(this.length<=180){for(var r in this.map)for(var o=this.map[r],s=0;sa?-1:ir}),fn=M(function(e,r){return e>=r}),Be=function(t,e){switch(arguments.length){case 0:return Be;case 1:return function(){return function r(s){switch(arguments.length){case 0:return r;default:return ft(t,s)}}}();default:return ft(t,e)}},pn=be(function(e,r,s){return ce(Math.max(e.length,r.length,s.length),function(){return e.apply(this,arguments)?r.apply(this,arguments):s.apply(this,arguments)})}),ec=M(Dt),yt=cn(function(t,e){return e},null),tc=function(){function t(e,r){this.xf=r,this.f=e,this.set=new hn}return t.prototype["@@transducer/init"]=Pe.init,t.prototype["@@transducer/result"]=Pe.result,t.prototype["@@transducer/step"]=function(e,r){return this.set.add(this.f(r))?this.xf["@@transducer/step"](e,r):e},t}();function rc(t){return function(e){return new tc(t,e)}}var sc=M(Ke([],rc,function(t,e){for(var r=new hn,s=[],i=0,a,o;ie.toLowerCase():e=>e.toLocaleLowerCase(t)}function Tc(t,e={}){const r=e.split??(e.separateNumbers?Pc:_n),s=e.prefixCharacters??wn,i=e.suffixCharacters??wn;let a=0,o=t.length;for(;aa;){const c=o-1,l=t.charAt(c);if(!i.includes(l))break;o=c}return[t.slice(0,a),r(t.slice(a,o)),t.slice(o)]}const Ec=/(\S+)|(.)/g,Cc=/[\.#][\p{L}\p{N}]/u,xc=new RegExp("\\p{Ll}(?=[\\p{Lu}])","u"),Oc=/[\p{L}\p{N}]+/gu,Rc=new RegExp("^([^\\p{L}])*(?:\\p{L}\\.){2,}([^\\p{L}])*$","u"),Dc=new Set(["—","–","-","―","/"]),In=new Set([".","!","?"]),Mc=new Set([...In,":",'"',"'","”"]),jc=new Set(["a","an","and","as","at","because","but","by","en","for","if","in","neither","nor","of","on","only","or","over","per","so","some","than","that","the","to","up","upon","v","versus","via","vs","when","with","without","yet"]);function tf(t,e={}){const{locale:r=void 0,sentenceCase:s=!1,sentenceTerminators:i=In,titleTerminators:a=Mc,smallWords:o=jc,wordSeparators:c=Dc}=typeof e=="string"||Array.isArray(e)?{locale:e}:e,l=s?i:a;let m="",f=!0;for(const g of t.matchAll(Ec)){const{1:b,2:w,index:_=0}=g;if(w){m+=w;continue}if(Cc.test(b)){const k=b.match(Rc);if(k){const[T,x="",ee=""]=k;m+=s&&!f?b:kn(b,x.length,r),f=l.has(ee.charAt(0));continue}m+=b,f=l.has(b.charAt(b.length-1))}else{const k=Array.from(b.matchAll(Oc));let T=b,x=!1;for(let ee=0;ee0&&(!c.has(b.charAt(Ue-1))||o.has(ke)&&c.has($e)))continue}T=kn(T,Ue,r)}m+=T,f=x||l.has(b.charAt(b.length-1))}}return m}function kn(t,e,r){return t.slice(0,e)+t.charAt(e).toLocaleUpperCase(r)+t.slice(e+1)}const oe=[];for(let t=0;t<256;++t)oe.push((t+256).toString(16).slice(1));function Fc(t,e=0){return(oe[t[e+0]]+oe[t[e+1]]+oe[t[e+2]]+oe[t[e+3]]+"-"+oe[t[e+4]]+oe[t[e+5]]+"-"+oe[t[e+6]]+oe[t[e+7]]+"-"+oe[t[e+8]]+oe[t[e+9]]+"-"+oe[t[e+10]]+oe[t[e+11]]+oe[t[e+12]]+oe[t[e+13]]+oe[t[e+14]]+oe[t[e+15]]).toLowerCase()}let Ir;const Uc=new Uint8Array(16);function Lc(){if(!Ir){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ir=crypto.getRandomValues.bind(crypto)}return Ir(Uc)}const Pn={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function nt(t,e,r){if(Pn.randomUUID&&!t)return Pn.randomUUID();t=t||{};const s=t.random??t.rng?.()??Lc();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Fc(s)}var qt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Bt=typeof window>"u"||"Deno"in globalThis;function Ce(){}function $c(t,e){return typeof t=="function"?t(e):t}function qc(t){return typeof t=="number"&&t>=0&&t!==1/0}function Bc(t,e){return Math.max(t+(e||0)-Date.now(),0)}function kr(t,e){return typeof t=="function"?t(e):t}function Hc(t,e){return typeof t=="function"?t(e):t}function An(t,e){const{type:r="all",exact:s,fetchStatus:i,predicate:a,queryKey:o,stale:c}=t;if(o){if(s){if(e.queryHash!==Pr(o,e.options))return!1}else if(!St(e.queryKey,o))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||i&&i!==e.state.fetchStatus||a&&!a(e))}function Tn(t,e){const{exact:r,status:s,predicate:i,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(r){if(bt(e.options.mutationKey)!==bt(a))return!1}else if(!St(e.options.mutationKey,a))return!1}return!(s&&e.state.status!==s||i&&!i(e))}function Pr(t,e){return(e?.queryKeyHashFn||bt)(t)}function bt(t){return JSON.stringify(t,(e,r)=>Ar(r)?Object.keys(r).sort().reduce((s,i)=>(s[i]=r[i],s),{}):r)}function St(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>St(t[r],e[r])):!1}function En(t,e){if(t===e)return t;const r=Cn(t)&&Cn(e);if(r||Ar(t)&&Ar(e)){const s=r?t:Object.keys(t),i=s.length,a=r?e:Object.keys(e),o=a.length,c=r?[]:{},l=new Set(s);let m=0;for(let f=0;f{setTimeout(e,t)})}function Wc(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?En(t,e):e}function zc(t,e,r=0){const s=[...t,e];return r&&s.length>r?s.slice(1):s}function Gc(t,e,r=0){const s=[e,...t];return r&&s.length>r?s.slice(0,-1):s}var Tr=Symbol();function On(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Tr?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Vc=class extends qt{#e;#t;#r;constructor(){super(),this.#r=t=>{if(!Bt&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Rn=new Vc,Kc=class extends qt{#e=!0;#t;#r;constructor(){super(),this.#r=t=>{if(!Bt&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#e}},Ht=new Kc;function Qc(){let t,e;const r=new Promise((i,a)=>{t=i,e=a});r.status="pending",r.catch(()=>{});function s(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{s({status:"fulfilled",value:i}),t(i)},r.reject=i=>{s({status:"rejected",reason:i}),e(i)},r}function Jc(t){return Math.min(1e3*2**t,3e4)}function Dn(t){return(t??"online")==="online"?Ht.isOnline():!0}var Mn=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Er(t){return t instanceof Mn}function jn(t){let e=!1,r=0,s=!1,i;const a=Qc(),o=k=>{s||(b(new Mn(k)),t.abort?.())},c=()=>{e=!0},l=()=>{e=!1},m=()=>Rn.isFocused()&&(t.networkMode==="always"||Ht.isOnline())&&t.canRun(),f=()=>Dn(t.networkMode)&&t.canRun(),g=k=>{s||(s=!0,t.onSuccess?.(k),i?.(),a.resolve(k))},b=k=>{s||(s=!0,t.onError?.(k),i?.(),a.reject(k))},w=()=>new Promise(k=>{i=T=>{(s||m())&&k(T)},t.onPause?.()}).then(()=>{i=void 0,s||t.onContinue?.()}),_=()=>{if(s)return;let k;const T=r===0?t.initialPromise:void 0;try{k=T??t.fn()}catch(x){k=Promise.reject(x)}Promise.resolve(k).then(g).catch(x=>{if(s)return;const ee=t.retry??(Bt?0:3),ke=t.retryDelay??Jc,Ue=typeof ke=="function"?ke(r,x):ke,$e=ee===!0||typeof ee=="number"&&rm()?void 0:w()).then(()=>{e?b(x):_()})})};return{promise:a,cancel:o,continue:()=>(i?.(),a),cancelRetry:c,continueRetry:l,canStart:f,start:()=>(f()?_():w().then(_),a)}}var Xc=t=>setTimeout(t,0);function Zc(){let t=[],e=0,r=c=>{c()},s=c=>{c()},i=Xc;const a=c=>{e?t.push(c):i(()=>{r(c)})},o=()=>{const c=t;t=[],c.length&&i(()=>{s(()=>{c.forEach(l=>{r(l)})})})};return{batch:c=>{let l;e++;try{l=c()}finally{e--,e||o()}return l},batchCalls:c=>(...l)=>{a(()=>{c(...l)})},schedule:a,setNotifyFunction:c=>{r=c},setBatchNotifyFunction:c=>{s=c},setScheduler:c=>{i=c}}}var de=Zc(),Fn=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qc(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Bt?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Yc=class extends Fn{#e;#t;#r;#i;#s;#n;#o;constructor(t){super(),this.#o=!1,this.#n=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#i=t.client,this.#r=this.#i.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=tu(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(t){this.options={...this.#n,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(t,e){const r=Wc(this.state.data,t,this.options);return this.#a({data:r,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),r}setState(t,e){this.#a({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#s?.promise;return this.#s?.cancel(t),e?e.then(Ce).catch(Ce):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>Hc(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>kr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Bc(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#s&&(this.#o?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}fetch(t,e){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(t&&this.setOptions(t),!this.options.queryFn){const l=this.observers.find(m=>m.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,s=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},i=()=>{const l=On(this.options,e),f=(()=>{const g={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#o=!1,this.options.persister?this.options.persister(l,f,this):l(f)},o=(()=>{const l={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return s(l),l})();this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#a({type:"fetch",meta:o.fetchOptions?.meta});const c=l=>{Er(l)&&l.silent||this.#a({type:"error",error:l}),Er(l)||(this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this)),this.scheduleGc()};return this.#s=jn({initialPromise:e?.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:l=>{if(l===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(l)}catch(m){c(m);return}this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),this.scheduleGc()},onError:c,onFail:(l,m)=>{this.#a({type:"failed",failureCount:l,error:m})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#s.start()}#a(t){const e=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...eu(r.data,this.options),fetchMeta:t.meta??null};case"success":return this.#t=void 0,{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Er(s)&&s.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=e(this.state),de.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:t})})}};function eu(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Dn(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function tu(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,s=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ru=class extends qt{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,r){const s=e.queryKey,i=e.queryHash??Pr(s,e);let a=this.get(i);return a||(a=new Yc({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){de.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(r=>An(e,r))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(r=>An(t,r)):e}notify(t){de.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){de.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){de.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},su=class extends Fn{#e;#t;#r;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||nu(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})};this.#r=jn({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(i,a)=>{this.#i({type:"failed",failureCount:i,error:a})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",s=!this.#r.canStart();try{if(r)e();else{this.#i({type:"pending",variables:t,isPaused:s}),await this.#t.config.onMutate?.(t,this);const a=await this.options.onMutate?.(t);a!==this.state.context&&this.#i({type:"pending",context:a,variables:t,isPaused:s})}const i=await this.#r.start();return await this.#t.config.onSuccess?.(i,t,this.state.context,this),await this.options.onSuccess?.(i,t,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,t,this.state.context),this.#i({type:"success",data:i}),i}catch(i){try{throw await this.#t.config.onError?.(i,t,this.state.context,this),await this.options.onError?.(i,t,this.state.context),await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,t,this.state.context),i}finally{this.#i({type:"error",error:i})}}finally{this.#t.runNext(this)}}#i(t){const e=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),de.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function nu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var iu=class extends qt{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(t,e,r){const s=new su({mutationCache:this,mutationId:++this.#r,options:t.defaultMutationOptions(e),state:r});return this.add(s),s}add(t){this.#e.add(t);const e=Nt(t);if(typeof e=="string"){const r=this.#t.get(e);r?r.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=Nt(t);if(typeof e=="string"){const r=this.#t.get(e);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Nt(t);if(typeof e=="string"){const s=this.#t.get(e)?.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){const e=Nt(t);return typeof e=="string"?this.#t.get(e)?.find(s=>s!==t&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){de.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(r=>Tn(e,r))}findAll(t={}){return this.getAll().filter(e=>Tn(t,e))}notify(t){de.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return de.batch(()=>Promise.all(t.map(e=>e.continue().catch(Ce))))}};function Nt(t){return t.options.scope?.id}function Un(t){return{onFetch:(e,r)=>{const s=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let c={pages:[],pageParams:[]},l=0;const m=async()=>{let f=!1;const g=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},b=On(e.options,e.fetchOptions),w=async(_,k,T)=>{if(f)return Promise.reject();if(k==null&&_.pages.length)return Promise.resolve(_);const ee=(()=>{const Ls={client:e.client,queryKey:e.queryKey,pageParam:k,direction:T?"backward":"forward",meta:e.options.meta};return g(Ls),Ls})(),ke=await b(ee),{maxPages:Ue}=e.options,$e=T?Gc:zc;return{pages:$e(_.pages,ke,Ue),pageParams:$e(_.pageParams,k,Ue)}};if(i&&a.length){const _=i==="backward",k=_?au:Ln,T={pages:a,pageParams:o},x=k(s,T);c=await w(T,x,_)}else{const _=t??a.length;do{const k=l===0?o[0]??s.initialPageParam:Ln(s,c);if(l>0&&k==null)break;c=await w(c,k),l++}while(l<_)}return c};e.options.persister?e.fetchFn=()=>e.options.persister?.(m,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=m}}}function Ln(t,{pages:e,pageParams:r}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,r[s],r):void 0}function au(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}var ou=class{#e;#t;#r;#i;#s;#n;#o;#a;constructor(t={}){this.#e=t.queryCache||new ru,this.#t=t.mutationCache||new iu,this.#r=t.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#o=Rn.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Ht.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=this.#e.build(this,e),s=r.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(kr(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:r})=>{const s=r.data;return[e,s]})}setQueryData(t,e,r){const s=this.defaultQueryOptions({queryKey:t}),a=this.#e.get(s.queryHash)?.state.data,o=$c(e,a);if(o!==void 0)return this.#e.build(this,s).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return de.batch(()=>this.#e.findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,r)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;de.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=this.#e;return de.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},s=de.batch(()=>this.#e.findAll(t).map(i=>i.cancel(r)));return Promise.all(s).then(Ce).catch(Ce)}invalidateQueries(t,e={}){return de.batch(()=>(this.#e.findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},s=de.batch(()=>this.#e.findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Ce)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Ce)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=this.#e.build(this,e);return r.isStaleByTime(kr(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ce).catch(Ce)}fetchInfiniteQuery(t){return t.behavior=Un(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ce).catch(Ce)}ensureInfiniteQueryData(t){return t.behavior=Un(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ht.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(t){this.#r=t}setQueryDefaults(t,e){this.#i.set(bt(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],r={};return e.forEach(s=>{St(t,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(t,e){this.#s.set(bt(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#s.values()],r={};return e.forEach(s=>{St(t,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#r.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Pr(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Tr&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#r.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Cr;function xr(t){return{lang:t?.lang??Cr?.lang,message:t?.message,abortEarly:t?.abortEarly??Cr?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Cr?.abortPipeEarly}}var cu;function uu(t){return cu?.get(t)}var lu;function hu(t){return lu?.get(t)}var du;function mu(t,e){return du?.get(t)?.get(e)}function Je(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function U(t,e,r,s,i){const a=i&&"input"in i?i.input:r.value,o=i?.expected??t.expects??null,c=i?.received??Je(a),l={kind:t.kind,type:t.type,input:a,expected:o,received:c,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${c}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},m=t.kind==="schema",f=i?.message??t.message??mu(t.reference,l.lang)??(m?hu(l.lang):null)??s.message??uu(l.lang);f!==void 0&&(l.message=typeof f=="function"?f(l):f),m&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function H(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},xr())}}}function $n(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Wt(t,e){const r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}function fu(t){if(t.path){let e="";for(const r of t.path)if(typeof r.key=="string"||typeof r.key=="number")e?e+=`.${r.key}`:e+=r.key;else return null;return e}return null}var pu=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}},gu=/^\d+$/u,yu=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u,vu=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;function zt(t,e){return{kind:"validation",type:"check",reference:zt,async:!1,expects:null,requirement:t,message:e,"~run"(r,s){return r.typed&&!this.requirement(r.value)&&U(this,"input",r,s),r}}}function qn(t){return{kind:"validation",type:"digits",reference:qn,async:!1,expects:null,requirement:gu,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&U(this,"digits",e,r),e}}}function Ne(t){return{kind:"transformation",type:"filter_items",reference:Ne,async:!1,operation:t,"~run"(e){return e.value=e.value.filter(this.operation),e}}}var bu={md4:32,md5:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8,adler32:8};function Bn(t,e){return{kind:"validation",type:"hash",reference:Bn,expects:null,async:!1,requirement:RegExp(t.map(r=>`^[a-f0-9]{${bu[r]}}$`).join("|"),"iu"),message:e,"~run"(r,s){return r.typed&&!this.requirement.test(r.value)&&U(this,"hash",r,s),r}}}function Hn(t){return{kind:"validation",type:"hex_color",reference:Hn,async:!1,expects:null,requirement:yu,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&U(this,"hex color",e,r),e}}}function Nn(t,e){const r=Je(t);return{kind:"validation",type:"includes",reference:Nn,async:!1,expects:r,requirement:t,message:e,"~run"(s,i){return s.typed&&!s.value.includes(this.requirement)&&U(this,"content",s,i,{received:`!${r}`}),s}}}function pe(t){return{kind:"transformation",type:"map_items",reference:pe,async:!1,operation:t,"~run"(e){return e.value=e.value.map(this.operation),e}}}function Wn(t,e){return{kind:"validation",type:"min_length",reference:Wn,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,s){return r.typed&&r.value.length=${t instanceof Date?t.toJSON():Je(t)}`,requirement:t,message:e,"~run"(r,s){return r.typed&&!(r.value>=this.requirement)&&U(this,"value",r,s,{received:r.value instanceof Date?r.value.toJSON():Je(r.value)}),r}}}function Gt(t){return{kind:"validation",type:"non_empty",reference:Gt,async:!1,expects:"!0",message:t,"~run"(e,r){return e.typed&&e.value.length===0&&U(this,"length",e,r,{received:"0"}),e}}}function Su(t,e){if(t.issues)for(const r of e)for(const s of t.issues){let i=!1;const a=Math.min(r.length,s.path?.length??0);for(let o=0;or.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return H(this)},"~run"(r,s){let i,a,o;for(const c of this.options){const l=c["~run"]({value:r.value},s);if(l.typed)if(l.issues)a?a.push(l):a=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(a){if(a.length===1)return a[0];U(this,"type",r,s,{issues:Xn(a)}),r.typed=!0}else{if(o?.length===1)return o[0];U(this,"type",r,s,{issues:Xn(o)})}return r}}}function E(){return{kind:"schema",type:"unknown",reference:E,expects:"unknown",async:!1,get"~standard"(){return H(this)},"~run"(t){return t.typed=!0,t}}}function Zn(t,e,r){return{kind:"schema",type:"variant",reference:Zn,expects:"Object",async:!1,key:t,options:e,message:r,get"~standard"(){return H(this)},"~run"(s,i){const a=s.value;if(a&&typeof a=="object"){let o,c=0,l=this.key,m=[];const f=(g,b)=>{for(const w of g.options){if(w.type==="variant")f(w,new Set(b).add(w.key));else{let _=!0,k=0;for(const T of b){const x=w.entries[T];if(T in a?x["~run"]({typed:!1,value:a[T]},{abortEarly:!0}).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){_=!1,l!==T&&(c"u")){o=Xt({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var l in o)o[l]&&(c+="; "+l,o[l]!==!0&&(c+="="+o[l].split(";")[0]));return document.cookie=i+"="+t.write(a,i)+c}}function s(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],o={},c=0;c>>32-s},rotr:function(r,s){return r<<32-s|r>>>s},endian:function(r){if(r.constructor==Number)return e.rotl(r,8)&16711935|e.rotl(r,24)&4278255360;for(var s=0;s0;r--)s.push(Math.floor(Math.random()*256));return s},bytesToWords:function(r){for(var s=[],i=0,a=0;i>>5]|=r[i]<<24-a%32;return s},wordsToBytes:function(r){for(var s=[],i=0;i>>5]>>>24-i%32&255);return s},bytesToHex:function(r){for(var s=[],i=0;i>>4).toString(16)),s.push((r[i]&15).toString(16));return s.join("")},hexToBytes:function(r){for(var s=[],i=0;i>>6*(3-o)&63)):s.push("=");return s.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/ig,"");for(var s=[],i=0,a=0;i>>6-a*2);return s}};$r.exports=e}()),$r.exports}var qr,ii;function ai(){if(ii)return qr;ii=1;var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var r=[],s=0;s * @license MIT */var Br,oi;function qu(){if(oi)return Br;oi=1,Br=function(r){return r!=null&&(t(r)||e(r)||!!r._isBuffer)};function t(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function e(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))}return Br}var ci;function Bu(){return ci||(ci=1,function(){var t=$u(),e=ai().utf8,r=qu(),s=ai().bin,i=function(a,o){a.constructor==String?o&&o.encoding==="binary"?a=s.stringToBytes(a):a=e.stringToBytes(a):r(a)?a=Array.prototype.slice.call(a,0):!Array.isArray(a)&&a.constructor!==Uint8Array&&(a=a.toString());for(var c=t.bytesToWords(a),l=a.length*8,m=1732584193,f=-271733879,g=-1732584194,b=271733878,w=0;w>>24)&16711935|(c[w]<<24|c[w]>>>8)&4278255360;c[l>>>5]|=128<>>9<<4)+14]=l;for(var _=i._ff,k=i._gg,T=i._hh,x=i._ii,w=0;w>>0,f=f+ke>>>0,g=g+Ue>>>0,b=b+$e>>>0}return t.endian([m,f,g,b])};i._ff=function(a,o,c,l,m,f,g){var b=a+(o&c|~o&l)+(m>>>0)+g;return(b<>>32-f)+o},i._gg=function(a,o,c,l,m,f,g){var b=a+(o&l|c&~l)+(m>>>0)+g;return(b<>>32-f)+o},i._hh=function(a,o,c,l,m,f,g){var b=a+(o^c^l)+(m>>>0)+g;return(b<>>32-f)+o},i._ii=function(a,o,c,l,m,f,g){var b=a+(c^(o|~l))+(m>>>0)+g;return(b<>>32-f)+o},i._blocksize=16,i._digestsize=16,Lr.exports=function(a,o){if(a==null)throw new Error("Illegal argument "+a);var c=t.wordsToBytes(i(a,o));return o&&o.asBytes?c:o&&o.asString?s.bytesToString(c):t.bytesToHex(c)}}()),Lr.exports}var Hu=Bu();const Nu=Lu(Hu);var G=(t=>(t.production="production",t.staging="staging",t))(G||{}),Ze=(t=>(t.floor="floor",t.ceiling="ceiling",t.round="round",t))(Ze||{});const ui=O(["outfit-landing-page","outfits","trending-bundles"]);[...ui.options];var Z=(t=>(t.strikethrough="strikethrough",t.salesPriceOnly="sales-price-only",t))(Z||{});const Ye=O(["control","present","test"]),li="__stylitics",Wu="__unused-target",hi=O(["StyliticsAnchorItemsGalleryWidget","StyliticsBeautyWidget","StyliticsClassicWidget","StyliticsControlWidget","StyliticsComplementaryItemsWidget","StyliticsCrossSellWidget","StyliticsDimensionCollageWidget","StyliticsDynamicGalleriesWidget","StyliticsGalleryWidget","StyliticsGridWidget","StyliticsHotspotsWidget","StyliticsListWidget","StyliticsNikeWidget","StyliticsShopSimilarWidget","StyliticsShopTheOutfitWidget","StyliticsShopTheSetWidget","StyliticsSimilarStylesWidget","StyliticsStyledForYouWidget","StyliticsV3ClassicWidget","StyliticsV3HotspotsWidget","StyliticsVibeWidget"]),Zt=O(["top-left","top-right","bottom-left","bottom-right"]),zu=[[0,{}],[640,{}],[1023,{}],[1280,{}],[1536,{}]],Gu="https://widget-api.stylitics.com",Vu="https://widget-api-staging.stylitics.com";function Ku(t){return t===G.staging?Ju:Qu}const Qu="https://datastream.stylitics.com/api/engagements",Ju="https://datastream-staging.stylitics.com/api/engagements",Xu=new Set(["debug","error","info","log","warn"]),di="[Stylitics]: ",A=new Proxy(globalThis.console,{get(t,e,r){const s=Reflect.get(t,e,r);return typeof s=="function"&&Xu.has(e)?function(...i){return i.length>0&&typeof i[0]=="string"?i[0]=di+i[0]:i.unshift(di),s.apply(t,i)}:s}}),Zu=gt(gn);function it(t){return _r(JSON.parse,Lt(void 0))(t??"")}function Yu(t){return t instanceof Map?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):Object.fromEntries(Object.entries(t))}function el(t){return Object.entries(Yu(t)).reduce((e,[r,s])=>s===void 0?e:Object.assign(e,{[r]:typeof s=="object"&&!Array.isArray(s)?JSON.stringify(s):String(s)}),{})}function tl(t){return t instanceof URLSearchParams?t:typeof t=="string"||t==null?new URLSearchParams(t):new URLSearchParams(el(t))}function rl(t=[],e){if(t.length===0)return!1;const r=Math.ceil(t.length/2),s=Wo(br,t);return fn(Sr(0,e,s),r)}function ye(t){return t instanceof Error?t:Error(String(t))}function xe(t,e="log"){switch(e){case"debug":A.debug(t);break;case"error":A.error(t);break;case"log":A.log(t);break;case"warn":A.warn(t);break;default:A.log(t)}return t}class mi{static new(){return new this}constructor(){this.stack=[]}stack=[];clear=()=>{this.length=0};get length(){return this.stack.length}set length(e){this.stack.length=e}pop=()=>this.stack.pop();push=e=>{this.stack.push(e)};run=()=>{this.pop()?.()};runAll=()=>{for(;this.length>0;)this.run()}}function sl(){return new URL(window.location.href).searchParams.get("stylitics-debug")==="true"}function Hr(t,e){return{kind:"schema",type:"filter_array",reference:Hr,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return H(this)},"~run"(r,s){const i=r.value,a=r,o=function(){try{if(sl())return structuredClone(r)}catch{}return null}();if(Array.isArray(i)){a.typed=!0,a.value=[];for(const c of i){const l=this.item["~run"]({typed:!1,value:c},s);l.issues?o&&(o.issues?o.issues=[...o.issues,...l.issues]:o.issues=l.issues):a.value.push(l.value)}}else U(this,"type",a,s);return o?.issues?.length&&A.debug("filteredArray debug:",Kn(o.issues)),a}}}function P(t,e){const r=Se(t,e);if(r.error)throw r.error;return r.output}function Se(t,e){const r=ei(t,e);return r.success?{...r,error:void 0}:{...r,error:nl(r.issues)}}function je(t,e,r){try{return Jt(e,r)}catch{return t}}function nl(t){const e=JSON.stringify(Kn(t),null,2);return new il(e)}function C(t){return v(p(Jn(t)),y(e=>e??void 0))}class il extends Error{name="StyliticsValidationError";stack=void 0}class se{type="CookieStore";static keys={sessionId:"styliticsWidgetSession",widgetData:"styliticsWidgetData"};static new(e={}){return new this(e)}static getDefaultAttributes(){return{domain:al(window.location.host),path:"/",sameSite:"none",secure:!0}}constructor(e){this._enableStorage=e.enableStorage??!0}attributes=ze.attributes;converter=ze.converter;_enableStorage;get enableStorage(){return this._enableStorage}set enableStorage(e){e===!0&&(this._enableStorage=!0),e===!1&&(this._enableStorage=!1,this.clear())}getSessionId(){return this.get(se.keys.sessionId)}setSessionId(e,r){return this.set(se.keys.sessionId,e,r),this}deleteSessionId(){return this.remove(se.keys.sessionId),this}getWidgetData(){return this.get(se.keys.widgetData)}setWidgetData(e,r){return this.set(se.keys.widgetData,e,r),this}deleteWidgetData(){return this.remove(se.keys.widgetData),this}clear(e){Object.values(se.keys).forEach(r=>ze.remove(r,{...se.getDefaultAttributes(),...e}))}forEach(e,r){this.toMap().forEach((s,i,a)=>{e.apply(r,[i,s,a])})}get(e){return ze.get(e)}remove(e,r){ze.remove(e,{...se.getDefaultAttributes(),...r})}set(e,r,s){if(this.enableStorage){const i=se.getDefaultAttributes();return e===se.keys.sessionId&&(i.expires=1e3),ze.set(e,r,{...i,...s})}}toMap(){const e=Object.values(se.keys).reduce((r,s)=>{const i=this.get(s);return i!=null&&r.push([s,i]),r},[]);return new Map(e)}withAttributes=ze.withAttributes;withConverter=ze.withConverter}function al(t=""){if(t.includes("localhost"))return"localhost";switch(t.split(".").length){case 1:return"";case 2:return t;default:return t.slice(t.indexOf(".")+1)}}class K{type="LocalStore";static keys={browsedItems:"StyliticsBrowsedItems",campaignIds:"styliticsCampaignIds",experienceConfig:"StyliticsExperienceConfig",sessionId:"StyliticsSessionID",testOverride:"StyliticsTestOverride"};static keySet=new Set(Object.values(K.keys));static new(e={}){return new this(e)}constructor(e){this._enableStorage=e.enableStorage??!0,this.store=e.store??window.localStorage}store;_enableStorage;get enableStorage(){return this._enableStorage}set enableStorage(e){e===!0&&(this._enableStorage=!0),e===!1&&(this._enableStorage=!1,this.clear())}getCampaignIds(){return this.get(K.keys.campaignIds)}setCampaignIds(e){return this.set(K.keys.campaignIds,e),this}deleteCampaignIds(){return this.store.removeItem(K.keys.campaignIds),this}getBrowsedItems(){return this.get(K.keys.browsedItems)}setBrowsedItems(e){return this.set(K.keys.browsedItems,e),this}deleteBrowsedItems(){return this.store.removeItem(K.keys.browsedItems),this}getPurchasedItems(e){return this.get(e)}setPurchasedItems(e,r){return this.set(e,r),this}deletePurchasedItems(e){return this.store.removeItem(e),this}getExperienceConfig(){return this.get(K.keys.experienceConfig)}setExperienceConfig(e){return this.set(K.keys.experienceConfig,e),this}deleteExperienceConfig(){return this.store.removeItem(K.keys.experienceConfig),this}getSessionId(){return this.get(K.keys.sessionId)}setSessionId(e){return this.set(K.keys.sessionId,e),this}deleteSessionId(){return this.store.removeItem(K.keys.sessionId),this}getTestOverride(){return this.get(K.keys.testOverride)}setTestOverride(e){return this.set(K.keys.testOverride,e),this}deleteTestOverride(){return this.store.removeItem(K.keys.testOverride),this}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return`LocalStore {size: ${this.size}}`}clear(){this.forEach((e,r)=>{this.store.removeItem(r)})}delete(e){const r=this.has(e);return this.store.removeItem(e),r}entries(){return this.toMap().entries()}forEach(e,r){this.toMap().forEach((s,i,a)=>{e.apply(r,[s,i,a])})}get(e){return this.store.getItem(e)??void 0}has(e){return this.toMap().has(e)}keys(){return this.toMap().keys()}set(e,r){return this.enableStorage&&this.store.setItem(e,r),this}get size(){return localStorage.length}values(){return this.toMap().values()}toMap(){return Object.entries(this.store).reduce((e,[r,s])=>(this.isLocalStoreKey(r)&&s!=null&&e.set(r,s),e),new Map)}isLocalStoreKey(e){return K.keySet.has(e)||e.startsWith(fi)}}const fi="styliticsVisitorBoughtItems";class pi{type="ParamsStore";static new(e={}){return new this(e)}constructor(e){this.store=e.store??new URLSearchParams(window.location.search)}store;clear(){this.forEach(this.store.delete)}delete(e){const r=this.has(e);return this.store.delete(e),r}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.toParams.toString()}entries(){return this.store.entries()}forEach(e,r){this.toMap().forEach((s,i,a)=>{e.apply(r,[s,i,a])})}get(e){return this.store.get(e)??void 0}has(e){return this.store.has(e)}keys(){return this.store.keys()}set(e,r){return this.store.set(e,r),this}get size(){return this.store.size}values(){return this.store.values()}toHref(){return this.toUrl().href}toParams(){return this.store}toString(){return this.store.toString()}toUrl(){const e=new URL(window.location.href);return e.search=this.toString(),e}toMap(){return new Map(this.store)}}const gi=jr(S({browsed_at:Xe(h()),item_number:Xe(h()),product_id:Xe(u()),purchased_at:Xe(h()),remote_id:Xe(u()),timestamp:Xe(h())})),yi=I(gi),ol=J(u(),yi);function bi(t,e){return cl(Zo(t,e),e)}function cl(t,e){return t===-1?e:zo(t,1,e)}function Pt(t){return{browsed_at:t.browsed_at??t.timestamp??void 0,item_number:t.item_number??void 0,product_id:t.product_id??void 0,purchased_at:t.purchased_at??void 0,remote_id:t.remote_id??void 0,timestamp:void 0}}function Si(t,e,r){if(!ul(t))throw t;const s=r==="first"?ll:hl;return e.length===1?e:s(e)}function ul(t){return t instanceof Error&&t.name===gl}function ll(t){return t.slice(1)}function hl(t){return t.slice(0,-1)}function dl(t){return wr(/,/g,"",t)}function wi(t){return P(fl,t)}function _i(t){return P(ml,t)}const Ii=v(u(),y(dl)),ml=n(v(I(v(Q({...gi.entries,remote_id:n(C(Ii),void 0)}),y(Pt))),Ne(t=>si(t.remote_id))),[]),fl=n(v(I(Ii),Ne(t=>si(t)),pe(t=>Pt({remote_id:t}))),[]);function pl(t,e,r){const s=new Map,i=new Map;return t.forEach(a=>{if(Nr.has(a.type)){const{browsed:o=[],purchased:c=[]}=a.params;wi(o).forEach(l=>s.set(l.remote_id,l)),wi(c).forEach(l=>i.set(l.remote_id,l))}}),_i(e).forEach(a=>s.set(a.remote_id,a)),_i(r).forEach(a=>i.set(a.remote_id,a)),{browsed:Array.from(s.values()),purchased:Array.from(i.values())}}const gl="QuotaExceededError",Nr=new Set(["anchor-items-gallery","cross-sell","dynamic-galleries","styled-for-you"]);class Wr{static new(e,r,s={}){return new this(e,r,s)}constructor(e,r,s){this.client=e,this.store=r,this.limit=s.limit??100}client;limit;store;get(){return(this.getAll()[this.client]||[]).map(Pt)}set(e){const{item_number:r,product_id:s,remote_id:i}=e;if(eo(Te,[r,s,i])){A.warn("No item id values provided.");return}const a={item_number:r,remote_id:i,product_id:s,browsed_at:Date.now()},o=this.getAll(),c=this.get(),l=bi(m=>m.remote_id===a.remote_id,c).concat([a]).slice(-this.limit).map(Pt);o[this.client]=l;try{this.store.setBrowsedItems(JSON.stringify(o))}catch(m){o[this.client]=Si(m,l,"first"),this.store.setBrowsedItems(JSON.stringify(o))}}getAll(){const e=this.store.getBrowsedItems();if(!e)return{};const r=it(e),s=Se(ol,r);return s.success?s.output:{}}}class zr{static new(e,r){return new this(e,r)}constructor(e,r){this.client=e,this.store=r,this.key=`${fi}.${e}`}client;key;store;get(){const e=this.store.get(this.key);if(!e)return[];const r=it(e),s=Se(yl,r);if(s.success)return s.output.map(a=>({remote_id:a}));const i=Se(yi,r);return i.success?i.output.map(Pt):[]}set(e){const r=e.map(a=>({remote_id:a,purchased_at:Date.now()})),s=r.reduce((a,o)=>bi(c=>c.remote_id===o.remote_id,a),this.get()),i=r.concat(s).slice(0,100);try{this.store.set(this.key,JSON.stringify(i))}catch(a){const o=Si(a,i,"last");this.store.set(this.key,JSON.stringify(o))}return this}delete(){return this.store.delete(this.key),this}}const yl=I(u());function ki(t){const e=t?.split(".").filter(Boolean)||[];if(Zu(e)){const r=dc(e,window);if(ri(r)||ti(r))return String(r)}}var vl=Array.isArray,bl=Object.defineProperty;const at=()=>{};function Pi(t){for(var e=0;e{e===ot&&wl()})}ot.push(t)}function Il(t){try{return t()}finally{}}let Gr=!1;function kl(t){var e=Gr;try{return Gr=!0,t()}finally{Gr=e}}function Pl(t,e,r,s={}){function i(a){if(s.capture||Tl.call(e,a),!a.cancelBubble)return Il(()=>r?.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?_l(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function Al(t,e,r,s={}){var i=Pl(e,t,r,s);return()=>{t.removeEventListener(e,i,s)}}let Ai=null;function Tl(t){var e=this,r=e.ownerDocument,s=t.type,i=t.composedPath?.()||[],a=i[0]||t.target;Ai=t;var o=0,c=Ai===t&&t.__root;if(c){var l=i.indexOf(c);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var m=i.indexOf(e);if(m===-1)return;l<=m&&(o=l)}if(a=i[o]||t.target,a!==e){bl(t,"currentTarget",{configurable:!0,get(){return a||r}});try{for(var f,g=[];a!==null;){var b=a.assignedSlot||a.parentNode||a.host||null;try{var w=a["__"+s];if(w!=null&&(!a.disabled||t.target===a))if(vl(w)){var[_,...k]=w;_.apply(a,[t,...k])}else w.call(a,t)}catch(T){f?g.push(T):f=T}if(t.cancelBubble||b===e||b===null)break;a=b}if(f){for(let T of g)queueMicrotask(()=>{throw T});throw f}}finally{t.__root=e,delete t.currentTarget}}}function Ti(t,e,r){if(t==null)return e(void 0),r&&r(void 0),at;const s=kl(()=>t.subscribe(e,r));return s.unsubscribe?()=>s.unsubscribe():s}const ct=[];function El(t,e){return{subscribe:Ge(t,e).subscribe}}function Ge(t,e=at){let r=null;const s=new Set;function i(c){if(Sl(t,c)&&(t=c,r)){const l=!ct.length;for(const m of s)m[1](),ct.push(m,t);if(l){for(let m=0;m{s.delete(m),s.size===0&&r&&(r(),r=null)}}return{set:i,update:a,subscribe:o}}function Cl(t,e,r){const s=!Array.isArray(t),i=s?[t]:t;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const a=e.length<2;return El(r,(o,c)=>{let l=!1;const m=[];let f=0,g=at;const b=()=>{if(f)return;g();const _=e(s?m[0]:m,o,c);a?o(_):g=typeof _=="function"?_:at},w=i.map((_,k)=>Ti(_,T=>{m[k]=T,f&=~(1<{f|=1<e=r)(),e}function xl(t){const e=Ge(t?.clientHeight||0),r=Ge(t?.clientWidth||0);let s;const i=new ResizeObserver(a=>{const[{contentRect:o}]=a;s=window.requestAnimationFrame(()=>{e.set(o.height),r.set(o.width)})});return{heightStore:ut(e),widthStore:ut(r),get stores(){return{heightStore:this.heightStore,widthStore:this.widthStore}},get height(){return et(this.heightStore)},get width(){return et(this.widthStore)},observe(){return i.observe(t),this},unobserve(){return i.unobserve(t),this.cancelAnimationFrame(),this},disconnect(){return i.disconnect(),this.cancelAnimationFrame(),this},cancelAnimationFrame(){return s!==void 0&&window.cancelAnimationFrame(s),this}}}class Ol{onResize;onTouch;screenHeightStore;screenWidthStore;touchConfirmedStore;touchEnabledStore;resizeAbortController=new AbortController;touchAbortController=new AbortController;animationFrameRequestId=void 0;constructor({onResize:e,onTouch:r,screen_height:s=document.documentElement.clientHeight,screen_width:i=document.documentElement.clientWidth,touch_device:a=Dl(window.navigator.userAgent),touch_device_confirmed:o=!1}={}){this.onResize=e,this.onTouch=r,this.screenHeightStore=Ge(s),this.screenWidthStore=Ge(i),this.touchConfirmedStore=Ge(o),this.touchEnabledStore=Ge(a),this.animationFrameRequestId=void 0}get state(){return{screen_height:this.screen_height,screen_width:this.screen_width,touch_device:this.touch_device,touch_device_confirmed:this.touch_device_confirmed}}get stores(){return{screenHeightStore:ut(this.screenHeightStore),screenWidthStore:ut(this.screenWidthStore),touchConfirmedStore:ut(this.touchConfirmedStore),touchEnabledStore:ut(this.touchEnabledStore),viewportStore:Cl([this.screenHeightStore,this.screenWidthStore],([e,r])=>({screen_height:e,screen_width:r}))}}get screen_height(){return et(this.screenHeightStore)}set screen_height(e){this.screenHeightStore.set(e)}get screen_width(){return et(this.screenWidthStore)}set screen_width(e){this.screenWidthStore.set(e)}get touch_device(){return et(this.touchEnabledStore)}set touch_device(e){this.touchEnabledStore.set(e)}get touch_device_confirmed(){return et(this.touchConfirmedStore)}set touch_device_confirmed(e){this.touchConfirmedStore.set(e)}addEventListeners(){return this.addTouchListener().addResizeListener()}removeEventListeners(){return this.touchAbortController.abort(),this.resizeAbortController.abort(),this.cancelAnimationFrame(),this}cancelAnimationFrame(){this.animationFrameRequestId&&window.cancelAnimationFrame(this.animationFrameRequestId)}addTouchListener(){return window.addEventListener("touchstart",()=>{this.touch_device=!0,this.touch_device_confirmed=!0,this.onTouch?.(this.touch_device),this.touchAbortController.abort()},{signal:this.touchAbortController.signal}),this}addResizeListener(){return window.addEventListener("resize",()=>{this.animationFrameRequestId=window.requestAnimationFrame(()=>{const{clientHeight:e,clientWidth:r}=document.documentElement;this.screen_height!==e&&(this.screen_height=e),this.screen_width!==r&&(this.screen_width=r),this.onResize?.({screen_width:this.screen_width,screen_height:this.screen_height})})},{signal:this.resizeAbortController.signal}),this}}let At;function Rl(){if(At!==void 0)return At;const t=window.navigator,e=t.vendor,r=typeof window.opr<"u",s=t.userAgent.indexOf("Edge")>-1;return t.userAgent.match("CriOS")?(At=!1,!1):e==="Google Inc."&&r===!1&&s===!1?(At=!0,!0):(At=!1,!1)}function Dl(t){return jl()||Ml(t)}function Ml(t){return t.includes("iPhone")||t.includes("iPad")||t.includes("Android")||t.includes("Touch")}function jl(){const t=navigator.maxTouchPoints>0,e=window.matchMedia&&window.matchMedia("(any-pointer: fine)").matches;return t&&!e}function Fl(){const t=window.navigator.userAgent;return t.includes("Firefox")?"Firefox":t.includes("SamsungBrowser")?"Samsung Internet":t.includes("Opera")||t.includes("OPR")?"Opera":t.includes("Trident")?"Internet Explorer":t.includes("Edge")?"Edge (Legacy)":t.includes("Edg")?"Edge (Chromium)":t.includes("Chrome")?"Chrome":t.includes("Safari")?"Safari":"unknown"}function Ul(){return document.referrer}var Tt=(t=>(t.caES="ca-ES",t.csCZ="cs-CZ",t.daDK="da-DK",t.deAT="de-AT",t.deBE="de-BE",t.deCH="de-CH",t.deDE="de-DE",t.deLU="de-LU",t.elGR="el-GR",t.enAT="en-AT",t.enAU="en-AU",t.enBE="en-BE",t.enBG="en-BG",t.enCA="en-CA",t.enCH="en-CH",t.enCZ="en-CZ",t.enDE="en-DE",t.enDK="en-DK",t.enES="en-ES",t.enEU="en-EU",t.enFI="en-FI",t.enFR="en-FR",t.enGB="en-GB",t.enHR="en-HR",t.enHU="en-HU",t.enID="en-ID",t.enIE="en-IE",t.enIL="en-IL",t.enIN="en-IN",t.enJP="en-JP",t.enLU="en-LU",t.enMY="en-MY",t.enNL="en-NL",t.enNO="en-NO",t.enPH="en-PH",t.enPT="en-PT",t.enRO="en-RO",t.enSE="en-SE",t.enSG="en-SG",t.enSI="en-SI",t.enSK="en-SK",t.enUS="en-US",t.enVN="en-VN",t.enZA="en-ZA",t.esES="es-ES",t.esMX="es-MX",t.fiFI="fi-FI",t.frBE="fr-BE",t.frCA="fr-CA",t.frCH="fr-CH",t.frFR="fr-FR",t.frLU="fr-LU",t.huHU="hu-HU",t.isIS="is-IS",t.itCH="it-CH",t.itIT="it-IT",t.jaJP="ja-JP",t.nlBE="nl-BE",t.nlNL="nl-NL",t.noNO="no-NO",t.plPL="pl-PL",t.ptPT="pt-PT",t.svSE="sv-SE",t.thTH="th-TH",t.trTR="tr-TR",t.zhTW="zh-TW",t.enKR="en-KR",t.koKR="ko-KR",t.enHK="en-HK",t.enCN="en-CN",t.zhHansCN="zh-Hans-CN",t.zhHantTW="zh-Hant-TW",t))(Tt||{}),Ei=(t=>(t.AUD="AUD",t.BGN="BGN",t.CAD="CAD",t.CHF="CHF",t.CZK="CZK",t.DKK="DKK",t.EUR="EUR",t.GBP="GBP",t.HRK="HRK",t.ILS="ILS",t.ISK="ISK",t.INR="INR",t.JPY="JPY",t.MXN="MXN",t.NOK="NOK",t.PLN="PLN",t.RON="RON",t.SEK="SEK",t.TRY="TRY",t.USD="USD",t.ZAR="ZAR",t))(Ei||{});const Ll={"ca-ES":"EUR","cs-CZ":"CZK","da-DK":"DKK","de-AT":"EUR","de-BE":"EUR","de-CH":"CHF","de-DE":"EUR","de-LU":"EUR","el-GR":"EUR","en-AT":"EUR","en-AU":"AUD","en-BE":"EUR","en-BG":"BGN","en-CA":"CAD","en-CH":"CHF","en-CN":"USD","en-CZ":"CZK","en-DE":"EUR","en-DK":"DKK","en-ES":"EUR","en-EU":"EUR","en-FI":"EUR","en-FR":"EUR","en-GB":"GBP","en-HK":"USD","en-HR":"HRK","en-HU":"EUR","en-ID":"USD","en-IE":"EUR","en-IL":"ILS","en-IN":"INR","en-JP":"JPY","en-KR":"USD","en-LU":"EUR","en-MY":"USD","en-NL":"EUR","en-NO":"NOK","en-PH":"USD","en-PT":"EUR","en-RO":"RON","en-SE":"SEK","en-SG":"USD","en-SI":"EUR","en-SK":"EUR","en-US":"USD","en-VN":"USD","en-ZA":"ZAR","es-ES":"EUR","es-MX":"MXN","fi-FI":"EUR","fr-BE":"EUR","fr-CA":"CAD","fr-CH":"CHF","fr-FR":"EUR","fr-LU":"EUR","hu-HU":"EUR","is-IS":"ISK","it-CH":"CHF","it-IT":"EUR","ja-JP":"JPY","ko-KR":"USD","nl-BE":"EUR","nl-NL":"EUR","no-NO":"NOK","pl-PL":"PLN","pt-PT":"EUR","sv-SE":"SEK","th-TH":"USD","tr-TR":"TRY","zh-Hans-CN":"USD","zh-Hant-TW":"USD","zh-TW":"USD"};function $l(t){return Ll[t]??"USD"}function Vr(t,e="en-US",{hideDoubleZeroCents:r}={}){if(typeof t=="string")return t;const s=t,i=ql(e);r&&Bl(s)&&(i.maximumFractionDigits=0,i.minimumFractionDigits=0);try{return new Intl.NumberFormat(e,i).format(s)}catch(a){return A.warn(`Stylitics locale ${e} was not set properly. Defaulting to en-US`,a),Vr(s,"en-US",{hideDoubleZeroCents:r})}}function ql(t){const e={style:"currency",currency:$l(t)};return t==="fr-CA"&&Rl()&&(e.currencyDisplay="narrowSymbol"),e}function Bl(t){return t%1===0}function Ci(t){return Nu(t)}var Oe=(t=>(t.slideout="slideout",t.flip="flip",t.crossfade="crossfade",t.modal="modal",t.click="click",t.hover="hover",t))(Oe||{});const xi=v(u(),Bn(["md5"])),Oi=v(ue([u(),h()]),y(String)),Hl=n(p(v(Oi,Gt())),void 0),Nl=n(p(v(ue([xi,v(Oi,Gt(),y(Ci))]))),void 0),Ri=O(["_self","_blank","new-tab","same-tab"]),Wl=O(["account","cart","checkout","clp","gallery","homepage","mini-cart","order-confirmation","outfit-landing-page","pdp","wishlist"]),Di=O(["colorway","sku"]),ve=O(["h1","h2","h3","h4","h5","h6"]),zl={"new-tab":"_blank","same-tab":"_self",_blank:"_blank",_self:"_self"},Mi=y(t=>zl[t]);var ji=(t=>(t.boxyBlack="boxyBlack",t.boxyRed="boxyRed",t.brightMinimal="brightMinimal",t.graySophisticated="graySophisticated",t.giftBox="giftBox",t.raisedGray="raisedGray",t.softMinimal="softMinimal",t.tropicalGradient="tropicalGradient",t.whiteMinimalist="whiteMinimalist",t))(ji||{});const Fi=n(ue([$(ji),v(O([2,"2","blackMinimalist"]),y(()=>"boxyBlack")),v(O([3,"3","colorful"]),y(()=>"whiteMinimalist")),v(O([6,"6","whiteBlackSupport"]),y(()=>"softMinimal")),v(O([8,"8"]),y(()=>"graySophisticated"))]),t=>(A.warn("Invalid Label Style provided to schema",t?.value),"boxyBlack"));Tt.enUS;const Gl=n(v(u(),zt(t=>(ei($(Tt),t).success||A.warn(`received an unrecognized locale of "${t}". We will use the provided value, but please ensure it is correct.`),!0))),Tt.enUS),le=n(I(u()),[]),ne=v(n(h(),1),y(t=>Math.max(1,t))),Vl=n(p(Wl),t=>(t?.issues?.[0]&&q(t?.value)&&A.warn("received an unrecognized placement value. We will use the provided value, but please ensure it is correct."),t?.value)),Kl=v(n(p(ue([v(h(),y(String)),u()])),void 0),y(pn(ku,br,String))),Ql=n(v(ue([d(),J(u(),v(ue([u(),I(u())]),y(Du)))]),y(t=>typeof t=="boolean"?t?{__true__:[]}:{__false__:[]}:t)),{}),Jl=n(p(O(["frequency","purchases","views"])),void 0),Ui=n(h(),100),Yt=n(p(v(u(),Nn("%v","Stylitics Validation Error: No dynamic value placeholder"))),void 0),Li=n(O(["auto","on-hover"]),"auto"),V=v(S({addToCartCTA:n(u(),"Add to Cart"),addToCartDescription:n(u(),"Select Size"),clickItemLinkDesktop:v(n(Ri,"_blank"),Mi),clickItemLinkMobile:v(n(Ri,"_self"),Mi),clientOriginalImages:n(d(),!1),clientUserId:n(p(ue([h(),u()])),void 0),combinedDiscountPercentage:n(d(),!1),ctaButtonContrast:n(d(),!1),dataSource:n(ui,"outfits"),desktopHorizontalScroll:n(d(),!1),dialogAsModal:n(d(),!0),editorialAnchorItem:n(d(),!1),enableStorage:n(d(),!0),enableTracking:n(d(),!0),env:n($(G),G.production),gutterWidth:n(h(),16),hideAnchorItem:n(d(),!1),hideDoubleZeroCents:n(d(),!1),item_number_type:n(p(Di),void 0),item_number:Kl,itemDetailsModalHeader:n(u(),"Product List"),itemDiscountImageLabel:n(d(),!1),itemDiscountPercentage:n(d(),!1),itemDiscountText:n(p(u()),void 0),itemDiscountThreshold:n(h(),5),itemLinkCTA:n(u(),"Shop"),labelStyle:n(p(Fi),void 0),locale:Gl,maxResults:n(h(),10),minResults:n(h(),1),mixAndMatch:n(d(),!1),mixAndMatchRow:n(d(),!1),modalHeading:n(u(),"Shop This Look"),modalHeadingLevel:n(ve,"h4"),moduleHeading:n(p(u()),void 0),moduleHeadingLevel:n(p(ve),void 0),moduleSubHeading:n(p(u()),void 0),nextOutfitPeek:n(h(),0),outfitDiscountPercentage:n(d(),!1),outfitDiscountText:n(u(),"Up to"),outfitDiscountThreshold:n(h(),20),outfitPromoIndicators:n(d(),!1),outfitPromoThreshold:n(h(),3),placement:Vl,previousOutfitPeek:n(h(),0),profileId:n(p(ue([h(),u()])),void 0),profileIdPath:n(p(u()),void 0),promoIndicators:Ql,regulatedDiscountPercentage:n(d(),!1),responsive:n(I(L([h(),S({})])),zu),roundingStyle:n(p($(Ze)),void 0),salesPriceStyle:n($(Z),Z.strikethrough),showCarouselDots:n(d(),!1),sizeDropdown:n(d(),!1),socialProofItemLabel:Yt,socialProofOutfitLabel:Yt,socialProofThreshold:Ui,tags:n(p(u()),void 0),trackingEnv:n($(G),G.production),useFixture:n(d(),!1),videoPlayMode:Li}),y(F)),Xl=D(V);function $i(){return ue([u(),...Zl().options])}function Zl(){return ue([It(Element),It(Document),It(ShadowRoot)])}function j(t){return P(v(n(ue([v(J(u(),E()),zt(Yl),y(eh)),J(u(),E())]),{}),y(nh),y(th),y(rh),y(sh)),t)}function Yl(t){return Object.keys(t).some(r=>qi.has(r))}function eh(t){return Object.entries(t).reduce((e,[r,s])=>{const i=qi.has(r)&&typeof s=="object"?s:{[r]:s};return{...e,...i}},{})}function th(t){const e={...t},r=je(null,d(),e.disableMnM),s=je(null,d(),e.mixAndMatch);return q(s)?e.mixAndMatch=s:q(r)&&(e.mixAndMatch=!r),delete e.disableMnM,e}function rh(t){const e={...t},r=je(null,d(),e.disableLocalStorageAndCookies),s=je(null,d(),e.enableStorage);return q(s)?e.enableStorage=s:q(r)&&(e.enableStorage=!r),delete e.disableLocalStorageAndCookies,e}function sh(t){const e={...t},r=je(null,d(),e.doNotTrack),s=je(null,d(),e.enableTracking);return q(s)?e.enableTracking=s:q(r)&&(e.enableTracking=!r),delete e.doNotTrack,e}function nh(t){const e={...t},r=je(null,h(),e.minResults)??je(null,h(),e.min),s=je(null,h(),e.maxResults)??je(null,h(),e.max);return q(r)&&(e.minResults=r),q(s)&&(e.maxResults=s),delete e.min,delete e.max,e}const qi=new Set(["analytics","api","customer","display","internal","navigation","price","text"]);function F(t){const e={...t},r=P(Hl,t.clientUserId??t.profileId??ki(t.profileIdPath));return r&&(e.clientUserId=r),e}function we(t){return q(t.item_number)||q(t.tags)}function B(t){return{...t,maxResults:Math.max(t.minResults,t.maxResults)}}function ih(t){return Vt(S({item_number:Mr(V.entries.item_number)}),t)?"item_number":Vt(S({tags:Mr(V.entries.tags)}),t)?"tags":"unknown"}function er(t){return t?.enableStorage!==!1}function tr(t){return t?.enableTracking!==!1}function Bi(t,e){return e===void 0?t:(ah[e]||(s=>s))(t)}const ah={floor:Math.floor,ceiling:Math.ceil,round:Math.round};function oh(t,e){return uh(t,e)&&(e??0)>0}function ch(t,e){return typeof t=="number"&&t>0&&t>(e??0)}function uh(t,e){return!ch(t,e)}function lh(t,e){return typeof e=="number"&&e>0&&e<(t||1/0)}const Kr={"Indoor Dinnerware":"Dinnerware",Flatware:"Flatware","Table Runners & Tablecloth":"Tabletop Decor","Placemats & Chargers":"Tabletop Decor","Napkins & Napkin Rings":"Tabletop Decor","Indoor Drinkware":"Everyday Glassware","Indoor Stemware":"Everyday Glassware",Serveware:"Servingware"},Qr={"Comforters & Duvets":"Comforters & Duvets","Duvet Covers":"Comforters & Duvets","Bedding Sets":"Comforters & Duvets","Quilts & Coverlets":"Quilts & Coverlets",Sheets:"Sheets","Pillowcases & Shams":"Sheets","Indoor Pillows":"Indoor Pillow","Pillow Inserts":"Pillow Insert","Mattresses & Bases":"Mattress Pads & Toppers"};({...Qr,...Kr});const hh=v(S({price_localized:kt(),price_value:kt(),price:C(h()),sale_price_localized:kt(),sale_price_value:kt(),sale_price:C(h())}),y(({price:t,sale_price:e})=>({price:t,salePrice:e,priceLocalized:void 0,salePriceLocalized:void 0}))),dh=v(S({price_value:C(h()),price:C(u()),sale_price_value:C(h()),sale_price:C(u())}),y(({price_value:t,sale_price_value:e})=>({price:t,salePrice:e,priceLocalized:void 0,salePriceLocalized:void 0}))),mh=v(S({price_localized:C(u()),price:C(h()),sale_price_localized:C(u()),sale_price:C(h())}),y(({price:t,sale_price:e,price_localized:r,sale_price_localized:s})=>({price:t,salePrice:e,priceLocalized:r,salePriceLocalized:s}))),fh=ue([mh,dh,hh]),Jr=n(S({height:h(),width:h(),x:h(),y:h(),z:h()}),()=>({x:0,y:0,z:0,height:0,width:0})),Hi=n(S({image_height:h(),image_width:h(),outfit_height:h(),outfit_width:h()}),()=>({image_height:0,image_width:0,outfit_height:0,outfit_width:0})),Ni=n(Q({product_count:n(p(h()),void 0)}),{product_count:void 0}),ph=n(ue([Qt(),v(u(),Gn(),zn(),y(t=>t.startsWith("#")?t:`#${t}`),Hn(),y(t=>t.length===4?"#"+t.split("").slice(1).map(e=>e+e).join(""):t))]),void 0),tt=Q({_exp_suppressed_promotions:n(I(u()),[]),"collage-dimensions":Hi,"line1-name":C(u()),"line2-name":C(u()),account_id:h(),account_username:u(),affiliate_link:C(u()),base_image_url:u(),brand:C(u()),buy_url:p(u()),category:u(),client_original_image_url:C(u()),color_hex:C(ph),color:C(u()),coords:Jr,cover_image_url:C(u()),department:u(),frequency:n(h(),0),gender:u(),image_url:u(),item_id:h(),item_promo_texts:n(I(u()),[]),large_image_url:u(),lookbook_image_url:C(u()),name:u(),original_image_url:C(u()),other_client_item_ids:Ni,pattern:C(u()),position:p(h()),price_localized:p(E()),price_value:p(E()),price:p(E()),product_id:C(u()),promo_text:C(u()),promotions:n(I(u()),[]),purchases:n(h(),0),remote_id:u(),retailer_category:C(u()),retailer_color:C(u()),retailer_material:C(u()),retailer_patterns:n(I(u()),[]),retailer_style:C(u()),retailer:C(u()),sale_price_localized:p(E()),sale_price_value:p(E()),sale_price:p(E()),sku:C(u()),skus:n(I(u()),[]),small_image_url:u(),social_proof_label:p(u()),stocked:n(d(),!0),style:u(),tags:n(I(u()),[]),transparent_image_url:p(u()),username:u(),views:n(h(),0)}),Xr=Q({_exp_suppressed_label:p(u()),account_id:h(),account_username:u(),ai_generated_imagery:n(d(),!1),background:p(E()),base_image_url:u(),caption:C(u()),cover_image_url:C(u()),id:h(),image_url:u(),item_ids:n(I(h()),[]),items_count:p(h()),items:Hr(tt),label:p(u()),large_image_url:p(u()),lookbook_caption:C(u()),lookbook_image_url:u(),lookbook_title:C(u()),nbr_oos:p(h()),"on-model-image":p(d(),!1),outfit_id:p(h()),outfit_version_id:p(h()),position:p(h()),primary_remote_id:p(u()),primary_requested_id:p(u()),primary_stylitics_item_id:p(h()),relative_boost:p(u()),social_proof_label:p(u()),static_image:C(d()),tags:n(I(u()),[]),title:p(u()),transparent_image_url:p(u()),username:u()}),gh=Q({account_username:u(),affiliate_link:C(u()),brand:C(u()),category:u(),client_original_image_url:C(u()),"collage-dimensions":Hi,coords:Jr,gender:u(),id:h(),image_url:u(),item_id:h(),large_image_url:u(),name:u(),other_client_item_ids:Ni,price_localized:p(E()),price_value:p(E()),price:p(E()),product_id:C(u()),promotions:I(u()),remote_id:u(),retailer_style:C(u()),retailer:C(u()),sale_price_localized:p(E()),sale_price_value:p(E()),sale_price:p(E()),sku:C(u()),skus:n(I(u()),[]),small_image_url:u(),style:u(),username:u(),_exp_suppressed_promotions:n(I(u()),[]),"line1-name":C(u()),"line2-name":C(u()),account_id:C(h()),base_image_url:n(u(),""),buy_url:p(u()),color_hex:C(u()),color:C(u()),cover_image_url:C(u()),department:n(u(),""),frequency:n(h(),0),item_promo_texts:n(I(u()),[]),lookbook_image_url:n(u(),""),original_image_url:C(u()),pattern:n(u(),""),position:C(h()),promo_text:C(u()),purchases:n(h(),0),retailer_category:C(u()),retailer_color:C(u()),retailer_material:C(u()),retailer_patterns:n(I(u()),[]),stocked:n(d(),!0),tags:n(I(u()),[]),transparent_image_url:p(u()),views:n(h(),0)});function rr(t){return v(tt,y(e=>({...e,...rt(e,t),collage_dimensions:e["collage-dimensions"],__type:"normalized-item"})))}function sr(t){return v(Q({...Xr.entries,items:v(Hr(rr(t)),y(e=>{const{socialProofItemLabel:r,socialProofAction:s,socialProofThreshold:i}=t;return r&&s&&i?e.map((a,o)=>({...Ki(a,{socialProofItemLabel:r,socialProofAction:s,socialProofThreshold:i}),index:o})):e.map((a,o)=>({...a,index:o}))}))}),y(e=>({...e,onModelImage:e["on-model-image"]})))}function yh(t){return v(gh,y(e=>({...e,...rt(e,t),collage_dimensions:e["collage-dimensions"],__type:"normalized-item"})))}function rt(t,e){return P(v(fh,y(r=>vh(r,e))),t)}function vh(t,e){{const r=q(t.salePrice)?Bi(t.salePrice,e.roundingStyle):void 0,s=q(t.price)?Bi(t.price,e.roundingStyle):lh(t.price,r)?r:void 0,i=q(t.priceLocalized)?t.priceLocalized:q(s)?Vr(s,e.locale,e):void 0,a=q(t.salePriceLocalized)?t.salePriceLocalized:q(r)?Vr(r,e.locale,e):void 0;return oh(s,r)?{price:t.salePrice,salePrice:void 0,roundedPrice:r,roundedSalePrice:void 0,formattedPrice:a,formattedSalePrice:void 0}:{price:t.price,salePrice:t.salePrice,formattedPrice:i,formattedSalePrice:a,roundedPrice:s,roundedSalePrice:r}}}const Wi=3,zi=6,bh=ln(Sr(-1/0,"browsed_at")),Sh=ln(Sr(-1/0,"purchased_at")),Gi=Mu(yc(Wi,zi+1)),Vi=mc(Gi,["outfits","length"]),wh=Po([Vi,q]),Zr={minResults:Wi,maxResults:zi,byBrowsedAtDescending:bh,byPurchasedAtDescending:Sh,includedInRange:Gi,outfitLengthIsValid:Vi,isValidAnchorItem:wh};function lt(t,{minResults:e=1,emitWarnings:r=!1}){return t.length>=e?t:(r&&A.warn("API response does not satisfy the min results parameter."),[])}function Ki(t,e){const{socialProofItemLabel:r,socialProofThreshold:s,socialProofAction:i}=e;return{...t,...t[i]>=s&&{social_proof_label:r.replace("%v",t[i].toString())}}}function Yr(t,e){return P(_h(e),t)}function _h(t){return v(S({"upsell-items":v(Ih(t))}),y(e=>({upsellItems:e["upsell-items"]})))}function Ih(t){const e=new Set;return v(I(kh),y(r=>lt(r,t)),Ne(r=>e.has(r.remote_id)?!1:(e.add(r.remote_id),!0)),pe((r,s)=>({...r,...rt(r,t),index:s})))}const kh=Q(We(tt,["account_id","account_username","affiliate_link","base_image_url","brand","category","client_original_image_url","color_hex","color","department","gender","image_url","item_id","large_image_url","lookbook_image_url","name","other_client_item_ids","pattern","price_localized","price","product_id","promotions","remote_id","retailer_category","retailer_color","retailer_style","retailer","sale_price_localized","sale_price","sku","skus","small_image_url","stocked","style","tags","transparent_image_url","username"]).entries);function Qi(t,e){return P(Ph(e),t)}function Ph(t){const e=Ah(t),r=J(u(),Ji);return v(S({complementary_items:p(e,{}),requested_items:p(J(u(),jr(Ji)),{})}),y(({complementary_items:s,requested_items:i})=>{const a={anchorItem:void 0,departments:{}};if(!Vt(r,i)){const[f]=Object.keys(i);return m(`requested item with id "${f}" is not available.`),a}const o=Object.values(s);if(o.length===0)return m("no complementary_items present."),a;const[c]=o,l=Object.entries(c);if(l.length===0)return m("no departments in complementary_items."),a;for(const[f,g]of l)if(g.length===0)return m(`"${f}" has no items.`),a;function m(f){t.emitWarnings&&A.warn(f)}return{anchorItem:Object.values(i)?.[0],departments:c}}))}function Ah(t){return J(u(),J(u(),v(I(Th),pe((e,r)=>({...e,...rt(e,t),index:r})))))}const Th=Q({...We(tt,["affiliate_link","brand","category","client_original_image_url","department","image_url","item_id","name","price","product_id","remote_id","sale_price","style"]).entries,guided:d(),index:p(h()),promotions:p(I(u()),[]),relevance:h()}),Ji=Q({account_id:h(),affiliate_link:u(),image_url:u(),item_id:h(),remote_id:u()});function es(t,e){return P(Eh(e),t)}function Eh(t){return v(S({bundles:v(I(Ch(t)),y(e=>lt(e,t)))}),y(e=>({outfits:e.bundles})))}function Ch(t){return Q({...Rh.entries,items:v(I(xh(t)),pe((e,r)=>({...e,index:r})))})}function xh(t){return v(Xi,y(e=>({...e,...rt(e,t)})))}const Xi=We(tt,["account_username","affiliate_link","base_image_url","color_hex","item_id","name","other_client_item_ids","price_localized","price","promotions","remote_id","sale_price_localized","sale_price","stocked"]),Zi=Q({id:h(),name:u(),pairing_message:u()}),Oh=Q({browsed_items:p(I(Zi),[]),purchased_items:p(I(Zi),[]),"cold-start-vector":p(d(),!1)}),Rh=Q({...We(Xr,["account_id","account_username","base_image_url","cover_image_url","id","image_url","large_image_url","lookbook_image_url","primary_remote_id","primary_stylitics_item_id","transparent_image_url","username"]).entries,items:I(Xi),personalization:n(Oh,{browsed_items:[],purchased_items:[],"cold-start-vector":!1})}),ie=S({cssExperiment:p(u()),cssTheme:p(u()),enableLogging:n(d(),!1),itemDiscountImage:n(d(),!1),itemImageHover:n(d(),!1),itemInfoStatic:n(d(),!1),itemInfoStaticMobile:n(d(),!1),itemLinkCta:n(p(u()),void 0),labelPresenceTest:n(p(Ye),void 0),macysCategory:n(d(),!1),macysCategoryAll:n(d(),!1),mixAndMatchCollage:n(d(),!1),mobileGallery:n(d(),!1),mobileItemsExposed:n(d(),!1),mobileModalList:n(d(),!1),originalItemOrder:n(d(),!1),plusIcon:n(d(),!1),productListType:n(p($(Oe)),void 0),recipeInfoPresenceTest:n(p(Ye),void 0),setCookie:n(d(),!1),shopButtonExpanded:n(d(),!1),shopButtonLarge:n(d(),!1),shopButtonPosition:n(p(Zt),void 0),shopSimilarHotspots:n(d(),!1),smallItemImage:n(d(),!1),testPresence:n(p(Ye),void 0),v3Classic:n(d(),!1),v3Hotspots:n(d(),!1),verticalAnchorGrid:n(d(),!1),widgetVariant:n(p(hi),void 0),...V.entries}),Yi=v(S({...ie.entries,browsed:le,maxBrowsedItems:n(h(),10),maxPurchasedItems:n(h(),10),purchased:le,responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:3}],[550,{columns:3}],[730,{columns:4}],[900,{columns:5}]]),sessionId:n(u(),""),itemDetailsModalHeader:n(u(),"Product List"),shopThisLookCTA:n(u(),"Shop This Look")}),y(B),y(F)),Dh={defaults:D(S({...Yi.entries})),parse:t=>P(Yi,j(t))},ea=v(S({...ie.entries,item_number:u(),maxResults:n(N(1),1),minResults:n(N(1),1),addAllToCartCTAPosition:n(O(["bottom","top"]),"bottom"),shoppableAnchorItem:n(d(),!1),showCarouselCardSeparator:n(d(),!0),showCarouselDots:n(d(),!0),salesPriceStyle:n($(Z),Z.strikethrough),addAllToCartCTA:n(u(),"Add All Items to Cart"),modalHeading:n(u(),"Mix & Match"),swapButton:n(u(),"Swap"),swapItemHeading:n(u(),"Swapping")}),y(B),y(F)),Mh={defaults:D(S({...ea.entries})),parse:t=>P(ea,j(t))},ta=v(S({...ie.entries,minResults:n(h(),3),cardAspectRatio:n(h(),1.25),carouselAdvancementRate:ne,editorialAspectRatio:n(h(),1),gutterWidth:n(h(),16),isGallery:n(d(),!1),nextOutfitPeek:n(h(),.1),previousOutfitPeek:n(h(),0),productListRevealType:n($(Oe),Oe.slideout),shopTheModelAI:n(d(),!1),showCarouselDots:n(d(),!1),showMobileArrows:n(d(),!1),sizeDropdown:n(d(),!1),mixAndMatchRow:n(d(),!1),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1023,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]]),backToLookCTA:n(u(),"Back To Look"),seeMoreOptionsCTA:n(u(),"See More Options"),viewDetailsCTA:n(u(),"Shop The Look")}),ge(me([["item_number"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),jh={defaults:D(S({...ta.entries})),parse:t=>P(ta,j(t))},ra=v(S({...ie.entries,apparelOnly:n(d(),!1),maxDepartments:n(h(),5),cardAspectRatio:n(h(),1.5),carouselAdvancementRate:ne,gutterWidth:n(h(),12),imageOnHover:n(d(),!1),isGallery:n(d(),!1),nextOutfitPeek:n(h(),0),showAllDepartments:n(d(),!1),showMobileArrows:n(d(),!0),sizeDropdown:n(d(),!1),sessionId:n(u(),""),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:3}],[640,{columns:4}],[1023,{columns:4}],[1280,{columns:5}],[1536,{columns:5}]]),tablistHeading:n(u(),"Style it with"),tablistHeadingLevel:n(ve,"h2")}),y(B),y(F)),Fh={defaults:D(S({...ra.entries})),parse:t=>P(ra,j(t))},sa=v(ie,y(F)),na={defaults:D(S({...sa.entries})),parse:t=>P(sa,j(t))},ia=v(S({...ie.entries,brand:n(p(u()),void 0),browsed:le,category:n(p(u()),void 0),department:n(p(u()),void 0),from_accounts:n(p(u()),void 0),gender:n(p(u()),void 0),item_number:n(p(u()),void 0),maxItems:n(p(h()),20),maxPrice:n(p(h()),void 0),maxResults:n(h(),20),minPrice:n(p(h()),void 0),minResults:n(h(),3),purchased:le,style:n(p(u()),void 0),tags:n(p(u()),void 0),cardAspectRatio:n(h(),1.6),carouselAdvancementRate:ne,gutterWidth:n(h(),16),imageOnHover:n(d(),!1),layout:n(O(["gallery","horizontal","vertical"]),"horizontal"),nextOutfitPeek:n(h(),.3),previousOutfitPeek:n(h(),0),showCarouselDots:n(d(),!1),showMobileArrows:n(d(),!1),sizeDropdown:n(d(),!1),sessionId:n(u(),""),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:2}],[425,{columns:3}],[640,{columns:4}],[1023,{columns:5}],[1280,{columns:6}],[1536,{columns:7}]])}),y(B),y(F)),Uh={defaults:D(S({...ia.entries})),parse:t=>P(ia,j(t))},aa=v(S({...ie.entries,minResults:n(h(),3),carouselAdvancementRate:ne,dynamicOutfitBackground:n(d(),!1),gutterWidth:n(h(),16),horizontalProductList:n(d(),!1),mixAndMatchRow:n(d(),!1),nextOutfitPeek:n(h(),0),previousOutfitPeek:n(h(),0),showMobileArrows:n(d(),!0),sizeDropdown:n(d(),!1),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1023,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]]),seeMoreOptionsCTA:n(u(),"See More Options"),viewDetailsCTA:n(u(),"View Details")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),Lh={defaults:D(S({...aa.entries})),parse:t=>P(aa,j(t))},oa=v(S({...ie.entries,ids:n(u(),""),minResults:n(h(),3),page:v(n(u(),()=>ca(globalThis?.location?.href??"")),y(ca)),carouselAdvancementRate:ne,gutterWidth:n(h(),16),nextOutfitPeek:n(h(),0),previousOutfitPeek:n(h(),0),browsed:le,purchased:le,sessionId:n(u(),""),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1024,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]]),viewItemsCTAText:n(u(),"View Details")}),y(B),y(F)),$h={defaults:D(S({...oa.entries})),parse:t=>P(oa,j(t))};function ca(t){return wr(/^http(s?):\/\//i,"",t)}const ua=v(S({...ie.entries,minResults:n(h(),3),cardAspectRatio:n(h(),1.4),collageAnchorItem:n(d(),!1),editorialAnchorItem:n(d(),!1),editorialFirstAnchorItem:n(d(),!1),gapWidth:n(h(),5),gridPeek:n(d(),!1),gridStarter:n(d(),!1),gutterWidthMobile:n(h(),14),hideAnchorItemCard:n(d(),!1),itemInfoAnimation:n(O(["fade","slide"]),"slide"),itemInfoAnimationDuration:n(h(),200),itemInfoImage:n(d(),!1),itemInfoStatic:n(d(),!1),maxGridSize:n(h(),7),mobileItemsCarousel:n(d(),!1),nextOutfitPeekMobile:n(h(),.05),nonEditorialImages:n(d(),!1),originalItemOrder:n(d(),!1),shopTheModelEditorial:n(d(),!1),showMobileArrows:n(d(),!1),showPlusIcon:n(d(),!1),smallItemScaling:n(d(),!1),squareAspectRatio:n(d(),!1),typeScaledGrid:n(d(),!1),verticalAnchorAspectRatio:n(h(),1.4),verticalAnchorLayout:n(d(),!1),verticalLayout:n(d(),!1),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1023,{columns:3}],[1190,{columns:3}],[1536,{columns:4}]]),counterHeading:n(u(),"Look"),counterHeadingLevel:n(ve,"h4"),itemLinkCTA:n(u(),"Shop"),mobileItemsCarouselCTA:n(u(),"Back to Model"),swapCTA:n(u(),"Swap")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),qh={defaults:D(S({...ua.entries})),parse:t=>P(ua,j(t))},la=v(S({...ie.entries,minResults:n(h(),3),cardAspectRatio:n(h(),1.25),carouselAdvancementRate:ne,gutterWidth:n(h(),16),largeItemImage:n(d(),!1),mixAndMatchRow:n(d(),!1),mobileItemsCarousel:n(d(),!1),nextOutfitPeek:n(h(),.1),previousOutfitPeek:n(h(),0),productListRevealType:n($(Oe),Oe.slideout),showMobileArrows:n(d(),!1),sizeDropdown:n(d(),!1),smallItemImage:n(d(),!1),staticItemInfo:n(d(),!1),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[480,{columns:2}],[1023,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]]),modalHeading:n(u(),"Shop The Look"),seeMoreOptionsCTA:n(u(),"Alternative Options"),viewDetailsCTA:n(u(),"Shop The Look")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),Bh={defaults:D(S({...la.entries})),parse:t=>P(la,j(t))},ha=v(S({...ie.entries,minResults:n(h(),1),gutterWidth:n(h(),16),imageAspectRatio:n(h(),1.2),imageOnHover:n(d(),!1),listLayout:n(O(["vertical","horizontal","mobile-gallery","vertical-anchor"]),"horizontal"),mobileVerticalList:n(d(),!1),mobileVisibleCardCount:n(h(),2.5),originalItemOrder:n(d(),!1),shopTheModelAI:n(d(),!1),showPlusIcon:n(d(),!1),sizeDropdown:n(d(),!1),counterDeterminator:n(u(),"of"),counterHeading:n(u(),"look"),counterHeadingLevel:n(ve,"h4"),itemLinkCTA:n(u(),""),modalHeading:n(u(),"Similar Items"),modalHeadingLevel:n(ve,"h4"),similarItemsButton:n(u(),"Similar Items")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),Hh={defaults:D(S({...ha.entries})),parse:t=>P(ha,j(t))},da=v(S({...ie.entries,minResults:n(h(),3),hideDoubleZeroCents:n(d(),!0),roundingStyle:n(p($(Ze)),Ze.ceiling),salesPriceStyle:n($(Z),Z.salesPriceOnly),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1024,{columns:3}]]),itemDetailsModalHeader:n(u(),"Complete the look"),viewDetailsCTA:n(u(),"View entire look")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),Nh={defaults:D(S({...da.entries})),parse:t=>P(da,j(t))},ma=v(S({...ie.entries,outfit_id:v(h(),Or(1)),salesPriceStyle:n($(Z),Z.salesPriceOnly)}),y(B),y(F)),Wh={defaults:D(S({...ma.entries})),parse:t=>P(ma,j(t))},fa=v(S({...ie.entries,allowOutOfStock:n(d(),!0),maxPerItem:n(h(),6),minPerItem:n(h(),3),reMatch:n(d(),!1),retryCount:v(n(h(),0),y(an(0,10))),carouselAdvancementRate:ne,hotspotsOverlay:n(d(),!1),parentSelector:p(u()),shopButtonMargin:n(h(),5),shopButtonExpanded:n(d(),!1),shopButtonPosition:n(Zt,"bottom-right"),skipModeration:n(d(),!1),responsive:n(I(L([h(),S({height:h()})])),[[0,{height:44}],[200,{height:44}],[300,{height:44}],[400,{height:44}]]),anchorItemHeading:n(u(),"Currently Viewing"),anchorItemHeadingLevel:n(ve,"h4"),anchorItemLabel:n(u(),"This Item"),itemsHeading:n(u(),"Similar Items"),itemsHeadingLevel:n(ve,"h4"),modalHeading:n(u(),"Shop The Look"),shopButtonText:n(u(),"Shop The Look"),viewDetailsCTA:n(u(),"View Details")}),y(F)),zh={defaults:D(S({...fa.entries})),parse:t=>P(fa,j(t))},pa=v(S({...ie.entries,item_number:u(),maxResults:n(h(),5),minResults:n(h(),2)}),y(t=>{const e=Math.max(2,t.minResults),r=Math.max(e,t.maxResults);return{...t,maxResults:r,minResults:e}}),y(F)),Gh={defaults:D(S({...pa.entries})),parse:t=>P(pa,j(t))},ga=v(S({...ie.entries,minResults:n(h(),1),cardAspectRatio:n(h(),1.55),carouselAdvancementRate:ne,gutterWidth:n(h(),16),imageOnHover:n(d(),!1),nextOutfitPeek:n(h(),.2),showCarouselDots:n(d(),!1),showMobileArrows:n(d(),!1),sizeDropdown:n(d(),!1),salesPriceStyle:n($(Z),Z.salesPriceOnly),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:2}],[640,{columns:3}],[864,{columns:4}],[1199,{columns:5}]])}),y(B),y(F)),Vh={defaults:D(S({...ga.entries})),parse:t=>P(ga,j(t))},ya=v(S({...ie.entries,maxBrowsedItems:n(h(),10),maxPurchasedItems:n(h(),10),personalizedResults:n(d(),!0),browsed:le,purchased:le,carouselAdvancementRate:v(n(h(),1),y(t=>Math.max(1,t))),defaultTab:n(O(["purchased","browsed"]),"purchased"),sessionId:n(u(),""),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1024,{columns:2}],[1280,{columns:2}]]),fullPageLinkText:n(u(),""),fullPageLinkUrl:n(u(),""),shopThisLookCTA:n(u(),"Shop This Look")}),y(F)),Kh={defaults:D(S({...ya.entries})),parse:t=>P(ya,j(t))},va=v(S({...ie.entries,minResults:n(h(),1),backgroundColor:n(O(["consistent","expressive"]),"expressive"),backgroundPattern:n(p(O(["grainy","leaves","scribbles","waves","plaid"])),void 0),badgeType:n(p(O(["mood","season","interior","trend"])),void 0),cardAspectRatio:n(h(),1.4),cardDesign:n(O(["clean","eclectic"]),"eclectic"),carouselAdvancementRate:ne,clientOriginalImages:n(d(),!1),editorialAnchorItem:n(d(),!1),gutterWidth:n(h(),16),hideAnchorItem:n(d(),!1),itemOrder:n(O(["default","random"]),"default"),nextOutfitPeek:n(h(),.1),productType:n(O(["apparel","home"]),"apparel"),shopTheModelEditorial:n(d(),!1),showCarouselDots:n(d(),!1),showMobileArrows:n(d(),!1),hideDoubleZeroCents:n(d(),!0),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1023,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]])}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),Qh={defaults:D(S({...va.entries})),parse:t=>P(va,j(t))};function nr(t,e){return P(Jh(e),t)}function Jh(t){const e=Xh(t);return S({browsed:v(e,y(r=>ba("browsed",r,t)),Rr(Zr.byBrowsedAtDescending),y(r=>r.slice(0,t.maxBrowsedItems))),purchased:v(e,y(r=>ba("purchased",r,t)),Rr(Zr.byPurchasedAtDescending),y(r=>r.slice(0,t.maxPurchasedItems)))})}function Xh(t){const e=v(I(Zh(t)),Ne(r=>Zr.isValidAnchorItem(r)));return v(S({additional:e,requested:e}),y(({additional:r,requested:s})=>s.concat(r)))}function Zh(t){return v(Q({base_image_url:u(),browsed_at:p(u()),name:u(),bundles:I(Yh(t)),remote_id:u(),purchased_at:p(u())}),y(e=>{const{bundles:r,...s}=e;return{...s,outfits:e.bundles}}))}function Yh(t){const{account_id:e,cover_image_url:r,id:s,image_url:i}=sr(t).entries;return Q({account_id:e,cover_image_url:r,id:s,image_url:i,account_username:u(),base_image_url:u(),items:ed(t),large_image_url:u(),lookbook_image_url:u(),primary_remote_id:u(),primary_stylitics_item_id:h(),relative_boost:p(u()),similar_item_remote_id:C(u()),transparent_image_url:u(),username:u()})}function ed(t){return v(I(v(td,y(e=>({...e,...rt(e,t),collage_dimensions:e["collage-dimensions"],__type:"normalized-item"})))),pe((e,r)=>({...e,index:r})))}function ba(t,e,r){const s=yt(Le("remote_id"),r.browsedItems),i=yt(Le("remote_id"),r.purchasedItems),a=yt(Le("remote_id"),e.flatMap(o=>o.outfits.flatMap(c=>c.items.map(l=>({...l,isSimilarItem:!!(l.remote_id&&c.similar_item_remote_id)&&l.remote_id===c.similar_item_remote_id})))));return e.map(o=>{const c=o.browsed_at?Number(new Date(o.browsed_at)):s[o.remote_id]?.browsed_at,l=o.purchased_at?Number(new Date(o.purchased_at)):i[o.remote_id]?.purchased_at;return{...o,...a[o.remote_id],itemType:t,browsed_at:c,purchased_at:l,outfits:o.outfits.map((m,f)=>{const g=m.items.map(_=>({..._,isSimilarItem:a[_.remote_id].isSimilarItem})),b=g.findIndex(_=>_.remote_id===o.remote_id||_.isSimilarItem),w=g[b];return{...m,anchorItemType:t,anchorItemId:w?.item_id??-1,items:w?.stocked?g.slice(0,b).concat(g.slice(b+1)).concat([g[b]]):g,position:f+1}})}})}const td=We(tt,["account_username","affiliate_link","base_image_url","buy_url","collage-dimensions","item_id","name","price_localized","price","promotions","remote_id","sale_price_localized","sale_price","stocked"]);function ts(t,e){return P(rs(e),t)}function rs(t){return J(u(),v(I(yh(t)),pe((e,r)=>({...e,index:r}))))}function ss(t,e){return P(rd(e),t)}function rd(t){return v(S({items:p(v(I(rr(t)),y(e=>lt(e,t)),pe((e,r)=>({...e,index:r}))),[]),outfit:p(v(wu(Xr,["items"]),y(e=>({...e,onModelImage:e["on-model-image"]})))),replacements:p(rs(t),{}),similar_outfits:p(v(I(sr(t)),pe((e,r)=>({...e,position:e.position??r}))),[])}),y(e=>({anchorItem:void 0,outfit:e.outfit?{...e.outfit,items:e.items}:void 0,outfits:e.similar_outfits,replacements:e.replacements})))}function Re(t,e){return P(sd(e),t)}function sd(t){return v(nd(t),y(e=>id(e,t.anchorItemRemoteId)),y(e=>({...e,outfits:ad(e.outfits,t)})))}function nd(t){return S({anchor_item:p(v(rr(t),y(e=>{const{socialProofItemLabel:r,socialProofAction:s,socialProofThreshold:i}=t;return r&&s&&i?Ki(e,{socialProofItemLabel:r,socialProofAction:s,socialProofThreshold:i}):e}))),outfits:v(I(sr(t)),y(e=>lt(e,t)),pe((e,r)=>({...e,position:e.position??r}))),replacements:p(rs(t),{})})}function id(t,e){const{anchor_item:r,...s}=t,i=s;if(q(r))for(const a of t.outfits){const o=a.items.find(c=>c.remote_id===r.remote_id);if(o){i.anchorItem={...r,index:o.index};break}}else if(q(e))for(const a of t.outfits){const o=a.items.find(c=>c.remote_id===e);i.anchorItem=o;break}return i}function ad(t,e){const{socialProofAction:r,socialProofOutfitLabel:s,socialProofThreshold:i=100}=e;return!r||!s?t:t.map(a=>{const o=a.items.reduce((c,l)=>c+=l[r]>=i?l[r]:0,0);return{...a,...o>0&&{social_proof_label:s.replace("%v",o.toString())}}})}function ns(t,e){return P(od(e),t)}function od(t){return S({localization:p(u()),matches:n(cd(t),{}),version:p(u())})}function cd(t){return v(J(u(),S({account_id:h(),feature_groups:n(ud(t),{}),image_url:p(u()),status:p(u())})),y(e=>Object.entries(e)),Ne(([e,r])=>{const s=Object.values(r.feature_groups).length>0;return!s&&t.emitWarnings&&A.warn(`image URL "${e}" does not have feature groups`),s}),y(e=>Object.fromEntries(e)))}function ud(t){return v(J(u(),S({features:n(ld(t),{})})),y(e=>Object.entries(e)),Ne(([,e])=>Object.values(e.features).length>0),y(e=>Object.fromEntries(e)))}function ld(t){return v(J(u(),S({category:u(),coords:v(S({...Jr.entries,z:n(h(),0)})),items:n(v(I(hd(t)),pe((e,r)=>({...e,index:r}))),[]),"pdp-feature":n(d(),!1)})),y(e=>Object.entries(e)),Ne(([,e])=>e.items.length>0),pe(([e,r])=>[e,{...r,featureId:e}]),y(e=>Object.fromEntries(e)))}function hd(t){return v(Q({...We(tt,["account_id","affiliate_link","brand","client_original_image_url","item_id","name","original_image_url","price","promotions","remote_id","sale_price","stocked"]).entries,base_image_url:C(u())}),y(e=>({...e,...rt(e,t),collage_dimensions:e["collage-dimensions"],__type:"normalized-item"})))}function is(t,e){return P(dd(e),t)}function dd(t){const e=n(v(I(rr(t)),y(r=>lt(r,t)),pe((r,s)=>({...r,index:s}))),[]);return v(S({account_id:h(),item_sets:n(L([e,e]),[[],[]])}),y(r=>({accountId:r.account_id,currentBottomItem:r.item_sets[1][0],currentTopItem:r.item_sets[0][0],itemGroups:r.item_sets})))}function Sa(t,e){return P(md(e),t)}function md(t){return S({htmlSelector:p(u()),modules:I(fd(t)),screenSize:O(["desktop","mobile","tablet"]),stylesheetUrl:u()})}function fd(t){return Zn("type",[S({...te.entries,type:N("anchor-items-gallery"),params:v(E(),y(Dh.parse)),data:v(E(),y(e=>nr(e,t)))}),S({...te.entries,type:N("beauty"),params:v(E(),y(Mh.parse)),data:v(E(),y(e=>Re(e,t)))}),S({...te.entries,type:N("classic"),params:v(E(),y(jh.parse)),data:v(E(),y(e=>Re(e,t)))}),S({...te.entries,type:N("control"),params:v(E(),y(na.parse)),data:n(p(Qt()),void 0)}),S({...te.entries,type:N("complementary-items"),params:v(E(),y(Fh.parse)),data:v(E(),y(e=>Re(e,t)))}),S({...te.entries,type:N("cross-sell"),params:v(E(),y(Uh.parse)),data:v(E(),y(e=>Yr(e,t)))}),S({...te.entries,type:N("dimension-collage"),params:v(E(),y(Lh.parse)),data:v(E(),y(e=>Re(e,t)))}),S({...te.entries,type:N("dynamic-galleries"),params:v(E(),y($h.parse)),data:v(E(),y(e=>es(e,t)))}),S({...te.entries,type:N("grid"),params:v(E(),y(qh.parse)),data:v(E(),y(e=>Re(e,t)))}),S({...te.entries,type:N("hotspots"),params:v(E(),y(Bh.parse)),data:v(E(),y(e=>Re(e,t)))}),S({...te.entries,type:N("list"),params:v(E(),y(Hh.parse)),data:v(E(),y(e=>Re(e,t)))}),S({...te.entries,type:N("moodboard"),params:v(E(),y(na.parse)),data:n(p(Qt()),void 0)}),S({...te.entries,type:N("nike"),params:v(E(),y(Nh.parse)),data:v(E(),y(e=>Re(e,t)))}),S({...te.entries,type:N("shop-similar"),params:v(E(),y(zh.parse)),data:v(E(),y(e=>ns(e,t)))}),S({...te.entries,type:N("shop-the-outfit"),params:v(E(),y(Wh.parse)),data:v(E(),y(e=>ss(e,t)))}),S({...te.entries,type:N("shop-the-set"),params:v(E(),y(Gh.parse)),data:v(E(),y(e=>is(e,t)))}),S({...te.entries,type:N("similar-styles"),params:v(E(),y(Vh.parse)),data:v(E(),y(e=>ts(e,t)))}),S({...te.entries,type:N("styled-for-you"),params:v(E(),y(Kh.parse)),data:v(E(),y(e=>nr(e,t)))}),S({...te.entries,type:N("vibe"),params:v(E(),y(Qh.parse)),data:v(E(),y(e=>Re(e,t)))})])}const te=S({configId:u(),configProvenance:J(u(),E()),htmlSelector:p(u()),moduleIndex:n(h(),0),on:p(J(u(),Kt()),{}),override:p(J(u(),Kt()),{}),target:p(Qn($i)),testPresence:p(Ye),username:u()});function wa(t,e){return P(pd(e),t)}function pd(t){return v(S({"trending-bundles":v(I(sr(t)),y(e=>lt(e,t)),pe((e,r)=>({...e,position:e.position??r})))}),y(e=>({anchorItem:void 0,outfits:e["trending-bundles"],replacements:{}})))}class Et{constructor(e=new Map){this.callbacks=e}callbacks;get=(e,r)=>{const s=this.buildKeyFor(e,r);return this.callbacks.get(s)};set=(e,r,s)=>{const i=this.buildKeyFor(e,r);return this.callbacks.set(i,s),this};delete=(e,r)=>{const s=this.buildKeyFor(e,r);return this.callbacks.delete(s),this};execute=(e,r,...s)=>(this.get(e,r)?.(...s),this);entries=()=>Array.from(this.entries());keys=()=>Array.from(this.callbacks.keys());values=()=>Array.from(this.values());get size(){return this.callbacks.size}buildKeyFor(e,r){return _a(e,r).replace("bundle","outfit")}}function _a(t,e){return`${t}.${e}`}var Y=(t=>(t.addAllToCart="add-all-to-cart",t.addToCart="add-to-cart",t.carousel="carousel",t.click="click",t.collapseSeeMoreOptions="collapse-see-more-options",t.create="create",t.expandSeeMoreOptions="expand-see-more-options",t.hide="hide",t.hover="hover",t.hoverEnd="hover-end",t.hoverStart="hover-start",t.interaction="interaction",t.load="load",t.mount="mount",t.suppress="suppress",t.swap="swap",t.view="view",t.visit="visit",t.zoom="zoom",t))(Y||{}),re=(t=>(t.addToCartButton="add-to-cart-button",t.bundle="bundle",t.bundles="bundles",t.collection="collection",t.data="data",t.fullPageLink="full-page-link",t.heroItem="hero-item",t.hotspot="hotspot",t.item="item",t.jumplink="jumplink",t.label="label",t.mnmCollapse="mnm-collapse",t.mnmExpand="mnm-expand",t.outfit="outfit",t.outfits="outfits",t.page="page",t.replacement="replacement",t.replacements="replacements",t.script="script",t.set="set",t.shop="shop",t.sizeButton="size-button",t.tab="tab",t.target="target",t.theme="theme",t.thumbnail="thumbnail",t.widget="widget",t))(re||{});const gd=$(Y);function yd(t){const{success:e}=Se(gd,t);return e}const vd=$(re);function bd(t){const{success:e}=Se(vd,t);return e}function Sd(t){return mn(_r)(e=>{const r=e instanceof Error?e:new Error(`Stylitics: caught unknown exception: ${String(e)}`);t.error(r)})}Sd(globalThis.console);var Ia=(t=>(t.gallery="gallery",t.insights="insights",t.module="module",t.pdp="pdp",t.widget="widget",t))(Ia||{});class wd{cleanupStack=mi.new();engagementQueue;engagementCache;_env;timeoutId;#e=()=>{};constructor(e={}){this._env=e.env??G.production,this.engagementQueue=e.engagementQueue??[],this.engagementCache=e.engagementCache??new Set,this.#e=e.onError??this.#e,this.cleanupStack.push(()=>{this.flushEngagements(),this.#i(),this.removeEventListeners()})}get env(){return this._env}set env(e){this._env=e}get endpoint(){return Ku(this.env)}cleanup=()=>{this.cleanupStack.runAll()};queueEngagement=e=>{const r=this.#t(e);if(r)return r;const s=P(n(v(u(),y(Number)),1e3),new URL(window.location.href).searchParams.get("stylitics-event-delay"));this.timeoutId=window.setTimeout(this.flushEngagements,s)};sendEngagement=e=>{const r=this.#t(e);if(r)return r;this.flushEngagements()};flushEngagements=()=>{if(this.engagementQueue.length===0)return this;try{P(v(I(E()),y(vt(this.#r)),Dr({},"Received unserializable engagement value"),y(e=>Pa(this.endpoint,{requestInit:{body:e},onError:this.#e}))),this.engagementQueue)}catch(e){A.error(ye(e))}return this};addEventListeners=()=>this.#s().#o();removeEventListeners=()=>this.#n().#a();isDuplicateEvent=e=>{const r=typeof e=="object"?ka(e):e;return this.engagementCache.has(r)&&kd(r)};#t=e=>{if(!_d(e))return new Error("Stylitics: Invalid Action or Subject");const r=ka(e),s=hc(["__pkid"],e);this.isDuplicateEvent(r)||(this.engagementQueue.push(s),this.engagementCache.add(r),this.#i())};#r=()=>(this.engagementQueue.length=0,this);#i=()=>{this.timeoutId!=null&&window.clearTimeout(this.timeoutId)};#s=()=>(window.addEventListener("beforeunload",this.flushEngagements),this.cleanupStack.push(this.#n),this);#n=()=>(window.removeEventListener("beforeunload",this.flushEngagements),this);#o=()=>(window.document.addEventListener("visibilitychange",this.#c),this.cleanupStack.push(this.#a),this);#a=()=>(window.document.removeEventListener("visibilitychange",this.#c),this);#c=()=>(window.document.visibilityState==="hidden"&&this.flushEngagements(),this)}function _d(t){return yd(t.action)&&bd(t.subject)}function Id(t,e,r=void 0){const s=_a(t,e);return r?`${s}.${r}`:s}function ka(t){return Id(t.action,t.subject,t.__pkid)}function kd(t){return!Pd.some(e=>t.includes(e))}const Pd=["add-to-cart","carousel","click","collapse-see-more-options","expand-see-more-options","hover-end","hover-start","interaction"];class as{queryClient=new ou({defaultOptions:{queries:{staleTime:1/0}}});constructor({env:e,origin:r}={}){this.env=e||Td(),this._origin=r}env;_origin;response=void 0;get origin(){return this._origin||Ed(this.env)}async fetchComplementary({fetchQueryOptions:e={},useFixture:r,searchParams:s,parseOptions:i,...a}){return this.queryClient.fetchQuery({queryKey:["complementary",s,r],queryFn:async()=>{if(r)return Promise.resolve(r).then(c=>typeof c=="function"?c():De()).then(c=>Qi(c,i)).then(Ie).catch(c=>xe(_e(c),"error"));const o=await he({url:ae({href:this.origin,path:"/api/items/complementary",searchParams:s}),validate:async c=>Qi(await c.json(),i),...a});return o.error&&i.emitWarnings&&A.warn(o.error.message),this.response=o},...e})}async fetchDynamicGalleries({fetchQueryOptions:e={},useFixture:r,searchParams:s,parseOptions:i,...a}){const o=Fe(s);return this.queryClient.fetchQuery({queryKey:["dynamic-galleries",o,r],queryFn:async()=>{if(r)return Promise.resolve(r).then(l=>typeof l=="function"?l():De()).then(l=>es(l,i)).then(Ie).catch(l=>xe(_e(l),"error"));const c=await he({url:ae({href:this.origin,path:"/api/dynamic-galleries",searchParams:o}),validate:async l=>es(await l.json(),i),...a});return c.error&&i.emitWarnings&&A.warn(c.error.message),this.response=c},...e})}async fetchExperiences({fetchQueryOptions:e={},sessionId:r,useFixture:s,searchParams:i,...a}){const o=Fe(i);return this.fetch({queryKey:["experiences",r,o,s],queryFn:()=>{const c=ae({href:this.origin,path:`/api/experiences/${r}`,searchParams:o});return he({url:c,...a})},...e},s)}async fetchOrchestrator({fetchQueryOptions:e={},useFixture:r,searchParams:s,parseOptions:i,...a}){return this.queryClient.fetchQuery({queryKey:["outfits",s,r],queryFn:async()=>{if(r)return Promise.resolve(r).then(c=>typeof c=="function"?c():De()).then(c=>Sa(c,i)).then(Ie).catch(c=>xe(_e(c),"error"));const o=await he({url:ae({href:this.origin,path:"/api/orchestrator",searchParams:s}),validate:async c=>Sa(await c.json(),i),...a});return o.error&&i.emitWarnings&&A.warn(o.error.message),this.response=o},...e})}async fetchOutfitLandingPage({fetchQueryOptions:e={},outfitId:r,useFixture:s,searchParams:i,parseOptions:a,...o}){const c=Fe(i);return this.queryClient.fetchQuery({queryKey:["outfit-landing-page",r,c,s],queryFn:async()=>{if(s)return Promise.resolve(s).then(m=>typeof m=="function"?m():De()).then(m=>ss(m,a)).then(Ie).catch(m=>xe(_e(m),"error"));const l=await he({url:ae({href:this.origin,path:`/api/outfit-landing-page/${r}`,searchParams:c}),validate:async m=>ss(await m.json(),a),...o});return l.error&&a.emitWarnings&&A.warn(l.error.message),this.response=l},...e})}async fetchOutfits({fetchQueryOptions:e={},useFixture:r,searchParams:s,parseOptions:i,...a}){const o=Fe(s);return this.queryClient.fetchQuery({queryKey:["outfits",o,r],queryFn:async()=>{if(r)return Promise.resolve(r).then(l=>typeof l=="function"?l():De()).then(l=>Re(l,i)).then(Ie).catch(l=>xe(_e(l),"error"));const c=await he({url:ae({href:this.origin,path:"/api/outfits",searchParams:o}),validate:async l=>Re(await l.json(),i),...a});return c.error&&i.emitWarnings&&A.warn(c.error.message),this.response=c},...e})}fetchFromDataSource(e,r){switch(e){case"trending-bundles":return this.fetchTrendingBundles(r);case"outfit-landing-page":{const{outfitId:s,...i}=r;return s!==void 0?this.fetchOutfitLandingPage({...i,outfitId:s}):this.fetchOutfits(r)}default:return this.fetchOutfits(r)}}async fetchReplacements({fetchQueryOptions:e={},itemIds:r,itemNumbers:s,useFixture:i,searchParams:a,parseOptions:o,...c}){const l={...P(ir,a),ids:r,item_number:s};function m(f){o.emitWarnings&&A.warn(f)}return this.queryClient.fetchQuery({queryKey:["replacements",l,i],queryFn:async()=>{if(i)return Promise.resolve(i).then(g=>typeof g=="function"?g():De()).then(g=>ts(g,o)).then(Ie).catch(g=>xe(_e(g),"error"));const f=await he({url:ae({href:this.origin,path:"/api/items/replacements",searchParams:l}),validate:async g=>ts(await g.json(),o),...c});return f.error?m(f.error.message):Object.keys(f.data).length===0&&m("No replacements available"),this.response=f},...e})}async fetchShopTheImage({fetchQueryOptions:e={},useFixture:r,searchParams:s,parseOptions:i,...a}){return this.queryClient.fetchQuery({queryKey:["shop-the-image",s,r],queryFn:async()=>{if(r)return Promise.resolve(r).then(c=>typeof c=="function"?c():De()).then(c=>ns(c,i)).then(Ie).catch(c=>xe(_e(c),"error"));const o=await he({url:ae({href:this.origin,path:"/api/shop-the-image",searchParams:s}),validate:async c=>ns(await c.json(),i),...a});return o.error&&i.emitWarnings&&A.warn(o.error.message),this.response=o},...e})}async fetchShopTheSet({fetchQueryOptions:e={},useFixture:r,searchParams:s,parseOptions:i,...a}){const o=Fe(s);return this.queryClient.fetchQuery({queryKey:["shop-the-set",o,r],queryFn:async()=>{if(r)return Promise.resolve(r).then(l=>typeof l=="function"?l():De()).then(l=>is(l,i)).then(Ie).catch(l=>xe(_e(l),"error"));const c=await he({url:ae({href:this.origin,path:"/api/shop-the-set",searchParams:o}),validate:async l=>is(await l.json(),i),...a});return c.error&&i.emitWarnings&&A.warn(c.error.message),this.response=c},...e})}async fetchStyledForYou({fetchQueryOptions:e={},useFixture:r,searchParams:s,parseOptions:i,...a}){const o=Fe(s);return this.queryClient.fetchQuery({queryKey:["styled-for-you",o,r],queryFn:async()=>{if(r)return Promise.resolve(r).then(l=>typeof l=="function"?l():De()).then(l=>nr(l,i)).then(Ie).catch(l=>xe(_e(l),"error"));const c=await he({url:ae({href:this.origin,path:"/api/styled-for-you",searchParams:o}),validate:async l=>nr(await l.json(),i),...a});return c.error&&i.emitWarnings&&A.warn(c.error.message),this.response=c},...e})}async fetchTrendingBundles({fetchQueryOptions:e={},useFixture:r,searchParams:s,parseOptions:i,...a}){const o=Fe(s);return this.queryClient.fetchQuery({queryKey:["trending-bundles",o,r],queryFn:async()=>{if(r)return Promise.resolve(r).then(l=>typeof l=="function"?l():De()).then(l=>wa(l,i)).then(Ie).catch(l=>xe(_e(l),"error"));const c=await he({url:ae({href:this.origin,path:"/api/trending-bundles",searchParams:o}),validate:async l=>wa(await l.json(),i),...a});return c.error&&i.emitWarnings&&A.warn(c.error.message),this.response=c},...e})}async fetchUpsells({fetchQueryOptions:e={},useFixture:r,searchParams:s,parseOptions:i,...a}){const o=Fe(s);return this.queryClient.fetchQuery({queryKey:["upsells",o,r],queryFn:async()=>{if(r)return Promise.resolve(r).then(l=>typeof l=="function"?l():De()).then(l=>Yr(l,i)).then(Ie).catch(l=>xe(_e(l),"error"));const c=await he({url:ae({href:this.origin,path:"/api/upsells",searchParams:o}),validate:async l=>Yr(await l.json(),i),...a});return c.error&&i.emitWarnings&&A.warn(c.error.message),this.response=c},...e})}async fetchOutfitLandingPageLegacy({fetchQueryOptions:e={},outfitId:r,useFixture:s,searchParams:i,...a}){const o=Fe(i);return this.fetch({queryKey:["outfit-landing-page",r,o,s],queryFn:()=>{const c=ae({href:this.origin,path:`/api/outfit-landing-page/${r}`,searchParams:o});return he({url:c,...a})},...e},s)}async fetchOutfitsLegacy({fetchQueryOptions:e={},useFixture:r,searchParams:s,...i}={}){const a=Fe(s);return this.fetch({queryKey:["outfits",a,r],queryFn:()=>{const o=ae({href:this.origin,path:"/api/outfits",searchParams:a});return he({url:o,...i})},...e},r)}async fetchReplacementsLegacy({fetchQueryOptions:e={},itemIds:r,itemNumbers:s,useFixture:i,searchParams:a,...o}){const c={...P(ir,a),ids:r,item_number:s};return this.fetch({queryKey:["replacements",c,i],queryFn:()=>{const l=ae({href:this.origin,path:"/api/items/replacements",searchParams:c});return he({url:l,...o})},...e},i)}async fetchShopTheSetLegacy({fetchQueryOptions:e={},itemIds:r,itemNumbers:s,useFixture:i,searchParams:a,...o}){const c={...P(ir,a),ids:r,item_number:s};return this.fetch({queryKey:["shop-the-set",c,i],queryFn:()=>{const l=ae({href:this.origin,path:"/api/shop-the-set",searchParams:c});return he({url:l,...o})},...e},i)}async fetch(e,r){let s;return s=e.queryFn,this.response=await this.queryClient.fetchQuery({...e,queryFn:s})}}function ae({href:t="http://localhost:5173/",...e}={href:"http://localhost:5173/"}){const r=new URL(t||"http://localhost:5173/");return e.hash&&(r.hash=e.hash),e.host&&(r.host=e.host),e.password&&(r.password=e.password),e.path&&(r.pathname=e.path),e.port&&(r.port=String(e.port)),e.protocol&&(r.protocol=e.protocol),e.searchParams&&(r.search=tl(e.searchParams).toString()),e.username&&(r.username=e.username),r}async function he({url:t,validate:e=Ad,requestInit:r={},timeout:s=5e3}){const i=new URL(t),a=new AbortController,o=setTimeout(()=>a.abort(),s);try{const c=await fetch(i.href,{...r,signal:a.signal}).catch(Od).finally(()=>clearTimeout(o)),{status:l,statusText:m}=c;return c.ok?Ie(await e(c),c):_e(new Error(`Stylitics: Error fetching from ${i.origin}: ${l} - ${m}`),l===504?"timeout":"API-error",c)}catch(c){return _e(c)}}async function Ad(t){return t.json()}function Td(){return G.production!=="production"?G.staging:G.production}function Ed(t){return t!==G.production?Vu:Gu}function Fe(t){return{...P(ir,t),...P(Cd,t)}}const Cd=n(v(J(u(),E()),y(t=>Object.fromEntries(Object.entries(t).filter(([e])=>e.startsWith("exp."))))),{}),ir=v(n(S({"p.b":n(p(ue([u(),I(u())])),void 0),"p.p":n(p(ue([u(),I(u())])),void 0),ab_exceptions:n(p(v(I(S({applies_to:u(),description:u(),id:u(),reason:u(),timestamp:h()})),Wn(1))),void 0),brand:n(p(u()),void 0),category:n(p(u()),void 0),client_user_id:n(p(u()),void 0),department:n(p(u()),void 0),from_accounts:n(p(d()),void 0),gender:n(p(u()),void 0),ids:n(p(u()),void 0),item_number:n(p(u()),void 0),item_number_type:n(p(Di),void 0),locale:n(p(u()),void 0),max:n(p(h()),void 0),max_items:n(p(h()),void 0),max_price:n(p(h()),void 0),min:n(p(h()),void 0),min_price:n(p(h()),void 0),page:n(p(u()),void 0),price_hide_double_zero_cents:n(p(d()),void 0),price_rounding:n(p(u()),void 0),profile:n(p(u()),void 0),return_object:n(p(d()),void 0),session_id:n(p(u()),void 0),style:n(p(u()),void 0),tags:n(p(u()),void 0),total:n(p(h()),void 0),username:n(p(u()),void 0),with_item_coords:n(p(d()),void 0)}),{}),y(t=>Object.fromEntries(Object.entries(t).sort())));function xd({browsedItems:t,experienceConfig:e,purchasedItems:r,sessionId:s}){const i={};for(const a in e)if(a.match(/previous|engagement|label-presence|pz/)){{const o=Ut("remote_id",t);o&&o.length&&Object.assign(i,{"p.b":o,session_id:s})}{const o=Ut("remote_id",r);o&&o.length&&Object.assign(i,{"p.p":o})}break}return i}function Od(t){const e=ye(t);if(e.name==="AbortError")return new Response(null,{status:504,statusText:e.message});throw t}function Ie(t,e){return{data:t,error:null,errorReason:null,httpResponse:e}}function _e(t,e,r){const s=ye(t),i=/invalid/i.test(s.message);return{data:null,error:s,errorReason:e??(i?"validation error":"unknown"),httpResponse:r}}function Pa(t,e){if(!window.navigator.sendBeacon(t,e.requestInit.body)){const r="Failed to send data via sendBeacon. Trying fetch.";A.warn(r),e.onError?.(ye(r)),window.fetch(t,fe({method:"POST",headers:{"Content-Type":"application/json"}},e.requestInit)).then(s=>{if(!s.ok){const i=ye(`Fetch fallback was unsuccessful: ${s.status} - ${s.statusText}`);e.onError?.(i),A.error(i)}}).catch(s=>{const i=ye(s);i.message=`Error while sending via fetch fallback. Cause: ${i.message}`,e.onError?.(i),A.error(i)})}}async function De(t){throw new Error("Stylitics: loading fixture in production is not supported.")}Object.values({floor:{name:"floor",departments:["bath mats","indoor rugs","indoor/outdoor rugs","kitchen rugs & mats","outdoor rugs"],priority:0},seating:{name:"seating",departments:["desk chairs","indoor benches","indoor dining seating","indoor lounge chairs","indoor sofas & sectionals","indoor/outdoor dining seating","indoor/outdoor lounge chairs","indoor/outdoor ottomans & stools","indoor/outdoor sofas & sectionals","living room sets","nursery seating","beds","nursery cribs"],priority:1},surface:{name:"surface",departments:["console tables & sideboards","indoor accent tables","indoor coffee tables","indoor dining tables","desks","nightstands","indoor/outdoor accent tables","indoor/outdoor coffee tables","indoor/outdoor dining tables","tv stands & media consoles","outdoor kitchen & bar furniture"],priority:2},storage:{name:"storage",departments:["bathroom furniture","entryway storage accessories","entryway storage furniture","home storage accessories","home storage furniture","nursery furniture","recycling & trash"],priority:3},lighting:{name:"lighting",departments:["indoor lighting","indoor/outdoor lighting","outdoor lighting","lighting accessories"],priority:4},wall:{name:"wall",departments:["decorative mirrors","wall organization","wall treatments","window treatments","mailboxes, house numbers, & door knockers"],priority:5},soft:{name:"soft",departments:["bathroom linens","bedding","indoor furniture cushions","indoor pillows","throw blankets","nursery bedding","outdoor furniture cushions"],priority:6},kitchen:{name:"kitchen",departments:["beverage & food items","coffee & tea","indoor dinnerware","indoor drinkware","kitchen accessories","kitchen electrics","kitchen tools & prep","ovenware & bakeware","pots & pans","servingware","utensils","wine & cocktails"],priority:7},decor:{name:"decor",departments:["botanicals","entertainment","fitness","gear","holiday","home cleaning","home electrics","indoor home decor","indoor/outdoor decor","office accessories","outdoor accessories","outdoor fire pits & heaters","outdoor recreation","pets","rug & fabric swatches","tabletop decor","travel","wellness"],priority:8}}).reduce((t,e)=>(e.departments.forEach(r=>{t[r]=e}),t),{});const Rd=["face wash","face peel","face exfoliator","toner","essence","skin patch","face serum","face treatment","face gel","face oil","sleep mask","eye mask","eye serum","face moisturizer","day cream","night cream","neck cream","eye cream","sunscreen"],Dd=["shampoo","colored hair shampoo","conditioner","colored hair conditioner","hair mask","colored hair mask","hair treatment","detangler spray","leave-in conditioner","hair oil","hair serum","heat protectant","hair cream","hair curl cream","hair styling cream","hair mousse","hair gel","hair texture spray","hair mist","humidity spray","hairspray","dry shampoo","hair comb","hair brush","hair dryer","blow out brush","hair rollers","hair clips","flat iron","curling iron"],Md=["primer","foundation","cream foundation","liquid foundation","powder foundation","face powder","under eye concealer","concealer","spot concealer","color corrector","tinted moisturizer","bb cream","cc cream","blush","cream blush","powder blush","bronzer","contour palette","contour stick","highlighter","translucent powder","eyeshadow primer","eyebrow primer","liquid eyeliner","pencil eyeliner","eyebrow gel","eyebrow pencil","brow powder","pencil eyeshadow","liquid eyeshadow","eyeshadow stick","powder eyeshadow","eyeshadow palette","eyelash curler","false eyelashes","mascara primer","mascara","lip liner","lipstick","lip crayon","lip gloss & lipstick set","lip gloss","lip balm","lip oil","lip treatment","lip palette","setting spray"],jd=["face wash","hand wash","soap","body wash","shower gel","body scrub","body exfoliator","bath oil","bath salts","shaving cream","after shave cream","after shave gel","beard oil","beard balm","body oil","body lotion","deodorant","face mask","face moisturizer","hand cream","hair cream","hair oil","hair mist","body spray","cologne","perfume"],Fd=["nail polish remover","cuticle exfoliator","nail scrub","cuticle pusher","cuticle clipper","nail scissors","nail clipper","nail buffer","nail file","nail tool set","base coat","false nails","nail tinted moisturizer","nail veil","nail polish","nail polish set","nail lacquer","nail embellishment","nail pen","top coat","quick dry drops","nail treatment","cuticle oil"];function Ct(t){return t.reduce((e,r,s)=>e.set(r,s),new Map)}const Aa=Ct(Dd),Ta=Ct(jd),Ud=Ct(Md),Ea=Ct(Fd),Ld=Ct(Rd),Ca=new Map([["fragrance",Ta],["hair",Aa],["haircare",Aa],["hygiene",Ta],["makeup",Ud],["nail",Ea],["nails",Ea],["skincare",Ld]]);function $d(t){function e(s){return s==null?String(s):Array.isArray(s)?s.filter(Pu).map(e).join(","):String(s)}return Object.entries(xa(t)).map(([s,i])=>`${s}=${e(i)}`).join("&")}function xa(t,e=""){return Object.keys(t).reduce((r,s)=>{const i=t[s];if(i===null)return r;const a=e?`${e}.${s}`:s;if(i instanceof Set){const o=[...i];r[a]=o}else typeof i=="object"&&!Array.isArray(i)?Object.assign(r,xa(i,a)):r[a]=i;return r},{})}gc("transform","propertyName");const qd="https://web-assets.stylitics.com/";function Bd(){return"style.css"}function Hd(){return qd}function Nd(t){const{host:e=Hd(),path:r=Bd(),urlArgs:s}=t;return new URL(`${e}${r}?${$d(ju(i=>i===void 0,s))}`)}class os{_id;cookieStore;localStore;constructor(e={}){this.cookieStore=e.cookieStore??se.new({enableStorage:!0}),this.localStore=e.localStore??K.new({enableStorage:!0}),this._id=e.id??this.findOrReplaceId()}get id(){return this._id}syncStoredSessionIds(){return this.cookieSessionId=this.id,this.localSessionId=this.id,this}set enableCookieStorage(e){this.cookieStore.enableStorage=e,this.syncStoredSessionIds()}set id(e){this._id=e,this.cookieSessionId=e,this.localSessionId=e}get cookieSessionId(){return this.cookieStore.getSessionId()}set cookieSessionId(e){this.cookieStore.setSessionId(e,{expires:1e3})}get localSessionId(){return this.localStore.getSessionId()}set localSessionId(e){this.localStore.setSessionId(e)}findOrReplaceId(){return this.id=this.findOrCreateSessionId()}findOrCreateSessionId(){return this.localSessionId||this.cookieSessionId||nt()}}function Wd(t,e=1){return parseInt(t.substring(0,8),16)%100{if(typeof r=="string"&&r.includes("web-assets.stylitics.com")&&window.location.href.startsWith("http")){const i=ye(e);return i.message=s,this.error(i)}};#o(e){return this.#n.#e.push({error:e,meta:this.metadata}),this.#c(),this.#n.#r=window.setTimeout(this.#u,1e3),this}#a(e){return this.#n.#t.push({data:e,meta:this.metadata}),this.#c(),this.#n.#r=window.setTimeout(this.#u,1e3),this}#c=()=>{const e=this.#n.#r;return e&&window.clearTimeout(e),this.#n.#r=void 0,this};#u=()=>{this.#l(),this.#h()};#l(){if(this.#n.#e.length===0)return;const e=this.#n.#e;return this.#n.#e=[],this.#d("ERROR",e)}#h(){if(this.#n.#t.length===0)return;const e=this.#n.#t;return this.#n.#t=[],this.#d("INFO",e)}#d(e,r){if(this.enableLogging)try{P(v(E(),Dr({},"Received unserializable engagement value"),y(s=>Pa(this.#f(e),{requestInit:{body:s}}))),r)}catch(s){A.error("Failed to POST to log-api",ye(s))}}#m(e){return this.#s=e,this}#f(e){return`${this.#g}/${this.#p(e)}`}#p(e){const r=e==="ERROR"?"logError":"logData",s=this.env===G.staging?"_staging":"";return`${r}${s}`}#g="https://us-east1-tranquil-petal-272922.cloudfunctions.net"}function Gd(t){return{message:t.message,stack:t.stack??"unknown"}}class Ve{static getOrInit=()=>window[li]??=this.#e();static destroy(){delete window[li]}static#e(){return new this}#t=se.new();#r=zd.new();#i=G.production;#s=!0;#n=K.new();#o=ar.new(this);#a={};#c=new os({cookieStore:this.#t,localStore:this.#n});constructor(){}get cookieStore(){return this.#t}get env(){return this.#i}set env(e){this.#i=e}get localStore(){return this.#n}get logger(){return this.#o}get metadata(){return{browser:Fl(),href:window.location.href,is_lower:Vd(window.location.href),origin:window.location.origin,session_id:this.sessionId,user_agent:window.navigator.userAgent}}get session(){return this.#c}get sessionId(){return this.session.id}get isStorageEnabled(){return this.cookieStore.enableStorage||this.localStore.enableStorage}enableStorage(){return this.cookieStore.enableStorage=!0,this.localStore.enableStorage=!0,this}disableStorage(){return this.cookieStore.enableStorage=!1,this.localStore.enableStorage=!1,this}get isTrackingEnabled(){return this.#s}enableTracking(){return this.#s=!0,this}disableTracking(){return this.#s=!1,this}syncStoredSessionIds(){return this.#c.syncStoredSessionIds(),this}getPdpItemRemoteId(e){return this.#r.getPdpItemRemoteId(e)}hasPdpItemRemoteId(e){return this.#r.hasPdpItemRemoteId(e)}setPdpItemRemoteId(e,r){return this.#r.setPdpItemRemoteId(e,r),this}addItem(e){return this.#r.addItem(e),this}removeItem(e){return this.#r.removeItem(e),this}hasItem(e){return this.#r.hasItem(e)}getItemByItemId(e){return this.#r.getItemByItemId(e)}getItemByRemoteId(e){return this.#r.getItemByRemoteId(e)}registerModule(e,r){return this.#a[e]??=r,this}getModule(e){return this.#a[e]||A.error(`Module with key of "${e}" has not been registered.`),this.#a[e]}}function Vd(t){return["web-assets.stylitics.com","localhost","staging","development"].some(e=>t.includes(e))}const Kd=Ve.getOrInit;class Qd{context;constructor(e){this.context=e}get api(){return this.context.engagementsApi}get clientCallbacks(){return this.context.clientCallbacks}get contextData(){return this.context.eventContextData}get isTrackingEnabled(){return this.context.isTrackingEnabled}queueEvent(e){return this.processEvent(e)}processEvent(e){if(!this.isTrackingEnabled)return;const r=this.api.queueEngagement({...this.contextData,...e});return r instanceof Error&&A.warn(r),r}addReferrerIfPresent(e){const r=Ul();return r?{...e,referrer:r}:e}getItemPayload(e){const r=this.getDatabaseItem(e.item),i={__pkid:e.outfit?`${r.item_id}-${e.outfit.id}`:String(r.item_id),item_id:r.item_id,item_position:e.position,item_price:r.price,item_remote_id:r.remote_id,item_sale_price:r.salePrice,outfit_id:e.outfit?.id,relative_boost:e.outfit?.relative_boost,subject:re.item};return i.item_position&&=Number(i.item_position),i}getDatabaseItem(e){const r=Ve.getOrInit();if(e.item_id===void 0&&e.remote_id!==void 0){const s=r.getItemByRemoteId(e.remote_id);return{...e,item_id:s?.item_id}}if(e.item_id!==void 0&&e.remote_id===void 0){const s=r.getItemByItemId(e.item_id);return{...e,remote_id:s?.remote_id}}return e}}const Oa=O(["main","widget"]),Jd=O([...Oa.options,"jumplink"]),Xd=O(["item","item-hotspot","item-image","item-name","item-price","item-shop","item-size","hero-item",...Jd.options]);function Ra(t,e,r=`Invalid ui_component value received: ${e}`){const s=Se(t,e);return s.success||A.warn(r),s}function Zd(t,e,r=`Invalid value type received: ${e}`){const s=Se(t,e);return s.success||A.warn(r),s}class Yd extends Qd{onAddItemToCart=e=>{const{currency:r=Ei.USD,item:s,placement:i="main",pkid:a,price:o}=e,c=s.price??s.salePrice;Ra(Oa,i,`Invalid placement value received: ${i}`),Zd(u(),r,`Invalid Currency value received: ${r}`);const l=_r(Ee(String,parseFloat,un(c)),Lt(c)),m=this.getDatabaseItem(s),f={__pkid:a??m.item_id??m.remote_id,action:Y.addToCart,currency:r,item_id:m.item_id,item_price:l(o),item_remote_id:m.remote_id,subject:re.item,ui_component:i};this.queueEvent(f),this.clientCallbacks.execute(f.action,f.subject,e)};onDataLoad=e=>this.clientCallbacks.get(Y.load,re.data)?.(e);onItemClick=e=>{Ra(Xd,e.uiComponent);const r={...this.getItemPayload(e),action:Y.click,outfit_position:e.outfitPosition,relative_boost:e.outfit?.relative_boost,ui_component:e.uiComponent};this.queueEvent(r),this.clientCallbacks.execute(r.action,r.subject,e)};onItemView=e=>{const{itemImageType:r="client_original_image"}=e,s={...this.getItemPayload(e),action:Y.view,item_image_type:r};this.queueEvent(s),this.clientCallbacks.execute(s.action,s.subject,e)};onJumpLinkClick=()=>{this.queueEvent({__pkid:this.contextData.instance_id,action:Y.click,subject:re.jumplink})};onOutfitMount=e=>{const r=this.clientCallbacks.get(Y.mount,re.outfit),s=this.clientCallbacks.get(Y.mount,re.bundle),i=r||s,a=e.outfit||e.bundle;i?.({...e,bundle:a,outfit:a})};onOutfitLabelClick=e=>{const r={__pkid:`${e.outfit.id}_label`,action:Y.click,context_type:e.labelStyle,outfit_id:e.outfit.id,outfit_position:e.outfitPosition,relative_boost:e.outfit.relative_boost,sort_label:e.sortLabel,subject:re.outfit,ui_component:"label"};this.queueEvent(r),this.clientCallbacks.execute(r.action,r.subject,e)};onOutfitsMount=e=>{const r=this.clientCallbacks.get(Y.mount,re.outfits),s=this.clientCallbacks.get(Y.mount,re.bundles),i=r||s,a=e.outfits||e.bundles;i?.({...e,bundles:a,outfits:a})};onPageVisit=()=>{this.queueEvent(this.addReferrerIfPresent({__pkid:window.location.href,action:Y.visit,subject:re.page}))};onTargetHide=({nonIntersectableAt:e})=>{this.queueEvent(this.addReferrerIfPresent({__pkid:e,action:Y.hide,subject:re.target}))};onTargetView=()=>{this.queueEvent(this.addReferrerIfPresent({__pkid:this.contextData.instance_id,action:Y.view,subject:re.target}))};onWidgetInteraction=e=>{this.queueEvent({__pkid:this.contextData.instance_id,action:Y.interaction,subject:re.widget,event_time:e.event_time})};onWidgetLoad=e=>{this.queueEvent({__pkid:this.contextData.instance_id,action:Y.load,subject:re.widget})};onWidgetSuppress=()=>{this.queueEvent({__pkid:this.contextData.instance_id,action:Y.suppress,subject:re.widget})}}class cs{static new(e,r){return new this(e,r)}time;ttl;constructor(e,r){this.time=e,this.ttl=r}get isLive(){return this.time>=this.oldestLiveTime}get isExpired(){return!this.isLive}get oldestLiveTime(){return Date.now()-this.ttl}}class us{static async initialize(e){return this.new(e).fetchConfigIfExpired()}static new(e){return new this(e)}api;client;context;lookup;overrides;schema;session;store;_fullConfig;constructor(e){this.api=e.api,this.client=e.client,this.context=e.context,this.session=e.session,this.store=e.store,this.overrides=ms.new(this.client,{context:this.context,store:this.store}),this.schema=ls(this.client),this._fullConfig=this.getStoredConfig(),this.lookup=this.buildLookup(),this.syncEnableCookieStorage()}get abExceptions(){return Object.values(this.lookup).reduce((e,r)=>{const{abException:s}=r;return s&&e.push(s),e},[])}get createdAt(){return this.clientConfig.timestamp}get clientConfig(){return this.fullConfig.client[this.client]}get experiences(){return this.clientConfig.experiences}get fullConfig(){return this._fullConfig}set fullConfig(e){this._fullConfig=e,this.storeConfig(),this.lookup=this.buildLookup(),this.syncEnableCookieStorage()}syncEnableCookieStorage(){this.session.enableCookieStorage=this.getValueFor("set-cookie")??this.session.cookieStore.enableStorage}get config(){return Object.values(this.lookup).reduce((e,r)=>Object.assign(e,r.rawEntry),{})}get isLive(){return cs.new(this.createdAt,or).isLive}get isInControlGroup(){return this.getValueFor("test-presence")==="control"}get isInExperimentGroup(){return this.getValueFor("test-presence")==="present"}get isInLabelExperimentGroup(){return this.getValueFor("label-presence-test")==="present"}get isInRecipeInfoExperimentGroup(){return this.getValueFor("recipe-info-presence-test")==="present"}async fetchConfigIfExpired(){return this.isLive?this:(this.fullConfig=await this.fetchConfig(),this)}async fetchFreshConfig(){return this.fullConfig=await this.fetchConfig(),this}async fetchConfig(){const e=n(J(u(),E()),{});try{const r=await this.api.fetchExperiences({sessionId:this.session.id,searchParams:{username:this.client},validate:async s=>P(e,await s.json())});return r.error?this.fullConfig:{client:{...this.fullConfig.client,[this.client]:{experiences:r.data,timestamp:Date.now()}}}}catch(r){return A.error(r),this.fullConfig}}getStoredConfig(){const e=this.store.getExperienceConfig();return P(ls(this.client),it(e))}storeConfig(){return this.store.setExperienceConfig(JSON.stringify(this.fullConfig)),this.overrides.syncToStore(),this}get(e){return this.lookup[e]}getValueFor(e){return this.get(e).value}getOverrideFor(e){return this.overrides.get(e)}buildLookup(){return Ot.options.reduce((e,r)=>Object.assign(e,{[r]:e[r]||Da.new({client:this.client,experiments:this,name:r,scope:hs()})}),em(this))}}function ls(t){return n(S({client:Q({[t]:n(S({experiences:n(J(u(),E()),{}),timestamp:n(h(),ds)}),()=>({experiences:{},timestamp:ds()}))})}),()=>({client:{[t]:{experiences:{},timestamp:ds()}}}))}function em(t){const{client:e}=t,r=RegExp(`^exp\\.(?${e})\\.(?${ja}*)(?:\\?(?.*))?$`),s=RegExp(`^exp\\.(?${e})\\.(?${ja})-(?${tm})$`),i=S({client:N(e),name:Ot,scope:v(p(u()),y(hs))}),a=v(S({client:N(e),name:Ot,moduleType:p(u())}),y(({moduleType:f,...g})=>P(i,f?{...g,scope:`moduleType=${f}`}:g)));function o(f){const g=Se(a,f.match(s)?.groups);if(g.success)return g.output;const b=Se(i,f.match(r)?.groups);if(b.success)return b.output}function c(f,g){return Se(We(xt,[f.name]),{[f.name]:g})}const m=P(ls(t.client),t.fullConfig).client[t.client].experiences;return Object.entries(m).reduce((f,[g,b])=>{const w=o(g);if(!w)return f;const _=c(w,b);if(!_.success)return f;const k=w.name,T=_.output[k];return Object.assign(f,{[k]:Da.new({client:w.client,name:k,experiments:t,scope:w.scope??hs(),value:T})})},{})}class Da{static new(e){return new this(e)}_value;client;experiments;name;scope;constructor(e){this._value=e.value,this.client=e.client,this.experiments=e.experiments,this.name=e.name,this.scope=e.scope}get abException(){if(this.override.abException&&this.hasOperantOverride)return this.override.abException}get documentWidth(){return this.experiments.context.documentWidth}get itemCategory(){return this.experiments.context.itemCategory}get moduleType(){return this.experiments.context.moduleType}get productGroupType(){return this.experiments.context.productGroupType}get rawEntry(){return{[this.rawKey]:this.value}}get rawKey(){return`exp.${this.client}.${this.name}`}get override(){return this.experiments.getOverrideFor(this.name)}get value(){const e=this.override.value;if(q(e))return e;if(this.satisfiesAllScopes)return this._value}get satisfiesAllScopes(){return this.satisfiesModuleTypeScope(this.moduleType)&&this.satisfiesItemCategoryScope(this.itemCategory)&&this.satisfiesProductGroupTypeScope(this.productGroupType)&&this.satisfiesScreenSizeScope(this.documentWidth)}satisfiesItemCategoryScope(e){return Te(e)||this.isUnscopedBy("itemCategory")||this.scope.itemCategory.has(e)}satisfiesModuleTypeScope(e){return this.isUnscopedBy("moduleType")||this.scope.moduleType.has(e)}satisfiesProductGroupTypeScope(e){return this.isUnscopedBy("productGroupType")||this.scope.productGroupType.has(e)}satisfiesScreenSizeScope(e){try{return this.isUnscopedBy("screenSize")||this.scope.screenSize.has(Fa(e))}catch{return!0}}isUnscopedBy(e){return this.scope[e].size===0}get hasOperantOverride(){return this.override.hasOverride&&this.override.value!==this._value}}const Ma=O(["anchor-items-gallery","beauty","classic","control","complementary-items","cross-sell","dimension-collage","dynamic-galleries","gallery","grid","hotspots","list","moodboard","nike","shop-similar","shop-the-outfit","shop-the-set","similar-styles","styled-for-you","v3-classic","v3-hotspots","vibe"]),xt=S({"beauty-widget-apply":n(d(),!1),"bust-cache":n(d(),!1),"carousel-dots":n(d(),!1),"client-original-images":n(d(),!1),"collage-anchor-item":n(d(),!1),"combined-discount-percentage":n(d(),!1),"css-experiment":p(u()),"css-theme":p(u()),"cta-button-contrast":n(d(),!1),"editorial-anchor-item":n(d(),!1),"enable-logging":n(d(),!1),"grid-peek":n(d(),!1),"grid-starter":n(d(),!1),"hide-anchor-item":n(d(),!1),"hide-double-zero-cents":n(p(d()),void 0),"image-aspect-ratio":n(p(u()),void 0),"item-discount-percentage":n(d(),!1),"item-discount-image":n(d(),!1),"item-image-hover":n(d(),!1),"item-info-static":n(d(),!1),"item-info-static-mobile":n(d(),!1),"item-link-cta":n(p(u()),void 0),"item-modal-static":n(d(),!1),"label-presence-test":Ye,"label-style":Fi,"large-item-image":n(d(),!1),"macys-category":n(d(),!1),"macys-category-all":n(d(),!1),"enhanced-list-plus":n(d(),!1),"max-results":n(p(v(u(),qn(),y(Number))),void 0),"mix-and-match":n(d(),!1),"mix-and-match-collage":n(d(),!1),"mix-and-match-row":n(d(),!1),"mobile-arrows":n(d(),!1),"mobile-gallery":n(d(),!1),"mobile-items-carousel":n(d(),!1),"mobile-items-exposed":n(d(),!1),"mobile-modal-list":n(d(),!1),"mobile-vertical-list":n(d(),!1),orchestrator:n(d(),!1),"original-item-order":n(d(),!1),"outfit-discount-percentage":n(d(),!1),"outfit-promo-indicators":n(d(),!1),"plus-icon":n(d(),!1),"product-list-type":n(p($(Oe)),void 0),"profile-id-path":u(),"promo-indicators":n(d(),!1),"recipe-info-presence-test":Ye,"regulated-discount-percentage":n(d(),!1),"rounding-style":n(p($(Ze)),void 0),"sales-price-style":n(p($(Z)),void 0),"scaled-grid":n(d(),!1),"set-cookie":n(d(),!1),"shop-button-expanded":n(d(),!1),"shop-button-large":n(d(),!1),"shop-button-position":Zt,"shop-the-model-ai":n(d(),!1),"shop-the-model-editorial":n(d(),!1),"shop-similar-hotspots":n(d(),!1),"small-item-image":n(d(),!1),"social-proof-action":Jl,"social-proof-item-label":Yt,"social-proof-outfit-label":Yt,"social-proof-threshold":Ui,"test-presence":Ye,"track-purchase-log-percentage":n(p(h()),void 0),"vertical-anchor-grid":n(d(),!1),"video-play-mode":Li,"v3-classic":n(d(),!1),"v3-hotspots":n(d(),!1),"widget-variant":hi}),Ot=Yn(xt),ja=Ot.options.join("|"),tm=Ma.options.join("|"),rm={mobile:Fr(-1/0,500),tablet:Fr(500,950),desktop:Fr(950,1/0)},{mobile:sm,tablet:nm}=rm;function Fa(t){return sm(t)?"mobile":nm(t)?"tablet":"desktop"}function hs(t){const e=new URLSearchParams(t);return{itemCategory:new Set(e.getAll("itemCategory")),moduleType:new Set(e.getAll("moduleType")),productGroupType:new Set(e.getAll("productGroupType")),screenSize:new Set(e.getAll("screenSize"))}}function ds(){return Date.now()-or-1}const or=3600*1e3;class ms{static new(e,r){return new this(e,r)}static keys={param:"styliticsoverride",store:K.keys.testOverride};constructor(e,r){this.client=e,this.store=r.store,this.context=r.context,this.schema=this.buildSchema(),this.lookup=this.buildLookup(),this.config=this.getStoredConfig(),this.syncToStore()}get(e){return this.lookup[e]}config;client;context;lookup;schema;store;syncToStore(){return this.overrides.forEach(e=>{e.shouldClearTimestamp?delete this.config[this.client][e.name]:e.shouldStoreTimestamp&&(this.config[this.client][e.name]=Date.now())}),this.store.setTestOverride(JSON.stringify(this.config)),this}getTimestampFor(e){return this.config[this.client][e]}get overrides(){return Object.values(this.lookup)}buildSchema(){return n(Q({[this.client]:om}),{[this.client]:{}})}buildLookup(){return Ot.options.reduce((e,r)=>{const s=im.new(r,this);return Object.assign(e,{[r]:s})},{})}getStoredConfig(){const e=this.store.getTestOverride(),r=it(e);return P(this.schema,r)}}class im{static new(e,r){return new this(e,r)}constructor(e,r){this.name=e,this.overrides=r,this.metadata=cm[this.name]}name;metadata;overrides;get abException(){if(!(!this.metadata||this.hasHardOverrideValue||!this.hasSoftOverride))return{...am(this.metadata),timestamp:this.timestamp??Date.now()}}get value(){return this.hardOverrideValue??this.softOverrideValue}get hardOverrideValue(){const e=pi.new(),r=this.name.replaceAll("-",""),s=e.get(`stylitics-experience-${this.name}-${this.moduleType}`)??e.get(`stylitics-experience-${this.name}`)??e.get(`stylitics-${this.name}`)??e.get(`stylitics-${r}`)??void 0;if(Te(s))return;let i;switch(this.dataType){case"boolean":i=Ou;break;case"number":i=ri;break;case"string":i=ti;break;default:i=Lt(!1)}const a=it(s)||s,o=i(a)?a:i(s)?s:void 0,c=Se(xt.entries[this.name],o);if(c.success)return c.output}get softOverrideValue(){return this.hasSoftOverride?this.metadataValue:void 0}get hasOverride(){return q(this.value)}get hasHardOverrideValue(){return q(this.hardOverrideValue)}get hasSoftOverride(){return this.hasOverrideSearchParam||this.isLive}get shouldStoreTimestamp(){return this.hasOverrideSearchParam}get shouldClearTimestamp(){return!this.hasOverrideSearchParam&&this.isExpired}get context(){return this.overrides.context}get moduleType(){return this.context.moduleType}get hasOverrideSearchParam(){return q(this.searchParamValue)&&q(this.metadata)&&this.searchParamValue===this.metadata.id}get timestamp(){return this.overrides.getTimestampFor(this.name)}get isExpired(){return q(this.timestamp)&&cs.new(this.timestamp,or).isExpired}get isLive(){return q(this.timestamp)&&cs.new(this.timestamp,or).isLive}get searchParamValue(){if(!this.metadata)return;const e=pi.new().get(ms.keys.param),r=Se(N(this.metadata.id),e);return r.success?r.output:void 0}get metadataValue(){return this.metadata?.value}get dataType(){const e=xt.entries[this.name],s=(e.type==="optional"?_u(e):e).expects;return s.includes(" | ")?typeof it(s.replaceAll(/[()]/g,"").split(" | ")[0]):s}}const am=fc(["applies_to","description","id","reason"]),om=J(Yn(xt),h()),cm={"test-presence":{applies_to:"presence",description:"Exclude user from presence test",id:"001",name:"test-presence",reason:"email marketing",value:"present"}};function Ua(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}Ua("7c833cef8f876dd0d6b04213"),Ua("694ba0e109e5fdfe4ac3cbadf27095e75c89590ac83f6ac2631933a8cb29acdf");class La{set;update;subscribe;constructor(e=nt()){const{set:r,update:s,subscribe:i}=Ge(e);this.set=r,this.update=s,this.subscribe=i}get value(){return et(this)}refresh(e=nt()){return this.set(P(um,e)),e}}const um=v(u(),Vn("Stylitics Global Store: Invalid instanceId provided")),lm=n(S({instanceId:It(La)}),()=>({instanceId:new La}));function hm(){return globalThis.StyliticsGlobalStore??=wt(lm)}const $a=hm(),fs=v(S({...V.entries,browsed:le,maxBrowsedItems:n(h(),10),maxPurchasedItems:n(h(),10),purchased:le,responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:3}],[550,{columns:3}],[730,{columns:4}],[900,{columns:5}]]),sessionId:n(u(),""),itemDetailsModalHeader:n(u(),"Product List"),shopThisLookCTA:n(u(),"Shop This Look")}),y(B),y(F)),dm={defaults:D(S({...fs.entries})),parse:t=>P(fs,j(t)),Schema:fs},ps=v(S({...V.entries,item_number:u(),maxResults:n(N(1),1),minResults:n(N(1),1),addAllToCartCTAPosition:n(O(["bottom","top"]),"bottom"),shoppableAnchorItem:n(d(),!1),showCarouselCardSeparator:n(d(),!0),showCarouselDots:n(d(),!0),salesPriceStyle:n($(Z),Z.strikethrough),addAllToCartCTA:n(u(),"Add All Items to Cart"),modalHeading:n(u(),"Mix & Match"),swapButton:n(u(),"Swap"),swapItemHeading:n(u(),"Swapping")}),y(B),y(F)),mm={defaults:D(S({...ps.entries})),parse:t=>P(ps,j(t)),Schema:ps},gs=v(S({...V.entries,minResults:n(h(),3),outfit_id:n(p(h()),void 0),cardAspectRatio:n(h(),1.25),carouselAdvancementRate:ne,editorialAspectRatio:n(h(),1),gutterWidth:n(h(),16),isGallery:n(d(),!1),nextOutfitPeek:n(h(),.1),previousOutfitPeek:n(h(),0),productListRevealType:n($(Oe),Oe.slideout),shopTheModelAI:n(d(),!1),showCarouselDots:n(d(),!1),showMobileArrows:n(d(),!1),sizeDropdown:n(d(),!1),mixAndMatchRow:n(d(),!1),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1023,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]]),backToLookCTA:n(u(),"Back To Look"),seeMoreOptionsCTA:n(u(),"See More Options"),viewDetailsCTA:n(u(),"Shop The Look")}),ge(me([["item_number"]],fm,"Invalid input: Must provide either item_number, outfit_id, or tags"),["item_number"]),y(B),y(F)),ys={defaults:D(S({...gs.entries})),parse:t=>P(gs,j(t)),Schema:gs};function fm(t){return qe(t.dataSource,"trending-bundles")||qe(t.dataSource,"outfit-landing-page")&&q(t.outfit_id)||q(t.item_number)||q(t.tags)}const vs=v(S({...V.entries,apparelOnly:n(d(),!1),maxDepartments:n(h(),5),cardAspectRatio:n(h(),1.5),carouselAdvancementRate:ne,gutterWidth:n(h(),12),imageOnHover:n(d(),!1),isGallery:n(d(),!1),nextOutfitPeek:n(h(),0),showAllDepartments:n(d(),!1),showMobileArrows:n(d(),!0),sizeDropdown:n(d(),!1),sessionId:n(u(),""),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:3}],[640,{columns:4}],[1023,{columns:4}],[1280,{columns:5}],[1536,{columns:5}]]),tablistHeading:n(u(),"Style it with"),tablistHeadingLevel:n(ve,"h2")}),y(B),y(F)),pm={defaults:D(S({...vs.entries})),parse:t=>P(vs,j(t)),Schema:vs},bs=v(S({...V.entries,brand:n(p(u()),void 0),browsed:le,category:n(p(u()),void 0),department:n(p(u()),void 0),from_accounts:n(p(u()),void 0),gender:n(p(u()),void 0),item_number:n(p(u()),void 0),maxItems:n(p(h()),20),maxPrice:n(p(h()),void 0),maxResults:n(h(),20),minPrice:n(p(h()),void 0),minResults:n(h(),3),purchased:le,style:n(p(u()),void 0),tags:n(p(u()),void 0),cardAspectRatio:n(h(),1.6),carouselAdvancementRate:ne,gutterWidth:n(h(),16),imageOnHover:n(d(),!1),layout:n(O(["gallery","horizontal","vertical"]),"horizontal"),nextOutfitPeek:n(h(),.3),previousOutfitPeek:n(h(),0),showCarouselDots:n(d(),!1),showMobileArrows:n(d(),!1),sizeDropdown:n(d(),!1),sessionId:n(u(),""),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:2}],[425,{columns:3}],[640,{columns:4}],[1023,{columns:5}],[1280,{columns:6}],[1536,{columns:7}]])}),y(B),y(F)),gm={defaults:D(S({...bs.entries})),parse:t=>P(bs,j(t)),Schema:bs},Ss=v(S({...V.entries,minResults:n(h(),3),carouselAdvancementRate:ne,dynamicOutfitBackground:n(d(),!1),gutterWidth:n(h(),16),horizontalProductList:n(d(),!1),mixAndMatchRow:n(d(),!1),nextOutfitPeek:n(h(),0),previousOutfitPeek:n(h(),0),showMobileArrows:n(d(),!0),sizeDropdown:n(d(),!1),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1023,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]]),seeMoreOptionsCTA:n(u(),"See More Options"),viewDetailsCTA:n(u(),"View Details")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),ym={defaults:D(S({...Ss.entries})),parse:t=>P(Ss,j(t)),Schema:Ss},ws=v(S({...V.entries,ids:n(u(),""),minResults:n(h(),3),page:v(n(u(),()=>qa(globalThis?.location?.href??"")),y(qa)),carouselAdvancementRate:ne,gutterWidth:n(h(),16),nextOutfitPeek:n(h(),0),previousOutfitPeek:n(h(),0),browsed:le,purchased:le,sessionId:n(u(),""),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1024,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]]),viewItemsCTAText:n(u(),"View Details")}),y(B),y(F)),vm={defaults:D(S({...ws.entries})),parse:t=>P(ws,j(t)),Schema:ws};function qa(t){return wr(/^http(s?):\/\//i,"",t)}const _s=v(S({...V.entries,minResults:n(h(),3),cardAspectRatio:n(h(),1.4),collageAnchorItem:n(d(),!1),editorialFirstAnchorItem:n(d(),!1),gapWidth:n(h(),5),gridPeek:n(d(),!1),gridStarter:n(d(),!1),gutterWidthMobile:n(h(),14),hideAnchorItemCard:n(d(),!1),itemInfoAnimation:n(O(["fade","slide"]),"slide"),itemInfoAnimationDuration:n(h(),200),itemInfoImage:n(d(),!1),itemInfoStatic:n(d(),!1),maxGridSize:n(h(),7),mobileItemsCarousel:n(d(),!1),nextOutfitPeekMobile:n(h(),.05),nonEditorialImages:n(d(),!1),originalItemOrder:n(d(),!1),shopTheModelEditorial:n(d(),!1),showMobileArrows:n(d(),!1),showPlusIcon:n(d(),!1),smallItemScaling:n(d(),!1),squareAspectRatio:n(d(),!1),typeScaledGrid:n(d(),!1),verticalAnchorAspectRatio:n(h(),1),verticalAnchorLayout:n(d(),!1),verticalLayout:n(d(),!1),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1023,{columns:3}],[1190,{columns:3}],[1536,{columns:4}]]),counterHeading:n(u(),"Look"),counterHeadingLevel:n(ve,"h4"),itemLinkCTA:n(u(),"Shop"),mobileItemsCarouselCTA:n(u(),"Back to Model"),swapCTA:n(u(),"Swap")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),bm={defaults:D(S({..._s.entries})),parse:t=>P(_s,j(t)),Schema:_s},Is=v(S({...V.entries,minResults:n(h(),3),cardAspectRatio:n(h(),1.25),carouselAdvancementRate:ne,gutterWidth:n(h(),16),largeItemImage:n(d(),!1),mixAndMatchRow:n(d(),!1),mobileItemsCarousel:n(d(),!1),nextOutfitPeek:n(h(),.1),previousOutfitPeek:n(h(),0),productListRevealType:n($(Oe),Oe.slideout),showMobileArrows:n(d(),!1),sizeDropdown:n(d(),!1),smallItemImage:n(d(),!1),staticItemInfo:n(d(),!1),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[480,{columns:2}],[1023,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]]),modalHeading:n(u(),"Shop The Look"),seeMoreOptionsCTA:n(u(),"Alternative Options"),viewDetailsCTA:n(u(),"Shop The Look")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),Sm={defaults:D(S({...Is.entries})),parse:t=>P(Is,j(t)),Schema:Is},ks=v(S({...V.entries,minResults:n(h(),1),editorialAnchorItem:n(d(),!1),editorialFirstAnchorItem:n(d(),!1),editorialShopTheModel:n(d(),!1),gutterWidth:n(h(),16),imageAspectRatio:n(h(),1.2),imageOnHover:n(d(),!1),listLayout:n(O(["vertical","horizontal","mobile-gallery","vertical-anchor"]),"horizontal"),mobileVerticalList:n(d(),!1),mobileVisibleCardCount:n(h(),2.5),originalItemOrder:n(d(),!1),shopTheModelAI:n(d(),!1),showPlusIcon:n(d(),!1),sizeDropdown:n(d(),!1),counterDeterminator:n(u(),"of"),counterHeading:n(u(),"look"),counterHeadingLevel:n(ve,"h4"),itemLinkCTA:n(u(),""),modalHeading:n(u(),"Similar Items"),modalHeadingLevel:n(ve,"h4"),similarItemsButton:n(u(),"Similar Items")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),wm={defaults:D(S({...ks.entries})),parse:t=>P(ks,j(t)),Schema:ks},Ps=v(S({...V.entries,minResults:n(h(),3),hideDoubleZeroCents:n(d(),!0),roundingStyle:n(p($(Ze)),Ze.ceiling),salesPriceStyle:n($(Z),Z.salesPriceOnly),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1024,{columns:3}]]),itemDetailsModalHeader:n(u(),"Complete the look"),viewDetailsCTA:n(u(),"View entire look")}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),_m={defaults:D(S({...Ps.entries})),parse:t=>P(Ps,j(t)),Schema:Ps},As=v(S({...V.entries,allowOutOfStock:n(d(),!0),maxPerItem:n(h(),6),minPerItem:n(h(),3),reMatch:n(d(),!1),retryCount:v(n(h(),0),y(an(0,10))),carouselAdvancementRate:ne,hotspotsOverlay:n(d(),!1),parentSelector:p(u()),shopButtonMargin:n(h(),5),shopButtonExpanded:n(d(),!1),shopButtonPosition:n(Zt,"bottom-right"),skipModeration:n(d(),!1),responsive:n(I(L([h(),S({height:h()})])),[[0,{height:44}],[200,{height:44}],[300,{height:44}],[400,{height:44}]]),anchorItemHeading:n(u(),"Currently Viewing"),anchorItemHeadingLevel:n(ve,"h4"),anchorItemLabel:n(u(),"This Item"),itemsHeading:n(u(),"Similar Items"),itemsHeadingLevel:n(ve,"h4"),modalHeading:n(u(),"Shop The Look"),shopButtonText:n(u(),"Shop The Look"),viewDetailsCTA:n(u(),"View Details")}),y(F)),Im={defaults:D(S({...As.entries})),parse:t=>P(As,j(t)),Schema:As},Ts=v(S({...V.entries,outfit_id:v(h(),Or(1)),salesPriceStyle:n($(Z),Z.salesPriceOnly)}),y(B),y(F)),km={defaults:D(S({...Ts.entries})),parse:t=>P(Ts,j(t)),Schema:Ts},Es=v(S({...V.entries,item_number:u(),maxResults:n(h(),5),minResults:n(h(),2)}),y(t=>{const e=Math.max(2,t.minResults),r=Math.max(e,t.maxResults);return{...t,maxResults:r,minResults:e}}),y(F)),Pm={defaults:D(S({...Es.entries})),parse:t=>P(Es,j(t)),Schema:Es},Cs=v(S({...V.entries,minResults:n(h(),1),cardAspectRatio:n(h(),1.55),carouselAdvancementRate:ne,gutterWidth:n(h(),16),imageOnHover:n(d(),!1),nextOutfitPeek:n(h(),.2),showCarouselDots:n(d(),!1),showMobileArrows:n(d(),!1),sizeDropdown:n(d(),!1),salesPriceStyle:n($(Z),Z.salesPriceOnly),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:2}],[640,{columns:3}],[864,{columns:4}],[1199,{columns:5}]])}),y(B),y(F)),Am={defaults:D(S({...Cs.entries})),parse:t=>P(Cs,j(t)),Schema:Cs},xs=v(S({...V.entries,maxBrowsedItems:n(h(),10),maxPurchasedItems:n(h(),10),personalizedResults:n(d(),!0),browsed:le,purchased:le,carouselAdvancementRate:v(n(h(),1),y(t=>Math.max(1,t))),defaultTab:n(O(["purchased","browsed"]),"purchased"),sessionId:n(u(),""),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1024,{columns:2}],[1280,{columns:2}]]),fullPageLinkText:n(u(),""),fullPageLinkUrl:n(u(),""),shopThisLookCTA:n(u(),"Shop This Look")}),y(F)),Tm={defaults:D(S({...xs.entries})),parse:t=>P(xs,j(t)),Schema:xs},Os=v(Q({...V.entries,trackingEnv:n($(G),G.production),from_accounts:n(p(u()),void 0),minResults:n(h(),1),bundleBackgroundColor:n(u(),"#fff"),bundleProductList:n(O(["slideout-on-click","product-list-on-click","product-list-on-hover"]),"slideout-on-click"),clickableCarouselAdvancementRate:n(h(),1),clickableCarouselDots:n(d(),!1),clickableCarouselGutterWidth:n(h(),16),clickableCarouselNextItemPeek:n(h(),0),clickableCarouselPreviousItemPeek:n(h(),0),clickableImageMnM:n(d(),!1),mixAndMatch:n(p(d()),void 0),productListMnM:n(d(),!1),swipeableCarouselArrows:n(d(),!1),swipeableCarouselDots:n(d(),!1),swipeableCarouselGutterWidth:n(h(),16),swipeableCarouselLeftPadding:n(h(),0),swipeableCarouselNextItemPeek:n(h(),.275),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1024,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]]),backToLookCTA:n(p(u()),void 0),itemLinkCTA:n(u(),"SHOP"),mnmClose:n(p(u()),void 0),seeMoreOptionsCTA:n(p(u()),void 0),viewDetailsCTA:n(p(u()),void 0)}),y(B),y(F)),Em={defaults:D(S({...Os.entries})),parse:t=>P(Os,j(t)),Schema:Os},Rs=v(Q({...V.entries,trackingEnv:n($(G),G.production),from_accounts:n(p(u()),void 0),minResults:n(h(),1),bundleBackgroundColor:n(u(),"#fff"),bundleProductList:n(O(["slideout-on-click","product-list-on-click","product-list-on-hover"]),"slideout-on-click"),clickableCarouselAdvancementRate:n(h(),1),clickableCarouselDots:n(d(),!1),clickableCarouselGutterWidth:n(h(),16),clickableCarouselNextItemPeek:n(h(),0),clickableCarouselPreviousItemPeek:n(h(),0),clickableImageMnM:n(d(),!1),mixAndMatch:n(p(d()),void 0),itemDetailsModalFooter:n(p(u()),void 0),mobileGalleryLayout:n(d(),!1),productListMnM:n(d(),!1),swipeableCarouselArrows:n(d(),!1),swipeableCarouselDots:n(d(),!1),swipeableCarouselGutterWidth:n(h(),16),swipeableCarouselLeftPadding:n(h(),0),swipeableCarouselNextItemPeek:n(h(),.275),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[600,{columns:2}],[1040,{columns:3}],[1300,{columns:4}]]),responsiveMobile:n(I(L([h(),S({columns:h()})])),[[0,{columns:2}],[600,{columns:3}],[1040,{columns:3}],[1300,{columns:3}]]),backToLookCTA:n(p(u()),void 0),itemDetailsModalFooterCTA:n(p(u()),void 0),itemDetailsModalHeader:n(p(u()),void 0),itemLinkCTA:n(u(),"SHOP"),mnmClose:n(p(u()),void 0),seeMoreOptionsCTA:n(p(u()),void 0),viewDetailsCTA:n(p(u()),void 0)}),y(B),y(F)),Cm={defaults:D(S({...Rs.entries})),parse:t=>P(Rs,j(t)),Schema:Rs},Ds=v(Q({...V.entries,trackingEnv:n($(G),G.production),from_accounts:n(p(u()),void 0),minResults:n(h(),1),with_item_coords:n(d(),!0),bundleBackgroundColor:n(u(),"#fff"),clickableCarouselAdvancementRate:n(h(),1),clickableCarouselDots:n(d(),!1),clickableCarouselNextItemPeek:n(h(),0),clickableCarouselPreviousItemPeek:n(h(),0),hideAnchorItem:n(d(),!0),hotspotsAppearOnLoad:n(p(d()),!1),hotspotsIcon:n(p(u()),"eye"),hotspotsOverlayOrder:n(I(I(u())),[["name"],["name","price"]]),hotspotsPersist:n(p(d()),!1),hotspotsShowProductListCTA:n(d(),!0),swipeableCarouselLeftPadding:n(h(),0),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1100,{columns:3}]]),itemDetailsModalHeader:n(p(u()),void 0),itemLinkCTA:n(u(),"SHOP"),viewDetailsCTA:n(p(u()),void 0)}),y(B),y(F)),xm={defaults:D(S({...Ds.entries})),parse:t=>P(Ds,j(t)),Schema:Ds},Ms=v(S({...V.entries,minResults:n(h(),1),backgroundColor:n(O(["consistent","expressive"]),"expressive"),backgroundPattern:n(p(O(["grainy","leaves","scribbles","waves","plaid"])),void 0),badgeType:n(p(O(["mood","season","interior","trend"])),void 0),cardAspectRatio:n(h(),1.4),cardDesign:n(O(["clean","eclectic"]),"eclectic"),carouselAdvancementRate:ne,clientOriginalImages:n(d(),!1),editorialAnchorItem:n(d(),!1),gutterWidth:n(h(),16),hideAnchorItem:n(d(),!1),itemOrder:n(O(["default","random"]),"default"),nextOutfitPeek:n(h(),.1),productType:n(O(["apparel","home"]),"apparel"),shopTheModelEditorial:n(d(),!1),showCarouselDots:n(d(),!1),showMobileArrows:n(d(),!1),hideDoubleZeroCents:n(d(),!0),responsive:n(I(L([h(),S({columns:h()})])),[[0,{columns:1}],[640,{columns:2}],[1023,{columns:3}],[1280,{columns:4}],[1536,{columns:5}]])}),ge(me([["item_number"],["tags"]],we,"Invalid input: Must provide either item_number or tags"),["item_number"]),y(B),y(F)),Om={defaults:D(S({...Ms.entries})),parse:t=>P(Ms,j(t)),Schema:Ms};G.staging+"",G.production+"";function Rm(t){let e,r;return typeof t=="string"?(r=document.getElementById(t)??document.querySelector(t)??void 0,e=t):(r=t,e=t.constructor.name),r==null&&A.error(`Could not find target ID/element for provided target: "${e}"`),r}class ht{static from(e){if(e===Wu)return new js(document.createElement("div"),document);if(typeof e=="string")return ht.from(Rm(e));if(e instanceof Element){const r=e.getRootNode();return r instanceof Document?new js(e,r):r instanceof ShadowRoot?new Dm(e,r):(A.warn("The root node of the provided target is not of type ShadowDom or Document. Falling back to Document as the root."),new js(e,document))}throw new Error(`Stylitics: target must be an instance of Element. Received: "${e}"`)}cleanupStack;scriptParent;target;constructor(e){this.target=e,this.cleanupStack=mi.new(),this.scriptParent=document.body}attachScript(e){return this.scriptParent.append(e),e}createScript(e){const{src:r,type:s="module",async:i=!0,onload:a}=e;return Object.assign(document.createElement("script"),{async:i,onload:a,src:r,type:s})}removeScript(e){return this.scriptParent.contains(e)?this.scriptParent.removeChild(e):A.warn("Attempted to remove a script that is not attached to the document body."),e}attachStylesheet(e){return Array.from(this.stylesheetParent.querySelectorAll('link[rel="stylesheet"]')).some(r=>r.href===e.href)?(A.warn("Stylesheet already attached, skipping attachment."),e):(this.stylesheetParent.appendChild(e),this.cleanupStack.push(()=>this.removeStylesheet(e)),e)}attachStylesheetFromHref(e){const r=this.createStylesheet(e);return this.attachStylesheet(r)}createStylesheet(e){return Object.assign(document.createElement("link"),{href:e,rel:"stylesheet",type:"text/css"})}removeStylesheet(e){return this.stylesheetParent.contains(e)?this.stylesheetParent.removeChild(e):A.warn("Attempted to remove a stylesheet that is not attached to the root element."),e}cleanup(){this.cleanupStack.runAll()}getTarget(e){if(e===void 0)return;let r;if(typeof e=="string"){const s=/^[a-zA-Z][a-zA-Z0-9\-_:.]*$/;let i;e.startsWith("#")?i=e:s.test(e)?i=`#${e}`:i=e;try{r=this.root.querySelector(i)??void 0}catch(a){A.warn(`Invalid selector: ${i}`,a),r=void 0}}else r=e;return r}}class js extends ht{root;stylesheetParent;constructor(e,r){super(e),this.root=r,this.stylesheetParent=this.root.head,this.target=e}get visibleRoot(){return this.root.body}}class Dm extends ht{root;stylesheetParent;constructor(e,r){if(r.mode!=="open")throw new Error("Stylitics: ShadowRoot must be in open mode.");super(e),this.root=r,this.stylesheetParent=this.root,this.target=e}get visibleRoot(){return this.root}}function Mm(t){return t.extend({api:({env:e},r)=>r(new as({env:e})),baseUiContext:({clientCallbacks:e,clientOverrides:r,enrichedItemDataLookup:s,enrichedOutfitDataLookup:i,logger:a,resizeObserver:o,windowListener:c},l)=>l({clientCallbacks:e,clientOverrides:r,enrichedItemDataLookup:s,enrichedOutfitDataLookup:i,logger:a,...o.stores,...c.stores}),browsedItems:({client:e,localStore:r},s)=>s(Wr.new(e,r)),client:"demo",clientCallbacks:({},e)=>e(new Et),clientOverrides:({},e)=>e(new Et),consoleDebug:async({},e)=>{const r=vi.spyOn(A,"debug").mockImplementation(vi.fn());await e(r),r.mockRestore()},consoleError:async({},e)=>{const r=vi.spyOn(A,"error").mockImplementation(vi.fn());await e(r),r.mockRestore()},consoleInfo:async({},e)=>{const r=vi.spyOn(A,"info").mockImplementation(vi.fn());await e(r),r.mockRestore()},consoleLog:async({},e)=>{const r=vi.spyOn(A,"log").mockImplementation(vi.fn());await e(r),r.mockRestore()},consoleWarn:async({},e)=>{const r=vi.spyOn(A,"warn").mockImplementation(vi.fn());await e(r),r.mockRestore()},cookieStore:({enableStorage:e},r)=>r(se.new({enableStorage:e})),enableStorage:!0,enableTracking:!0,env:({},e)=>e(G.staging),experimentContext:({},e)=>e({documentWidth:1e3,productGroupType:"item_number",moduleType:"classic"}),locale:Tt.enUS,localStore:({enableStorage:e},r)=>r(K.new({enableStorage:e})),logger:({stylitics:e},r)=>r(e.logger),engagementsApi:async({env:e},r)=>{const s=new wd({env:e});vi.spyOn(s,"queueEngagement").mockReturnValue(void 0),vi.spyOn(s,"sendEngagement").mockReturnValue(void 0),await r(s)},enrichedItemDataLookup:({},e)=>e(new Map),enrichedOutfitDataLookup:({},e)=>e(new Map),engagementsHandler:({eventContext:e},r)=>r(new Yd(e)),eventContext:({engagementsApi:e,eventContextData:r},s)=>s({clientCallbacks:new Et,engagementsApi:e,eventContextData:r,isTrackingEnabled:!0}),eventContextData:({locale:e},r)=>r({account_id:960,amp_account_id:960,amp_account_username:"test-username",client_user_id:"asdf",experience_config:{},instance_id:"asdf",locale:e,page_url:"http://localhost:3000/",placement:"cart",screen_height:456,screen_width:123,session_id:"qwerty",touch_device:!0,widget_subtype:Ia.module,widget_type:"widget_type",widget_version:"widget_version"}),experiments:({api:e,client:r,experimentContext:s,session:i,localStore:a},o)=>o(us.new({api:e,client:r,context:s,session:i,store:a})),pdpEventContext:({eventContext:e,pdpEventContextData:r},s)=>s(fe(e,{eventContextData:r})),pdpEventContextData:({eventContextData:e},r)=>r(fe(e,{pdp_item_id:1234,pdp_item_remote_id:"asdf"})),purchasedItems:({client:e,localStore:r},s)=>s(zr.new(e,r)),resizeObserver:({target:e},r)=>r(xl(e)),session:({cookieStore:e,localStore:r},s)=>s(new os({cookieStore:e,localStore:r})),stylitics:async({},e)=>{await e(Ve.getOrInit()),Ve.destroy(),K.new().clear(),se.new().clear()},target:async({},e)=>{const r=globalThis.document.createElement("div");globalThis.document.body.appendChild(r),await e(r),r.remove()},windowListener:({},e)=>e(new Ol)})}Ee(Mm,jm);function jm(t){throw new Error("You are trying to use `extendItWithApiData` in production. This is not allowed. Please remove this from your code.")}He(Map),He(Function),He(Set),He(Symbol),sn([He(String),He(Number),He(Boolean),He(Symbol)]);var Fs=(t=>(t.composer="composer",t.loader="loader",t))(Fs||{});const Ba="composer",Ha="421477a2ea",cr="https://web-assets.stylitics.com/",X="2025.10.30.421477a2ea",R="421477a2ea",cf="http://localhost:9999",ur={"anchor-items-gallery":{type:"anchor-items-gallery",classname:"StyliticsAnchorItemsGalleryWidget",css:`anchor-items-gallery/${R}/anchor-items-gallery.css?version=${X}`,js:`anchor-items-gallery/${R}/anchor-items-gallery.internal.js`,Params:dm},beauty:{type:"beauty",classname:"StyliticsBeautyWidget",css:`beauty/${R}/beauty.css?version=${X}`,js:`beauty/${R}/beauty.internal.js`,Params:mm},classic:{type:"classic",classname:"StyliticsClassicWidget",css:`classic/${R}/classic.css?version=${X}`,js:`classic/${R}/classic.internal.js`,Params:ys},control:{type:"control",classname:"StyliticsControlWidget",css:`control/${R}/control.css?version=${X}`,js:`control/${R}/control.internal.js`,Params:ys},"complementary-items":{type:"complementary-items",classname:"StyliticsComplementaryItemsWidget",css:`complementary-items/${R}/complementary-items.css?version=${X}`,js:`complementary-items/${R}/complementary-items.internal.js`,Params:pm},"cross-sell":{type:"cross-sell",classname:"StyliticsCrossSellWidget",css:`cross-sell/${R}/cross-sell.css?version=${X}`,js:`cross-sell/${R}/cross-sell.internal.js`,Params:gm},"dimension-collage":{type:"dimension-collage",classname:"StyliticsDimensionCollageWidget",css:`dimension-collage/${R}/dimension-collage.css?version=${X}`,js:`dimension-collage/${R}/dimension-collage.internal.js`,Params:ym},"dynamic-galleries":{type:"dynamic-galleries",classname:"StyliticsDynamicGalleriesWidget",css:`dynamic-galleries/${R}/dynamic-galleries.css?version=${X}`,js:`dynamic-galleries/${R}/dynamic-galleries.internal.js`,Params:vm},gallery:{type:"gallery",classname:"StyliticsGalleryWidget",css:`v3-gallery/${R}/gallery.css?version=${X}`,js:`v3-gallery/${R}/gallery.internal.js`,Params:Cm},grid:{type:"grid",classname:"StyliticsGridWidget",css:`grid/${R}/grid.css?version=${X}`,js:`grid/${R}/grid.internal.js`,Params:bm},hotspots:{type:"hotspots",classname:"StyliticsHotspotsWidget",css:`hotspots/${R}/hotspots.css?version=${X}`,js:`hotspots/${R}/hotspots.internal.js`,Params:Sm},list:{type:"list",classname:"StyliticsListWidget",css:`list/${R}/list.css?version=${X}`,js:`list/${R}/list.internal.js`,Params:wm},moodboard:{type:"control",classname:"StyliticsControlWidget",css:`control/${R}/control.css?version=${X}`,js:`control/${R}/control.internal.js`,Params:ys},nike:{type:"nike",classname:"StyliticsNikeWidget",css:`nike/${R}/nike.css?version=${X}`,js:`nike/${R}/nike.internal.js`,Params:_m},"shop-similar":{type:"shop-similar",classname:"StyliticsShopSimilarWidget",css:`shop-similar/${R}/shop-similar.css?version=${X}`,js:`shop-similar/${R}/shop-similar.internal.js`,Params:Im},"shop-the-outfit":{type:"shop-the-outfit",classname:"StyliticsShopTheOutfitWidget",css:`shop-the-outfit/${R}/shop-the-outfit.css?version=${X}`,js:`shop-the-outfit/${R}/shop-the-outfit.internal.js`,Params:km},"shop-the-set":{type:"shop-the-set",classname:"StyliticsShopTheSetWidget",css:`shop-the-set/${R}/shop-the-set.css?version=${X}`,js:`shop-the-set/${R}/shop-the-set.internal.js`,Params:Pm},"similar-styles":{type:"similar-styles",classname:"StyliticsSimilarStylesWidget",css:`similar-styles/${R}/similar-styles.css?version=${X}`,js:`similar-styles/${R}/similar-styles.internal.js`,Params:Am},"styled-for-you":{type:"styled-for-you",classname:"StyliticsStyledForYouWidget",css:`styled-for-you/${R}/styled-for-you.css?version=${X}`,js:`styled-for-you/${R}/styled-for-you.internal.js`,Params:Tm},"v3-classic":{type:"v3-classic",classname:"StyliticsV3ClassicWidget",css:`v3-classic/${R}/v3-classic.css?version=${X}`,js:`v3-classic/${R}/v3-classic.internal.js`,Params:Em},"v3-hotspots":{type:"v3-hotspots",classname:"StyliticsV3HotspotsWidget",css:`v3-hotspots/${R}/v3-hotspots.css?version=${X}`,js:`v3-hotspots/${R}/v3-hotspots.internal.js`,Params:xm},vibe:{type:"vibe",classname:"StyliticsVibeWidget",css:`vibe/${R}/vibe.css?version=${X}`,js:`vibe/${R}/vibe.internal.js`,Params:Om}};yt(Le("classname"),Object.values(ur));function Fm(t,e){return ur[t].Params.parse(e)}const dt={...ur,"shop-similar":{...ur["shop-similar"],classname:"StyliticsShopSimilarWidgetCompat"}},Um={...yt(Le("classname"),Object.values(dt)),StyliticsShopSimilarWidget:dt["shop-similar"]},lr=J(u(),Kt()),Na=We(Q({...V.entries}),["env","enableStorage","enableTracking","trackingEnv"]);function Lm(t){return Jt(Na,{...D(Na),...t})}const Wa=$i(),za=n(v(J(u(),E()),y(j)),{});function Ga(t){return v(S({client:v(u(),N(t)),username:p(v(u(),N(t))),env:p($(G),G.production),target:p(Wa,void 0),htmlSelector:p(u()),config:S({on:p(lr,{}),override:p(lr,{}),sharedParams:p(za,{}),modules:I(S({client:p(u()),configId:p(u()),on:p(lr,{}),override:p(lr,{}),params:p(za,{}),target:p(Wa),htmlSelector:p(u()),type:Ma}))})}),zt(e=>{const r=e.config.modules.filter(o=>o.type==="nike");if(!(r.length>0))return!0;const i=r.every(o=>!o.client||o.client.includes("nike"));return e.client.includes("nike")&&i},"Invalid module type received."))}function Va(t){return v(Ga(t),y(e=>({...e,target:qm(e.config.modules,e.target)})),y(e=>{const r=Jt(n($(G),e.env),e.config.sharedParams.env??e.config.sharedParams.trackingEnv);return{...e,config:{...e.config,sharedParams:Lm({...e.config.sharedParams,env:r,trackingEnv:r})}}}),y(e=>({...e,config:{...e.config,modules:e.config.modules.map(r=>({...r,params:fe(r.params,e.config.sharedParams)}))}})))}function Ka(t,e){const r=Ga(t).entries.config.entries,s=jr(r.modules.item),i=S({...r,modules:p(I(s),[])});return v(i,y(a=>{const o=e.modules,c=a.modules,l={...e,...a,modules:o,on:{...e.on,...a.on},override:{...e.override,...a.override},sharedParams:fe(e.sharedParams,a.sharedParams)};return a.modules.some(f=>q(f.configId))??!1?c.forEach((f,g)=>{if(!f.configId){A.warn(`config.modules[${g}].configId was not provided. Skipping refresh for this module.`);return}const b=o.findIndex(_=>_.configId===f.configId);if(b===-1){A.warn(`No current module exists with configId of "${f.configId}". Skipping refresh for this module.`);return}const w=o[b];l.modules[b]=Qa(w,f,a.sharedParams)}):o.forEach((f,g)=>{const b=c[g];if(b)l.modules[g]=Qa(f,b,a.sharedParams);else{const w=fe(f,{params:a.sharedParams});l.modules[g]=w}}),l}))}function Qa(t,e,r={}){return{...t,...e,on:fe(t.on,e.on??{}),override:fe(t.override,e.override??{}),params:$m(t.params,e.params,r)}}function $m(t,e={},r={}){const s=uc(t,e);return fe(s,r)}function qm(t,e){if(e!==void 0)return e;if(!(t.length===1&&t[0].type==="shop-similar"))throw new Error("Stylitics: target is required");const s=document.createElement("div");return s.id="stylitics-unused-composer-root-target",s}function Bm(t,e,r){if((e.type==="beauty"||e.params.showPlusIcon===!0)&&["macys","bloomingdales"].includes(t.client))return e;const s=t.getValueFor("widget-variant"),i=t.context.productGroupType==="tags",a=Te(s)||i?e.type:r[s].type;return t.context.moduleType=a,{...e,type:a}}function Hm(t,e){if(!(e.type==="hotspots"&&t.getValueFor("v3-hotspots")))return e;const s="v3-hotspots";return t.context.moduleType=s,{...e,type:s}}function Nm(t,e){if(!(e.type==="classic"&&t.getValueFor("v3-classic")))return e;const s="v3-classic";return t.context.moduleType=s,{...e,type:s}}function Wm({moduleConfig:t,experimentData:e}){let r=t.type;const s=(e.taxonomies.itemDepartment??"").toLowerCase();return Ca.has(s)&&(r="beauty"),{...t,type:r}}function zm({experiments:t,moduleConfig:e,experimentData:r}){const s=t.getValueFor("macys-category"),i=t.getValueFor("macys-category-all");if(s){let a="Pair it with",o="list";const c=(r.taxonomies.itemDepartment??"").toLowerCase(),l=rl(r.taxonomies.allItemsDepartments,"fragrance"),m=r.taxonomies.allRetailerCategories.some(f=>!["health & beauty","cosmetics"].includes(f));return Ca.has(c)&&!l&&!m&&i&&(o="beauty",a="Enjoy every step of your routine"),c==="fragrance"&&l&&["macys","bloomingdales"].includes(t.client)&&(a="More of what you're looking for"),t.context.moduleType=o,{...e,type:o,params:{...e.params,counterHeading:"Bundle",hideAnchorItemCard:!1,moduleHeading:a,moduleHeadingLevel:"h3",shoppableAnchorItem:!0,showCarouselDots:!0}}}return t.context.moduleType=e.type,e}function Gm({experiments:t,moduleConfig:e,experimentData:r}){let s=e.type,i="Pair it with";const a="h3";let o=e.params.maxResults,c=e.params.minResults,l=e.params.showPlusIcon;const m=r.taxonomies.itemCategory??"";function f(_,k){const T=[];for(const x of _){if(!Object.keys(k).includes(x.category)||T.includes(k[x.category]))return!1;T.push(k[x.category])}return!0}const g=r.outfits?.[0]?.items??[],b=Object.keys(Kr).includes(m)&&g.length===5&&f(g,Kr),w=Object.keys(Qr).includes(m)&&g.length===5&&f(g,Qr);return b?i="Set your table":w&&(i="Build your bed"),(b||w)&&(t.context.moduleType=s,o=1,c=1,s="list",l=!0),{...e,type:s,params:{...e.params,maxResults:o,minResults:c,moduleHeading:i,moduleHeadingLevel:a,showPlusIcon:l}}}function Vm(t,e){const r=t.getValueFor("mix-and-match");return Te(r)?e:fe(e,{params:{mixAndMatch:r}})}function Ja(t,e){const r=Nr.has(t.type)?"pz":ih(t.params);return{documentWidth:document.documentElement.clientWidth,moduleType:t.type,productGroupType:r,...e}}function Km({experiments:t,moduleRecords:e,pattern:r=Jm,rootManager:s}){const a=[...s.root.querySelectorAll('link[rel="stylesheet"]')].some(g=>g?.href?.match(r)),o=e.length>1||t.getValueFor("css-theme")||t.getValueFor("css-experiment"),c=cr;new URL(`${c}${e[0].type}.css`);const l=new URL(e[0].css),m=Nd({host:c,urlArgs:{base:Xm(e),experiments:t.getValueFor("css-experiment"),theme:t.getValueFor("css-theme"),version:R}}),f=o?m:l;if(!a){const g=s.createStylesheet(f.href),b=setTimeout(()=>{g.remove(),A.error(`Timeout loading CSS file ${f.href}`)},1e4);g.addEventListener("load",()=>clearTimeout(b)),g.addEventListener("error",w=>{clearTimeout(b),g.remove(),A.error("Failed to load stylesheet",w),A.log("Attempting to load fallback stylesheet"),e.forEach(_=>Qm(_,s))}),s.attachStylesheet(g)}}function Qm(t,e){const r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=new URL(t.css).href,e.attachStylesheet(r)}const Jm=new RegExp(`(stylitics|localhost).*style(-.*)?.css$|stylitics.+(${R}|style.css)$`);function Xm(t){return t.map(e=>e.js.includes("v3")&&!e.type.includes("v3")?`v3-${e.type}`:e.type).join(",")}async function Zm({api:t,browsedItems:e,client:r,experiments:s,moduleConfig:i,purchasedItems:a,sessionId:o}){const c={taxonomies:{allItemsCategories:[],allItemsDepartments:[],allRetailerCategories:[],itemCategory:void 0,itemDepartment:void 0}};if(Te(i.params.item_number))return c;const l={client_user_id:Ym(s,i.params),item_number_type:i.params.item_number_type,item_number:i.params.item_number,locale:i.params.locale,max:i.params.maxResults,min:i.params.minResults,price_hide_double_zero_cents:i.params.hideDoubleZeroCents,price_rounding:i.params.roundingStyle,profile:i.type,return_object:!0,session_id:o,tags:i.params.tags,total:i.params.maxResults,username:r,with_item_coords:!0,...xd({browsedItems:e,purchasedItems:a,experienceConfig:s.experiences,sessionId:o}),...s.experiences,...s.config},m=i.params.item_number;let f,g,b=[];if(i.type==="shop-the-set"){const w=await t.fetchShopTheSet({useFixture:!1,searchParams:{...l,with_item_coords:!1},parseOptions:i.params});w.data&&(b=w.data.itemGroups.flat())}else if(["gallery","v3-classic","v3-hotspots"].includes(i.type)){const w=await t.fetchOutfitsLegacy({searchParams:l});if(w.data){const _=w.data.outfits?.[0]||{};b=_?.items||[],f=_?.primary_stylitics_item_id,g=_?.primary_remote_id}}else{const w=await t.fetchOutfits({useFixture:!1,searchParams:l,parseOptions:i.params});if(w.data){c.outfits=w.data.outfits;const _=w.data.outfits?.[0]||{};b=_?.items||[],f=_?.primary_stylitics_item_id,g=_?.primary_remote_id}}for(const w of b)w.category&&c.taxonomies.allItemsCategories.push(w.category.toLowerCase()),w.department&&c.taxonomies.allItemsDepartments.push(w.department.toLowerCase()),w.retailer_category&&c.taxonomies.allRetailerCategories.push(w.retailer_category.split(" > ")[0].toLowerCase()),[w.item_id,w.remote_id,w.product_id].some(_=>_&&[m,f,g].includes(_))&&(c.taxonomies.itemCategory=w.category,c.taxonomies.itemDepartment=w.department);return c}function Ym(t,e){return Jt(v(S({profileIdPath:n(p(u()),void 0),clientUserId:n(p(v(u(),Gt())),void 0)}),y(({profileIdPath:r,clientUserId:s})=>{const i=t.getValueFor("profile-id-path")??r,a=(ki(i)||s)?.toString();return a&&Ci(a)})),e)}class Us{static async initialize(e){const{client:r,config:s,env:i,target:a}=P(Va(e.client),e),o=er(s.sharedParams),c=tr(s.sharedParams),l=new as({env:i}),m=ms.new(r,{context:{documentWidth:document.documentElement.clientWidth,moduleType:"composer",productGroupType:"unknown"},store:Ve.getOrInit().localStore});return Promise.resolve(new Us({api:l,client:r,config:s,env:i,isStorageEnabled:o,isTrackingEnabled:c,overrides:m,target:a}))}#e=new Et;client;config;env;modules=[];name="StyliticsOrchestrator";target;type=Ba;version=Ha;api;browsedItems;overrides;instanceIdStore=$a.instanceId;previousConfig;purchasedItems;rootManager;_isTrackingEnabled=!0;_clientUserIdHash;constructor({api:e,client:r,config:s,env:i,isStorageEnabled:a,isTrackingEnabled:o,overrides:c,target:l}){this.api=e,this.client=r,this.config=s,this.env=i,this.overrides=c,this.previousConfig=null,this.target=l,this.setStorage(a),this.setTracking(o),this.browsedItems=Wr.new(this.client,this.localStore),this.purchasedItems=zr.new(this.client,this.localStore),this.rootManager=ht.from(this.target),this.#t()}get stylitics(){return Ve.getOrInit()}get cookieStore(){return this.stylitics.cookieStore}get localStore(){return this.stylitics.localStore}get session(){return this.stylitics.session}get root(){return A.warn("StyliticsComposer.root is a private property and should not be accessed."),this.rootManager.target}get instanceId(){return this.instanceIdStore.value}on=(e,r,s)=>{this.#e.set(e,r,s)};async start(){this.debug("Starting Composer"),this.previousConfig=[this.target,Qe(this.config)];const e=Object.assign(document.createElement("h3"),{textContent:"Loading..."});try{const r=await this.fetchData();if(r.error){A.error("composer.start() failed.",r.error);return}await Promise.all([this.attachStylesheet(r.data.stylesheetUrl),...r.data.modules.map((s,i)=>this.attachScript(s,i))]),this.debug("Composer started")}catch(r){A.error(ye(r))}finally{e.remove()}}async destroy(){this.debug("Destroying"),await Promise.all(this.modules.map(e=>e.destroy())),this.rootManager.cleanup(),this.debug("Destroyed")}async refresh(e){if(this.config=P(Ka(this.client,this.config),e),this.configsAreEqual)return this.logSkipRefresh();this.instanceId=nt(),this.previousConfig=[this.target,Qe(this.config)],this.setStorage(er(this.config.sharedParams)),this.setTracking(tr(this.config.sharedParams));const r=await this.fetchData();if(r.error){A.error("composer.refresh() failed.",r.error);return}this.#t();try{await Promise.all(r.data.modules.map((s,i)=>this.modules[i]?.refresh(s.params,s.data))),this.debug("Modules refreshed.")}catch(s){A.error(s)}}attachStylesheet(e){return new Promise(r=>{const s=ae({href:e});ae({protocol:"http",host:"localhost",port:"8787",path:"style-staging.css",searchParams:new URL(e).searchParams});const i=s;i.searchParams.append("version",this.version);const a=this.rootManager.createStylesheet(i.href),o=setTimeout(()=>{a.remove(),A.error(`Timeout loading CSS file ${e}`)},1e4);a.addEventListener("load",()=>{clearTimeout(o),r()}),this.rootManager.attachStylesheet(a)})}attachScript(e,r){return new Promise((s,i)=>{try{const a=e.target&&this.rootManager.getTarget(e.target),o=e.htmlSelector&&this.rootManager.getTarget(e.htmlSelector),c=a||o,m=c||(()=>{const w=typeof e.htmlSelector=="string"?e.htmlSelector:`stylitics-${e.type}-${r}`;let _=1,k=w;for(;this.rootManager.getTarget(k);)k=`${w}-${_}`,_++;return Object.assign(document.createElement("section"),{id:k})})();c||this.rootManager.target.appendChild(m);const f=dt[e.type],g=this.rootManager.createScript({src:`${cr}${f.js}`,onload:async()=>{try{const w=Ve.getOrInit().getModule(e.type)?.Widget;if(!w)return i(new Error(`Module of type "${e.type}" is not available.`));const _=new w({username:e.username,target:m,data:e.data,params:e.params,opts:{api:this.api,configProvenance:e.configProvenance,cookieStore:this.cookieStore,localStore:this.localStore,metadata:{loaderType:Fs.composer},moduleIndex:r,overrides:this.overrides,session:this.session,type:e.type}});_.deriveInstanceId(this.instanceIdStore),Object.entries(fe(this.config.on,e.on??{})).forEach(([k,T])=>{const[x,ee]=k.split(".");_.on(x,ee,T)}),Object.entries(fe(this.config.override,e.override??{})).forEach(([k,T])=>{const[x,ee]=k.split(".");_.override(x,ee,T)}),this.modules.push(_),this.debug(`Starting ${f.classname}`),await _.start(),this.debug(`${f.classname} started`),s()}catch(w){i(ye(w))}}}),b=this.#r.onCreateScript(g);this.rootManager.attachScript(b)}catch(a){i(ye(a))}})}get isInitialStart(){return Te(this.previousConfig)}get configsAreEqual(){return qe(this.previousConfig,[this.target,Qe(this.config)])}set instanceId(e){this.instanceIdStore.refresh(e)}debug(e){}logSkipRefresh(){A.debug("called start/refresh with the same configuration. Skipping.")}disableTracking(){return this.isTrackingEnabled=!1,this}enableTracking(){return this.isTrackingEnabled=!0,this}doNotTrack(){return this.disableTracking()}doTrack(){return this.enableTracking()}get isTrackingEnabled(){return this._isTrackingEnabled}set isTrackingEnabled(e){e===!0&&(this._isTrackingEnabled=!0,this.modules.forEach(r=>r.enableTracking())),e===!1&&(this._isTrackingEnabled=!1,this.modules.forEach(r=>r.disableTracking()))}disableStorage(){return this.localStore.enableStorage=!1,this.cookieStore.enableStorage=!1,this.modules.forEach(e=>e.disableStorage()),this}enableStorage(){return this.localStore.enableStorage=!0,this.cookieStore.enableStorage=!0,this.modules.forEach(e=>e.enableStorage()),this.session.syncStoredSessionIds(),this.overrides.syncToStore(),this}disableLocalStorageAndCookies(){return this.localStore.enableStorage=!1,this.cookieStore.enableStorage=!1,this.modules.forEach(e=>e.disableStorage()),this}enableLocalStorageAndCookies(){return this.localStore.enableStorage=!0,this.cookieStore.enableStorage=!0,this.modules.forEach(e=>e.enableStorage()),this.session.syncStoredSessionIds(),this.overrides.syncToStore(),this}get isStorageEnabled(){return this.cookieStore.enableStorage||this.localStore.enableStorage}setTracking(e){return e?this.enableTracking():this.disableTracking(),this}setStorage(e){return e?this.enableStorage():this.disableStorage(),this}async fetchData(){const e=new Map,r=pl(this.config.modules,this.browsedItems.get(),this.purchasedItems.get()),s={browsed:r.browsed.map(o=>o.remote_id),purchased:r.purchased.map(o=>o.remote_id)},i=this.config.modules.map(o=>{const c={client_user_id:this.clientUserIdHash,item_number_type:o.params.item_number_type,item_number:o.params.item_number,locale:o.params.locale,max:o.params.maxResults,min:o.params.minResults,price_hide_double_zero_cents:o.params.hideDoubleZeroCents,price_rounding:o.params.roundingStyle,profile:o.type,return_object:!0,session_id:this.session.id,tags:o.params.tags,total:o.params.maxResults,username:o.client??this.client,with_item_coords:!0,...Nr.has(o.type)&&s,...o.type==="styled-for-you"&&{personalized_results:o.params.personalizedResults,session_id:o.params.sessionId||this.session.id}},l={...o,...c,configId:o.configId??nt()};return e.set(l.configId,l),{...l,on:void 0,override:void 0,target:void 0}}),a=await this.api.fetchOrchestrator({useFixture:new URL(location.href).searchParams.get("stylitics-orc-fixture")==="true",searchParams:{config:{browsed:s.browsed,modules:i,pageUrl:this.pageUrl.href,purchased:s.purchased,screenSize:Fa(document.body.clientWidth),sessionId:this.session.id}},parseOptions:{...Xl,emitWarnings:!0,browsedItems:r.browsed,purchasedItems:r.purchased,maxBrowsedItems:1/0,maxPurchasedItems:1/0}});return a.data&&a.data.modules.forEach(o=>{const c=e.get(o.configId);Object.assign(o,{on:c?.on??{},override:c?.override??{},target:c?.target??void 0})}),a}updateClientUserIdHash(){const e=P(Nl,this.config.sharedParams.clientUserId);this.clientUserIdHash=e}get clientUserIdHash(){return Te(this._clientUserIdHash)&&this.updateClientUserIdHash(),this._clientUserIdHash}set clientUserIdHash(e){Vt(xi,e)&&(this._clientUserIdHash=e)}get pageUrl(){const e=new URL(location.href);return this.overrides.get("test-presence").abException?.id==="001"&&e.searchParams.set("styliticsoverride","001"),e}#t=()=>{Object.entries(this.config.on).forEach(([e,r])=>{const[s,i]=e.split(".");this.#e.set(s,i,r)})};#r={onCreateScript:e=>{const s=(this.#e.get(Y.create,re.script)??(()=>e))(e);return s instanceof HTMLScriptElement?s:(A.warn("create.script callback did not return an HTMLScriptElement. Ignoring returned value."),e)}}}class hr{static async initialize(e){const{client:r,config:s,env:i,target:a}=P(Va(e.client),e),o=er(s.sharedParams),c=tr(s.sharedParams),l=K.new({enableStorage:o}),m=se.new({enableStorage:o}),f=new as({env:i}),g=new os({cookieStore:m,localStore:l}),b=us.new({api:f,client:r,context:{documentWidth:document.documentElement.clientWidth,moduleType:"unknown",productGroupType:"unknown"},session:g,store:l});return await(["demo","lilacblonde"].some(w=>r.includes(w))?b.fetchFreshConfig():b.fetchConfigIfExpired()),b.getValueFor("orchestrator")??!1?await Us.initialize(e):new hr({api:f,client:r,env:i,experiments:b,config:s,session:g,target:a,cookieStore:m,localStore:l,isStorageEnabled:o,isTrackingEnabled:c})}#e=new Et;client;config;env;modules=[];name="StyliticsComposer";target;type=Ba;version=Ha;api;get stylitics(){return Ve.getOrInit()}get cookieStore(){return this.stylitics.cookieStore}get localStore(){return this.stylitics.localStore}get session(){return this.stylitics.session}experiments;instanceIdStore=$a.instanceId;previousConfig;rootManager;_isTrackingEnabled=!0;constructor({api:e,client:r,config:s,env:i,experiments:a,isStorageEnabled:o,isTrackingEnabled:c,target:l}){this.api=e,this.client=r,this.config=s,this.env=i,this.experiments=a,this.previousConfig=null,this.target=l,this.setStorage(o),this.setTracking(c),this.rootManager=ht.from(this.target),this.#t()}get root(){return A.warn("StyliticsComposer.root is a private property and should not be accessed."),this.rootManager.target}get instanceId(){return this.instanceIdStore.value}on=(e,r,s)=>{this.#e.set(e,r,s)};async start(){this.debug("Starting Composer"),this.previousConfig=[this.target,Qe(this.config)];const e=Object.assign(document.createElement("h3"),{textContent:"Loading..."});try{const r=await this.processModuleConfigs();Km({experiments:this.experiments,moduleRecords:r.map(s=>({...dt[s.type],css:cr+dt[s.type].css})),rootManager:this.rootManager}),await Promise.all(r.map(this.attachScript.bind(this))),this.debug("Composer started")}catch(r){A.error(ye(r))}finally{e.remove()}}async destroy(){this.debug("Destroying"),await Promise.all(this.modules.map(e=>e.destroy())),this.rootManager.cleanup(),this.debug("Detroyed")}async refresh(e){if(this.config=P(Ka(this.client,this.config),e),this.configsAreEqual)return this.logSkipRefresh();this.instanceId=nt(),this.previousConfig=[this.target,Qe(this.config)],this.setStorage(er(this.config.sharedParams)),this.setTracking(tr(this.config.sharedParams)),this.#t();try{await Promise.all(this.config.modules.map((r,s)=>this.modules[s]?.refresh(r.params))),this.debug("Modules refreshed.")}catch(r){A.error(r)}}attachScript(e,r){return new Promise((s,i)=>{try{const a=e.target&&this.rootManager.getTarget(e.target),c=a||(()=>{const g=typeof e.target=="string"?e.target:`stylitics-${e.type}-${r}`;let b=1,w=g;for(;this.rootManager.getTarget(w);)w=`${g}-${b}`,b++;return Object.assign(document.createElement("section"),{id:w})})();a||this.rootManager.target.appendChild(c);const l=dt[e.type],m=this.rootManager.createScript({src:`${cr}${l.js}`,onload:async()=>{try{const g=e.client||this.client,b=this.stylitics.getModule(e.type)?.WidgetLegacy;if(!b)return i(new Error(`Module of type "${e.type}" is not available.`));const w=new b(g,c,e.params,{api:this.api,cookieStore:this.cookieStore,localStore:this.localStore,metadata:{loaderType:Fs.composer},session:this.session});w.deriveInstanceId(this.instanceIdStore),Object.entries(fe(this.config.on,e.on??{})).forEach(([_,k])=>{const[T,x]=_.split(".");w.on(T,x,k)}),Object.entries(fe(this.config.override,e.override??{})).forEach(([_,k])=>{const[T,x]=_.split(".");w.override(T,x,k)}),this.modules.push(w),this.debug(`Starting ${l.classname}`),await w.start(),this.debug(`${l.classname} started`),s()}catch(g){i(ye(g))}}}),f=this.#r.onCreateScript(m);this.rootManager.attachScript(f)}catch(a){i(ye(a))}})}get configsAreEqual(){return qe(this.previousConfig,[this.target,Qe(this.config)])}set instanceId(e){this.instanceIdStore.refresh(e)}debug(e){}logSkipRefresh(){A.debug("Called start/refresh with the same configuration. Skipping.")}isSingleModuleType(){return sc(Le("type"),this.config.modules).length===1}applyWidgetVariantExperiment=e=>this.isSingleModuleType()?Bm(this.experiments,e,Um):e;processModuleConfigs(){return Promise.all(this.config.modules.map(async e=>{let r={taxonomies:{allItemsCategories:[],allItemsDepartments:[],allRetailerCategories:[],itemCategory:void 0,itemDepartment:void 0}};const s=i=>{this.experiments.context=Ja(i,r.taxonomies)};return Promise.resolve(Qe(e)).then(Ee(vt(s),i=>Hm(this.experiments,i),i=>Nm(this.experiments,i),vt(s))).then(async i=>{const a=i.client??this.client;this.experiments=a===this.client?this.experiments:await us.initialize({api:this.api,client:a,context:this.experiments.context,session:this.session,store:this.localStore});const o={...i,params:Fm(i.type,i.params)};r=await Zm({api:this.api,browsedItems:Wr.new(a,this.experiments.store).get(),client:this.client,experiments:this.experiments,moduleConfig:o,purchasedItems:zr.new(a,this.experiments.store).get(),sessionId:this.session.id});const c=this.experiments.getValueFor("beauty-widget-apply"),l=this.experiments.getValueFor("enhanced-list-plus");return c?Wm({moduleConfig:i,experimentData:r}):l?Gm({experiments:this.experiments,moduleConfig:i,experimentData:r}):zm({experiments:this.experiments,moduleConfig:i,experimentData:r})}).then(Ee(vt(s),this.applyWidgetVariantExperiment,i=>Vm(this.experiments,i),vt(s)))}))}setExperimentContext=e=>{this.experiments.context=Ja(e)};disableTracking(){return this.isTrackingEnabled=!1,this}enableTracking(){return this.isTrackingEnabled=!0,this}doNotTrack(){return this.disableTracking()}doTrack(){return this.enableTracking()}get isTrackingEnabled(){return this._isTrackingEnabled}set isTrackingEnabled(e){e===!0&&(this._isTrackingEnabled=!0,this.modules.forEach(r=>r.enableTracking())),e===!1&&(this._isTrackingEnabled=!1,this.modules.forEach(r=>r.disableTracking()))}disableStorage(){return this.localStore.enableStorage=!1,this.cookieStore.enableStorage=!1,this.modules.forEach(e=>e.disableStorage()),this}enableStorage(){return this.localStore.enableStorage=!0,this.cookieStore.enableStorage=!0,this.modules.forEach(e=>e.enableStorage()),this.session.syncStoredSessionIds(),this.experiments.storeConfig(),this}disableLocalStorageAndCookies(){return this.localStore.enableStorage=!1,this.cookieStore.enableStorage=!1,this.modules.forEach(e=>e.disableStorage()),this}enableLocalStorageAndCookies(){return this.localStore.enableStorage=!0,this.cookieStore.enableStorage=!0,this.modules.forEach(e=>e.enableStorage()),this.session.syncStoredSessionIds(),this.experiments.storeConfig(),this}get isStorageEnabled(){return this.cookieStore.enableStorage||this.localStore.enableStorage}setTracking(e){return e?this.enableTracking():this.disableTracking(),this}setStorage(e){return e?this.enableStorage():this.disableStorage(),this}#t=()=>{Object.entries(this.config.on).forEach(([e,r])=>{const[s,i]=e.split(".");this.#e.set(s,i,r)})};#r={onCreateScript:e=>{const s=(this.#e.get(Y.create,re.script)??(()=>e))(e);return s instanceof HTMLScriptElement?s:(A.warn("create.script callback did not return an HTMLScriptElement. Ignoring returned value."),e)}}}return window.StyliticsComposer||=hr,hr}();