(function(k,n){"object"===typeofmodule&&module.exports?module.exports=n():"function"===typeofdefine&&define.amd?define(n):k.SecondLevelDomains=n(k)})(this,function(k){varn=k&&k.SecondLevelDomains,l={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",
bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",
ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ","do":" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",
es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",
id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ","in":" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",
kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",
mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",
ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",
ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",
tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",
rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",
tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",
us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",
(function(k,n){"object"===typeofmodule&&module.exports?module.exports=n(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeofdefine&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],n):k.URI=n(k.punycode,k.IPv6,k.SecondLevelDomains,k)})(this,function(k,n,l,h){functionc(a,b){vard=1<=arguments.length,e=2<=arguments.length;if(!(thisinstanceofc))returnd?e?newc(a,b):newc(a):newc;if(void0===a){if(d)thrownewTypeError("undefined is not a valid argument for URI");
a="undefined"!==typeoflocation?location.href+"":""}if(null===a&&d)thrownewTypeError("null is not a valid argument for URI");this.href(a);returnvoid0!==b?this.absoluteTo(b):this}functionm(a){returna.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}functionw(a){returnvoid0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}functionp(a){return"Array"===w(a)}functionD(a,b){vard={},c;if("RegExp"===w(b))d=null;elseif(p(b)){varf=0;for(c=b.length;f<c;f++)d[b[f]]=!0}elsed[b]=
a[b]=d:("string"===typeofa[b]&&(a[b]=[a[b]]),p(d)||(d=[d]),a[b]=(a[b]||[]).concat(d));elsethrownewTypeError("URI.addQuery() accepts an object, string as the name parameter");};c.setQuery=function(a,b,d){if("object"===typeofb)for(vareinb)q.call(b,e)&&c.setQuery(a,e,b[e]);elseif("string"===typeofb)a[b]=void0===d?null:d;elsethrownewTypeError("URI.setQuery() accepts an object, string as the name parameter");};c.removeQuery=function(a,b,d){vare;if(p(b))for(d=0,e=b.length;d<e;d++)a[b[d]]=
void0;elseif("RegExp"===w(b))for(eina)b.test(e)&&(a[e]=void0);elseif("object"===typeofb)for(einb)q.call(b,e)&&c.removeQuery(a,e,b[e]);elseif("string"===typeofb)void0!==d?"RegExp"===w(d)?!p(a[b])&&d.test(a[b])?a[b]=void0:a[b]=D(a[b],d):a[b]!==String(d)||p(d)&&1!==d.length?p(a[b])&&(a[b]=D(a[b],d)):a[b]=void0:a[b]=void0;elsethrownewTypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");};c.hasQuery=function(a,b,d,e){switch(w(b)){case"String":break;
case"RegExp":for(varfina)if(q.call(a,f)&&b.test(f)&&(void0===d||c.hasQuery(a,f,d)))return!0;return!1;case"Object":for(varginb)if(q.call(b,g)&&!c.hasQuery(a,g,b[g]))return!1;return!0;default:thrownewTypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter");}switch(w(d)){case"Undefined":returnbina;case"Boolean":returna=!(p(a[b])?!a[b].length:!a[b]),d===a;case"Function":return!!d(a[b],b,a);case"Array":returnp(a[b])?(e?u:B)(a[b],d):!1;case"RegExp":returnp(a[b])?
e?u(a[b],d):!1:!(!a[b]||!a[b].match(d));case"Number":d=String(d);case"String":returnp(a[b])?e?u(a[b],d):!1:a[b]===d;default:thrownewTypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}};c.joinPaths=function(){for(vara=[],b=[],d=0,e=0;e<arguments.length;e++){varf=newc(arguments[e]);a.push(f);f=f.segment();for(varg=0;g<f.length;g++)"string"===typeoff[g]&&b.push(f[g]),f[g]&&d++}if(!b.length||!d)returnnewc("");b=(newc("")).segment(b);
e.lastIndex=m+l.length))}e.lastIndex=0;returna};c.ensureValidHostname=function(a,b){vard=!!a,e=!1;b&&(e=u(c.hostProtocols,b));if(e&&!d)thrownewTypeError("Hostname cannot be empty, if protocol is "+b);if(a&&a.match(c.invalid_hostname_characters)){if(!k)thrownewTypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(k.toASCII(a).match(c.invalid_hostname_characters))thrownewTypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_]');
}};c.ensureValidPort=function(a){if(a){varb=Number(a);if(!(/^[0-9]+$/.test(b)&&0<b&&65536>b))thrownewTypeError('Port "'+a+'" is not a valid port');}};c.noConflict=function(a){if(a)returna={URI:this.noConflict()},h.URITemplate&&"function"===typeofh.URITemplate.noConflict&&(a.URITemplate=h.URITemplate.noConflict()),h.IPv6&&"function"===typeofh.IPv6.noConflict&&(a.IPv6=h.IPv6.noConflict()),h.SecondLevelDomains&&"function"===typeofh.SecondLevelDomains.noConflict&&(a.SecondLevelDomains=h.SecondLevelDomains.noConflict()),
case"ip6":case"ipv6":case"inet6":returne;case"idn":returnh;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":returnk}returnnull};varJ=g.protocol,K=g.port,L=g.hostname;g.protocol=function(a,b){if(a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(c.protocol_expression)))thrownewTypeError('Protocol "'+a+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");returnJ.call(this,a,b)};g.scheme=g.protocol;g.port=function(a,b){if(this._parts.urn)returnvoid0===
a?"":this;void0!==a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),c.ensureValidPort(a)));returnK.call(this,a,b)};g.hostname=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0!==a){vard={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==c.parseHost(a,d))thrownewTypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');a=d.hostname;this._parts.preventInvalidHostname&&c.ensureValidHostname(a,this._parts.protocol)}returnL.call(this,
a,b)};g.origin=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a){vard=this.protocol();returnthis.authority()?(d?d+"://":"")+this.authority():""}d=c(a);this.protocol(d.protocol()).authority(d.authority()).build(!b);returnthis};g.host=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a)returnthis._parts.hostname?c.buildHost(this._parts):"";if("/"!==c.parseHost(a,this._parts))thrownewTypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');
this.build(!b);returnthis};g.authority=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a)returnthis._parts.hostname?c.buildAuthority(this._parts):"";if("/"!==c.parseAuthority(a,this._parts))thrownewTypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');this.build(!b);returnthis};g.userinfo=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a){vard=c.buildUserinfo(this._parts);returnd?d.substring(0,d.length-1):d}"@"!==a[a.length-1]&&
this._parts.hostname.replace(c,a);elsethrownewTypeError('TLD "'+a+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))thrownewReferenceError("cannot set TLD on non-domain host");c=newRegExp(m(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(c,a)}elsethrownewTypeError("cannot set TLD empty");this.build(!b);returnthis};g.directory=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a||!0===a){if(!this._parts.path&&
a));this.build(!b);returnthis};g.segment=function(a,b,c){vard=this._parts.urn?":":"/",f=this.path(),g="/"===f.substring(0,1);f=f.split(d);void0!==a&&"number"!==typeofa&&(c=b,b=a,a=void0);if(void0!==a&&"number"!==typeofa)throwError('Bad segment "'+a+'", must be 0-based integer');g&&f.shift();0>a&&(a=Math.max(f.length+a,0));if(void0===b)returnvoid0===a?f:f[a];if(null===a||void0===f[a])if(p(b)){f=[];a=0;for(varh=b.length;a<h;a++)if(b[a].length||f.length&&f[f.length-1].length)f.length&&!f[f.length-
this._parts.escapeQuerySpace),this.build(!b),this):M.call(this,a,b)};g.setQuery=function(a,b,d){vare=c.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"===typeofa||ainstanceofString)e[a]=void0!==b?b:null;elseif("object"===typeofa)for(varfina)q.call(a,f)&&(e[f]=a[f]);elsethrownewTypeError("URI.addQuery() accepts an object, string as the name parameter");this._parts.query=c.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeofa&&
"%26");void0!==h[1]&&(d+="="+c.decodeQuery(h[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}b+="?"+d.substring(1)}returnb+=c.decodeQuery(a.hash(),!0)};g.absoluteTo=function(a){varb=this.clone(),d=["protocol","username","password","hostname","port"],e,f;if(this._parts.urn)throwError("URNs do not have any generally defined hierarchical components");ainstanceofc||(a=newc(a));if(b._parts.protocol)returnb;b._parts.protocol=a._parts.protocol;if(this._parts.hostname)returnb;for(e=0;f=d[e];e++)b._parts[f]=
a._parts[f];b._parts.path?(".."===b._parts.path.substring(-2)&&(b._parts.path+="/"),"/"!==b.path().charAt(0)&&(d=(d=a.directory())?d:0===a.path().indexOf("/")?"/":"",b._parts.path=(d?d+"/":"")+b._parts.path,b.normalizePath())):(b._parts.path=a._parts.path,b._parts.query||(b._parts.query=a._parts.query));b.build();returnb};g.relativeTo=function(a){varb=this.clone().normalize();if(b._parts.urn)throwError("URNs do not have any generally defined hierarchical components");a=(newc(a)).normalize();vard=
b._parts;vare=a._parts;varf=b.path();a=a.path();if("/"!==f.charAt(0))throwError("URI is already relative");if("/"!==a.charAt(0))throwError("Cannot calculate a URI relative to another relative URI");d.protocol===e.protocol&&(d.protocol=null);if(d.username===e.username&&d.password===e.password&&null===d.protocol&&null===d.username&&null===d.password&&d.hostname===e.hostname&&d.port===e.port)d.hostname=null,d.port=null;elsereturnb.build();if(f===a)returnd.path="",b.build();f=c.commonPath(f,a);