PageSourceSearch

https://dominos.com.gt/_nuxt/CZMsrdiS.js

js dominos.com.gt collected 2026-10-05 21:35:35 UTC 18,602 bytes, 1 lines download raw bytes

1import{f as mt,b0 as ht,ao as vt,b8 as gt,d as a,aR as _t,b as _,w as $,E as kt,a as St,z as bt,aI as he,aJ as Z,aK as y,x as v,Q as l,aM as g,aP as O,aU as L,aV as wt,n as Pt,aH as At}from"./0UcNmHsd.js";import{M as It}from"./Cprj4g4W.js";import{a as ve,P as ge,b as _e}from"./7MNRgu8Z.js";import{u as Ot}from"./CAEeWyaK.js";import{h as Et,d as Rt,q as Ct,j as Nt,u as jt}from"./DIRthnPV.js";import{u as Tt,g as ke}from"./CpUxOya8.js";import{e as qt,d as Mt}from"./D0gAwyL_.js";import"./DjB66o0C.js";import"./CJZscHVZ.js";const zt={class:"card-result-container"},Bt={class:"card-result-title"},Ut={class:"card-result-section payment-result"},Dt={key:0,class:"processing-state"},$t={class:"processing-message"},Lt={key:1},xt={key:0,class:"result approved"},Ft={class:"status-title approved"},Vt={key:0,class:"status-detail"},Jt={class:"status-value"},Kt={key:1,class:"status-detail"},Qt={class:"status-value"},Wt={class:"status-detail status-note"},Yt={key:2,class:"status-detail status-note"},Gt={key:3,class:"status-detail status-success"},Ht={key:4,class:"status-detail status-error"},Zt={key:1,class:"result rejected"},Xt={class:"status-title rejected"},er={key:0,class:"status-detail status-error"},tr=mt({__name:"resultado-tarjeta",async setup(rr){const E=ht(),Se=vt(),be=!0,we=[],Pe=null,m=gt("checkout-card-redirect-state",()=>({postEntries:we,queryEntries:U(E.query),rawPostBody:"",storedPayload:Pe})),P=Ot(),{secureJson:x}=Et(),{paymentMethods:Ae}=Tt(),Ie=Rt(),Oe=a(()=>Ie.isAuthenticated.value),{format:Ee}=Ct(),{clearPersistedGclid:Re}=qt(),{t:Ce}=_t(),{track:Ne}=Nt(),je=Mt(),p=_("idle"),A=_(""),R=_(null),X=_(""),b=_(null),d=_("idle"),k=_(""),S=_(null);{if(!m.value.queryEntries.length){const e=U(E.query);e.length&&(m.value.queryEntries=e)}$(()=>E.query,e=>{const t=U(e);t.length&&(m.value.queryEntries=t)},{deep:!0})}const ee=_(!1);kt(()=>{P.hydrate?.(),pt(),it(),b.value=de(),St(()=>{if(ee.value)return;const e=te.value,t=F.value,o=T.value.length>0||q.value.length>0,r=!!I.value,n=!!(e&&Object.keys(e).length);if(!(!o&&!r&&!n)){ee.value=!0;try{console.groupCollapsed("[PowerTranz] Redirect payload"),console.log("Stored payload",D(e)),console.log("Aggregated snapshot",D(t)),console.log("POST entries",D(T.value)),console.log("Query entries",D(q.value)),console.log("Raw POST body",I.value||null),console.groupEnd()}catch(s){console.warn("Unable to log PowerTranz redirect payload",s)}}})});const T=a(()=>m.value.postEntries),q=a(()=>m.value.queryEntries),I=a(()=>m.value.rawPostBody),te=a(()=>m.value.storedPayload),M=a(()=>{const e=E.fullPath||"",t=e.indexOf("?");if(t===-1)return"";const o=e.indexOf("#",t),r=o!==-1?o:e.length;return e.slice(t+1,r)}),re=a(()=>{const e=E.hash||"";return e.startsWith("#")?e.slice(1):e}),F=a(()=>{const e=o=>{const r={};for(const n of o){const s=n.key,u=n.displayValue;if(s)if(Object.prototype.hasOwnProperty.call(r,s)){const h=r[s];Array.isArray(h)?h.push(u):typeof h=="string"&&(r[s]=[h,u])}else r[s]=u}return r},t={post:e(T.value),query:e(q.value)};return I.value&&(t.rawPostBody=I.value),M.value&&(t.rawQueryString=M.value),re.value&&(t.hash=re.value),t}),oe=a(()=>P.summary),V=a(()=>oe.value?.payment??null),Te=a(()=>{const e=new Set,t=V.value;if(!t)return e;const o=r=>{if(typeof r!="string")return;const n=r.trim();n&&e.add(n.toLowerCase())};return o(t.method),o(t.pulseCode),o(t.c3Code),e}),qe=a(()=>{const e=V.value;return!e||typeof e.apiUrl!="string"?"":e.apiUrl.trim()}),Me=a(()=>{const e=Ae.value;if(!e.length)return null;const t=Te.value;if(t.size){for(const n of e)if(He(n).some(u=>t.has(u)))return n}const o=V.value?.method;if(o){const n=o.trim().toLowerCase();for(const s of e){const u=ke(s).trim().toLowerCase();if(u&&u===n)return s}}return e.find(n=>n.isCreditCard)||null}),ze=a(()=>{const e=qe.value;if(e)return{baseUrl:e,source:"receipt"};const t=Me.value?.apiUrl;return typeof t=="string"&&t.trim()?{baseUrl:t.trim(),source:"payment_method"}:{baseUrl:"",source:""}}),Be=a(()=>ze.value.baseUrl),ne=a(()=>{const e=Be.value;return e?`${e.replace(/\/+$/,"")}/payment`:""}),Ue=a(()=>{const e=fe(T.value);if(e)return{value:e,source:"post"};const t=fe(q.value);if(t)return{value:t,source:"query"};const o=te.value;if(o?.post){const s=C(o.post);if(s)return{value:s,source:"stored"}}if(o?.query){const s=C(o.query);if(s)return{value:s,source:"stored"}}if(o?.originalBody){const s=j(o.originalBody);if(s){const u=C(s);if(u)return{value:u,source:"stored"}}}const r=C(F.value.post);if(r)return{value:r,source:"post"};const n=C(F.value.query);if(n)return{value:n,source:"query"};if(I.value){const s=pe(I.value);if(s)return{value:s,source:"raw-post"}}if(M.value){const s=pe(M.value);if(s)return{value:s,source:"raw-query"}}return{value:"",source:""}}),se=a(()=>Ue.value.value.trim()),ae=a(()=>{const e=se.value,t=ne.value;return!e||!t?"":`${e}::${t}`}),ie=a(()=>p.value==="loading"||p.value==="idle"),ue=a(()=>p.value==="success"||p.value==="error"),J=a(()=>et(R.value)),K=a(()=>p.value==="success"&&tt(J.value)),z=a(()=>rt(J.value)),De=a(()=>ot(J.value)),ce=a(()=>{const e=De.value;return typeof e!="number"||Number.isNaN(e)?"":Ee(e)});$(ae,e=>{e&&p.value!=="loading"&&$e()},{immediate:!0}),$(()=>({approved:K.value,payloadReady:!!b.value}),({approved:e})=>{e&&d.value==="idle"&&(le(),Le())},{immediate:!0}),$(ue,e=>{if(!e)return;const t=K.value,o=A.value||void 0;je.trackCardPaymentResult(t,o)}),bt(()=>{S.value!=null&&(window.clearTimeout(S.value),S.value=null)});async function $e(e={}){const t=ae.value;if(!t||p.value==="loading"||!e.force&&X.value===t&&p.value!=="error")return;X.value=t;const o=se.value,r=ne.value;if(!(!o||!r)){p.value="loading",A.value="",R.value=null;try{console.info("[checkout] Submitting SpiToken to payment endpoint",{endpoint:r,token:Xe(o)})}catch{}try{const n=await x(r,"payment",{method:"POST",json:{token:o}});if(!n.ok){p.value="error",A.value=n.error||n.message||"Request failed",R.value=n.raw??null;return}p.value="success",R.value=n.raw??n.data??null}catch(n){p.value="error",A.value=typeof n?.message=="string"?n.message:typeof n=="string"?n:"Request failed",R.value=null}}}function Le(){d.value!=="pending"&&(S.value!=null&&(window.clearTimeout(S.value),S.value=null),d.value="pending",k.value="",
1S.value=window.setTimeout(()=>{S.value=null,xe()},2e3))}async function xe(){const e=le();if(!e){d.value="error",k.value=B();return}const t=z.value?.trim();t&&Fe(e.payload,t);try{const o=await x(e.endpoint,"place_order",{json:e.payload});if(!o.ok){d.value="error",k.value=o.error||o.message||B();return}const r=o.raw??o.data??{},n=Ze(r);if(n.message){d.value="error",k.value=n.message;return}if(!n.orderId||n.orderId<=0){d.value="error",k.value=B();return}Qe(n)}catch(o){d.value="error",k.value=typeof o?.message=="string"&&o.message.trim()?o.message:B()}}function le(){if(b.value)return b.value;const e=de();return e&&(b.value=e),e}function de(){try{const e=window.sessionStorage.getItem(ve);if(!e)return null;const t=JSON.parse(e);if(!t||typeof t!="object")return null;const o=typeof t.endpoint=="string"?t.endpoint.trim():"",r=t.payload&&typeof t.payload=="object"?t.payload:null;return!o||!r?null:{endpoint:o,payload:r,storedAt:typeof t.storedAt=="number"?t.storedAt:void 0}}catch(e){return console.warn("[checkout] Unable to load pending card order payload",e),null}}function Fe(e,t){if(!e||typeof e!="object"||!t)return;const o=Array.isArray(e.payments)?e.payments:null;if(!(!o||!o.length))for(const r of o)!r||typeof r!="object"||(r.authorization_number=t,r.reference||(r.reference="PowerTranz"),typeof r.card_number=="string"&&(r.card_number=Ve(r.card_number)),typeof r.type=="string"&&!r.type.trim()&&(r.type="UNKNOWN"))}function Ve(e){if(typeof e!="string")return"";const t=e.replace(/[^0-9]/g,"");if(!t.length)return"";const o=t.split("").map((n,s)=>s<t.length-4?"X":n),r=[];for(let n=0;n<o.length;n+=4)r.push(o.slice(n,n+4).join(""));return r.join(" ").trim()}function Je(){try{window.sessionStorage.removeItem(ve)}catch(e){console.warn("[checkout] Unable to clear pending card order payload from storage",e)}}async function Ke(e,t,o){try{const r={...e,logged_in:Oe.value};t&&(r.c3_id=String(t),r.status||(r.status="PREP")),o&&(r.store_order_id=String(o));const s=await x("https://olodp.apigt.work/olodp/v1/orders/save","save_order",{method:"POST",json:r});if(!s.ok)return console.error("[checkout] Error saving order via API:",s.error||s.message),{orderId:null,error:s.error||s.message||"Failed to save order"};const u=s.data??s.raw??{},h=u.order_id??u.orderId??u.id??null;return h?(console.log("[checkout] Order saved via API:",{orderId:h,c3_id:t}),{orderId:h,error:null}):(console.error("[checkout] No order ID returned from API"),{orderId:null,error:"No order ID returned from API"})}catch(r){return console.error("[checkout] Error saving order via API:",r),{orderId:null,error:r?.message||"Unknown error saving order"}}}async function Qe(e){d.value="success",k.value="";const t=b.value?.payload;if(t&&e.orderId){const{orderId:n,error:s}=await Ke(t,e.orderId,e.storeID);s?console.warn("[checkout] Order save error (non-critical):",s):n&&console.log("[checkout] Order saved via API:",n)}Je(),b.value=null,jt().clear();const r=We(e,z.value);Ye(r),Ge(e)}function We(e,t){const o=P.summary;if(!o)return null;const r=JSON.parse(JSON.stringify(o));if(e.orderId&&e.orderId>0&&(r.orderId=String(e.orderId)),e.storeID){const n=typeof e.storeID=="number"?e.storeID.toString():e.storeID,s=n?.trim?.()??n;r.storeOrderId=s?String(s):r.storeOrderId??null}return e.etaMins&&Number.isFinite(e.etaMins)&&e.etaMins>0&&(r.etaMinutes=e.etaMins),r.placedAt=Date.now(),r.payment&&(r.payment.authorizationCode=t?t.trim()||null:r.payment.authorizationCode??null),P.setSummary(r),r}function Ye(e){if(!e)return;const t=Array.isArray(e.items)?e.items.length:0;try{Ne("checkout_place_success",{category:"checkout",value:t,meta:{method:e.payment?.method??"",total:e.total,oid:e.orderId}})}catch{}}function Ge(e){try{Re();const t=e.orderId&&e.orderId>0?String(e.orderId):P.summary?.orderId??"",o=e.etaMins&&Number.isFinite(e.etaMins)&&e.etaMins>0?`${e.etaMins} min`:void 0,r={};t&&(r.id=t),o&&(r.eta=o);const n=P.summary?.phone;n&&(r.telefono=n),Se.replace({path:"/checkout/colocada",query:r}).catch(()=>{})}catch(t){console.warn("[checkout] Unable to navigate to placed page",t)}}function B(){return Ce("checkout.place_order_failed","No se pudo colocar la orden. Intenta nuevamente.")}function He(e){const t=new Set,o=r=>{if(typeof r!="string")return;const n=r.trim();n&&t.add(n.toLowerCase())};return o(ke(e)),o(e.id),o(e.name),o(e.c3Code),o(e.pulseCode),Array.from(t)}function fe(e){for(const t of e)if(t?.key&&t.key.toLowerCase()==="spitoken"){const o=(t.displayValue||"").trim();if(o)return o}return""}function C(e){if(!e)return"";
1for(const[t,o]of Object.entries(e))if(typeof t=="string"&&t.toLowerCase()==="spitoken"){const r=Q(o);if(r)return r}return""}function Q(e,t=new Set){if(typeof e=="string")return e.trim();if(Array.isArray(e)){for(const o of e){const r=Q(o,t);if(r)return r}return""}if(e&&typeof e=="object"){if(t.has(e))return"";t.add(e);for(const o of Object.values(e)){const r=Q(o,t);if(r)return r}}return""}function pe(e){if(!e)return"";const t=/"SpiToken"\s*:\s*"([^"\r\n]+)"/i,o=/(?:^|[&?\s])SpiToken=([^&\s]+)/i,r=e.match(t);if(r?.[1])return r[1].trim();const n=e.match(o);if(n?.[1]){const s=n[1];try{return decodeURIComponent(s.replace(/\+/g,"%20"))}catch{return s}}return""}function Ze(e){const t=[];e!==void 0&&t.push(e);const o=new Set,r=[];for(;t.length;){const i=t.shift();if(!(!i||typeof i!="object"||o.has(i))){o.add(i),r.push(i);for(const f of["data","result","order","response"]){const c=i[f];c&&typeof c=="object"&&t.push(c)}}}const n=["order_id","orderId","OrderID","id","orderID","order_number","orderNumber","OrderNumber"],s=["message","Message","mensaje","Mensaje"],u=["eta","etaMinutes","eta_mins","etaMins","Eta","eta_minutes"],h=["storeID","store_id","StoreID","storeId","store_order_id","storeOrderId"];let W=0,Y="",G=null,H=null;for(const i of r){for(const f of n)if(i&&i[f]!==void 0&&W<=0){const c=i[f],w=typeof c=="string"?parseInt(c,10):Number(c);if(Number.isFinite(w)&&w>0){W=w;break}}for(const f of s)if(i&&typeof i[f]=="string"&&!Y){const c=i[f].trim();if(c){Y=c;break}}for(const f of u)if(i&&G==null&&i[f]!==void 0){const c=i[f],w=typeof c=="string"?parseInt(c,10):Number(c);if(Number.isFinite(w)&&w>0){G=w;break}}for(const f of h)if(i&&H==null&&i[f]!==void 0){const c=i[f];if(typeof c=="string"||typeof c=="number"){H=c;break}}}const yt=oe.value?.orderType==="DELIVERY"?35:15;return{orderId:W,message:Y,etaMins:G??yt,storeID:H??void 0}}function Xe(e){const t=e.trim();return t.length<=8?t:`${t.slice(0,4)}...${t.slice(-4)}`}function et(e){if(!e)return null;if(typeof e=="object"&&!Array.isArray(e))return e;if(typeof e=="string")try{const t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return t}catch{return null}return null}function tt(e){if(!e)return!1;const t=e.Approved??e.approved;if(typeof t=="boolean")return t;if(typeof t=="string"){const o=t.trim().toLowerCase();return o?o==="true"||o==="1":!1}return typeof t=="number"?t===1:!1}function rt(e){if(!e)return"";const t=e.AuthorizationCode??e.authorizationCode;return typeof t=="string"?t.trim():typeof t=="number"?String(t):""}function ot(e){if(!e)return null;const t=e.ApprovedAmount??e.approvedAmount??e.Amount??e.amount;if(typeof t=="number")return t;if(typeof t=="string"){const o=t.replace(/,/g,""),r=parseFloat(o);return Number.isNaN(r)?null:r}return null}function nt(e,t){const o=[];if(e)for(const[r,n]of Object.entries(e))Array.isArray(n)?n.forEach(s=>N(o,"POST",r,s)):N(o,"POST",r,n);return!o.length&&t&&N(o,"POST","raw_body",t),o}function U(e){const t=[];for(const[o,r]of Object.entries(e||{}))Array.isArray(r)?r.forEach(n=>N(t,"QUERY",o,n)):N(t,"QUERY",o,r);return t}function N(e,t,o,r){const n=st(r);e.push({key:o,source:t,...n})}function st(e){const t=ye(e);return{displayValue:t,prettyJson:at(t)}}function ye(e){if(Array.isArray(e))return e.map(t=>ye(t)).join(", ");if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function at(e){const t=e.trim();if(!t||!t.startsWith("{")&&!t.startsWith("["))return null;try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return null}}function it(){try{const e=lt();if(!e)return;try{window.sessionStorage.removeItem(ge)}catch{}ft();let t=null;try{t=JSON.parse(e)}catch{t=ct(e)}if(!t||typeof t!="object")return;m.value.storedPayload=ut(t);const o=j(t.post),r=j(t.query)??{},n=nt(o,typeof t.rawBody=="string"?t.rawBody:""),s=U(r);n.length&&(m.value.postEntries=n),s.length&&(m.value.queryEntries=s),typeof t.rawBody=="string"&&t.rawBody&&(m.value.rawPostBody=t.rawBody)}catch(e){console.error("Failed to hydrate redirect payload from session storage",e)}}function ut(e){if(!e||typeof e!="object")return null;const t=e,o={};
1"post"in t&&(o.post=j(t.post)),typeof t.rawBody=="string"&&(o.rawBody=t.rawBody),typeof t.rawPostBody=="string"&&!o.rawBody&&(o.rawBody=t.rawPostBody),"query"in t&&(o.query=j(t.query)),typeof t.receivedAt=="number"&&(o.receivedAt=t.receivedAt);for(const[r,n]of Object.entries(t))r==="post"||r==="rawBody"||r==="query"||r==="receivedAt"||(o[r]=n);return o}function ct(e){try{const t=atob(e);return JSON.parse(t)}catch{return null}}function j(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function lt(){const t=new URLSearchParams(window.location.search).get("payload");if(t)try{const s=me(t);if(s)return s}catch(s){console.warn("[PowerTranz] Failed to decode payload from URL",s)}let o=null;try{o=window.sessionStorage.getItem(ge)}catch{}if(o)return o;const r=dt(_e);return r&&me(r)||null}function dt(e){try{const t=document.cookie?document.cookie.split(";"):[];for(const o of t){const[r,...n]=o.split("=");if(r&&r.trim()===e){const s=n.join("=").trim();if(!s)return null;try{return decodeURIComponent(s)}catch{return s}}}}catch{}return null}function me(e){try{const t=e.replace(/-/g,"+").replace(/_/g,"/"),o=t.length%4===0?0:4-t.length%4,r=t+"=".repeat(o);return atob(r)}catch{return null}}function ft(){try{document.cookie=`${_e}=; Max-Age=0; Path=/checkout/resultado-tarjeta; Secure; SameSite=Lax`}catch{}}function pt(){try{const{pathname:e,search:t,hash:o}=window.location;if(!e.endsWith("/index.html"))return;const r=e.replace(/\/index\.html$/i,"")||"/",s=`${r.endsWith("/")&&r!=="/"?r.slice(0,-1):r}${t}${o}`;window.history.replaceState({},document.title,s)}catch(e){console.warn("Unable to normalize result URL",e)}}function D(e){if(e==null)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}return(e,t)=>{const o=wt,r=It;return y(),he(r,null,{default:Z(()=>[v("div",zt,[v("header",null,[v("h1",Bt,l(ie.value?e.$t("checkout.card_payment_processing_title","Finalizando cobro con tarjeta"):e.$t("checkout.card_payment_result_title","Resultado de cobro")),1)]),v("section",Ut,[ie.value?(y(),g("div",Dt,[v("p",$t,l(e.$t("checkout.card_payment_processing_message","Estamos procesando tu pago, por favor espera…")),1)])):ue.value?(y(),g("div",Lt,[K.value?(y(),g("div",xt,[v("p",Ft,l(e.$t("checkout.card_payment_status_approved","APROBADO")),1),z.value?(y(),g("p",Vt,[L(l(e.$t("checkout.card_payment_authorization_label","Código de autorización"))+": ",1),v("span",Jt,l(z.value),1)])):O("",!0),ce.value?(y(),g("p",Kt,[L(l(e.$t("checkout.card_payment_amount_label","Monto aprobado"))+": ",1),v("span",Qt,l(ce.value),1)])):O("",!0),v("p",Wt,l(e.$t("checkout.card_payment_approved_instruction","El cobro con tarjeta ha sido aprobado, por favor no recargués la página, estamos guardando tu orden.")),1),d.value==="pending"?(y(),g("p",Yt,l(e.$t("checkout.card_payment_saving_order","Guardando tu orden...")),1)):d.value==="success"?(y(),g("p",Gt,l(e.$t("checkout.card_payment_saved_order","Tu orden ha sido guardada exitosamente.")),1)):d.value==="error"?(y(),g("p",Ht,l(k.value||e.$t("checkout.place_order_failed","No se pudo colocar la orden. Intenta nuevamente.")),1)):O("",!0),d.value==="error"?(y(),he(o,{key:5,class:"action-link",to:"/checkout/confirmar"},{default:Z(()=>[L(l(e.$t("checkout.card_payment_retry","Intentar de nuevo")),1)]),_:1})):O("",!0)])):(y(),g("div",Zt,[v("p",Xt,l(e.$t("checkout.card_payment_status_rejected","RECHAZADO")),1),A.value?(y(),g("p",er,l(A.value),1)):O("",!0),Pt(o,{class:"action-link",to:"/checkout/confirmar"},{default:Z(()=>[L(l(e.$t("checkout.card_payment_retry","Intentar de nuevo")),1)]),_:1})]))])):O("",!0)])])]),_:1})}}}),fr=At(tr,[["__scopeId","data-v-df18ae89"]]);export{fr as default};

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.