vendor: 8,162 bytes, lines 1-251
1import { c as commonjsGlobal } from "./@intlify-eb6c00e7.js"; 2var nprogressExports = {}; 3var nprogress = { 4 get exports() { 5 return nprogressExports; 6 }, 7 set exports(v) { 8 nprogressExports = v; 9 } 10}; 11/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress 12 * @license MIT */ 13(function(module, exports) { 14 (function(root, factory) { 15 { 16 module.exports = factory(); 17 } 18 })(commonjsGlobal, function() { 19 var NProgress2 = {}; 20 NProgress2.version = "0.2.0"; 21 var Settings = NProgress2.settings = { 22 minimum: 0.08, 23 easing: "ease", 24 positionUsing: "", 25 speed: 200, 26 trickle: true, 27 trickleRate: 0.02, 28 trickleSpeed: 800, 29 showSpinner: true, 30 barSelector: '[role="bar"]', 31 spinnerSelector: '[role="spinner"]', 32 parent: "body", 33 template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>' 34 }; 35 NProgress2.configure = function(options) { 36 var key, value; 37 for (key in options) { 38 value = options[key]; 39 if (value !== void 0 && options.hasOwnProperty(key)) 40 Settings[key] = value; 41 } 42 return this; 43 }; 44 NProgress2.status = null; 45 NProgress2.set = function(n) { 46 var started = NProgress2.isStarted(); 47 n = clamp(n, Settings.minimum, 1); 48 NProgress2.status = n === 1 ? null : n; 49 var progress = NProgress2.render(!started), bar = progress.querySelector(Settings.barSelector), speed = Settings.speed, ease = Settings.easing; 50 progress.offsetWidth; 51 queue(function(next) { 52 if (Settings.positionUsing === "") 53 Settings.positionUsing = NProgress2.getPositioningCSS(); 54 css(bar, barPositionCSS(n, speed, ease)); 55 if (n === 1) { 56 css(progress, { 57 transition: "none", 58 opacity: 1 59 }); 60 progress.offsetWidth; 61 setTimeout(function() { 62 css(progress, { 63 transition: "all " + speed + "ms linear", 64 opacity: 0 65 }); 66 setTimeout(function() { 67 NProgress2.remove(); 68 next(); 69 }, speed); 70 }, speed); 71 } else { 72 setTimeout(next, speed); 73 } 74 }); 75 return this; 76 }; 77 NProgress2.isStarted = function() { 78 return typeof NProgress2.status === "number"; 79 }; 80 NProgress2.start = function() { 81 if (!NProgress2.status) 82 NProgress2.set(0); 83 var work = function() { 84 setTimeout(function() { 85 if (!NProgress2.status) 86 return; 87 NProgress2.trickle(); 88 work(); 89 }, Settings.trickleSpeed); 90 }; 91 if (Settings.trickle) 92 work(); 93 return this; 94 }; 95 NProgress2.done = function(force) { 96 if (!force && !NProgress2.status) 97 return this; 98 return NProgress2.inc(0.3 + 0.5 * Math.random()).set(1); 99 }; 100 NProgress2.inc = function(amount) { 101 var n = NProgress2.status; 102 if (!n) { 103 return NProgress2.start(); 104 } else { 105 if (typeof amount !== "number") { 106 amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); 107 } 108 n = clamp(n + amount, 0, 0.994); 109 return NProgress2.set(n); 110 } 111 }; 112 NProgress2.trickle = function() { 113 return NProgress2.inc(Math.random() * Settings.trickleRate); 114 }; 115 (function() { 116 var initial = 0, current = 0; 117 NProgress2.promise = function($promise) { 118 if (!$promise || $promise.state() === "resolved") { 119 return this; 120 } 121 if (current === 0) { 122 NProgress2.start(); 123 } 124 initial++; 125 current++; 126 $promise.always(function() { 127 current--; 128 if (current === 0) { 129 initial = 0; 130 NProgress2.done(); 131 } else { 132 NProgress2.set((initial - current) / initial); 133 } 134 }); 135 return this; 136 }; 137 })(); 138 NProgress2.render = function(fromStart) { 139 if (NProgress2.isRendered()) 140 return document.getElementById("nprogress"); 141 addClass(document.documentElement, "nprogress-busy"); 142 var progress = document.createElement("div"); 143 progress.id = "nprogress"; 144 progress.innerHTML = Settings.template; 145 var bar = progress.querySelector(Settings.barSelector), perc = fromStart ? "-100" : toBarPerc(NProgress2.status || 0), parent = document.querySelector(Settings.parent), spinner; 146 css(bar, { 147 transition: "all 0 linear", 148 transform: "translate3d(" + perc + "%,0,0)" 149 }); 150 if (!Settings.showSpinner) { 151 spinner = progress.querySelector(Settings.spinnerSelector); 152 spinner && removeElement(spinner); 153 } 154 if (parent != document.body) { 155 addClass(parent, "nprogress-custom-parent"); 156 } 157 parent.appendChild(progress); 158 return progress; 159 }; 160 NProgress2.remove = function() { 161 removeClass(document.documentElement, "nprogress-busy"); 162 removeClass(document.querySelector(Settings.parent), "nprogress-custom-parent"); 163 var progress = document.getElementById("nprogress"); 164 progress && removeElement(progress); 165 }; 166 NProgress2.isRendered = function() { 167 return !!document.getElementById("nprogress"); 168 }; 169 NProgress2.getPositioningCSS = function() { 170 var bodyStyle = document.body.style; 171 var vendorPrefix = "WebkitTransform" in bodyStyle ? "Webkit" : "MozTransform" in bodyStyle ? "Moz" : "msTransform" in bodyStyle ? "ms" : "OTransform" in bodyStyle ? "O" : ""; 172 if (vendorPrefix + "Perspective" in bodyStyle) { 173 return "translate3d"; 174 } else if (vendorPrefix + "Transform" in bodyStyle) { 175 return "translate"; 176 } else { 177 return "margin"; 178 } 179 }; 180 function clamp(n, min, max) { 181 if (n < min) 182 return min; 183 if (n > max) 184 return max; 185 return n; 186 } 187 function toBarPerc(n) { 188 return (-1 + n) * 100; 189 } 190 function barPositionCSS(n, speed, ease) { 191 var barCSS; 192 if (Settings.positionUsing === "translate3d") { 193 barCSS = { transform: "translate3d(" + toBarPerc(n) + "%,0,0)" }; 194 } else if (Settings.positionUsing === "translate") { 195 barCSS = { transform: "translate(" + toBarPerc(n) + "%,0)" }; 196 } else { 197 barCSS = { "margin-left": toBarPerc(n) + "%" }; 198 } 199 barCSS.transition = "all " + speed + "ms " + ease; 200 return barCSS; 201 } 202 var queue = function() { 203 var pending = []; 204 function next() { 205 var fn = pending.shift(); 206 if (fn) { 207 fn(next); 208 } 209 } 210 return function(fn) { 211 pending.push(fn); 212 if (pending.length == 1) 213 next(); 214 }; 215 }(); 216 var css = function() { 217 var cssPrefixes = ["Webkit", "O", "Moz", "ms"], cssProps = {}; 218 function camelCase(string) { 219 return string.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(match, letter) { 220 return letter.toUpperCase(); 221 }); 222 } 223 function getVendorProp(name) { 224 var style = document.body.style; 225 if (name in style) 226 return name; 227 var i = cssPrefixes.length, capName = name.charAt(0).toUpperCase() + name.slice(1), vendorName; 228 while (i--) { 229 vendorName = cssPrefixes[i] + capName; 230 if (vendorName in style) 231 return vendorName; 232 } 233 return name; 234 } 235 function getStyleProp(name) { 236 name = camelCase(name); 237 return cssProps[name] || (cssProps[name] = getVendorProp(name)); 238 } 239 function applyCss(element, prop, value) { 240 prop = getStyleProp(prop); 241 element.style[prop] = value; 242 } 243 return function(element, properties) { 244 var args = arguments, prop, value; 245 if (args.length == 2) { 246 for (prop in properties) { 247 value = properties[prop]; 248 if (value !== void 0 && properties.hasOwnProperty(prop)) 249 applyCss(element, prop, value); 250 } 251 } else {
252 applyCss(element, args[1], args[2]); 253 } 254 }; 255 }(); 256 function hasClass(element, name) { 257 var list = typeof element == "string" ? element : classList(element); 258 return list.indexOf(" " + name + " ") >= 0; 259 } 260 function addClass(element, name) { 261 var oldList = classList(element), newList = oldList + name; 262 if (hasClass(oldList, name)) 263 return; 264 element.className = newList.substring(1); 265 } 266 function removeClass(element, name) { 267 var oldList = classList(element), newList; 268 if (!hasClass(element, name)) 269 return; 270 newList = oldList.replace(" " + name + " ", " "); 271 element.className = newList.substring(1, newList.length - 1); 272 } 273 function classList(element) { 274 return (" " + (element.className || "") + " ").replace(/\s+/gi, " "); 275 } 276 function removeElement(element) { 277 element && element.parentNode && element.parentNode.removeChild(element); 278 } 279 return NProgress2; 280 }); 281})(nprogress); 282const NProgress = nprogressExports; 283export { 284 NProgress as N 285};
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.