(()=>{var e=[,(e,t,n)=>{var o=n(2),i={injectContext:function(e){void 0!==e.authenticated?e.context=o.contexts.authenticated:e.context=o.contexts.anonymous}};e.exports=i},e=>{e.exports={contexts:{authenticated:"AUTHENTICATED",anonymous:"ANONYMOUS"}}},(e,t,n)=>{var o=n(4),i=n(5),r=n(2),c="https://api.mercadopago.com/v1/device_sessions",u="",s=document.currentScript&&document.currentScript.getAttribute("view")||"",a=document.currentScript&&document.currentScript.getAttribute("output")||"",d=document.currentScript&&document.currentScript.nonce||"",l={getDeviceSessionURI:function(e){return"".concat(c,"/web_device")},getDeviceSessionBody:function(){return{section:"external",view:s}},getAnonymousURI:function(e){return"".concat(c,"/anonymous_device_session")},getAnonymousBody:function(e){return{device_id:e,view:s}},getAnonymousCallback:function(e){return function(t){var o=JSON.parse(t);n.g.MP_DEVICE_SESSION_ID=o.id;var r=document.getElementById("deviceId");null!=r&&(r.value=o.id),""!=a&&(i.build(a,o.id),i.defineGetterDeviceSessionId(a)),void 0!==e.out&&i.build(e.out,o.id)}},getDeviceSessionCallback:function(e){var t=this;return function(c){var s=JSON.parse(c),a=document.createElement("script");if(a.appendChild(document.createTextNode(s.widget.replace(//gi,"").replace(/<\/script>[\s\S]*/gi,""))),""!=d&&a.setAttribute("nonce",d),i.addElement("head",a),u=s.id,n.g.MP_DEVICE_SESSION_ID=u,e.context===r.contexts.anonymous){n.g.MP_DEVICE_SESSION_ID=void 0;var l=t;setTimeout((function(){o.post({uri:l.getAnonymousURI(e),body:l.getAnonymousBody(u),then:l.getAnonymousCallback(e)})}),3e3)}}},execute:function(e){o.post({uri:this.getDeviceSessionURI(e),body:this.getDeviceSessionBody(),then:this.getDeviceSessionCallback(e)})}};e.exports=l},e=>{var t={post:function(e){var t=new XMLHttpRequest;t.open("POST",e.uri),t.setRequestHeader("Content-type","application/json"),t.withCredentials=false,t.send(JSON.stringify(e.body)),t.onreadystatechange=function(){4===t.readyState&&200===t.status&&void 0!==e.then&&e.then(t.responseText)}}};e.exports=t},(e,t,n)=>{var o={addElement:function(e,t){document.querySelector(e).appendChild(t)},addInputHidden:function(e,t,n){document.addEventListener("DOMContentLoaded",(function(){var o=document.createElement("input");o.id=t,o.name=t,o.type="hidden",o.value=n;var i=document.querySelector(e);null!=i?i.appendChild(o):document.body.appendChild(o)}))},build:function(e,t){this.recursiveBuild(n.g.window,e.split("."),t)},recursiveBuild:function(e,t,n){t.length>1?(e[t[0]]=e[t[0]]||{},this.recursiveBuild(e[t[0]],t.slice(1),n)):1===t.length&&(e[t[0]]=n)},defineGetterDeviceSessionId:function(e){this.recursiveDefineGetter(n.g.window,e.split("."))},recursiveDefineGetter:function(e,t){1!=t.length&&(t.length>2?this.recursiveDefineGetter(e[t[0]],t.slice(1)):2===t.length&&Object.defineProperty(e[t[0]],t[1],{get:function(){return window.MP_DEVICE_SESSION_ID}}))}};e.exports=o}],t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var o=0;ou});var r=n(1),c=n(3),u=i((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.injectContext(t),c.execute(t)}));new u({})})()})();