import{b as s}from"./chunk-WOPL5OOA.js";import{Ia as o,a as i,b as n}from"./chunk-VQ6IH7OA.js";var d=(()=>{class r{static getDotDiscount(e){let t=e?.dotDiscount;if(t){let a=JSON.parse(t.text);return n(i({},t),{config:n(i({},a),{text:a.text,type:a.type?a.type:"CLASSIC"})})}}static getModelName(e,t){return this.productNameRemoveMemory(this.productNameRemoveDualSim(this.productNameRemoveBrand(e,t)))}static productNameRemoveBrand(e,t){return e.brand&&t.displayName.indexOf(e.brand.name)>-1?t.displayName.replace(e.brand.name,"").trim():t.displayName}static productNameRemoveDualSim(e){return e.replace(/\(?dual sim\)?/i,"").trim()}static productNameRemoveMemory(e){return e.split(" ").filter(t=>!t.toUpperCase().includes("GB")&&!t.toUpperCase().includes("MB")).join(" ")}getActiveVariant(e,t){let a=e.variants?.[0];return t&&(a=e.variants?.find(c=>c.id===t)??a),n(i({},a),{capacity:e.badge?.capacity,brand:e.brand,categoryName:e.categoryName})}getBadges(e){return e.badge?Object.values(e.badge).filter(t=>!!t):[]}static outOfStock(e,t){return e==="noStock"||e==="expired"||t===s.error}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=o({token:r,factory:r.\u0275fac})}}return r})();export{d as a};