var frontend_viewability;!function(){"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};e.r(s);class t{constructor(e,s){this.name=e,this.version=s}}const i="NONE",n="DIRECT",r="sessionStart",o="sessionFinish",a="full",c="definedByJavaScript",h="htmlDisplay",d="definedByJavaScript",l="beginToRender",u="generic";class p{constructor(e,s,t){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a;this.resourceUrl=e,this.vendorKey=s,this.verificationParameters=t,this.accessMode=i}serialize(){return{accessMode:this.accessMode,resourceUrl:this.resourceUrl,vendorKey:this.vendorKey,verificationParameters:this.verificationParameters}}}var m=class{constructor(e,s){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.partner=e,this.verificationScriptResources=s,this.slotElement=null,this.contentUrl=t,this.customReferenceData=i,this.underEvaluation=!1,this.serviceWindow=null}setSlotElement(e){this.slotElement=e}setServiceWindow(e){this.serviceWindow=e}};const _="omid_message_guid",v="omid_message_method",f="omid_message_version",g="omid_message_args";class w{static deserialize(e){return new w(e[_],e[v],e[f],e[g])}constructor(e,s,t,i){this.guid=e,this.method=s,this.version=t,this.args=i}serialize(){const e={[_]:this.guid,[v]:this.method,[f]:this.version};return void 0!==this.args&&(e[g]=this.args),e}}var y=w;var E=class{constructor(e){this.to=e,this.communicationType_=i}handleMessage(e,s){this.onMessage&&this.onMessage(e,s)}serialize(e){return JSON.stringify(e)}deserialize(e){try{return JSON.parse(e)}catch(e){return{}}}isDirectCommunication(){return this.communicationType_===n}};class S extends E{constructor(e){super(e),this.communicationType_=n,this.handleExportedMessage=S.prototype.handleExportedMessage.bind(this)}sendMessage(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.to;if(!s)throw new Error("Message destination must be defined at construction time or when sending the message.");s.handleExportedMessage(e.serialize(),this)}handleExportedMessage(e,s){this.handleMessage(y.deserialize(e),s)}isCrossOrigin(){return!1}}var T=S;let M;M=(()=>{if(void 0!==M&&M)return M;if(void 0!==e.g&&e.g)return e.g;if("undefined"!=typeof window&&window)return window;if("undefined"!=typeof globalThis&&globalThis)return globalThis;const s=Function("return this")();if(s)return s;throw new Error("Could not determine global object context.")})();var R={omidGlobal:M};const b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return null!=e&&void 0!==e.top&&null!=e.top},{omidGlobal:I}=R,x=e=>{if(e===I)return!1;try{if(void 0===e.location.hostname)return!0}catch(e){return!0}return!1},O=["omid","v1_SessionServiceCommunication"];function C(e,s){return s.reduce(((e,s)=>e&&e[s]),e)}function U(e,s){if(!x(e)){const t=C(e,s);if(t)return new T(t)}return null}function A(e,s){for(let t=0;t(e=>{const s=16*Math.random()|0;return e?(3&s|8).toString(16):s.toString(16)})("y"===e)))}const L="SessionService.",k=(e,s)=>s+e,D=e=>/\d+\.\d+\.\d+(-.*)?/.test(e),P=(e,s)=>{const t=e.split("-")[0].split("."),i=s.split("-")[0].split(".");for(let e=0;e<3;e+=1){const s=parseInt(t[e],10),n=parseInt(i[e],10);if(s>n)return!0;if(s0&&void 0!==arguments[0]?arguments[0]:V;this.interfaceRoot_=e[K]}isSupported(){return null!=this.interfaceRoot_}sendMessage(e,s,t){let i=e,n=this.interfaceRoot_;const r="registerSessionObserver"===i?[s]:t;if(i in z&&(i=z[i]),F.includes(i)&&(n=n[j]),!n[i])throw new Error("Unrecognized method name: ".concat(i,"."));n[i](...r)}};const B="1.3.37-dev";class G{constructor(e,s,t){this.impressionOccurred_=!1,this.hasAdEvents_=!1,this.hasMediaEvents_=!1,this.isSessionRunning_=!1,this.creativeType_=null,this.callbackMap_={},this.impressionType_=null,this.creativeLoaded_=!1,this.context_=e;const i=this.context_.serviceWindow||void 0;this.communication_=s||function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;const t=[e,(i=e,b(i)?i.top:I)];var i;return s&&t.unshift(s),A(t,O)}((e=>{let s=e;return void 0===e&&"undefined"!=typeof window&&window&&(s=window),b(s)?s:I})(),i),this.sessionInterface_=t||new J,this.communication_&&(this.communication_.onMessage=this.handleInternalMessage_.bind(this)),this.setClientInfo_(),this.injectVerificationScripts_(e.verificationScriptResources),e.slotElement&&this.sendSlotElement_(e.slotElement),this.sendContentUrl_(e.contentUrl),this.watchSessionEvents_()}setCreativeType(e){if(e===c)throw new Error("Creative type cannot be redefined with value ".concat(c));if(this.impressionOccurred_)throw new Error("Impression has already occurred");if(this.creativeLoaded_)throw new Error("Creative has already loaded");if(this.creativeType_&&this.creativeType_!==c)throw new Error("Creative type cannot be redefined");if(void 0===this.creativeType_)throw new Error("Native integration is using OMID 1.2 or earlier");this.sendOneWayMessage("setCreativeType",e),this.creativeType_=e}setImpressionType(e){if(e===d)throw new Error("Impression type cannot be redefined with value ".concat(d));if(this.impressionOccurred_)throw new Error("Impression has already occurred");if(this.creativeLoaded_)throw new Error("Creative has already loaded");if(this.impressionType_&&this.impressionType_!==d)throw new Error("Impression type cannot be redefined");if(void 0===this.impressionType_)throw new Error("Native integration is using OMID 1.2 or earlier");this.sendOneWayMessage("setImpressionType",e),this.impressionType_=e}isSupported(){return Boolean(this.communication_)||this.sessionInterface_.isSupported()}isSendingElementsSupported_(){return this.communication_?this.communication_.isDirectCommunication():this.sessionInterface_.isSupported()}registerSessionObserver(e){this.sendMessage("registerSessionObserver",e)}start(){const e={customReferenceData:this.context_.customReferenceData,underEvaluation:this.context_.underEvaluation};this.sendOneWayMessage("startSession",e)}finish(){this.sendOneWayMessage("finishSession")}error(e,s){this.sendOneWayMessage("sessionError",e,s)}registerAdEvents(){if(this.hasAdEvents_)throw new Error("AdEvents already registered.");this.hasAdEvents_=!0,this.sendOneWayMessage("registerAdEvents")}sendOneWayMessage(e){for(var s=arguments.length,t=new Array(s>1?s-1:0),i=1;i2?t-2:0),n=2;ne.serialize()));this.sendOneWayMessage("injectVerificationScriptResources",s)}sendSlotElement_(e){this.sendElement_(e,"setSlotElement")}sendElement_(e,s){this.isSendingElementsSupported_()?this.sendOneWayMessage(s,e):this.error(u,"Session Client ".concat(s," called when communication is cross-origin"))}sendContentUrl_(e){e&&this.sendOneWayMessage("setContentUrl",e)}setElementBounds(e){this.sendOneWayMessage("setElementBounds",e)}watchSessionEvents_(){this.registerSessionObserver((e=>{e.type===r&&(this.isSessionRunning_=!0,this.creativeType_=e.data.creativeType,this.impressionType_=e.data.impressionType),e.type===o&&(this.isSessionRunning_=!1)}))}}class Y{constructor(e){try{e.registerAdEvents(),this.adSession=e}catch(e){throw new Error("AdSession already has an ad events instance registered")}}impressionOccurred(){this.adSession.assertSessionRunning(),this.adSession.impressionOccurred(),this.adSession.sendOneWayMessage("impressionOccurred")}loaded(){this.adSession.sendOneWayMessage("loaded")}}class q{constructor(e,s,i,n){var r=this;this.MEASUREMENT_SCRIPT_URL="",this.VENDOR_KEY="mercadolibre",this.VERIFICATIONS_PARAMETER="",this.SDK_URL="",this._session=null,this._meliVaTrackUrl="",this._adEvents=null,this.setMeliVaTrackUrl=e=>{this._meliVaTrackUrl=e},this.start=e=>{if(this._meliVaTrackUrl&&""!==this._meliVaTrackUrl){const s=this.createOmsdkIframe();s.addEventListener("load",this.omsdkIframeDidLoad(s,e)),document.body.appendChild(s)}},this.impressionOccurred=()=>{var e;null===(e=this._adEvents)||void 0===e||e.impressionOccurred()},this.finishSession=()=>{var e;null===(e=this._session)||void 0===e||e.finish()},this.isValidNonce=e=>"string"==typeof e&&e.length>0,this.createOmsdkIframe=()=>{const e=document.createElement("iframe");e.style.display="none";const s=window.viewability.getNonceToken(),t=this.isValidNonce(s),i="