PageSourceSearch

https://servimax.co/8287.65e58052c5f10642.js

js servimax.co collected 2026-10-02 01:21:47 UTC 6,892 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkservimax_home_page=self.webpackChunkservimax_home_page||[]).push([[8287],{3409:(B,M,m)=>{m.d(M,{W:()=>g});var _=m(1471),I=m(4412),v=m(5447),a=m(4438);let g=(()=>{class E{constructor(){this.secretKey="shgL09283*",this.impuestos=0,this.subtotal=0,this.total=0,this.totalsSubject=new I.t({subtotal:0,total:0,impuestos:0}),this.totals$=this.totalsSubject.asObservable()}saveStorageElement(e,s,r){const o=_.AES.encrypt(JSON.stringify(r),this.secretKey).toString();"Local"===e?localStorage.setItem(s,o):sessionStorage.setItem(s,o)}getStorageElement(e,s){const r="Local"===e?localStorage.getItem(s):sessionStorage.getItem(s);if(!r)return null;try{const o=_.AES.decrypt(r,this.secretKey);return JSON.parse(o.toString(_.enc.Utf8))}catch{return null}}deleteStorageElement(e,s){"Session"===e?localStorage.removeItem(s):sessionStorage.removeItem(s)}cleanAll(e){"Session"===e?localStorage.clear():sessionStorage.clear()}addToCart(e){if((0,v.K)(e))return;const s=this.getCart(),r=s.find(o=>o.id===e.id);r?r.quantity+=e.quantity:s.push({...e}),this.saveStorageElement("Local","cart",s),this.calcularTotales()}removeFromCart(e){const s=this.getCart(),r=s.findIndex(o=>o.id===e.id);-1!==r&&(s.splice(r,1),this.saveStorageElement("Local","cart",s),this.calcularTotales())}calcularTotales(){const e=this.getCart(),s=e.reduce((T,u)=>T+u.price*u.quantity,0),r=this.calcularImpuestos(e),o=s+r;this.impuestos=r,this.subtotal=s,this.total=o,this.totalsSubject.next({subtotal:this.subtotal,total:this.total,impuestos:this.impuestos}),this.saveStorageElement("Session","subtotal",s),this.saveStorageElement("Session","total",o),this.saveStorageElement("Session","impuestos",r)}calcularImpuestos(e){let s=0;return e.forEach(r=>{r.taxed&&r.taxed.forEach(o=>{"IMP_VALOR_PROD"===o.type?s+=o.value*r.quantity:"IMP_PORCENTAJE_PROD"===o.type&&(s+=o.value*r.price*r.quantity)})}),s}setImpuestos(e){this.impuestos=e}getCart(){return this.getStorageElement("Local","cart")||[]}clearCart(){this.deleteStorageElement("Session","cart"),this.calcularTotales()}getSubtotal(){return this.calcularTotales(),this.subtotal}getTotal(){return this.calcularTotales(),this.total}getTotalImpuestos(){return this.calcularTotales(),this.impuestos}static{this.\u0275fac=function(s){return new(s||E)}}static{this.\u0275prov=a.jDH({token:E,factory:E.\u0275fac,providedIn:"root"})}}return E})()},5447:(B,M,m)=>{m.d(M,{K:()=>s,l:()=>r});var _=m(6354),P=m(5312),I=m(7090),v=m(4438),a=m(1626),g=m(7530);const E={title:"\u{1f381} Tienes un regalo",hint:"Tu compra te da derecho a este regalo. M\xe1rcalo si lo quieres."},y={title:"\u{1f381} Elige lo que te llevas",hint:"Tu compra te da derecho a esto. Marca cu\xe1les regalos quieres \u2014 uno, varios o ninguno."},e=o=>String(o??"").trim().toUpperCase(),s=o=>{if(!o)return!1;if(/^\s*BONIFICADO\b/i.test(o.name??""))return!0;const T=Number(o.price);return Number.isFinite(T)&&T<=0};let r=(()=>{class o{constructor(u,c){this.http=u,this.storageService=c,this.regionBase=new I.s("bogota",P.c);const l=this.storageService.getStorageElement({space:"Session",typeElement:"sede"})?.base||"bogota";this.regionBase=new I.s(l,P.c)}currentSource(){return"whatsapp"===sessionStorage.getItem("specialSource")?"CHATBOT":"WEB"}currentSede(){return this.storageService.getStorageElement({space:"Session",typeElement:"sede"})?.base||"bogota"}getGiftProductInfo(u){return this.http.post(`${this.regionBase.getUserBase()}products/getProductLite`,{abakoId:u},{headers:{sede:this.currentSede()}}).pipe((0,_.T)(c=>{const l=Array.isArray(c?.response)?c.response[0]:c?.response;return l?.name?{name:String(l.name),urlFile:l.urlFile||void 0}:null}))}getPromoCampaignsByComerce(u){return this.http.post(`${this.regionBase.getUserBase()}orders/getPromoCampaignsByComerce`,{idComerce:u,source:this.currentSource()},{headers:{sede:this.currentSede()}}).pipe((0,_.T)(c=>c?.response??[]))}expectedGifts(u,c){const l=new Map,h=new Map;for(const d of c||[]){const S=e(d?.code);if(!S)continue;l.set(S,(l.get(S)??0)+(Number(d.quantity)||0));const p=Number(d.value);Number.isFinite(p)&&p>0&&h.set(S,(h.get(S)??0)+p)}const O=new Map;
1for(const d of u||[]){const S="CLIENTE_ELIGE"===e(d.giftSelectionMode||"AUTO"),p=new Map,b=(t,i,n,f)=>{const C=e(t);if(!(C&&n>0))return;let D=(p.get(C)?.qty??0)+n;null!=f&&f>0&&(D=Math.min(D,f)),p.set(C,{qty:D,name:(i||"").trim()||p.get(C)?.name||""})};for(const t of d.rules??[]){const i=l.get(e(t.triggerCode))??0;if(i<=0||null!=t.minQuantity&&i<t.minQuantity)continue;const n=Math.floor(i/(t.perUnits||1))*(t.bonusQuantity||1);b(t.bonusCode,t.bonusName,n,t.maxPerCustomer)}for(const t of d.groups??[]){const i=(t.conditions??[]).filter(f=>e(f.code));if(0===i.length)continue;let n=1/0;for(const f of i){const C=l.get(e(f.code))??0,A=f.minQuantity||1;if(C<A){n=0;break}n=Math.min(n,Math.floor(C/A))}!Number.isFinite(n)||n<=0||b(t.bonusCode,t.bonusName,n*(t.bonusQuantity||1),t.maxPerCustomer)}for(const t of d.valueRules??[]){if(!(t.perAmount>0))continue;let i=0;for(const C of t.scopeCodes??[])i+=h.get(e(C))??0;if(i=Math.round(100*i)/100,i<t.perAmount)continue;let n=Math.floor((i+1e-6)/t.perAmount);(null!=t.maxOffersPerInvoice&&t.maxOffersPerInvoice>0&&(n=Math.min(n,t.maxOffersPerInvoice)),n<=0)||b(t.bonusCode,t.bonusName,n*(t.bonusQuantity||1),null!=t.maxOffersPerCustomer&&t.maxOffersPerCustomer>0?t.maxOffersPerCustomer*(t.bonusQuantity||1):null)}for(const[t,i]of p){const n=O.get(t),f=n?[...n.campaignCodes]:[];d.code&&!f.includes(d.code)&&f.push(d.code),O.set(t,{bonusCode:t,bonusName:i.name||n?.bonusName||t,quantity:(n?.quantity??0)+i.qty,campaignCode:n?.campaignCode||d.code,campaignCodes:f,selectable:S||!0===n?.selectable})}}return Array.from(O.values())}maxByCampaign(u){const c={};for(const l of u||[]){const h=Number(l?.giftSelectionMax);Number.isFinite(h)&&h>0&&(c[l.code]=Math.floor(h))}return c}minByCampaign(u){const c={};for(const l of u||[]){const h=Number(l?.giftSelectionMin);Number.isFinite(h)&&h>0&&(c[l.code]=Math.floor(h))}return c}copyForGifts(u,c){const l=(c||[]).filter(t=>t.selectable),h=new Set(l.map(t=>t.bonusCode)).size,O=1===h?E:y,d=1===h?"single":"multiple",S=new Set(l.map(t=>t.campaignCode)),p=[];for(const t of u||[]){if(!S.has(t.code)||"CLIENTE_ELIGE"!==e(t.giftSelectionMode||"AUTO"))continue;const i=t.giftCopy?.merchant?.[d];i&&String(i.title||"").trim()&&p.push({title:String(i.title).trim(),hint:String(i.hint||"").trim()})}if(!p.length)return O;const b=p[0];return p.every(t=>t.title===b.title&&t.hint===b.hint)?b:O}static{this.\u0275fac=function(c){return new(c||o)(v.KVO(a.Qq),v.KVO(g.n))}}static{this.\u0275prov=v.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})()},5743:(B,M,m)=>{m.d(M,{N:()=>_,aL:()=>P});const _=a=>a&&(a.includes("http")?a:`https://storage.googleapis.com/attachments-servimax-isa/${a}`),P=a=>a||0===a?"$"+Math.round(a).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"):"$0"}}]);

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.