1import{i as f}from"./Bfrw7srn.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="eb91b191-a503-45fe-a2f1-38407b240fa1",t._sentryDebugIdIdentifier="sentry-dbid-eb91b191-a503-45fe-a2f1-38407b240fa1")}catch{}})();function y(t){const{shop:e,includeFuture:r}=t,u=(e&&e.deals?JSON.parse(JSON.stringify(e.deals)):[]).filter(n=>{const o=f().startOf("day");if(n.custom){const i=d(n.dateFrom),c=d(n.dateTo);return(r||i===null||!o.isBefore(i))&&(c===null||!o.isAfter(c))}else if(n.weekdays)return r?!0:n.weekdays.split(",").includes(o.day().toString())});return D(u)}function A(t){const{shop:e,product:r,timeslot:s}=t;if(!r)return;const o=(e&&e.deals?JSON.parse(JSON.stringify(e.deals)):[]).filter(i=>{if(i.products&&i.products.includes(t.product.id)||t.product.categories&&i.categories&&i.categories.some(c=>t.product.categories.includes(c))||r.categories&&i.categories&&i.categories.some(c=>r.categories.filter(a=>a.hasOwnProperty("id")&&a.id==c.id)))return i}).filter(i=>{let c=f().startOf("day");if(s&&s.date&&(c=f(s.date).startOf("day")),i.custom){const a=d(i.dateFrom),l=d(i.dateTo);if((a===null||!c.isBefore(a))&&(l===null||!c.isAfter(l)))return!0}else{const a=i.weekdays.split(","),l=c.day().toString();if(a.includes(l))return!0}});if(o.sort((i,c)=>{const a=i.fixedPrice?i.fixedPrice:i.discountPercentage?t.product.price-t.product.price*i.discountPercentage/100:i.discountAmount?t.product.price-i.discountAmount:t.product.price,l=c.fixedPrice?c.fixedPrice:c.discountPercentage?t.product.price-t.product.price*c.discountPercentage/100:c.discountAmount?t.product.price-c.discountAmount:t.product.price;return a-l}),o.length>0)return o[0]}function m(t){const{deal:e,timeslot:r}=t;let s=f().startOf("day");if(r&&r.date&&(s=f(r.date).startOf("day")),e.custom){const u=d(e.dateFrom),n=d(e.dateTo);if((u===null||!s.isBefore(u))&&(n===null||!s.isAfter(n)))return e}else{const u=e.weekdays.split(","),n=s.day().toString();if(u.includes(n))return e}}function E(t){const{shop:e,deal:r}=t;return(e&&e.products?JSON.parse(JSON.stringify(e.products)):[]).filter(n=>{if(r.products&&r.products.includes(n.id)||n.categories&&r.categories&&r.categories.some(o=>n.categories.includes(o)))return n})}function O(t){const{cart:e,shop:r,timeslot:s}=t,u=e&&e.items?JSON.parse(JSON.stringify(e.items)).map(o=>o.product):[];for(const o of u)if(A({shop:r,product:o,timeslot:s}))return!0;const n=y({shop:r,includeFuture:!0});if(n&&n.length>0){for(const o of n)if(m({deal:o,timeslot:s})&&o.freeShipping)return!0}return!1}function D(t){const e=f().startOf("day");return t.sort((r,s)=>{const u=p(r,e),n=p(s,e);if(u!==n)return u?-1:1;const o=g(r,e).valueOf()-g(s,e).valueOf();return o!==0?o:r.freeShipping!==s.freeShipping?r.freeShipping?-1:1:r.fixedPrice!==s.fixedPrice?r.fixedPrice-s.fixedPrice:r.discountPercentage!==s.discountPercentage?s.discountPercentage-r.discountPercentage:s.discountAmount-r.discountAmount})}function d(t){if(!t)return null;const e=f(t);return e.isValid()?e.startOf("day"):null}function p(t,e){if(t.custom){const r=d(t.dateFrom),s=d(t.dateTo);return(r===null||!e.isBefore(r))&&(s===null||!e.isAfter(s))}return(t.weekdays||"").split(",").map(Number).some(r=>r===e.day())}function g(t,e){if(t.custom){const s=d(t.dateFrom);return s&&s.isAfter(e)?s:e}const r=(t.weekdays||"").split(",").map(Number).filter(s=>s>=0&&s<=6).reduce((s,u)=>Math.min(s,(u-e.day()+7)%7),1/0);return r===1/0?e.add(100,"year"):e.add(r,"day")}function T(t){if(t.startsWith("AMOUNT:")){const e=t.replace("AMOUNT:","");return`â¬${parseFloat(e)} korting`}else if(t.startsWith("PERCENTAGE:")){const e=t.replace("PERCENTAGE:","");return`${parseInt(e)}% korting`}else if(t.startsWith("FIXEDPRICE:")){const e=t.replace("FIXEDPRICE:","");return`Voor â¬${parseFloat(e)}`}else if(t.startsWith("BUYGETFREE:")){const[e,r]=t.replace("BUYGETFREE:","").split("-");return`${e} + ${r} gratis`}else if(t.startsWith("BUYGETDISCOUNT:")){const[e,r,s]=t.replace("BUYGETDISCOUNT:","").split("-");return t=="BUYGETDISCOUNT:2-1-50P"?"2e halve prijs":"Stapelkorting"}else{if(t.startsWith("STACK:"))return t.replace("STACK:","").split(":"),"Stapelkorting";if(t.startsWith("AMOUNTFIXEDPRICEEACH:")){const[e,r]=t.replace("AMOUNTFIXEDPRICEEACH:","").split("-");return`${e} voor â¬${r} per stuk`}}
1}export{T as a,A as b,O as c,m as d,E as e,y as g};
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.