1import{cx as D,aN as g,aM as O,bv as x,bb as f,cy as p,aU as L,by as T,cz as A}from"./B28ecb5o.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"d24d26768c5a01fd6805d2d9098748ca6be520dc"};var i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="08c4b6a6-8ed3-46ed-a1a4-d1228b0d7ee8",a._sentryDebugIdIdentifier="sentry-dbid-08c4b6a6-8ed3-46ed-a1a4-d1228b0d7ee8")}catch{}})();const N=D("modals",()=>{const a=g([]),i=g([]),s=O(()=>Object.fromEntries(i.value.map(e=>[e?.name,e.data])));function c(e){i.value.push(e)}function y(e){i.value=i.value.filter(t=>t?.name!==e)}function v(){i.value=[]}function r(e){const t=i.value.findIndex(u=>u?.name===e.name);i.value=[...i.value.slice(0,t),e,...i.value.slice(t+1)]}async function l(e){return await x.get(`coupons/${e}`).then(t=>(r({name:"ModelPromo",data:{...t.data}}),t)).catch(()=>{})}return{ids:a,setData:c,update:r,close:y,get:s,clear:v,initPromo:l}}),C="favorite",k="favorite-count",I=D("favorite",()=>{const a=g([]),i=g({}),s=N();function c(e){a.value=[...e.ids],i.value=e.count}function y(){const e=f(C,{path:"/",maxAge:p}),t=e.value?e.value.toString().split(",").map(n=>+n):[],u=f(k,{path:"/",maxAge:p}),o=u.value?Object.fromEntries(u.value.toString().split(",").map(n=>{const d=n.split("-");return[d[0],+d[1]]})):{};t.length&&c({ids:t,count:o})}function v({id:e,catId:t,deleteCard:u}){let o=a.value;const n={...i.value};let d=!!u;if(o.includes(e))o=o.filter(m=>m!==e),d=!0,--n[t]<1&&delete n[t];else if(d=!1,o.length>=300){s.setData({name:"limit",data:{type:"favorite"}});return}else o=[...o,e],n[t]=n[t]?n[t]+1:1;const S=f(k,{path:"/",maxAge:p});S.value=Object.entries(n).map(m=>m.join("-")).join(",");const b=f(C,{path:"/",maxAge:p});b.value=o.join(","),c({ids:o,count:n}),E({ids:o,count:n});const h=s.get.notification,w={name:"notification",data:{type:"favorite",categoryCount:n[t],deleteCard:d,id:e,catId:t,date:Date.now()}};return h?s.update(w):s.setData(w),o}function r(){const e=f(k,{path:"/",maxAge:p});e.value=null;const t=f(C,{path:"/",maxAge:p});t.value=null,c({ids:[],count:{}}),E({ids:[],count:{}})}function l(e,t,u){e&&t&&u==="8tjFVGPSXybonKgALDh2RkxmHEzf4WTQwvN0"&&v({id:Number(e),catId:Number(e),deleteCard:!1})}return{ids:a,toggleFavorite:v,countInCategory:i,getFavoriteEnvironment:y,clearFavorite:r,setFavoriteState:c,externalToggleFavorite:l}}),K="favorite",F="compare",R=()=>{const{setFavoriteState:a}=I(),{setCompareState:i}=M(),s=c=>{c.key===K?a(JSON.parse(c.newValue)):c.key===F&&i(JSON.parse(c.newValue))};L(()=>{window&&window.addEventListener("storage",s)}),T(()=>{window&&window.removeEventListener("storage",s)})},E=a=>{window&&window.localStorage.setItem(K,JSON.stringify(a))},J=a=>{window&&window.localStorage.setItem(F,JSON.stringify(a))},_="compare",j="compare-count",M=D("compare",()=>{const a=g([]),i=g({}),s=N();function c(r){a.value=[...r.ids],i.value=r.count}function y(){const r=f(_,{path:"/",maxAge:p}),l=r.value?r.value.toString().split(",").map(u=>+u):[],e=f(j,{path:"/",maxAge:p}),t=e.value?Object.fromEntries(e.value.toString().split(",").map(u=>{const o=u.split("-");return[o[0],+o[1]]})):{};l.length&&c({ids:l,count:t})}function v({id:r,catId:l,deleteCard:e,hideNotification:t}){const{domain:u}=A(window.location.hostname,window.location.port);let o=a.value;const n={...i.value};let d=!!e;if(o.includes(r))o=o.filter(m=>m!==r),--n[l]<1&&delete n[l],d=!0;else if(d=!1,o.length>=300){s.setData({name:"limit",data:{type:"compare"}});return}else o=[...o,r],n[l]=n[l]?n[l]+1:1;const S=f(j,{path:"/",domain:u,maxAge:p});S.value=Object.entries(n).map(m=>m.join("-")).join(",");const b=f(_,{path:"/",domain:u,maxAge:p});b.value=o.join(","),c({ids:o,count:n}),J({ids:o,count:n});const h=s.get.notification,w={name:"notification",data:{type:"compare",categoryCount:n[l],deleteCard:d,id:r,catId:Number(l),date:Date.now()}};t||(h?s.update(w):s.setData(w))}return{ids:a,countInCategory:i,setCompareState:c,toggleCompare:v,getCompareEnvironment:y}});export{M as a,N as b,R as c,I as u}; 2//# sourceMappingURL=B-xgNN_7.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.