vendor: 4,444 bytes, lines 1-130
1/*! 2 * JavaScript Cookie v2.0.4 3 * https://github.com/js-cookie/js-cookie 4 * 5 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 6 * Released under the MIT license 7 */ 8(function(factory) { 9 if (typeof define === 'function' && define.amd) { 10 define(factory); 11 } else if (typeof exports === 'object') { 12 module.exports = factory(); 13 } else { 14 var _OldCookies = window.Cookies; 15 var api = window.Cookies = factory(); 16 api.noConflict = function() { 17 window.Cookies = _OldCookies; 18 return api; 19 }; 20 } 21}(function() { 22 function extend() { 23 var i = 0; 24 var result = {}; 25 for (; i < arguments.length; i++) { 26 var attributes = arguments[ i ]; 27 for (var key in attributes) { 28 result[key] = attributes[key]; 29 } 30 } 31 return result; 32 } 33 34 function init(converter) { 35 function api(key, value, attributes) { 36 var result; 37 38 // Write 39 40 if (arguments.length > 1) { 41 attributes = extend({ 42 path: '/' 43 }, api.defaults, attributes); 44 45 if (typeof attributes.expires === 'number') { 46 var expires = new Date(); 47 expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); 48 attributes.expires = expires; 49 } 50 51 try { 52 result = JSON.stringify(value); 53 if (/^[\{\[]/.test(result)) { 54 value = result; 55 } 56 } catch (e) { 57 } 58 59 if (!converter.write) { 60 value = encodeURIComponent(String(value)) 61 .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); 62 } else { 63 value = converter.write(value, key); 64 } 65 66 key = encodeURIComponent(String(key)); 67 key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); 68 key = key.replace(/[\(\)]/g, escape); 69 70 return (document.cookie = [ 71 key, '=', value, 72 attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE 73 attributes.path && '; path=' + attributes.path, 74 attributes.domain && '; domain=' + attributes.domain, 75 attributes.secure ? '; secure' : '' 76 ].join('')); 77 } 78 79 // Read 80 81 if (!key) { 82 result = {}; 83 } 84 85 // To prevent the for loop in the first place assign an empty array 86 // in case there are no cookies at all. Also prevents odd result when 87 // calling "get()" 88 var cookies = document.cookie ? document.cookie.split('; ') : []; 89 var rdecode = /(%[0-9A-Z]{2})+/g; 90 var i = 0; 91 92 for (; i < cookies.length; i++) { 93 var parts = cookies[i].split('='); 94 var name = parts[0].replace(rdecode, decodeURIComponent); 95 var cookie = parts.slice(1).join('='); 96 97 if (cookie.charAt(0) === '"') { 98 cookie = cookie.slice(1, -1); 99 } 100 101 try { 102 cookie = converter.read ? 103 converter.read(cookie, name) : converter(cookie, name) || 104 cookie.replace(rdecode, decodeURIComponent); 105 106 if (this.json) { 107 try { 108 cookie = JSON.parse(cookie); 109 } catch (e) { 110 } 111 } 112 113 if (key === name) { 114 result = cookie; 115 break; 116 } 117 118 if (!key) { 119 result[name] = cookie; 120 } 121 } catch (e) { 122 } 123 } 124 125 return result; 126 } 127 128 api.get = api.set = api; 129 api.getJSON = function() { 130 return api.apply({
131 json: true 132 }, [].slice.call(arguments)); 133 }; 134 api.defaults = {}; 135 136 api.remove = function(key, attributes) { 137 api(key, '', extend(attributes, { 138 expires: -1 139 })); 140 }; 141 142 api.withConverter = init; 143 144 return api; 145 } 146 147 return init(function() { 148 }); 149}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.