b0f6ed6203c6b84794084f41991dbc9fc608853a2cf1d097651314af3696ac0f

Source Code:

!function(){"use strict";var e=(i.prototype.resolveMethod=function(r){var t=this;if("android"===this.os&&void 0!==window[this.androidBridge]&&void 0!==window[this.androidBridge][r])return function(e,n){var o=JSON.stringify({callback:e,parameter:n[0]});window[t.androidBridge][r](o)};if("ios"===this.os&&void 0!==window.webkit&&void 0!==window.webkit.messageHandlers&&void 0!==window.webkit.messageHandlers[r])return function(e,n){var o=JSON.stringify({callback:e,parameter:n[0]});window.webkit.messageHandlers[r].postMessage(o)};throw new Error("["+this.os+"] App bridge of "+r+" does not exist")},i.prototype.invoke=function(e){for(var r=this,t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Promise(function(n){var o=e+"-"+i.callbackIdentifier++;window[o]=function(e){n(JSON.parse(e)),delete window[o]},r.resolveMethod(e)(o,t)})},i.callbackIdentifier=0,i);function i(e,n){this.os=e,this.androidBridge=n}function u(e){var n,o=[];for(var r in e){var t=e[r];if(e.hasOwnProperty(r)&&void 0!==t){var i=encodeURIComponent(r);if(n=t,"[object Array]"===Object.prototype.toString.call(n))for(var a=0;a<t.length;a++)o.push(i+"="+encodeURIComponent(String(t[a])));else o.push(i+"="+encodeURIComponent(String(t)))}}return o.join("&")}function t(e){try{var n=window[e],o="__storage_test__";return n.setItem(o,o),n.removeItem(o),!0}catch(e){return!1}}function l(e){for(var n=document.cookie.split(";"),o=0;o<n.length;o++){var r=n[o].replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"").split("=");if(r[0]===e)return decodeURIComponent(r[1])}if(t("localStorage"))return window.localStorage.getItem(e)||void 0}function w(e,n){document.cookie=e+"="+encodeURIComponent(n)+"; path=/; max-age=63072000",t("localStorage")&&window.localStorage.setItem(e,n)}function v(e){var n={name:e.name,message:e.message,fileName:e.fileName,stack:e.stack};(new Image).src="https://i.smartnews-ads.com/pe?b="+encodeURIComponent(JSON.stringify(n))}var a=0;function f(){return new e("ios","SmartNewsAds").invoke("retrieveUUID").catch(function(){return new e("android","SmartNewsAds").invoke("retrieveUUID")}).catch(function(){return o=window.parent===window.self,(null===(n=null===(e=window.webkit)||void 0===e?void 0:e.messageHandlers)||void 0===n?void 0:n.UUIDResolver)&&o?new Promise(function(n){var e,o,r,t="_smartnews_ads_legacy_callback_"+a++;window[t]=function(e){delete window[t],n(e)},null===(r=null===(o=null===(e=window.webkit)||void 0===e?void 0:e.messageHandlers)||void 0===o?void 0:o.UUIDResolver)||void 0===r||r.postMessage(t)}):Promise.reject(new Error("UUIDResolver does not exist"));var e,n,o}).catch(function(){return Promise.resolve(null)})}var m="snexid",h="snuuid";function o(e,n,o){var r,t,i,a={id:e,t:Math.floor((new Date).valueOf()/1e3),url:location.href,referrer:document.referrer,e:n,v:this.version};for(var s in o)o.hasOwnProperty(s)&&(a["d["+s+"]"]=o[s]);var d=null!=(r=l(m))?r:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)});w(m,d),a.exid=d;var c=null!=(i=null===(t=/[&?]snuuid=([^&]+)/.exec(location.search))||void 0===t?void 0:t[1])?i:l(h);return void 0!==c&&(w(h,c),a.uuid=c),"Promise"in window?Promise.race([f(),new Promise(function(e){return window.setTimeout(function(){return e(null)},1e3)})]).then(function(e){null!==e&&(w(h,e),a.uuid=e);var n=new Image;return n.width=0,n.height=0,n.style.display="none",n.src="https://i.smartnews-ads.com/p?"+u(a),a}).catch(function(e){return v(e),a}):((new Image).src="https://i.smartnews-ads.com/p?"+u(a),a)}try{!function(){if(void 0===window.SmartnewsAds||void 0===window.SmartnewsAds.p)throw new Error("SmartnewsAds does not defined.");var e=window.SmartnewsAds.p;if(e.callMethod=o,e.queue){for(var n in e.queue)e.queue.hasOwnProperty(n)&&e.callMethod.apply(e,e.queue[n]);e.queue.length=0}}()}catch(e){v(e)}}();