window.ad_cloud = window.ad_cloud || {};
window.ad_cloud.top_level_domain = "";
window.ad_cloud.itp = {};
window.ad_cloud.itp.iframe_url = "";
window.ad_cloud.callbacks = [];
window.ad_cloud.mapperDataCallbacks = [];
window.ad_cloud.fetch_initiated = false;
window.ad_cloud.pixelHost = "pixel.everesttech.net";
window.ad_cloud.jsHost = "www.everestjs.net";
window.ad_cloud.getArrayIndex = function(searchArray, obj) {
for (var i = 0; i < searchArray.length; i++) {
if (searchArray[i] == obj) {
return i;
}
}
return -1;
};
window.ad_cloud.isITPenabled = function() {
if(navigator.userAgent.indexOf("Chrome")==-1) {
if(navigator.userAgent.indexOf("Firefox")!=-1) {
var match = navigator.userAgent.match(/Firefox\/([0-9]+)\./);
var version = (match && match.length > 1 && match[1]) || '';
if(version && version != '' && parseInt(version) >= 69) return true;
}else if(navigator.userAgent.indexOf("FxiOS")!=-1) {
var match = navigator.userAgent.match(/FxiOS\/([0-9]+)\./);
var version = (match && match.length > 1 && match[1]) || '';
if(version && version != '' && parseInt(version) >= 22) return true;
}else if(navigator.userAgent.indexOf("Safari")!=-1) {
var match = navigator.userAgent.match(/version\/(\d+(\.\d+)?)/i);
var version = (match && match.length > 1 && match[1]) || '';
if(version && version != '' && parseInt(version) >= 11) return true;
else if(navigator.userAgent.indexOf("GSA\/") != -1) return true;
else if(navigator.userAgent.indexOf("EdgiOS\/") != -1) return true;
}
}
//Check for Edge browser UA, which might contain edge|edg|edgeA|edgeiOS
if(navigator.userAgent.indexOf("Safari")!=-1 && navigator.userAgent.indexOf("Chrome")!=-1) {
var uaRegEx = function(regexp) {return regexp.test(navigator.userAgent)};
return uaRegEx(/edg|edge|EdgA/i);
}
return false;
};
var AdCloudLocalStorage = {
isInitDone : false,
init: function() {
if(window.ad_cloud.isITPenabled() && window.ad_cloud.itp && window.ad_cloud.itp.iframe_url && window.ad_cloud.itp.iframe_url.toLowerCase() != "noiframe") {
"use strict";window.XdUtils=window.XdUtils||function(){function a(a,b){var c,d=b||{};for(c in a)a.hasOwnProperty(c)&&(d[c]=a[c]);return d}return{extend:a}}(),window.xdLocalStorage=window.xdLocalStorage||function(){function a(a){k[a.id]&&(k[a.id](a),delete k[a.id])}function b(b){var c;try{c=JSON.parse(b.data)}catch(a){}c&&c.namespace===h&&("iframe-ready"===c.id?(m=!0,i.initCallback()):a(c))}function c(a,b,c,d){j++,k[j]=d;var e={namespace:h,id:j,action:a,key:b,value:c};g.contentWindow.postMessage(JSON.stringify(e),"*")}function d(a){i=XdUtils.extend(a,i);var c=document.createElement("div");window.addEventListener?window.addEventListener("message",b,!1):window.attachEvent("onmessage",b),c.innerHTML='',document.body.appendChild(c),g=document.getElementById(i.iframeId)}function e(){return l?!!m||(console.log("You must wait for iframe ready message before using the api."),!1):(console.log("You must call xdLocalStorage.init() before using it."),!1)}function f(){return"complete"===document.readyState}var g,h="cross-domain-local-message",i={iframeId:"cross-domain-iframe",iframeUrl:void 0,initCallback:function(){}},j=-1,k={},l=!1,m=!0;return{init:function(a){if(!a.iframeUrl)throw"You must specify iframeUrl";if(l)return void console.log("xdLocalStorage was already initialized!");l=!0,f()?d(a):document.addEventListener?document.addEventListener("readystatechange",function(){f()&&d(a)}):document.attachEvent("readystatechange",function(){f()&&d(a)})},setItem:function(a,b,d){e()&&c("set",a,b,d)},getItem:function(a,b){e()&&c("get",a,null,b)},removeItem:function(a,b){e()&&c("remove",a,null,b)},key:function(a,b){e()&&c("key",a,null,b)},getSize:function(a){e()&&c("size",null,null,a)},getLength:function(a){e()&&c("length",null,null,a)},clear:function(a){e()&&c("clear",null,null,a)},wasInit:function(){return l}}}();
xdLocalStorage.init(
{
iframeUrl: window.ad_cloud.itp.iframe_url,
//an option function to be called right after the iframe was loaded and ready for action
initCallback: function () {
AdCloudLocalStorage.isInitDone = true;
window.ad_cloud.invokeLocalStorageCallbacks();
}
});
} else
window.ad_cloud.invokeLocalStorageCallbacks();
},
set: function(name, value) {
if( window.ad_cloud.isITPenabled() && window.ad_cloud.itp.iframe_url !== undefined && window.ad_cloud.itp.iframe_url != null && window.ad_cloud.itp.iframe_url.toLowerCase() == "noiframe") {
window.localStorage.setItem(name, decodeURIComponent(value));
}else if(window.ad_cloud.isITPenabled() && AdCloudLocalStorage.isInitDone) {
if(xdLocalStorage) {
xdLocalStorage.setItem(name, value, function (data) { console.log('Local Storage setItem callback.'); });
}
}
window.ad_cloud.invokeLocalStorageCallbacks();
},
setConversionData: function() {
var ef_id = window.ad_cloud.getEFID();
if(ef_id && ef_id != '') {
AdCloudLocalStorage.set('data_adcloud', decodeURIComponent(ef_id));
}
}
};
var AdCloudCookie = {
getDomain: function(url) {
if(url === undefined) return "";
return tldjs.getDomain(url);
},
init: function() {
var cookies = document.cookie.split( ';' ).map( function( x ) { return x.trim().split( '=' ); } ).reduce( function( a, b ) { a[ b[ 0 ] ] = b[ 1 ]; return a; }, {} );
window.ad_cloud.clientCookies = {};
window.ad_cloud.cookies = {};
var adcloudEFIDCookie = "data_adcloud";
for ( cookie in cookies )
{
if(cookie !== undefined && adcloudEFIDCookie.localeCompare(cookie) == 0)
window.ad_cloud.cookies[cookie] = cookies[cookie];
else
window.ad_cloud.clientCookies[cookie] = cookies[cookie];
}
},
set: function(name, value) {
if(window.ad_cloud.cookies === undefined) window.ad_cloud.cookies = [];
var expires = "";
var date = new Date();
date.setTime(date.getTime() + (91*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
value = encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
name = encodeURIComponent(String(name)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
document.cookie = name+"=" + value+ expires + "; path=/; domain=" + AdCloudCookie.getDomain(document.documentURI);
},
get: function(name) {
if(window.ad_cloud.cookies === undefined || window.ad_cloud.cookies.length == 0 || window.ad_cloud.cookies[name] === undefined) return "";
var value = window.ad_cloud.cookies[name].replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
return value;
}
}
if(window.adCloudCookieData === undefined) AdCloudCookie.init();
window.ad_cloud.AdCloudDataFetcher = {
removeListner : function() {
if (window.addEventListener) {
window.removeEventListener("message", adCloudDetailsReceiver, false);
} else {
window.detachEvent("onmessage", adCloudDetailsReceiver);
}
},
adCloudDetailsReceiver: function(message) {
if (window.ad_cloud.getArrayIndex(["http://www.everestjs.net","https://www.everestjs.net"],message.origin) == -1) {
return;
}
if(window.ad_cloud.pixelDetailReceiverCalled == true)
return;
window.ad_cloud.pixelDetailReceiverCalled = true;
// V2 pixelDetailReceiver callback
if(window.EF !== undefined && window.EF.pixelDetailsReceiver !== undefined)
window.EF.pixelDetailsReceiver(message);
// V3 pixelDetailReceiver callback
if(window.EF !== undefined && window.EF.pixelDetailsEvent !== undefined && window.EF.pixelDetailsEvent.pixelDetailsReceiver !== undefined)
window.EF.pixelDetailsEvent.pixelDetailsReceiver(message);
var surferId = "";
var imsId = "";
var qParams = message.data.substring(message.data.indexOf("#")+1);
var params = qParams.split("&");
params.forEach(function(param) {
if(param.indexOf("id=") == 0)
surferId = param.substring(param.indexOf("=") + 1);
else if(param.indexOf("imsId=") == 0)
imsId = param.substring(param.indexOf("=") + 1);
});
if(surferId != "") window.ad_cloud.surferId = surferId;
if(imsId != "" && (window.ad_cloud.imsorgid === undefined || window.ad_cloud.imsorgid === null || window.ad_cloud.imsorgid == ""))
window.ad_cloud.imsorgid = imsId;
window.ad_cloud.callbacks.forEach(function(func) {
func();
});
},
fetch: function(callback) {
window.ad_cloud.callbacks.push(callback);
if(window.ad_cloud.fetch_initiated) {
return;
}
/* http or https? */
var protocol = document.location.protocol=="https:"?"https":"http";
window.ad_cloud.fetch_initiated = true;
var url;
if(window.ad_cloud.userid)
url = "//pixel.everesttech.net/" + window.ad_cloud.userid + "/gr?ev_gb=0&url=" + protocol + "%3A%2F%2Fwww.everestjs.net%2Fstatic%2Fpixel_details.html%23gsurfer%3D__EFGSURFER__%26imsId%3D__EFIMSORGID__%26google%3D_EFGCK__%26time%3D__EFTIME__%26is_fb_cookie_synced%3D__EFFB__%26throttleCookie%3D__EFSYNC__%26optout%3D__EFOPTOUT__"
else
url = "//pixel.everesttech.net/1/gr?ev_gb=0&url=" + protocol + "%3A%2F%2Fwww.everestjs.net%2Fstatic%2Fpixel_details.html%23gsurfer%3D__EFGSURFER__%26imsId%3D__EFIMSORGID__%26google%3D_EFGCK__%26time%3D__EFTIME__%26is_fb_cookie_synced%3D__EFFB__%26throttleCookie%3D__EFSYNC__%26optout%3D__EFOPTOUT__"
var iframe = document.createElement('iframe');
if (url !== undefined) {
iframe.src=url;
}
window.ad_cloud.func_callback = callback;
iframe.height=0;
iframe.width=0;
iframe.frameborder=0;
iframe.style.display = 'none';
document.body.appendChild(iframe);
if (window.addEventListener) {
window.addEventListener("message", this.adCloudDetailsReceiver, false);
} else {
window.attachEvent("onmessage", this.adCloudDetailsReceiver);
}
}
};
window.ad_cloud.invokeLocalStorageCallbacks = function() {
if(window.ad_cloud.mapperDataCallbacks.length != 0) {
var func = window.ad_cloud.mapperDataCallbacks.pop();
func();
}
}
window.ad_cloud.getMCID = function() {
//Check for IE <= 10 browser and discard ECID implementation
if ((window.ad_cloud.imsorgid === undefined || window.ad_cloud.imsorgid == null || window.ad_cloud.imsorgid == "") ||
(navigator.userAgent !== undefined && navigator.userAgent.indexOf("MSIE")!=-1)) {
window.ad_cloud.addClickMapper();
return;
}
var initializeECID = function(id) {
var ecidObj = Visitor.getInstance(id);
if(ecidObj !== undefined) {
window.ad_cloud.ecid = ecidObj.getMarketingCloudVisitorID(function(id) {
if(id !== undefined && id != "")
{
window.ad_cloud.ecid = id;
window.ad_cloud.addClickMapper();
}
});
if(window.ad_cloud.ecid !== undefined && window.ad_cloud.ecid != '')
window.ad_cloud.addClickMapper();
}
}
if( typeof(Visitor) != "undefined" && window.ad_cloud.imsorgid !== undefined && window.ad_cloud.imsorgid != "") {
initializeECID(window.ad_cloud.imsorgid);
}else if(typeof alloy !== "undefined") {
alloy("getIdentity").then(function(result) {
window.ad_cloud.ecid = result.identity.ECID;
window.ad_cloud.addClickMapper();
}).catch(function(error) {
window.ad_cloud.addClickMapper();
return;
})
}else if( typeof(Visitor) == "undefined" && window.ad_cloud.imsorgid !== undefined && window.ad_cloud.imsorgid != "" ) {
var includeScript = function(src) {
return new Promise(function(resolve, reject) {
var tag = document.createElement("script");
tag.type = "text/javascript";
tag.async = true;
tag.onError = reject;
if (tag.addEventListener) {
tag.addEventListener("load", function() {resolve(); }, false);
tag.addEventListener("error", function() {reject(); }, false);
} else {
tag.attachEvent("onload", function() { resolve(); });
tag.attachEvent("onerror", function() { resolve(); });
}
if(window.ad_cloud.nounce !== undefined && window.ad_cloud.nounce != null && window.ad_cloud.nounce != "")
tag.nounce = window.ad_cloud.nounce;
tag.src = src;
document.head.appendChild(tag);
});
}
var visitorAPIJSURI = "https://www.everestjs.net/static/VisitorAPI.js";
includeScript(visitorAPIJSURI).then(function() {
initializeECID(window.ad_cloud.imsorgid);
}).catch(function() {
window.ad_cloud.addClickMapper();
})
}else {
window.ad_cloud.addClickMapper();
}
}
window.ad_cloud.getIMSORGId = function() {
window.ad_cloud.AdCloudDataFetcher.fetch(function() {
window.ad_cloud.getMCID();
});
};
window.ad_cloud.handleLocalStorageData = function(clickMapperFunc) {
if(window.ad_cloud.imsorgid === null || window.ad_cloud.imsorgid === undefined || window.ad_cloud.imsorgid == "")
window.ad_cloud.mapperDataCallbacks.push(window.ad_cloud.getIMSORGId);
else
window.ad_cloud.mapperDataCallbacks.push(window.ad_cloud.getMCID);
window.ad_cloud.mapperDataCallbacks.push(AdCloudLocalStorage.setConversionData);
window.ad_cloud.mapperDataCallbacks.push(AdCloudLocalStorage.init);
window.ad_cloud.invokeLocalStorageCallbacks();
};
window.ad_cloud.addClickMapper = function() {
var cmUrl;
if(window.ad_cloud.userid)
cmUrl = "//" + window.ad_cloud.pixelHost + "/" + window.ad_cloud.userid +"/cm?";
else
cmUrl = "//" + window.ad_cloud.pixelHost + "/1/cm?";
cmUrl += "ef_id=" + window.ad_cloud.getEFID();
if(window.ad_cloud.ecid)
cmUrl += "&ecvid=" + window.ad_cloud.ecid;
var image = document.createElement('img');
image.height="1px";
image.width="1px";
image.style.display = 'none';
image.src = cmUrl;
document.body.appendChild(image);
}
window.ad_cloud.getEFID = function() {
var ef_id, uri;
if(window.top != window)
{
// Works only 1 level UP for iframe
uri = document.referrer;
}else {
uri = document.documentURI;
}
var uri_parts = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+:))?(?:\/\/)?(?:([^:\/?#@]*(?::[^:\/?#@]*)?)?@)?([^:\/?#]*)(?::(\d*))?((?:\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?[^?#\/]*)(?:\?([^#]*))?(?:#(.*))?/.exec(uri).slice(1);
var efid_param;
if(uri_parts[5] && uri_parts[5].indexOf('ef_id') != -1)
efid_param = uri_parts[5];
else if(uri_parts[6] && uri_parts[6].indexOf('ef_id') != -1)
efid_param = uri_parts[6];
if(efid_param){
var ef_id_index = -1;
var params = efid_param.split('&');
for(var i = 0; i < params.length; i++) {
var param = params[i];
if(param.indexOf('ef_id') == 0) {
ef_id_index = 6;
break;
}else if(param.indexOf('?ef_id') == 0 || param.indexOf('#ef_id') == 0) {
ef_id_index = 7;
break;
}
}
if(ef_id_index != -1)
ef_id = param.substr(ef_id_index);
}else
window.ad_cloud.renewCookie();
return ef_id;
}
//if(window.ad_cloud.isITPenabled()) {
try {
window.ad_cloud = window.ad_cloud || {};
if (!window.ad_cloud.js_loaded) {
window.ad_cloud.js_loaded = true;
window.ad_cloud.setCookie = function() {
if(!window.ad_cloud.isITPenabled()) return;
var ef_id = window.ad_cloud.getEFID();
if(ef_id && ef_id != '') {
// Adding exipry to 91 days
AdCloudCookie.set('data_adcloud', decodeURIComponent(ef_id));
AdCloudLocalStorage.set('data_adcloud', decodeURIComponent(ef_id));
}
};
window.ad_cloud.getCookie = function() {
if(AdCloudCookie.get('data_adcloud', {domain: tldjs.getDomain(document.documentURI) }) !== undefined) {
var data = AdCloudCookie.get('data_adcloud', {domain: tldjs.getDomain(document.documentURI) });
if(data === undefined)
data = AdCloudLocalStorage.get('data_adcloud');
if( data === undefined)
data = window.localStorage.getItem('data_adcloud');
return data !== undefined ? data : '';
}
return '';
};
window.ad_cloud.renewCookie = function() {
var efId = AdCloudCookie.get('data_adcloud', {domain: tldjs.getDomain(document.documentURI) });
if(efId === undefined || efId == "") return;
AdCloudCookie.set('data_adcloud', decodeURIComponent(efId));
};
}
}catch(ex) {
// ignore if we cannt set cookie on client domain
}
//}
try {
var original_define;
// verificar se requirejs foi carregado e atribuir "esconder" ele do plugin abaixo
if (define && typeof define==="function") {
original_define = define;
define = false;
}
}catch(err) { // ignore
}
!function($){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=$();else if("function"==typeof define&&define.amd)define([],$);else{var a;a="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,a.tldjs=$()}}(function(){var $;return function $(a,o,i){function e(s,t){if(!o[s]){if(!a[s]){var r="function"==typeof require&&require;if(!t&&r)return r(s,!0);if(n)return n(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=o[s]={exports:{}};a[s][0].call(l.exports,function($){var o=a[s][1][$];return e(o?o:$)},l,l.exports,$,a,o,i)}return o[s].exports}for(var n="function"==typeof require&&require,s=0;s1&&(i=o[0]+"@",$=o[1]),$=$.replace(R,".");var e=$.split("."),n=s(e,a).join(".");return i+n}function r($){for(var a,o,i=[],e=0,n=$.length;e=55296&&a<=56319&&e65535&&($-=65536,a+=L($>>>10&1023|55296),$=56320|1023&$),a+=L($)}).join("")}function l($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:w}function m($,a){return $+22+75*($<26)-((0!=a)<<5)}function c($,a,o){var i=0;for($=o?T($/O):$>>1,$+=T($/a);$>N*j>>1;i+=w)$=T($/N);return T(i+(N+1)*$/($+q))}function h($){var a,o,i,e,s,t,r,m,h,g,d=[],k=$.length,b=0,p=A,f=C;for(o=$.lastIndexOf(I),o<0&&(o=0),i=0;i=128&&n("not-basic"),d.push($.charCodeAt(i));for(e=o>0?o+1:0;e=k&&n("invalid-input"),m=l($.charCodeAt(e++)),(m>=w||m>T((x-b)/t))&&n("overflow"),b+=m*t,h=r<=f?z:r>=f+j?j:r-f,!(mT(x/g)&&n("overflow"),t*=g;a=d.length+1,f=c(b-s,a,0==s),T(b/a)>x-p&&n("overflow"),p+=T(b/a),b%=a,d.splice(b++,0,p)}return u(d)}function g($){var a,o,i,e,s,t,u,l,h,g,d,k,b,p,f,y=[];for($=r($),k=$.length,a=A,o=0,s=C,t=0;t=a&&dT((x-o)/b)&&n("overflow"),o+=(u-a)*b,a=u,t=0;tx&&n("overflow"),d==a){for(l=o,h=w;g=h<=s?z:h>=s+j?j:h-s,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},N=w-z,T=Math.floor,L=String.fromCharCode;if(y={version:"1.4.1",ucs2:{decode:r,encode:u},decode:h,encode:g,toASCII:k,toUnicode:d},"function"==typeof $&&"object"==typeof $.amd&&$.amd)$("punycode",function(){return y});else if(b&&p)if(o.exports==b)p.exports=y;else for(v in y)y.hasOwnProperty(v)&&(b[v]=y[v]);else e.punycode=y}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function($,a,o){"use strict";function i($,a){return Object.prototype.hasOwnProperty.call($,a)}a.exports=function($,a,o,n){a=a||"&",o=o||"=";var s={};if("string"!=typeof $||0===$.length)return s;var t=/\+/g;$=$.split(a);var r=1e3;n&&"number"==typeof n.maxKeys&&(r=n.maxKeys);var u=$.length;r>0&&u>r&&(u=r);for(var l=0;l=0?(m=d.substr(0,k),c=d.substr(k+1)):(m=d,c=""),h=decodeURIComponent(m),g=decodeURIComponent(c),i(s,h)?e(s[h])?s[h].push(g):s[h]=[s[h],g]:s[h]=g}return s};var e=Array.isArray||function($){return"[object Array]"===Object.prototype.toString.call($)}},{}],3:[function($,a,o){"use strict";function i($,a){if($.map)return $.map(a);for(var o=[],i=0;i<$.length;i++)o.push(a($[i],i));return o}var e=function($){switch(typeof $){case"string":return $;case"boolean":return $?"true":"false";case"number":return isFinite($)?$:"";default:return""}};a.exports=function($,a,o,t){return a=a||"&",o=o||"=",null===$&&($=void 0),"object"==typeof $?i(s($),function(s){var t=encodeURIComponent(e(s))+o;return n($[s])?i($[s],function($){return t+encodeURIComponent(e($))}).join(a):t+encodeURIComponent(e($[s]))}).join(a):t?encodeURIComponent(e(t))+o+encodeURIComponent(e($)):""};var n=Array.isArray||function($){return"[object Array]"===Object.prototype.toString.call($)},s=Object.keys||function($){var a=[];for(var o in $)Object.prototype.hasOwnProperty.call($,o)&&a.push(o);return a}},{}],4:[function($,a,o){"use strict";o.decode=o.parse=$("./decode"),o.encode=o.stringify=$("./encode")},{"./decode":2,"./encode":3}],5:[function($,a,o){"use strict";function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function e($,a,o){if($&&u.isObject($)&&$ instanceof i)return $;var e=new i;return e.parse($,a,o),e}function n($){return u.isString($)&&($=e($)),$ instanceof i?$.format():i.prototype.format.call($)}function s($,a){return e($,!1,!0).resolve(a)}function t($,a){return $?e($,!1,!0).resolveObject(a):a}var r=$("punycode"),u=$("./util");o.parse=e,o.resolve=s,o.resolveObject=t,o.format=n,o.Url=i;var l=/^([a-z0-9.+-]+:)/i,m=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,h=["<",">",'"',"`"," ","\r","\n","\t"],g=["{","}","|","\\","^","`"].concat(h),d=["'"].concat(g),k=["%","/","?",";","#"].concat(d),b=["/","?","#"],p=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,y=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},z=$("querystring");i.prototype.parse=function($,a,o){if(!u.isString($))throw new TypeError("Parameter 'url' must be a string, not "+typeof $);var i=$.indexOf("?"),e=i!==-1&&i<$.indexOf("#")?"?":"#",n=$.split(e),s=/\\/g;n[0]=n[0].replace(s,"/"),$=n.join(e);var t=$;if(t=t.trim(),!o&&1===$.split("#").length){var m=c.exec(t);if(m)return this.path=t,this.href=t,this.pathname=m[1],m[2]?(this.search=m[2],a?this.query=z.parse(this.search.substr(1)):this.query=this.search.substr(1)):a&&(this.search="",this.query={}),this}var h=l.exec(t);if(h){h=h[0];var g=h.toLowerCase();this.protocol=g,t=t.substr(h.length)}if(o||h||t.match(/^\/\/[^@\/]+@[^@\/]+/)){var j="//"===t.substr(0,2);!j||h&&x[h]||(t=t.substr(2),this.slashes=!0)}if(!x[h]&&(j||h&&!w[h])){for(var q=-1,O=0;O127?"x":E[T];if(!N.match(f)){var F=S.slice(0,O),V=S.slice(O+1),H=E.match(y);H&&(F.push(H[1]),V.unshift(H[2])),V.length&&(t="/"+V.join(".")+t),this.hostname=F.join(".");break}}}this.hostname.length>p?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=r.toASCII(this.hostname));var P=this.port?":"+this.port:"",_=this.hostname||"";this.host=_+P,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==t[0]&&(t="/"+t))}if(!v[g])for(var O=0,R=d.length;O0)&&o.host.split("@");j&&(o.auth=j.shift(),o.host=o.hostname=j.shift())}return o.search=$.search,o.query=$.query,u.isNull(o.pathname)&&u.isNull(o.search)||(o.path=(o.pathname?o.pathname:"")+(o.search?o.search:"")),o.href=o.format(),o}if(!v.length)return o.pathname=null,o.search?o.path="/"+o.search:o.path=null,o.href=o.format(),o;for(var q=v.slice(-1)[0],O=(o.host||$.host||v.length>1)&&("."===q||".."===q)||""===q,C=0,A=v.length;A>=0;A--)q=v[A],"."===q?v.splice(A,1):".."===q?(v.splice(A,1),C++):C&&(v.splice(A,1),C--);if(!f&&!y)for(;C--;C)v.unshift("..");!f||""===v[0]||v[0]&&"/"===v[0].charAt(0)||v.unshift(""),O&&"/"!==v.join("/").substr(-1)&&v.push("");var I=""===v[0]||v[0]&&"/"===v[0].charAt(0);if(z){o.hostname=o.host=I?"":v.length?v.shift():"";var j=!!(o.host&&o.host.indexOf("@")>0)&&o.host.split("@");j&&(o.auth=j.shift(),o.host=o.hostname=j.shift())}return f=f||o.host&&v.length,f&&!I&&v.unshift(""),v.length?o.pathname=v.join("/"):(o.pathname=null,o.path=null),u.isNull(o.pathname)&&u.isNull(o.search)||(o.path=(o.pathname?o.pathname:"")+(o.search?o.search:"")),o.auth=$.auth||o.auth,o.slashes=o.slashes||$.slashes,o.href=o.format(),o},i.prototype.parseHost=function(){var $=this.host,a=m.exec($);a&&(a=a[0],":"!==a&&(this.port=a.substr(1)),$=$.substr(0,$.length-a.length)),$&&(this.hostname=$)}},{"./util":6,punycode:1,querystring:4}],6:[function($,a,o){"use strict";a.exports={isString:function($){return"string"==typeof $},isObject:function($){return"object"==typeof $&&null!==$},isNull:function($){return null===$},isNullOrUndefined:function($){return null==$}}},{}],7:[function($,a,o){"use strict";function i($){function a($,a){var i=a||b,n={hostname:p($),isValid:null,isIp:null,tldExists:!1,publicSuffix:null,domain:null,subdomain:null};return null===n.hostname?(n.isIp=!1,n.isValid=!1,n):(n.isIp=m(n.hostname),n.isIp?(n.isValid=!0,n):(n.isValid=l(n.hostname),n.isValid===!1?n:(i!==b&&i!==h||(n.tldExists=c(o,n.hostname)),i===h?n:(n.publicSuffix=r(o,n.hostname),i===g?n:(n.domain=t(e,n.publicSuffix,n.hostname),i===d?n:(n.subdomain=u(n.hostname,n.domain),n))))))}var o=$.rules||n||{},e=$.validHosts||[],p=$.extractHostname||s;return{extractHostname:p,isValid:l,parse:a,tldExists:function($){return a($,h).tldExists},getPublicSuffix:function($){return a($,g).publicSuffix},getDomain:function($){return a($,d).domain},getSubdomain:function($){return a($,k).subdomain},fromUserSettings:i}}var e=$("./lib/suffix-trie.js"),n=e.fromJson($("./rules.json")),s=$("./lib/clean-host.js"),t=$("./lib/domain.js"),r=$("./lib/public-suffix.js"),u=$("./lib/subdomain.js"),l=$("./lib/is-valid.js"),m=$("./lib/is-ip.js"),c=$("./lib/tld-exists.js"),h=1,g=2,d=3,k=4,b=5;a.exports=i({})},{"./lib/clean-host.js":8,"./lib/domain.js":9,"./lib/is-ip.js":11,"./lib/is-valid.js":12,"./lib/public-suffix.js":13,"./lib/subdomain.js":14,"./lib/suffix-trie.js":15,"./lib/tld-exists.js":16,"./rules.json":17}],8:[function($,a,o){function i($){return"."===$[$.length-1]?$.substr(0,$.length-1):$}function e($){return $.length>0&&($.charCodeAt(0)<=32||$.charCodeAt($.length-1)<=32)}function n($){for(var a=0;a<$.length;a+=1){var o=$.charCodeAt(a);if(o>=65&&o<=90)return!0}return!1}var s=$("url"),t=$("./is-valid.js"),r=/^(([a-z][a-z0-9+.-]*)?:)?\/\//;a.exports=function($){if(t($))return i($);var a=$;"string"!=typeof a&&(a=""+a);var o=e(a);o&&(a=a.trim());var u=n(a);if(u&&(a=a.toLowerCase()),(u||o)&&t(a))return i(a);r.test(a)||(a="//"+a);var l=s.parse(a,null,!0);return l.hostname?i(l.hostname):null}},{"./is-valid.js":12,url:5}],9:[function($,a,o){"use strict";function i($,a){return $.lastIndexOf(a)===$.length-a.length}function e($,a){return!!i($,a)&&($.length===a.length||"."===$[$.length-a.length-1])}function n($,a){var o=$.length-a.length-2,i=$.lastIndexOf(".",o);return i===-1?$:$.substr(i+1)}a.exports=function($,a,o){for(var i=0;i<$.length;i+=1){var s=$[i];if(e(o,s))return s}return null===a?null:a.length===o.length?null:n(o,a)}},{}],10:[function($,a,o){"use strict";a.exports=function($){var a=$.lastIndexOf(".");return a===-1?null:$.substr(a+1)}},{}],11:[function($,a,o){"use strict";function i($){for(var a=0,o=0;o<$.length;o+=1){var i=$.charCodeAt(o);if(46===i)a+=1;else if(i<48||i>57)return!1}return 3===a&&"."!==$[0]&&"."!==$[$.length-1]}function e($){for(var a=!1,o=0;o<$.length;o+=1){var i=$.charCodeAt(o);if(58===i)a=!0;else if(!(i>=48&&i<=57||i>=97&&i<=102))return!1}return a}a.exports=function($){return"string"==typeof $&&(0!==$.length&&(e($)||i($)))}},{}],12:[function($,a,o){"use strict";function i($){return $>=48&&$<=57}function e($){return $>=97&&$<=122}a.exports=function($){if("string"!=typeof $)return!1;if($.length>255)return!1;if(0===$.length)return!1;var a=$.charCodeAt(0);if(!e(a)&&!i(a))return!1;for(var o,n,s=-1,t=$.length,r=0;r64||46===o||45===o)return!1;s=r}else if(!e(n)&&!i(n)&&45!==n)return!1;o=n}return t-s-1<=63&&45!==o}},{}],13:[function($,a,o){"use strict";var i=$("./from-host.js");a.exports=function($,a){if($.hasTld(a))return a;var o=$.suffixLookup(a);return null===o?i(a):o}},{"./from-host.js":10}],14:[function($,a,o){"use strict";a.exports=function($,a){return null===a?null:$.substr(0,$.length-a.length-1)}},{}],15:[function($,a,o){"use strict";function i($,a){return null===$?a:null===a?$:$