forked from TideSec/Proxy_Pool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshims.js
1 lines (1 loc) · 16.8 KB
/
shims.js
1
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;g<i;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(a){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document),"function"!=typeof Object.create&&(Object.create=function(a){function b(){}return b.prototype=a,new b});var ua={toString:function(){return navigator.userAgent},test:function(a){return this.toString().toLowerCase().indexOf(a.toLowerCase())>-1}};ua.version=(ua.toString().toLowerCase().match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],ua.webkit=ua.test("webkit"),ua.gecko=ua.test("gecko")&&!ua.webkit,ua.opera=ua.test("opera"),ua.ie=ua.test("msie")&&!ua.opera,ua.ie6=ua.ie&&document.compatMode&&"undefined"==typeof document.documentElement.style.maxHeight,ua.ie7=ua.ie&&document.documentElement&&"undefined"!=typeof document.documentElement.style.maxHeight&&"undefined"==typeof XDomainRequest,ua.ie8=ua.ie&&"undefined"!=typeof XDomainRequest;var domReady=function(){var a=[],b=function(){if(!arguments.callee.done){arguments.callee.done=!0;for(var b=0;b<a.length;b++)a[b]()}};return document.addEventListener&&document.addEventListener("DOMContentLoaded",b,!1),ua.ie&&(!function(){try{document.documentElement.doScroll("left"),document.body.length}catch(a){return void setTimeout(arguments.callee,50)}b()}(),document.onreadystatechange=function(){"complete"===document.readyState&&(document.onreadystatechange=null,b())}),ua.webkit&&document.readyState&&!function(){"loading"!==document.readyState?b():setTimeout(arguments.callee,10)}(),window.onload=b,function(c){return"function"==typeof c&&(b.done?c():a[a.length]=c),c}}(),cssHelper=function(){var a,b={BLOCKS:/[^\s{;][^{;]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;|@-moz-document\s*url-prefix\(\)\s*{(([^{}])+{([^{}])+}([^{}])+)+})/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,WHITESPACE_IN_PARENTHESES:/\(\s*(\S*)\s*\)/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g},c=!1,d=[],e=function(a){"function"==typeof a&&(d[d.length]=a)},f=function(){for(var b=0;b<d.length;b++)d[b](a)},g={},h=function(a,b){if(g[a]){var c=g[a].listeners;if(c)for(var d=0;d<c.length;d++)c[d](b)}},j=function(a,b,c){if(ua.ie&&!window.XMLHttpRequest&&(window.XMLHttpRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP")}),!XMLHttpRequest)return"";var d=new XMLHttpRequest;try{d.open("get",a,!0),d.setRequestHeader("X_REQUESTED_WITH","XMLHttpRequest")}catch(a){return void c()}var e=!1;setTimeout(function(){e=!0},5e3),document.documentElement.style.cursor="progress",d.onreadystatechange=function(){4!==d.readyState||e||(!d.status&&"file:"===location.protocol||d.status>=200&&d.status<300||304===d.status||navigator.userAgent.indexOf("Safari")>-1&&"undefined"==typeof d.status?b(d.responseText):c(),document.documentElement.style.cursor="",d=null)},d.send("")},k=function(a){return a=a.replace(b.REDUNDANT_COMPONENTS,""),a=a.replace(b.REDUNDANT_WHITESPACE,"$1"),a=a.replace(b.WHITESPACE_IN_PARENTHESES,"($1)"),a=a.replace(b.MORE_WHITESPACE," "),a=a.replace(b.FINAL_SEMICOLONS,"}")},l={stylesheet:function(a){var c={},d=[],e=[],f=[],g=[],h=a.cssHelperText,i=a.getAttribute("media");if(i)var j=i.toLowerCase().split(",");else var j=["all"];for(var k=0;k<j.length;k++)d[d.length]=l.mediaQuery(j[k],c);var m=h.match(b.BLOCKS);if(null!==m)for(var k=0;k<m.length;k++)if("@media "===m[k].substring(0,7)){var n=l.mediaQueryList(m[k],c);f=f.concat(n.getRules()),e[e.length]=n}else f[f.length]=g[g.length]=l.rule(m[k],c,null);return c.element=a,c.getCssText=function(){return h},c.getAttrMediaQueries=function(){return d},c.getMediaQueryLists=function(){return e},c.getRules=function(){return f},c.getRulesWithoutMQ=function(){return g},c},mediaQueryList:function(a,c){var d={},e=a.indexOf("{"),f=a.substring(0,e);a=a.substring(e+1,a.length-1);for(var g=[],h=[],i=f.toLowerCase().substring(7).split(","),j=0;j<i.length;j++)g[g.length]=l.mediaQuery(i[j],d);var k=a.match(b.BLOCKS_INSIDE);if(null!==k)for(j=0;j<k.length;j++)h[h.length]=l.rule(k[j],c,d);return d.type="mediaQueryList",d.getMediaQueries=function(){return g},d.getRules=function(){return h},d.getListText=function(){return f},d.getCssText=function(){return a},d},mediaQuery:function(a,c){a=a||"";var d,e;"mediaQueryList"===c.type?d=c:e=c;for(var f,g=!1,h=[],i=!0,j=a.match(b.NOT_WHITESPACE),k=0;k<j.length;k++){var l=j[k];if(f||"not"!==l&&"only"!==l)if(f){if("("===l.charAt(0)){var m=l.substring(1,l.length-1).split(":");h[h.length]={mediaFeature:m[0],value:m[1]||null}}}else f=l;else"not"===l&&(g=!0)}return{getQueryText:function(){return a},getAttrStyleSheet:function(){return e||null},getList:function(){return d||null},getValid:function(){return i},getNot:function(){return g},getMediaType:function(){return f},getExpressions:function(){return h}}},rule:function(a,b,c){for(var d={},e=a.indexOf("{"),f=a.substring(0,e),g=f.split(","),h=[],i=a.substring(e+1,a.length-1).split(";"),j=0;j<i.length;j++)h[h.length]=l.declaration(i[j],d);return d.getStylesheet=function(){return b||null},d.getMediaQueryList=function(){return c||null},d.getSelectors=function(){return g},d.getSelectorText=function(){return f},d.getDeclarations=function(){return h},d.getPropertyValue=function(a){for(var b=0;b<h.length;b++)if(h[b].getProperty()===a)return h[b].getValue();return null},d},declaration:function(a,b){var c=a.indexOf(":"),d=a.substring(0,c),e=a.substring(c+1);return{getRule:function(){return b||null},getProperty:function(){return d},getValue:function(){return e}}}},m=function(b){if("string"==typeof b.cssHelperText){var c={stylesheet:null,mediaQueryLists:[],rules:[],selectors:{},declarations:[],properties:{}},d=c.stylesheet=l.stylesheet(b),e=(c.mediaQueryLists=d.getMediaQueryLists(),c.rules=d.getRules()),f=c.selectors,g=function(a){for(var b=a.getSelectors(),c=0;c<b.length;c++){var d=b[c];f[d]||(f[d]=[]),f[d][f[d].length]=a}};for(i=0;i<e.length;i++)g(e[i]);var h=c.declarations;for(i=0;i<e.length;i++)h=c.declarations=h.concat(e[i].getDeclarations());var j=c.properties;for(i=0;i<h.length;i++){var k=h[i].getProperty();j[k]||(j[k]=[]),j[k][j[k].length]=h[i]}return b.cssHelperParsed=c,a[a.length]=b,c}},n=function(a,b){},o=function(){c=!0,a=[];for(var d=[],e=function(){for(var a=0;a<d.length;a++)m(d[a]);var b=document.getElementsByTagName("style");for(a=0;a<b.length;a++)n(b[a]);c=!1,f()},g=document.getElementsByTagName("link"),h=0;h<g.length;h++){var i=g[h];i.getAttribute("rel").indexOf("style")>-1&&i.href&&0!==i.href.length&&!i.disabled&&(d[d.length]=i)}if(d.length>0){var l=0,o=function(){l++,l===d.length&&e()},p=function(a){var c=a.href;j(c,function(d){d=k(d).replace(b.RELATIVE_URLS,"url("+c.substring(0,c.lastIndexOf("/"))+"/$1)"),a.cssHelperText=d,o()},o)};for(h=0;h<d.length;h++)p(d[h])}else e()},p={stylesheets:"array",mediaQueryLists:"array",rules:"array",selectors:"object",declarations:"array",properties:"object"},q={stylesheets:null,mediaQueryLists:null,rules:null,selectors:null,declarations:null,properties:null},r=function(a,b){if(null!==q[a]){if("array"===p[a])return q[a]=q[a].concat(b);var c=q[a];for(var d in b)b.hasOwnProperty(d)&&(c[d]?c[d]=c[d].concat(b[d]):c[d]=b[d]);return c}},s=function(b){q[b]="array"===p[b]?[]:{};for(var c=0;c<a.length;c++){var d="stylesheets"===b?"stylesheet":b;r(b,a[c].cssHelperParsed[d])}return q[b]},t=function(a){return"undefined"!=typeof window.innerWidth?window["inner"+a]:"undefined"!=typeof document.documentElement&&"undefined"!=typeof document.documentElement.clientWidth&&0!=document.documentElement.clientWidth?document.documentElement["client"+a]:void 0};return{addStyle:function(a,b,c){var d,e="css-mediaqueries-js",f="",g=document.getElementById(e);return b&&b.length>0&&(f=b.join(","),e+=f),null!==g?d=g:(d=document.createElement("style"),d.setAttribute("type","text/css"),d.setAttribute("id",e),d.setAttribute("media",f),document.getElementsByTagName("head")[0].appendChild(d)),d.styleSheet?d.styleSheet.cssText+=a:d.appendChild(document.createTextNode(a)),d.addedWithCssHelper=!0,"undefined"==typeof c||c===!0?cssHelper.parsed(function(b){var c=n(d,a);for(var e in c)c.hasOwnProperty(e)&&r(e,c[e]);h("newStyleParsed",d)}):d.parsingDisallowed=!0,d},removeStyle:function(a){if(a.parentNode)return a.parentNode.removeChild(a)},parsed:function(b){c?e(b):"undefined"!=typeof a?"function"==typeof b&&b(a):(e(b),o())},stylesheets:function(a){cssHelper.parsed(function(b){a(q.stylesheets||s("stylesheets"))})},mediaQueryLists:function(a){cssHelper.parsed(function(b){a(q.mediaQueryLists||s("mediaQueryLists"))})},rules:function(a){cssHelper.parsed(function(b){a(q.rules||s("rules"))})},selectors:function(a){cssHelper.parsed(function(b){a(q.selectors||s("selectors"))})},declarations:function(a){cssHelper.parsed(function(b){a(q.declarations||s("declarations"))})},properties:function(a){cssHelper.parsed(function(b){a(q.properties||s("properties"))})},broadcast:h,addListener:function(a,b){"function"==typeof b&&(g[a]||(g[a]={listeners:[]}),g[a].listeners[g[a].listeners.length]=b)},removeListener:function(a,b){if("function"==typeof b&&g[a])for(var c=g[a].listeners,d=0;d<c.length;d++)c[d]===b&&(c.splice(d,1),d-=1)},getViewportWidth:function(){return t("Width")},getViewportHeight:function(){return t("Height")}}}();domReady(function(){var a,b={LENGTH_UNIT:/[0-9]+(em|ex|px|in|cm|mm|pt|pc)$/,RESOLUTION_UNIT:/[0-9]+(dpi|dpcm)$/,ASPECT_RATIO:/^[0-9]+\/[0-9]+$/,ABSOLUTE_VALUE:/^[0-9]*(\.[0-9]+)*$/},c=[],d=function(){var a="css3-mediaqueries-test",b=document.createElement("div");b.id=a;var c=cssHelper.addStyle("@media all and (width) { #"+a+" { width: 1px !important; } }",[],!1);document.body.appendChild(b);var e=1===b.offsetWidth;return c.parentNode.removeChild(c),b.parentNode.removeChild(b),d=function(){return e},e},e=function(){a=document.createElement("div"),a.style.cssText="position:absolute;top:-9999em;left:-9999em;margin:0;border:none;padding:0;width:1em;font-size:1em;",document.body.appendChild(a),16!==a.offsetWidth&&(a.style.fontSize=16/a.offsetWidth+"em"),a.style.width=""},f=function(b){a.style.width=b;var c=a.offsetWidth;return a.style.width="",c},g=function(a,c){var d=a.length,e="min-"===a.substring(0,4),g=!e&&"max-"===a.substring(0,4);if(null!==c){var h,i;if(b.LENGTH_UNIT.exec(c))h="length",i=f(c);else if(b.RESOLUTION_UNIT.exec(c)){h="resolution",i=parseInt(c,10);var j=c.substring((i+"").length)}else b.ASPECT_RATIO.exec(c)?(h="aspect-ratio",i=c.split("/")):b.ABSOLUTE_VALUE?(h="absolute",i=c):h="unknown"}var k,l;if("device-width"===a.substring(d-12,d))return k=screen.width,null!==c?"length"===h&&(e&&k>=i||g&&k<i||!e&&!g&&k===i):k>0;if("device-height"===a.substring(d-13,d))return l=screen.height,null!==c?"length"===h&&(e&&l>=i||g&&l<i||!e&&!g&&l===i):l>0;if("width"===a.substring(d-5,d))return k=document.documentElement.clientWidth||document.body.clientWidth,null!==c?"length"===h&&(e&&k>=i||g&&k<i||!e&&!g&&k===i):k>0;if("height"===a.substring(d-6,d))return l=document.documentElement.clientHeight||document.body.clientHeight,null!==c?"length"===h&&(e&&l>=i||g&&l<i||!e&&!g&&l===i):l>0;if("orientation"===a.substring(d-11,d))return k=document.documentElement.clientWidth||document.body.clientWidth,l=document.documentElement.clientHeight||document.body.clientHeight,"absolute"===h&&("portrait"===i?k<=l:k>l);if("aspect-ratio"===a.substring(d-12,d)){k=document.documentElement.clientWidth||document.body.clientWidth,l=document.documentElement.clientHeight||document.body.clientHeight;var m=k/l,n=i[1]/i[0];return"aspect-ratio"===h&&(e&&m>=n||g&&m<n||!e&&!g&&m===n)}if("device-aspect-ratio"===a.substring(d-19,d))return"aspect-ratio"===h&&screen.width*i[1]===screen.height*i[0];if("color-index"===a.substring(d-11,d)){var o=Math.pow(2,screen.colorDepth);return null!==c?"absolute"===h&&(e&&o>=i||g&&o<i||!e&&!g&&o===i):o>0}if("color"===a.substring(d-5,d)){var p=screen.colorDepth;return null!==c?"absolute"===h&&(e&&p>=i||g&&p<i||!e&&!g&&p===i):p>0}if("resolution"===a.substring(d-10,d)){var q;return q=f("dpcm"===j?"1cm":"1in"),null!==c?"resolution"===h&&(e&&q>=i||g&&q<i||!e&&!g&&q===i):q>0}return!1},h=function(a){var b=a.getValid(),c=a.getExpressions(),d=c.length;if(d>0){for(var e=0;e<d&&b;e++)b=g(c[e].mediaFeature,c[e].value);var f=a.getNot();return b&&!f||f&&!b}return b},i=function(a,b){for(var d=a.getMediaQueries(),e={},f=0;f<d.length;f++){var g=d[f].getMediaType();if(0!==d[f].getExpressions().length){var i=!0;if("all"!==g&&b&&b.length>0){i=!1;for(var j=0;j<b.length;j++)b[j]===g&&(i=!0)}i&&h(d[f])&&(e[g]=!0)}}var k=[],l=0;for(var m in e)e.hasOwnProperty(m)&&(l>0&&(k[l++]=","),k[l++]=m);k.length>0&&(c[c.length]=cssHelper.addStyle("@media "+k.join("")+"{"+a.getCssText()+"}",b,!1))},j=function(a,b){for(var c=0;c<a.length;c++)i(a[c],b)},k=function(a){for(var b=a.getAttrMediaQueries(),d=!1,e={},f=0;f<b.length;f++)h(b[f])&&(e[b[f].getMediaType()]=b[f].getExpressions().length>0);var g=[],i=[];for(var k in e)e.hasOwnProperty(k)&&(g[g.length]=k,e[k]&&(i[i.length]=k),"all"===k&&(d=!0));i.length>0&&(c[c.length]=cssHelper.addStyle(a.getCssText(),i,!1));var l=a.getMediaQueryLists();d?j(l):j(l,g)},l=function(a){for(var b=0;b<a.length;b++)k(a[b]);ua.ie?(document.documentElement.style.display="block",setTimeout(function(){document.documentElement.style.display=""},0),setTimeout(function(){cssHelper.broadcast("cssMediaQueriesTested")},100)):cssHelper.broadcast("cssMediaQueriesTested")},m=function(){for(var a=0;a<c.length;a++)cssHelper.removeStyle(c[a]);c=[],cssHelper.stylesheets(l)},n=0,o=function(){var a=cssHelper.getViewportWidth(),b=cssHelper.getViewportHeight();if(ua.ie){var c=document.createElement("div");c.style.position="absolute",c.style.top="-9999em",c.style.overflow="scroll",document.body.appendChild(c),n=c.offsetWidth-c.clientWidth,document.body.removeChild(c)}var e,f=function(){var c=cssHelper.getViewportWidth(),f=cssHelper.getViewportHeight();(Math.abs(c-a)>n||Math.abs(f-b)>n)&&(a=c,b=f,clearTimeout(e),e=setTimeout(function(){d()?cssHelper.broadcast("cssMediaQueriesTested"):m()},500))};window.onresize=function(){var a=window.onresize||function(){};return function(){a(),f()}}()},p=document.documentElement;return p.style.marginLeft="-32767px",setTimeout(function(){p.style.marginLeft=""},5e3),function(){d()?p.style.marginLeft="":(cssHelper.addListener("newStyleParsed",function(a){k(a.cssHelperParsed.stylesheet)}),cssHelper.addListener("cssMediaQueriesTested",function(){ua.ie&&(p.style.width="1px"),setTimeout(function(){p.style.width="",p.style.marginLeft=""},0),cssHelper.removeListener("cssMediaQueriesTested",arguments.callee)}),e(),m()),o()}}());try{document.execCommand("BackgroundImageCache",!1,!0)}catch(a){}